From 06ee82d540cb7009364315d9d19ac0a0a4427c67 Mon Sep 17 00:00:00 2001 From: fifthsegment <5513549+fifthsegment@users.noreply.github.com> Date: Fri, 25 Sep 2026 17:46:16 -0400 Subject: [PATCH 1/2] Fix Carbon UI follow-ups: login buttons, logout routing, DNS add button, services width Co-Authored-By: [CC] --- .../webserver/frontend/files/fs/bundle.js | 92 +++++++++---------- ui/src/App.svelte | 7 +- ui/src/components/__tests__/dns_ui.test.ts | 6 ++ .../__tests__/secure_setup_ui.test.ts | 12 +++ .../__tests__/shell_foundation.test.ts | 6 ++ ui/src/components/dnsArecords.svelte | 6 +- ui/src/components/globalheader.svelte | 9 +- ui/src/components/headerrightnav.svelte | 4 + ui/src/routes/login/login.svelte | 2 +- ui/src/routes/services/services.svelte | 1 - 10 files changed, 89 insertions(+), 56 deletions(-) diff --git a/application/webserver/frontend/files/fs/bundle.js b/application/webserver/frontend/files/fs/bundle.js index 514a786..c4f146e 100644 --- a/application/webserver/frontend/files/fs/bundle.js +++ b/application/webserver/frontend/files/fs/bundle.js @@ -1,16 +1,16 @@ -var HD=Object.defineProperty;var UD=(t,e,n)=>e in t?HD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var FD=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ki=(t,e,n)=>(UD(t,typeof e!="symbol"?e+"":e,n),n);var uke=FD((dl,hl)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(l){if(l.ep)return;l.ep=!0;const r=n(l);fetch(l.href,r)}})();const GD="modulepreload",VD=function(t){return"/"+t},Cp={},WD=function(e,n,i){if(!n||n.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(n.map(r=>{if(r=VD(r),r in Cp)return;Cp[r]=!0;const s=r.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===r&&(!s||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":GD,s||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),s)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e()).catch(r=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=r,window.dispatchEvent(s),!s.defaultPrevented)throw r})};function _e(){}const jD=t=>t;function Z(t,e){for(const n in e)t[n]=e[n];return t}function $D(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function LT(t){return t()}function Ap(){return Object.create(null)}function ut(t){t.forEach(LT)}function lo(t){return typeof t=="function"}function Se(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function qD(t){return Object.keys(t).length===0}function sg(t,...e){if(t==null){for(const i of e)i(void 0);return _e}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function YD(t){let e;return sg(t,n=>e=n)(),e}function ct(t,e,n){t.$$.on_destroy.push(sg(e,n))}function He(t,e,n,i){if(t){const l=DT(t,e,n,i);return t[0](l)}}function DT(t,e,n,i){return t[1]&&i?Z(n.ctx.slice(),t[1](i(e))):n.ctx}function Ue(t,e,n,i){if(t[2]&&i){const l=t[2](i(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],s=Math.max(e.dirty.length,l.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),og=IT?t=>requestAnimationFrame(t):_e;const Jo=new Set;function RT(t){Jo.forEach(e=>{e.c(t)||(Jo.delete(e),e.f())}),Jo.size!==0&&og(RT)}function KD(t){let e;return Jo.size===0&&og(RT),{promise:new Promise(n=>{Jo.add(e={c:t,f:n})}),abort(){Jo.delete(e)}}}const Sd=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function w(t,e){t.appendChild(e)}function PT(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function JD(t){const e=P("style");return e.textContent="/* empty */",QD(PT(t),e),e.sheet}function QD(t,e){return w(t.head||t,e),e.sheet}function O(t,e,n){t.insertBefore(e,n||null)}function E(t){t.parentNode&&t.parentNode.removeChild(t)}function Wn(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Kl(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Jl(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function I(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const xD=["width","height"];function we(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&xD.indexOf(i)===-1?t[i]=e[i]:I(t,i,e[i])}function st(t,e){for(const n in e)I(t,n,e[n])}function eI(t){return Array.from(t.childNodes)}function Y(t,e){e=""+e,t.data!==e&&(t.data=e)}function tI(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function nI(t,e,n){~ZD.indexOf(n)?tI(t,e):Y(t,e)}function Ll(t,e){t.value=e??""}function An(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function S(t,e,n){t.classList.toggle(e,!!n)}function NT(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}class iI{constructor(e=!1){Ki(this,"is_svg",!1);Ki(this,"e");Ki(this,"n");Ki(this,"t");Ki(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=Ie(n.nodeName):this.e=P(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n>>0}function rI(t,e){const n={stylesheet:JD(e),rules:{}};return Mc.set(t,n),n}function Lp(t,e,n,i,l,r,s,o=0){const a=16.666/i;let u=`{ +var HD=Object.defineProperty;var UD=(t,e,n)=>e in t?HD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var FD=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ki=(t,e,n)=>(UD(t,typeof e!="symbol"?e+"":e,n),n);var oke=FD((dl,hl)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(l){if(l.ep)return;l.ep=!0;const r=n(l);fetch(l.href,r)}})();const GD="modulepreload",VD=function(t){return"/"+t},Cp={},WD=function(e,n,i){if(!n||n.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(n.map(r=>{if(r=VD(r),r in Cp)return;Cp[r]=!0;const s=r.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===r&&(!s||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":GD,s||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),s)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e()).catch(r=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=r,window.dispatchEvent(s),!s.defaultPrevented)throw r})};function _e(){}const jD=t=>t;function Z(t,e){for(const n in e)t[n]=e[n];return t}function $D(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function LT(t){return t()}function Ap(){return Object.create(null)}function ut(t){t.forEach(LT)}function io(t){return typeof t=="function"}function Se(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function qD(t){return Object.keys(t).length===0}function sg(t,...e){if(t==null){for(const i of e)i(void 0);return _e}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function YD(t){let e;return sg(t,n=>e=n)(),e}function ct(t,e,n){t.$$.on_destroy.push(sg(e,n))}function He(t,e,n,i){if(t){const l=DT(t,e,n,i);return t[0](l)}}function DT(t,e,n,i){return t[1]&&i?Z(n.ctx.slice(),t[1](i(e))):n.ctx}function Ue(t,e,n,i){if(t[2]&&i){const l=t[2](i(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],s=Math.max(e.dirty.length,l.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),og=IT?t=>requestAnimationFrame(t):_e;const Jo=new Set;function RT(t){Jo.forEach(e=>{e.c(t)||(Jo.delete(e),e.f())}),Jo.size!==0&&og(RT)}function KD(t){let e;return Jo.size===0&&og(RT),{promise:new Promise(n=>{Jo.add(e={c:t,f:n})}),abort(){Jo.delete(e)}}}const Sd=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function w(t,e){t.appendChild(e)}function PT(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function JD(t){const e=P("style");return e.textContent="/* empty */",QD(PT(t),e),e.sheet}function QD(t,e){return w(t.head||t,e),e.sheet}function O(t,e,n){t.insertBefore(e,n||null)}function E(t){t.parentNode&&t.parentNode.removeChild(t)}function Wn(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function Kl(t){return function(e){return e.preventDefault(),t.call(this,e)}}function Jl(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function I(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const xD=["width","height"];function we(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&xD.indexOf(i)===-1?t[i]=e[i]:I(t,i,e[i])}function st(t,e){for(const n in e)I(t,n,e[n])}function eI(t){return Array.from(t.childNodes)}function Y(t,e){e=""+e,t.data!==e&&(t.data=e)}function tI(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function nI(t,e,n){~ZD.indexOf(n)?tI(t,e):Y(t,e)}function Ll(t,e){t.value=e??""}function An(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function S(t,e,n){t.classList.toggle(e,!!n)}function NT(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}class iI{constructor(e=!1){Ki(this,"is_svg",!1);Ki(this,"e");Ki(this,"n");Ki(this,"t");Ki(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=Ie(n.nodeName):this.e=P(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n>>0}function rI(t,e){const n={stylesheet:JD(e),rules:{}};return Mc.set(t,n),n}function Lp(t,e,n,i,l,r,s,o=0){const a=16.666/i;let u=`{ `;for(let k=0;k<=1;k+=a){const y=e+(n-e)*r(k);u+=k*100+`%{${s(y,1-y)}} `}const f=u+`100% {${s(n,1-n)}} -}`,c=`__svelte_${lI(f)}_${o}`,d=PT(t),{stylesheet:h,rules:g}=Mc.get(d)||rI(d,t);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,Cc+=1,c}function sI(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),l=n.length-i.length;l&&(t.style.animation=i.join(", "),Cc-=l,Cc||oI())}function oI(){og(()=>{Cc||(Mc.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&E(e)}),Mc.clear())})}let Eu;function zr(t){Eu=t}function As(){if(!Eu)throw new Error("Function called outside component initialization");return Eu}function aI(t){As().$$.before_update.push(t)}function sn(t){As().$$.on_mount.push(t)}function hr(t){As().$$.after_update.push(t)}function Ls(t){As().$$.on_destroy.push(t)}function on(){const t=As();return(e,n,{cancelable:i=!1}={})=>{const l=t.$$.callbacks[e];if(l){const r=NT(e,n,{cancelable:i});return l.slice().forEach(s=>{s.call(t,r)}),!r.defaultPrevented}return!0}}function pi(t,e){return As().$$.context.set(t,e),e}function jn(t){return As().$$.context.get(t)}function te(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const jo=[],xe=[];let Qo=[];const X1=[],BT=Promise.resolve();let K1=!1;function zT(){K1||(K1=!0,BT.then(ag))}function Ou(){return zT(),BT}function Es(t){Qo.push(t)}function Ct(t){X1.push(t)}const c1=new Set;let zo=0;function ag(){if(zo!==0)return;const t=Eu;do{try{for(;zot.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),Qo=e}let Qa;function cI(){return Qa||(Qa=Promise.resolve(),Qa.then(()=>{Qa=null})),Qa}function d1(t,e,n){t.dispatchEvent(NT(`${e?"intro":"outro"}${n}`))}const cc=new Set;let Hr;function ue(){Hr={r:0,c:[],p:Hr}}function fe(){Hr.r||ut(Hr.c),Hr=Hr.p}function p(t,e){t&&t.i&&(cc.delete(t),t.i(e))}function v(t,e,n,i){if(t&&t.o){if(cc.has(t))return;cc.add(t),Hr.c.push(()=>{cc.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}const dI={duration:0};function Dp(t,e,n,i){let r=e(t,n,{direction:"both"}),s=i?0:1,o=null,a=null,u=null,f;function c(){u&&sI(t,u)}function d(g,_){const k=g.b-s;return _*=Math.abs(k),{a:s,b:g.b,d:k,duration:_,start:g.start,end:g.start+_,group:g.group}}function h(g){const{delay:_=0,duration:k=300,easing:y=jD,tick:T=_e,css:M}=r||dI,A={start:XD()+_,b:g};g||(A.group=Hr,Hr.r+=1),"inert"in t&&(g?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),o||a?a=A:(M&&(c(),u=Lp(t,s,g,k,_,y,M)),g&&T(0,1),o=d(A,k),Es(()=>d1(t,g,"start")),KD(C=>{if(a&&C>a.start&&(o=d(a,k),a=null,d1(t,o.b,"start"),M&&(c(),u=Lp(t,s,o.b,o.duration,0,y,r.css))),o){if(C>=o.end)T(s=o.b,1-s),d1(t,o.b,"end"),a||(o.b?c():--o.group.r||ut(o.group.c)),o=null;else if(C>=o.start){const D=C-o.start;s=o.a+o.d*y(D/o.duration),T(s,1-s)}}return!!(o||a)}))}return{run(g){lo(r)?cI().then(()=>{r=r({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),o=a=null}}}function Ip(t,e){const n=e.token={};function i(l,r,s,o){if(e.token!==n)return;e.resolved=o;let a=e.ctx;s!==void 0&&(a=a.slice(),a[s]=o);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==r&&c&&(ue(),v(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),fe())}):e.block.d(1),u.c(),p(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[r]=u),f&&ag()}if($D(t)){const l=As();if(t.then(r=>{zr(l),i(e.then,1,e.value,r),zr(null)},r=>{if(zr(l),i(e.catch,2,e.error,r),zr(null),!e.hasCatch)throw r}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,t),!0;e.resolved=t}}function hI(t,e,n){const i=e.slice(),{resolved:l}=t;t.current===t.then&&(i[t.value]=l),t.current===t.catch&&(i[t.error]=l),t.block.p(i,n)}function it(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function HT(t,e){t.d(1),e.delete(t.key)}function Fn(t,e){v(t,1,1,()=>{e.delete(t.key)})}function Pn(t,e,n,i,l,r,s,o,a,u,f,c){let d=t.length,h=r.length,g=d;const _={};for(;g--;)_[t[g].key]=g;const k=[],y=new Map,T=new Map,M=[];for(g=h;g--;){const R=c(l,r,g),N=n(R);let G=s.get(N);G?i&&M.push(()=>G.p(R,e)):(G=u(N,R),G.c()),y.set(N,k[g]=G),N in _&&T.set(N,Math.abs(g-_[N]))}const A=new Set,C=new Set;function D(R){p(R,1),R.m(o,f),s.set(R.key,R),f=R.first,h--}for(;d&&h;){const R=k[h-1],N=t[d-1],G=R.key,B=N.key;R===N?(f=R.first,d--,h--):y.has(B)?!s.has(G)||A.has(G)?D(R):C.has(B)?d--:T.get(G)>T.get(B)?(C.add(G),D(R)):(A.add(B),d--):(a(N,s),d--)}for(;d--;){const R=t[d];y.has(R.key)||a(R,s)}for(;h;)D(k[h-1]);return ut(M),k}function Pe(t,e){const n={},i={},l={$$scope:1};let r=t.length;for(;r--;){const s=t[r],o=e[r];if(o){for(const a in s)a in o||(i[a]=1);for(const a in o)l[a]||(n[a]=o[a],l[a]=1);t[r]=o}else for(const a in s)l[a]=1}for(const s in i)s in n||(n[s]=void 0);return n}function Gi(t){return typeof t=="object"&&t!==null?t:{}}function At(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function U(t){t&&t.c()}function z(t,e,n){const{fragment:i,after_update:l}=t.$$;i&&i.m(e,n),Es(()=>{const r=t.$$.on_mount.map(LT).filter(lo);t.$$.on_destroy?t.$$.on_destroy.push(...r):ut(r),t.$$.on_mount=[]}),l.forEach(Es)}function H(t,e){const n=t.$$;n.fragment!==null&&(fI(n.after_update),ut(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function mI(t,e){t.$$.dirty[0]===-1&&(jo.push(t),zT(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&mI(t,c)),d}):[],u.update(),f=!0,ut(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=eI(e.target);u.fragment&&u.fragment.l(c),c.forEach(E)}else u.fragment&&u.fragment.c();e.intro&&p(t.$$.fragment),z(t,e.target,e.anchor),ag()}zr(a)}class Oe{constructor(){Ki(this,"$$");Ki(this,"$$set")}$destroy(){H(this,1),this.$destroy=_e}$on(e,n){if(!lo(n))return _e;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!qD(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const gI="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gI);const Ho=[];function _I(t,e){return{subscribe:Wt(t,e).subscribe}}function Wt(t,e=_e){let n;const i=new Set;function l(o){if(Se(t,o)&&(t=o,n)){const a=!Ho.length;for(const u of i)u[1](),Ho.push(u,t);if(a){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:l,update:r,subscribe:s}}function ur(t,e,n){const i=!Array.isArray(t),l=i?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return _I(n,(s,o)=>{let a=!1;const u=[];let f=0,c=_e;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,s,o);r?s(g):c=lo(g)?g:_e},h=l.map((g,_)=>sg(g,k=>{u[_]=k,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){ut(h),c(),a=!1}})}function Rp(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function pI(t){let e,n,i=t[1]&&Rp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let vI=class extends Oe{constructor(e){super(),Ee(this,e,bI,pI,Se,{size:0,title:1})}};const Gu=vI;function Pp(t,e,n){const i=t.slice();return i[2]=e[n].width,i}function kI(t){let e,n,i,l=[t[4]],r={};for(let s=0;s{e=Z(Z({},e),Te(C)),n(4,o=de(e,s)),"lines"in C&&n(5,a=C.lines),"heading"in C&&n(0,u=C.heading),"paragraph"in C&&n(1,f=C.paragraph),"width"in C&&n(2,c=C.width)},t.$$.update=()=>{if(t.$$.dirty&4&&n(7,l=parseInt(c,10)),t.$$.dirty&4&&n(6,r=c.includes("px")),t.$$.dirty&238&&f)for(let C=0;Ch[9];for(let h=0;h{a=null}),fe()),g&9&&(u=it(Array.from({length:h[3]?h[0]-1:h[0]},Up)),ue(),i=Pn(i,g,f,1,h,u,l,e,Fn,Hp,null,Bp),fe()),we(e,d=Pe(c,[g&16&&h[4]])),S(e,"bx--skeleton",!0),S(e,"bx--accordion",!0),S(e,"bx--accordion--start",h[1]==="start"),S(e,"bx--accordion--end",h[1]==="end"),S(e,"bx--accordion--sm",h[2]==="sm"),S(e,"bx--accordion--xl",h[2]==="xl")},i(h){if(!r){p(a);for(let g=0;ge;function OI(t,e,n){const i=["count","align","size","open"];let l=de(e,i),{count:r=4}=e,{align:s="end"}=e,{size:o=void 0}=e,{open:a=!0}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"count"in h&&n(0,r=h.count),"align"in h&&n(1,s=h.align),"size"in h&&n(2,o=h.size),"open"in h&&n(3,a=h.open)},[r,s,o,a,l,u,f,c,d]}class MI extends Oe{constructor(e){super(),Ee(this,e,OI,EI,Se,{count:0,align:1,size:2,open:3})}}const CI=MI;function AI(t){let e,n,i,l;const r=t[6].default,s=He(r,t,t[5],null);let o=[t[3]],a={};for(let u=0;u{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function II(t,e,n){const i=["align","size","disabled","skeleton"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{align:o="end"}=e,{size:a=void 0}=e,{disabled:u=!1}=e,{skeleton:f=!1}=e;const c=Wt(u);pi("Accordion",{disableItems:c});function d(A){te.call(this,t,A)}function h(A){te.call(this,t,A)}function g(A){te.call(this,t,A)}function _(A){te.call(this,t,A)}function k(A){te.call(this,t,A)}function y(A){te.call(this,t,A)}function T(A){te.call(this,t,A)}function M(A){te.call(this,t,A)}return t.$$set=A=>{e=Z(Z({},e),Te(A)),n(3,l=de(e,i)),"align"in A&&n(0,o=A.align),"size"in A&&n(1,a=A.size),"disabled"in A&&n(4,u=A.disabled),"skeleton"in A&&n(2,f=A.skeleton),"$$scope"in A&&n(5,s=A.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&c.set(u)},[o,a,f,l,u,s,r,d,h,g,_,k,y,T,M]}class RI extends Oe{constructor(e){super(),Ee(this,e,II,DI,Se,{align:0,size:1,disabled:4,skeleton:2})}}const ug=RI,PI=t=>({}),Fp=t=>({});function NI(t){let e;return{c(){e=j(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function BI(t){let e,n,i,l,r,s,o,a,u,f;i=new Gu({props:{class:"bx--accordion__arrow","aria-label":t[3]}});const c=t[7].title,d=He(c,t,t[6],Fp),h=d||NI(t),g=t[7].default,_=He(g,t,t[6],null);let k=[t[5]],y={};for(let T=0;T{!N&&c||n(1,u=N)});let g;sn(()=>()=>{h()});function _(N){te.call(this,t,N)}function k(N){te.call(this,t,N)}function y(N){te.call(this,t,N)}function T(N){te.call(this,t,N)}function M(N){te.call(this,t,N)}function A(N){te.call(this,t,N)}const C=()=>{n(0,a=!a),n(4,g=a?"expanding":"collapsing")},D=({key:N})=>{a&&N==="Escape"&&n(0,a=!1)},R=()=>{n(4,g=void 0)};return t.$$set=N=>{e=Z(Z({},e),Te(N)),n(5,l=de(e,i)),"title"in N&&n(2,o=N.title),"open"in N&&n(0,a=N.open),"disabled"in N&&n(1,u=N.disabled),"iconDescription"in N&&n(3,f=N.iconDescription),"$$scope"in N&&n(6,s=N.$$scope)},[a,u,o,f,g,l,s,r,_,k,y,T,M,A,C,D,R]}class HI extends Oe{constructor(e){super(),Ee(this,e,zI,BI,Se,{title:2,open:0,disabled:1,iconDescription:3})}}const fg=HI;function Gp(t,e,n){const i=t.slice();return i[7]=e[n],i}function Vp(t,e){let n,i,l;return{key:t,first:null,c(){n=P("div"),i=P("span"),i.textContent=" ",l=F(),S(i,"bx--link",!0),S(n,"bx--breadcrumb-item",!0),this.first=n},m(r,s){O(r,n,s),w(n,i),w(n,l)},p(r,s){},d(r){r&&E(n)}}}function UI(t){let e,n=[],i=new Map,l,r,s=it(Array.from({length:t[1]},Wp));const o=f=>f[7];for(let f=0;fe;function FI(t,e,n){const i=["noTrailingSlash","count"];let l=de(e,i),{noTrailingSlash:r=!1}=e,{count:s=3}=e;function o(c){te.call(this,t,c)}function a(c){te.call(this,t,c)}function u(c){te.call(this,t,c)}function f(c){te.call(this,t,c)}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"noTrailingSlash"in c&&n(0,r=c.noTrailingSlash),"count"in c&&n(1,s=c.count)},[r,s,l,o,a,u,f]}class GI extends Oe{constructor(e){super(),Ee(this,e,FI,UI,Se,{noTrailingSlash:0,count:1})}}const VI=GI;function WI(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{"aria-label":"Breadcrumb"},t[2]],u={};for(let f=0;f{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function qI(t,e,n){const i=["noTrailingSlash","skeleton"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{noTrailingSlash:o=!1}=e,{skeleton:a=!1}=e;function u(y){te.call(this,t,y)}function f(y){te.call(this,t,y)}function c(y){te.call(this,t,y)}function d(y){te.call(this,t,y)}function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(2,l=de(e,i)),"noTrailingSlash"in y&&n(0,o=y.noTrailingSlash),"skeleton"in y&&n(1,a=y.skeleton),"$$scope"in y&&n(3,s=y.$$scope)},[o,a,l,s,r,u,f,c,d,h,g,_,k]}class YI extends Oe{constructor(e){super(),Ee(this,e,qI,$I,Se,{noTrailingSlash:0,skeleton:1})}}const mr=YI,ZI=t=>({}),jp=t=>({}),XI=t=>({}),$p=t=>({});function KI(t){let e,n,i,l,r,s;const o=t[10].default,a=He(o,t,t[9],null);let u=!t[3]&&(t[8].icon||t[4])&&qp(t),f=[{rel:i=t[7].target==="_blank"?"noopener noreferrer":void 0},{href:t[2]},t[7]],c={};for(let d=0;d{u=null}),fe()),we(e,c=Pe(f,[(!l||h&128&&i!==(i=d[7].target==="_blank"?"noopener noreferrer":void 0))&&{rel:i},(!l||h&4)&&{href:d[2]},h&128&&d[7]])),S(e,"bx--link",!0),S(e,"bx--link--disabled",d[5]),S(e,"bx--link--inline",d[3]),S(e,"bx--link--visited",d[6]),S(e,"bx--link--sm",d[1]==="sm"),S(e,"bx--link--lg",d[1]==="lg")},i(d){l||(p(a,d),p(u),l=!0)},o(d){v(a,d),v(u),l=!1},d(d){d&&E(e),a&&a.d(d),u&&u.d(),t[20](null),r=!1,ut(s)}}}function JI(t){let e,n,i,l,r;const s=t[10].default,o=He(s,t,t[9],null);let a=!t[3]&&(t[8].icon||t[4])&&Yp(t),u=[t[7]],f={};for(let c=0;c{a=null}),fe()),we(e,f=Pe(u,[d&128&&c[7]])),S(e,"bx--link",!0),S(e,"bx--link--disabled",c[5]),S(e,"bx--link--inline",c[3]),S(e,"bx--link--visited",c[6])},i(c){i||(p(o,c),p(a),i=!0)},o(c){v(o,c),v(a),i=!1},d(c){c&&E(e),o&&o.d(c),a&&a.d(),t[19](null),l=!1,ut(r)}}}function qp(t){let e,n;const i=t[10].icon,l=He(i,t,t[9],jp),r=l||QI(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--link__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Fe(l,i,s,s[9],n?Ue(i,s[9],o,ZI):Ge(s[9]),jp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function QI(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function Yp(t){let e,n;const i=t[10].icon,l=He(i,t,t[9],$p),r=l||xI(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--link__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Fe(l,i,s,s[9],n?Ue(i,s[9],o,XI):Ge(s[9]),$p):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function xI(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function eR(t){let e,n,i,l;const r=[JI,KI],s=[];function o(a,u){return a[5]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function tR(t,e,n){const i=["size","href","inline","icon","disabled","visited","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{size:a=void 0}=e,{href:u=void 0}=e,{inline:f=!1}=e,{icon:c=void 0}=e,{disabled:d=!1}=e,{visited:h=!1}=e,{ref:g=null}=e;function _(G){te.call(this,t,G)}function k(G){te.call(this,t,G)}function y(G){te.call(this,t,G)}function T(G){te.call(this,t,G)}function M(G){te.call(this,t,G)}function A(G){te.call(this,t,G)}function C(G){te.call(this,t,G)}function D(G){te.call(this,t,G)}function R(G){xe[G?"unshift":"push"](()=>{g=G,n(0,g)})}function N(G){xe[G?"unshift":"push"](()=>{g=G,n(0,g)})}return t.$$set=G=>{e=Z(Z({},e),Te(G)),n(7,l=de(e,i)),"size"in G&&n(1,a=G.size),"href"in G&&n(2,u=G.href),"inline"in G&&n(3,f=G.inline),"icon"in G&&n(4,c=G.icon),"disabled"in G&&n(5,d=G.disabled),"visited"in G&&n(6,h=G.visited),"ref"in G&&n(0,g=G.ref),"$$scope"in G&&n(9,s=G.$$scope)},[g,a,u,f,c,d,h,l,o,s,r,_,k,y,T,M,A,C,D,R,N]}class nR extends Oe{constructor(e){super(),Ee(this,e,tR,eR,Se,{size:1,href:2,inline:3,icon:4,disabled:5,visited:6,ref:0})}}const UT=nR,iR=t=>({props:t&4}),Zp=t=>({props:{"aria-current":t[2]["aria-current"],class:"bx--link"}});function lR(t){let e;const n=t[3].default,i=He(n,t,t[8],Zp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&260)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,iR):Ge(l[8]),Zp)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function rR(t){let e,n;return e=new UT({props:{href:t[0],"aria-current":t[2]["aria-current"],$$slots:{default:[sR]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.href=i[0]),l&4&&(r["aria-current"]=i[2]["aria-current"]),l&256&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sR(t){let e;const n=t[3].default,i=He(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,null):Ge(l[8]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function oR(t){let e,n,i,l,r,s;const o=[rR,lR],a=[];function u(d,h){return d[0]?0:1}n=u(t),i=a[n]=o[n](t);let f=[t[2]],c={};for(let d=0;d{a[g]=null}),fe(),i=a[n],i?i.p(d,h):(i=a[n]=o[n](d),i.c()),p(i,1),i.m(e,null)),we(e,c=Pe(f,[h&4&&d[2]])),S(e,"bx--breadcrumb-item",!0),S(e,"bx--breadcrumb-item--current",d[1]&&d[2]["aria-current"]!=="page")},i(d){l||(p(i),l=!0)},o(d){v(i),l=!1},d(d){d&&E(e),a[n].d(),r=!1,ut(s)}}}function aR(t,e,n){const i=["href","isCurrentPage"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{href:o=void 0}=e,{isCurrentPage:a=!1}=e;pi("BreadcrumbItem",{});function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(2,l=de(e,i)),"href"in h&&n(0,o=h.href),"isCurrentPage"in h&&n(1,a=h.isCurrentPage),"$$scope"in h&&n(8,s=h.$$scope)},[o,a,l,r,u,f,c,d,s]}class uR extends Oe{constructor(e){super(),Ee(this,e,aR,oR,Se,{href:0,isCurrentPage:1})}}const xn=uR;function fR(t){let e,n,i,l=[t[2]],r={};for(let s=0;s{e=Z(Z({},e),Te(_)),n(2,l=de(e,i)),"href"in _&&n(0,r=_.href),"size"in _&&n(1,s=_.size)},[r,s,l,o,a,u,f,c,d,h,g]}class mR extends Oe{constructor(e){super(),Ee(this,e,hR,dR,Se,{href:0,size:1})}}const gR=mR,_R=t=>({props:t[0]&512}),Xp=t=>({props:t[9]});function pR(t){let e,n,i,l,r,s,o=t[8]&&Kp(t);const a=t[19].default,u=He(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon",style:g[8]?"margin-left: 0":void 0,"aria-label":g[3]}}}f&&(i=rn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{H(k,1)}),fe()}f?(i=rn(f,c(g)),U(i.$$.fragment),p(i.$$.fragment,1),z(i,e,null)):i=null}else if(f){const k={};_[0]&256&&(k.style=g[8]?"margin-left: 0":void 0),_[0]&8&&(k["aria-label"]=g[3]),i.$set(k)}we(e,h=Pe(d,[_[0]&512&&g[9]]))},i(g){l||(p(u,g),i&&p(i.$$.fragment,g),l=!0)},o(g){v(u,g),i&&v(i.$$.fragment,g),l=!1},d(g){g&&E(e),o&&o.d(),u&&u.d(g),i&&H(i),t[33](null),r=!1,ut(s)}}}function bR(t){let e,n,i,l,r,s,o=t[8]&&Jp(t);const a=t[19].default,u=He(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon","aria-label":g[3]}}}f&&(i=rn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{H(k,1)}),fe()}f?(i=rn(f,c(g)),U(i.$$.fragment),p(i.$$.fragment,1),z(i,e,null)):i=null}else if(f){const k={};_[0]&8&&(k["aria-label"]=g[3]),i.$set(k)}we(e,h=Pe(d,[_[0]&512&&g[9]]))},i(g){l||(p(u,g),i&&p(i.$$.fragment,g),l=!0)},o(g){v(u,g),i&&v(i.$$.fragment,g),l=!1},d(g){g&&E(e),o&&o.d(),u&&u.d(g),i&&H(i),t[32](null),r=!1,ut(s)}}}function vR(t){let e;const n=t[19].default,i=He(n,t,t[18],Xp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r[0]&262656)&&Fe(i,n,l,l[18],e?Ue(n,l[18],r,_R):Ge(l[18]),Xp)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function kR(t){let e,n;const i=[{href:t[7]},{size:t[1]},t[10],{style:t[8]&&"width: 3rem;"}];let l={};for(let r=0;r{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function yR(t,e,n){let i,l;const r=["kind","size","expressive","isSelected","icon","iconDescription","tooltipAlignment","tooltipPosition","as","skeleton","disabled","href","tabindex","type","ref"];let s=de(e,r),{$$slots:o={},$$scope:a}=e;const u=di(o);let{kind:f="primary"}=e,{size:c="default"}=e,{expressive:d=!1}=e,{isSelected:h=!1}=e,{icon:g=void 0}=e,{iconDescription:_=void 0}=e,{tooltipAlignment:k="center"}=e,{tooltipPosition:y="bottom"}=e,{as:T=!1}=e,{skeleton:M=!1}=e,{disabled:A=!1}=e,{href:C=void 0}=e,{tabindex:D="0"}=e,{type:R="button"}=e,{ref:N=null}=e;const G=jn("ComposedModal");function B(oe){te.call(this,t,oe)}function $(oe){te.call(this,t,oe)}function q(oe){te.call(this,t,oe)}function V(oe){te.call(this,t,oe)}function K(oe){te.call(this,t,oe)}function x(oe){te.call(this,t,oe)}function ie(oe){te.call(this,t,oe)}function X(oe){te.call(this,t,oe)}function ce(oe){te.call(this,t,oe)}function ae(oe){te.call(this,t,oe)}function ee(oe){te.call(this,t,oe)}function he(oe){te.call(this,t,oe)}function ne(oe){xe[oe?"unshift":"push"](()=>{N=oe,n(0,N)})}function re(oe){xe[oe?"unshift":"push"](()=>{N=oe,n(0,N)})}return t.$$set=oe=>{e=Z(Z({},e),Te(oe)),n(10,s=de(e,r)),"kind"in oe&&n(11,f=oe.kind),"size"in oe&&n(1,c=oe.size),"expressive"in oe&&n(12,d=oe.expressive),"isSelected"in oe&&n(13,h=oe.isSelected),"icon"in oe&&n(2,g=oe.icon),"iconDescription"in oe&&n(3,_=oe.iconDescription),"tooltipAlignment"in oe&&n(14,k=oe.tooltipAlignment),"tooltipPosition"in oe&&n(15,y=oe.tooltipPosition),"as"in oe&&n(4,T=oe.as),"skeleton"in oe&&n(5,M=oe.skeleton),"disabled"in oe&&n(6,A=oe.disabled),"href"in oe&&n(7,C=oe.href),"tabindex"in oe&&n(16,D=oe.tabindex),"type"in oe&&n(17,R=oe.type),"ref"in oe&&n(0,N=oe.ref),"$$scope"in oe&&n(18,a=oe.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&G&&N&&G.declareRef(N),t.$$.dirty[0]&4&&n(8,i=g&&!u.default),n(9,l={type:C&&!A?void 0:R,tabindex:D,disabled:A===!0?!0:void 0,href:C,"aria-pressed":i&&f==="ghost"&&!C?h:void 0,...s,class:["bx--btn",d&&"bx--btn--expressive",(c==="small"&&!d||c==="sm"&&!d||c==="small"&&!d)&&"bx--btn--sm",c==="field"&&!d||c==="md"&&!d&&"bx--btn--md",c==="field"&&"bx--btn--field",c==="small"&&"bx--btn--sm",c==="lg"&&"bx--btn--lg",c==="xl"&&"bx--btn--xl",f&&`bx--btn--${f}`,A&&"bx--btn--disabled",i&&"bx--btn--icon-only",i&&"bx--tooltip__trigger",i&&"bx--tooltip--a11y",i&&y&&`bx--btn--icon-only--${y}`,i&&k&&`bx--tooltip--align-${k}`,i&&h&&f==="ghost"&&"bx--btn--selected",s.class].filter(Boolean).join(" ")})},[N,c,g,_,T,M,A,C,i,l,s,f,d,h,k,y,D,R,a,o,B,$,q,V,K,x,ie,X,ce,ae,ee,he,ne,re]}class TR extends Oe{constructor(e){super(),Ee(this,e,yR,wR,Se,{kind:11,size:1,expressive:12,isSelected:13,icon:2,iconDescription:3,tooltipAlignment:14,tooltipPosition:15,as:4,skeleton:5,disabled:6,href:7,tabindex:16,type:17,ref:0},null,[-1,-1])}}const bt=TR;function SR(t){let e,n;const i=t[3].default,l=He(i,t,t[2],null);let r=[t[1]],s={};for(let o=0;o{e=Z(Z({},e),Te(a)),n(1,l=de(e,i)),"stacked"in a&&n(0,o=a.stacked),"$$scope"in a&&n(2,s=a.$$scope)},[o,l,s,r]}class OR extends Oe{constructor(e){super(),Ee(this,e,ER,SR,Se,{stacked:0})}}const MR=OR;function CR(t){let e,n,i,l,r=[t[0]],s={};for(let o=0;o{e=Z(Z({},e),Te(u)),n(0,l=de(e,i))},[l,r,s,o,a]}class LR extends Oe{constructor(e){super(),Ee(this,e,AR,CR,Se,{})}}const DR=LR,IR=t=>({}),Qp=t=>({});function RR(t){let e,n,i,l,r,s,o,a;const u=t[19].labelText,f=He(u,t,t[18],Qp),c=f||NR(t);let d=[t[16]],h={};for(let g=0;g{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function zR(t,e,n){let i,l;const r=["value","checked","group","indeterminate","skeleton","required","readonly","disabled","labelText","hideLabel","name","title","id","ref"];let s=de(e,r),{$$slots:o={},$$scope:a}=e,{value:u=""}=e,{checked:f=!1}=e,{group:c=void 0}=e,{indeterminate:d=!1}=e,{skeleton:h=!1}=e,{required:g=!1}=e,{readonly:_=!1}=e,{disabled:k=!1}=e,{labelText:y=""}=e,{hideLabel:T=!1}=e,{name:M=""}=e,{title:A=void 0}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{ref:D=null}=e;const R=on();let N=null;function G(ne){te.call(this,t,ne)}function B(ne){te.call(this,t,ne)}function $(ne){te.call(this,t,ne)}function q(ne){te.call(this,t,ne)}function V(ne){te.call(this,t,ne)}function K(ne){te.call(this,t,ne)}function x(ne){te.call(this,t,ne)}function ie(ne){te.call(this,t,ne)}function X(ne){te.call(this,t,ne)}function ce(ne){te.call(this,t,ne)}function ae(ne){xe[ne?"unshift":"push"](()=>{D=ne,n(3,D)})}const ee=()=>{i?n(1,c=c.includes(u)?c.filter(ne=>ne!==u):[...c,u]):n(0,f=!f)};function he(ne){xe[ne?"unshift":"push"](()=>{N=ne,n(14,N)})}return t.$$set=ne=>{e=Z(Z({},e),Te(ne)),n(16,s=de(e,r)),"value"in ne&&n(4,u=ne.value),"checked"in ne&&n(0,f=ne.checked),"group"in ne&&n(1,c=ne.group),"indeterminate"in ne&&n(5,d=ne.indeterminate),"skeleton"in ne&&n(6,h=ne.skeleton),"required"in ne&&n(7,g=ne.required),"readonly"in ne&&n(8,_=ne.readonly),"disabled"in ne&&n(9,k=ne.disabled),"labelText"in ne&&n(10,y=ne.labelText),"hideLabel"in ne&&n(11,T=ne.hideLabel),"name"in ne&&n(12,M=ne.name),"title"in ne&&n(2,A=ne.title),"id"in ne&&n(13,C=ne.id),"ref"in ne&&n(3,D=ne.ref),"$$scope"in ne&&n(18,a=ne.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&2&&n(15,i=Array.isArray(c)),t.$$.dirty[0]&32787&&n(0,f=i?c.includes(u):f),t.$$.dirty[0]&1&&R("check",f),t.$$.dirty[0]&16384&&n(17,l=(N==null?void 0:N.offsetWidth)<(N==null?void 0:N.scrollWidth)),t.$$.dirty[0]&147460&&n(2,A=!A&&l?N==null?void 0:N.innerText:A)},[f,c,A,D,u,d,h,g,_,k,y,T,M,C,N,i,s,l,a,o,G,B,$,q,V,K,x,ie,X,ce,ae,ee,he]}class HR extends Oe{constructor(e){super(),Ee(this,e,zR,BR,Se,{value:4,checked:0,group:1,indeterminate:5,skeleton:6,required:7,readonly:8,disabled:9,labelText:10,hideLabel:11,name:12,title:2,id:13,ref:3},null,[-1,-1])}}const FT=HR;function UR(t){let e,n,i,l,r,s,o,a,u,f=[{type:"checkbox"},{checked:i=t[2]?!1:t[1]},{indeterminate:t[2]},{id:t[4]},t[5],{"aria-checked":l=t[2]?void 0:t[1]}],c={};for(let d=0;d{u=d,n(0,u)})}return t.$$set=d=>{n(6,e=Z(Z({},e),Te(d))),n(5,l=de(e,i)),"checked"in d&&n(1,r=d.checked),"indeterminate"in d&&n(2,s=d.indeterminate),"title"in d&&n(3,o=d.title),"id"in d&&n(4,a=d.id),"ref"in d&&n(0,u=d.ref)},e=Te(e),[u,r,s,o,a,l,e,f,c]}class GR extends Oe{constructor(e){super(),Ee(this,e,FR,UR,Se,{checked:1,indeterminate:2,title:3,id:4,ref:0})}}const GT=GR;function VR(t){let e,n,i,l;const r=t[6].default,s=He(r,t,t[5],null);let o=[{role:"tablist"},t[1]],a={};for(let u=0;u{M&&n(2,u=l.length),n(4,l=[...l,{id:y,text:T,selected:M}])},update:y=>{n(2,u=l.map(({id:T})=>T).indexOf(y))},change:y=>{let T=i+y;T<0?T=l.length-1:T>=l.length&&(T=0),n(2,u=T)}}),hr(()=>{u!==i&&n(3,i=u)});function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(1,s=de(e,r)),"selectedIndex"in y&&n(2,u=y.selectedIndex),"size"in y&&n(0,f=y.size),"$$scope"in y&&n(5,a=y.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&l[i]&&(c("change",i),d.set(l[i].id))},n(3,i=-1),n(4,l=[]),[f,s,u,i,l,a,o,h,g,_,k]}class jR extends Oe{constructor(e){super(),Ee(this,e,WR,VR,Se,{selectedIndex:2,size:0})}}const $R=jR;function qR(t){let e;return{c(){e=j(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function YR(t){let e,n,i,l,r,s;const o=t[8].default,a=He(o,t,t[7],null),u=a||qR(t);let f=[{type:"button"},{role:"tab"},{tabindex:i=t[0]?"0":"-1"},{"aria-selected":t[0]},{disabled:t[3]},{id:t[4]},t[6]],c={};for(let d=0;d{n(0,a=D===f)});hr(()=>{a&&c.focus()}),sn(()=>()=>h());function g(D){te.call(this,t,D)}function _(D){te.call(this,t,D)}function k(D){te.call(this,t,D)}function y(D){te.call(this,t,D)}function T(D){te.call(this,t,D)}function M(D){xe[D?"unshift":"push"](()=>{c=D,n(1,c)})}const A=()=>{d.update(f)},C=({key:D})=>{D==="ArrowRight"?d.change(1):D==="ArrowLeft"&&d.change(-1)};return t.$$set=D=>{e=Z(Z({},e),Te(D)),n(6,l=de(e,i)),"text"in D&&n(2,o=D.text),"selected"in D&&n(0,a=D.selected),"disabled"in D&&n(3,u=D.disabled),"id"in D&&n(4,f=D.id),"ref"in D&&n(1,c=D.ref),"$$scope"in D&&n(7,s=D.$$scope)},[a,c,o,u,f,d,l,s,r,g,_,k,y,T,M,A,C]}class XR extends Oe{constructor(e){super(),Ee(this,e,ZR,YR,Se,{text:2,selected:0,disabled:3,id:4,ref:1})}}const xp=XR;function eb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function KR(t){let e,n,i,l=t[1]&&eb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class QR extends Oe{constructor(e){super(),Ee(this,e,JR,KR,Se,{size:0,title:1})}}const xR=QR;function eP(t){let e,n,i,l,r,s,o,a;n=new xR({props:{class:"bx--snippet__icon"}});let u=[{type:"button"},{"aria-live":"polite"},{"aria-label":t[2]},{title:t[2]},t[8]],f={};for(let c=0;c{try{await navigator.clipboard.writeText(y)}catch(T){console.log(T)}}}=e;const f=on();let c,d;sn(()=>()=>clearTimeout(d));function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}const _=()=>{a!==void 0&&(u(a),f("copy")),c!=="fade-in"&&(n(5,c="fade-in"),n(6,d=setTimeout(()=>{n(5,c="fade-out")},s)))},k=({animationName:y})=>{y==="hide-feedback"&&n(5,c=void 0)};return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(8,l=de(e,i)),"feedback"in y&&n(0,r=y.feedback),"feedbackTimeout"in y&&n(1,s=y.feedbackTimeout),"iconDescription"in y&&n(2,o=y.iconDescription),"text"in y&&n(3,a=y.text),"copy"in y&&n(4,u=y.copy)},[r,s,o,a,u,c,d,f,l,h,g,_,k]}class nP extends Oe{constructor(e){super(),Ee(this,e,tP,eP,Se,{feedback:0,feedbackTimeout:1,iconDescription:2,text:3,copy:4})}}const iP=nP;function tb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function lP(t){let e,n,i,l=t[1]&&tb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class sP extends Oe{constructor(e){super(),Ee(this,e,rP,lP,Se,{size:0,title:1})}}const Ds=sP;function nb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function oP(t){let e,n,i,l,r=t[1]&&nb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class uP extends Oe{constructor(e){super(),Ee(this,e,aP,oP,Se,{size:0,title:1})}}const Vu=uP;function ib(t){let e,n;return{c(){e=P("div"),n=j(t[6]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function lb(t){let e,n;return{c(){e=P("div"),n=j(t[8]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&256&&Y(n,i[8])},d(i){i&&E(e)}}}function fP(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=He(u,t,t[10],null);let c=[{role:"listbox"},{tabindex:"-1"},{"data-invalid":n=t[5]||void 0},t[9]],d={};for(let _=0;_{t.key==="Escape"&&t.stopPropagation()};function dP(t,e,n){const i=["size","type","open","light","disabled","invalid","invalidText","warn","warnText"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{type:a="default"}=e,{open:u=!1}=e,{light:f=!1}=e,{disabled:c=!1}=e,{invalid:d=!1}=e,{invalidText:h=""}=e,{warn:g=!1}=e,{warnText:_=""}=e;function k(T){te.call(this,t,T)}function y(T){te.call(this,t,T)}return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(9,l=de(e,i)),"size"in T&&n(0,o=T.size),"type"in T&&n(1,a=T.type),"open"in T&&n(2,u=T.open),"light"in T&&n(3,f=T.light),"disabled"in T&&n(4,c=T.disabled),"invalid"in T&&n(5,d=T.invalid),"invalidText"in T&&n(6,h=T.invalidText),"warn"in T&&n(7,g=T.warn),"warnText"in T&&n(8,_=T.warnText),"$$scope"in T&&n(10,s=T.$$scope)},[o,a,u,f,c,d,h,g,_,l,s,r,k,y]}class hP extends Oe{constructor(e){super(),Ee(this,e,dP,fP,Se,{size:0,type:1,open:2,light:3,disabled:4,invalid:5,invalidText:6,warn:7,warnText:8})}}const mP=hP;function gP(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=He(u,t,t[10],null);let c=[{role:t[2]},{"aria-expanded":t[6]},{"aria-owns":n=t[6]&&t[5]||void 0},{"aria-controls":i=t[6]&&t[5]||void 0},{"aria-disabled":t[1]},{"aria-label":l=t[6]?t[4]("close"):t[4]("open")},{tabindex:r=t[1]?"-1":t[3]},t[7]],d={};for(let h=0;hk[B]}=e,{id:g="ccs-"+Math.random().toString(36)}=e,{ref:_=null}=e;const k={[d.close]:"Close menu",[d.open]:"Open menu"},y=jn("MultiSelect");function T(B){te.call(this,t,B)}function M(B){te.call(this,t,B)}function A(B){te.call(this,t,B)}function C(B){te.call(this,t,B)}function D(B){te.call(this,t,B)}function R(B){te.call(this,t,B)}function N(B){te.call(this,t,B)}function G(B){xe[B?"unshift":"push"](()=>{_=B,n(0,_)})}return t.$$set=B=>{n(22,e=Z(Z({},e),Te(B))),n(7,s=de(e,r)),"disabled"in B&&n(1,u=B.disabled),"role"in B&&n(2,f=B.role),"tabindex"in B&&n(3,c=B.tabindex),"translateWithId"in B&&n(4,h=B.translateWithId),"id"in B&&n(9,g=B.id),"ref"in B&&n(0,_=B.ref),"$$scope"in B&&n(10,a=B.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&y&&_&&y.declareRef({key:"field",ref:_}),n(6,i=e["aria-expanded"]),t.$$.dirty&512&&n(5,l=`menu-${g}`)},e=Te(e),[_,u,f,c,h,l,i,s,d,g,a,o,T,M,A,C,D,R,N,G]}class pP extends Oe{constructor(e){super(),Ee(this,e,_P,gP,Se,{disabled:1,role:2,tabindex:3,translationIds:8,translateWithId:4,id:9,ref:0})}get translationIds(){return this.$$.ctx[8]}}const bP=pP;function vP(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{role:"listbox"},{id:n="menu-"+t[1]},t[2]],u={};for(let f=0;f{a=c,n(0,a)})}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"id"in c&&n(1,o=c.id),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class wP extends Oe{constructor(e){super(),Ee(this,e,kP,vP,Se,{id:1,ref:0})}}const yP=wP;function rb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function TP(t){let e,n,i=t[1]&&rb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let EP=class extends Oe{constructor(e){super(),Ee(this,e,SP,TP,Se,{size:0,title:1})}};const ho=EP;function OP(t){let e,n,i,l,r;n=new ho({props:{"aria-label":t[1],title:t[1]}});let s=[t[2]],o={};for(let a=0;af[d]}=e;const f={[a.close]:"Close menu",[a.open]:"Open menu"};function c(d){te.call(this,t,d)}return t.$$set=d=>{e=Z(Z({},e),Te(d)),n(2,s=de(e,r)),"open"in d&&n(0,o=d.open),"translateWithId"in d&&n(4,u=d.translateWithId)},t.$$.update=()=>{t.$$.dirty&1&&n(5,i=o?a.close:a.open),t.$$.dirty&48&&n(1,l=(u==null?void 0:u(i))??f[i])},[o,l,s,a,u,i,c]}class CP extends Oe{constructor(e){super(),Ee(this,e,MP,OP,Se,{open:0,translationIds:3,translateWithId:4})}get translationIds(){return this.$$.ctx[3]}}const VT=CP;function AP(t){let e,n,i,l,r,s;const o=t[8].default,a=He(o,t,t[7],null);let u=[{role:"option"},{tabindex:"-1"},{"aria-selected":t[0]},{disabled:i=t[2]?!0:void 0},t[5]],f={};for(let c=0;c{d=y,n(3,d)})}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(5,s=de(e,r)),"active"in y&&n(0,u=y.active),"highlighted"in y&&n(1,f=y.highlighted),"disabled"in y&&n(2,c=y.disabled),"$$scope"in y&&n(7,a=y.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(6,i=(d==null?void 0:d.offsetWidth)<(d==null?void 0:d.scrollWidth)),t.$$.dirty&72&&n(4,l=i?d==null?void 0:d.innerText:void 0),t.$$.dirty&10&&f&&d&&!d.matches(":hover")&&d.scrollIntoView({block:"nearest"})},[u,f,c,d,l,s,i,a,o,h,g,_,k]}class DP extends Oe{constructor(e){super(),Ee(this,e,LP,AP,Se,{active:0,highlighted:1,disabled:2})}}const IP=DP;function sb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function RP(t){let e,n,i=t[1]&&sb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let NP=class extends Oe{constructor(e){super(),Ee(this,e,PP,RP,Se,{size:0,title:1})}};const Dl=NP;function BP(t){let e,n,i,l,r,s,o,a=t[1]!==void 0&&ob(t);i=new Dl({});let u=[{role:"button"},{"aria-label":t[4]},{title:t[4]},{tabindex:l=t[2]?"-1":"0"},t[6]],f={};for(let c=0;c{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function UP(t,e,n){let i,l;const r=["selectionCount","disabled","translationIds","translateWithId","ref"];let s=de(e,r),{selectionCount:o=void 0}=e,{disabled:a=!1}=e;const u={clearAll:"clearAll",clearSelection:"clearSelection"};let{translateWithId:f=C=>d[C]}=e,{ref:c=null}=e;const d={[u.clearAll]:"Clear all selected items",[u.clearSelection]:"Clear selected item"},h=on(),g=jn("MultiSelect");function _(C){xe[C?"unshift":"push"](()=>{c=C,n(0,c)})}const k=C=>{a||h("clear",C)},y=C=>{!a&&C.key==="Enter"&&h("clear",C)};function T(C){xe[C?"unshift":"push"](()=>{c=C,n(0,c)})}const M=C=>{a||h("clear",C)},A=C=>{!a&&C.key==="Enter"&&h("clear",C)};return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(6,s=de(e,r)),"selectionCount"in C&&n(1,o=C.selectionCount),"disabled"in C&&n(2,a=C.disabled),"translateWithId"in C&&n(7,f=C.translateWithId),"ref"in C&&n(0,c=C.ref)},t.$$.update=()=>{t.$$.dirty&1&&g&&c&&g.declareRef({key:"selection",ref:c}),t.$$.dirty&2&&n(8,i=o?u.clearAll:u.clearSelection),t.$$.dirty&384&&n(4,l=(f==null?void 0:f(i))??d[i])},[c,o,a,u,l,h,s,f,i,_,k,y,T,M,A]}class FP extends Oe{constructor(e){super(),Ee(this,e,UP,HP,Se,{selectionCount:1,disabled:2,translationIds:3,translateWithId:7,ref:0})}get translationIds(){return this.$$.ctx[3]}}const WT=FP,J1=new Set,jT=Wt(0),ab=()=>jT.set([...J1].filter(t=>YD(t)).length),$T=t=>sn(()=>{J1.add(t);const e=t.subscribe(ab);return()=>{e(),J1.delete(t),ab()}});jT.subscribe(t=>{typeof document<"u"&&document.body.classList.toggle("bx--body--with-modal-open",t>0)});function GP(t){let e,n,i,l,r,s;const o=t[18].default,a=He(o,t,t[17],null);let u=[{role:"presentation"},t[14]],f={};for(let c=0;cn(9,o=ee));let M=null,A=null,C=!1;pi("ComposedModal",{closeModal:()=>{n(0,c=!1)},submit:()=>{y("submit"),y("click:button--primary")},declareRef:ee=>{M=ee},updateLabel:ee=>{T.set(ee)}});function D(ee){var ne;if(_==null)return;const he=((ne=ee||A)==null?void 0:ne.querySelector(_))||M;he!=null&&he.focus()}let R=!1;const N=Wt(c);ct(t,N,ee=>n(32,s=ee)),$T(N),sn(()=>{Ou().then(()=>{D()})}),hr(()=>{R?c||(R=!1,y("close")):c&&(R=!0,y("open"))});function G(ee){te.call(this,t,ee)}function B(ee){te.call(this,t,ee)}function $(ee){te.call(this,t,ee)}function q(ee){te.call(this,t,ee)}function V(ee){te.call(this,t,ee)}function K(ee){xe[ee?"unshift":"push"](()=>{A=ee,n(6,A)})}const x=()=>{n(7,C=!0)};function ie(ee){xe[ee?"unshift":"push"](()=>{k=ee,n(1,k)})}const X=ee=>{if(c){if(ee.key==="Escape")n(0,c=!1);else if(ee.key==="Tab"){const he=` +}`,c=`__svelte_${lI(f)}_${o}`,d=PT(t),{stylesheet:h,rules:g}=Mc.get(d)||rI(d,t);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,Cc+=1,c}function sI(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),l=n.length-i.length;l&&(t.style.animation=i.join(", "),Cc-=l,Cc||oI())}function oI(){og(()=>{Cc||(Mc.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&E(e)}),Mc.clear())})}let Eu;function zr(t){Eu=t}function As(){if(!Eu)throw new Error("Function called outside component initialization");return Eu}function aI(t){As().$$.before_update.push(t)}function on(t){As().$$.on_mount.push(t)}function hr(t){As().$$.after_update.push(t)}function Ls(t){As().$$.on_destroy.push(t)}function nn(){const t=As();return(e,n,{cancelable:i=!1}={})=>{const l=t.$$.callbacks[e];if(l){const r=NT(e,n,{cancelable:i});return l.slice().forEach(s=>{s.call(t,r)}),!r.defaultPrevented}return!0}}function pi(t,e){return As().$$.context.set(t,e),e}function jn(t){return As().$$.context.get(t)}function te(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const jo=[],xe=[];let Qo=[];const X1=[],BT=Promise.resolve();let K1=!1;function zT(){K1||(K1=!0,BT.then(ag))}function Ou(){return zT(),BT}function Es(t){Qo.push(t)}function Ct(t){X1.push(t)}const c1=new Set;let zo=0;function ag(){if(zo!==0)return;const t=Eu;do{try{for(;zot.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),Qo=e}let Qa;function cI(){return Qa||(Qa=Promise.resolve(),Qa.then(()=>{Qa=null})),Qa}function d1(t,e,n){t.dispatchEvent(NT(`${e?"intro":"outro"}${n}`))}const cc=new Set;let Hr;function ue(){Hr={r:0,c:[],p:Hr}}function fe(){Hr.r||ut(Hr.c),Hr=Hr.p}function p(t,e){t&&t.i&&(cc.delete(t),t.i(e))}function v(t,e,n,i){if(t&&t.o){if(cc.has(t))return;cc.add(t),Hr.c.push(()=>{cc.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}const dI={duration:0};function Dp(t,e,n,i){let r=e(t,n,{direction:"both"}),s=i?0:1,o=null,a=null,u=null,f;function c(){u&&sI(t,u)}function d(g,_){const k=g.b-s;return _*=Math.abs(k),{a:s,b:g.b,d:k,duration:_,start:g.start,end:g.start+_,group:g.group}}function h(g){const{delay:_=0,duration:k=300,easing:y=jD,tick:T=_e,css:M}=r||dI,A={start:XD()+_,b:g};g||(A.group=Hr,Hr.r+=1),"inert"in t&&(g?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),o||a?a=A:(M&&(c(),u=Lp(t,s,g,k,_,y,M)),g&&T(0,1),o=d(A,k),Es(()=>d1(t,g,"start")),KD(C=>{if(a&&C>a.start&&(o=d(a,k),a=null,d1(t,o.b,"start"),M&&(c(),u=Lp(t,s,o.b,o.duration,0,y,r.css))),o){if(C>=o.end)T(s=o.b,1-s),d1(t,o.b,"end"),a||(o.b?c():--o.group.r||ut(o.group.c)),o=null;else if(C>=o.start){const D=C-o.start;s=o.a+o.d*y(D/o.duration),T(s,1-s)}}return!!(o||a)}))}return{run(g){io(r)?cI().then(()=>{r=r({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),o=a=null}}}function Ip(t,e){const n=e.token={};function i(l,r,s,o){if(e.token!==n)return;e.resolved=o;let a=e.ctx;s!==void 0&&(a=a.slice(),a[s]=o);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==r&&c&&(ue(),v(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),fe())}):e.block.d(1),u.c(),p(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[r]=u),f&&ag()}if($D(t)){const l=As();if(t.then(r=>{zr(l),i(e.then,1,e.value,r),zr(null)},r=>{if(zr(l),i(e.catch,2,e.error,r),zr(null),!e.hasCatch)throw r}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,t),!0;e.resolved=t}}function hI(t,e,n){const i=e.slice(),{resolved:l}=t;t.current===t.then&&(i[t.value]=l),t.current===t.catch&&(i[t.error]=l),t.block.p(i,n)}function it(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function HT(t,e){t.d(1),e.delete(t.key)}function Fn(t,e){v(t,1,1,()=>{e.delete(t.key)})}function Pn(t,e,n,i,l,r,s,o,a,u,f,c){let d=t.length,h=r.length,g=d;const _={};for(;g--;)_[t[g].key]=g;const k=[],y=new Map,T=new Map,M=[];for(g=h;g--;){const R=c(l,r,g),N=n(R);let G=s.get(N);G?i&&M.push(()=>G.p(R,e)):(G=u(N,R),G.c()),y.set(N,k[g]=G),N in _&&T.set(N,Math.abs(g-_[N]))}const A=new Set,C=new Set;function D(R){p(R,1),R.m(o,f),s.set(R.key,R),f=R.first,h--}for(;d&&h;){const R=k[h-1],N=t[d-1],G=R.key,B=N.key;R===N?(f=R.first,d--,h--):y.has(B)?!s.has(G)||A.has(G)?D(R):C.has(B)?d--:T.get(G)>T.get(B)?(C.add(G),D(R)):(A.add(B),d--):(a(N,s),d--)}for(;d--;){const R=t[d];y.has(R.key)||a(R,s)}for(;h;)D(k[h-1]);return ut(M),k}function Pe(t,e){const n={},i={},l={$$scope:1};let r=t.length;for(;r--;){const s=t[r],o=e[r];if(o){for(const a in s)a in o||(i[a]=1);for(const a in o)l[a]||(n[a]=o[a],l[a]=1);t[r]=o}else for(const a in s)l[a]=1}for(const s in i)s in n||(n[s]=void 0);return n}function Gi(t){return typeof t=="object"&&t!==null?t:{}}function At(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function U(t){t&&t.c()}function z(t,e,n){const{fragment:i,after_update:l}=t.$$;i&&i.m(e,n),Es(()=>{const r=t.$$.on_mount.map(LT).filter(io);t.$$.on_destroy?t.$$.on_destroy.push(...r):ut(r),t.$$.on_mount=[]}),l.forEach(Es)}function H(t,e){const n=t.$$;n.fragment!==null&&(fI(n.after_update),ut(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function mI(t,e){t.$$.dirty[0]===-1&&(jo.push(t),zT(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&mI(t,c)),d}):[],u.update(),f=!0,ut(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=eI(e.target);u.fragment&&u.fragment.l(c),c.forEach(E)}else u.fragment&&u.fragment.c();e.intro&&p(t.$$.fragment),z(t,e.target,e.anchor),ag()}zr(a)}class Oe{constructor(){Ki(this,"$$");Ki(this,"$$set")}$destroy(){H(this,1),this.$destroy=_e}$on(e,n){if(!io(n))return _e;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!qD(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const gI="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gI);const Ho=[];function _I(t,e){return{subscribe:Wt(t,e).subscribe}}function Wt(t,e=_e){let n;const i=new Set;function l(o){if(Se(t,o)&&(t=o,n)){const a=!Ho.length;for(const u of i)u[1](),Ho.push(u,t);if(a){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:l,update:r,subscribe:s}}function ur(t,e,n){const i=!Array.isArray(t),l=i?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return _I(n,(s,o)=>{let a=!1;const u=[];let f=0,c=_e;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,s,o);r?s(g):c=io(g)?g:_e},h=l.map((g,_)=>sg(g,k=>{u[_]=k,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){ut(h),c(),a=!1}})}function Rp(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function pI(t){let e,n,i=t[1]&&Rp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let vI=class extends Oe{constructor(e){super(),Ee(this,e,bI,pI,Se,{size:0,title:1})}};const Gu=vI;function Pp(t,e,n){const i=t.slice();return i[2]=e[n].width,i}function kI(t){let e,n,i,l=[t[4]],r={};for(let s=0;s{e=Z(Z({},e),Te(C)),n(4,o=de(e,s)),"lines"in C&&n(5,a=C.lines),"heading"in C&&n(0,u=C.heading),"paragraph"in C&&n(1,f=C.paragraph),"width"in C&&n(2,c=C.width)},t.$$.update=()=>{if(t.$$.dirty&4&&n(7,l=parseInt(c,10)),t.$$.dirty&4&&n(6,r=c.includes("px")),t.$$.dirty&238&&f)for(let C=0;Ch[9];for(let h=0;h{a=null}),fe()),g&9&&(u=it(Array.from({length:h[3]?h[0]-1:h[0]},Up)),ue(),i=Pn(i,g,f,1,h,u,l,e,Fn,Hp,null,Bp),fe()),we(e,d=Pe(c,[g&16&&h[4]])),S(e,"bx--skeleton",!0),S(e,"bx--accordion",!0),S(e,"bx--accordion--start",h[1]==="start"),S(e,"bx--accordion--end",h[1]==="end"),S(e,"bx--accordion--sm",h[2]==="sm"),S(e,"bx--accordion--xl",h[2]==="xl")},i(h){if(!r){p(a);for(let g=0;ge;function OI(t,e,n){const i=["count","align","size","open"];let l=de(e,i),{count:r=4}=e,{align:s="end"}=e,{size:o=void 0}=e,{open:a=!0}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"count"in h&&n(0,r=h.count),"align"in h&&n(1,s=h.align),"size"in h&&n(2,o=h.size),"open"in h&&n(3,a=h.open)},[r,s,o,a,l,u,f,c,d]}class MI extends Oe{constructor(e){super(),Ee(this,e,OI,EI,Se,{count:0,align:1,size:2,open:3})}}const CI=MI;function AI(t){let e,n,i,l;const r=t[6].default,s=He(r,t,t[5],null);let o=[t[3]],a={};for(let u=0;u{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function II(t,e,n){const i=["align","size","disabled","skeleton"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{align:o="end"}=e,{size:a=void 0}=e,{disabled:u=!1}=e,{skeleton:f=!1}=e;const c=Wt(u);pi("Accordion",{disableItems:c});function d(A){te.call(this,t,A)}function h(A){te.call(this,t,A)}function g(A){te.call(this,t,A)}function _(A){te.call(this,t,A)}function k(A){te.call(this,t,A)}function y(A){te.call(this,t,A)}function T(A){te.call(this,t,A)}function M(A){te.call(this,t,A)}return t.$$set=A=>{e=Z(Z({},e),Te(A)),n(3,l=de(e,i)),"align"in A&&n(0,o=A.align),"size"in A&&n(1,a=A.size),"disabled"in A&&n(4,u=A.disabled),"skeleton"in A&&n(2,f=A.skeleton),"$$scope"in A&&n(5,s=A.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&c.set(u)},[o,a,f,l,u,s,r,d,h,g,_,k,y,T,M]}class RI extends Oe{constructor(e){super(),Ee(this,e,II,DI,Se,{align:0,size:1,disabled:4,skeleton:2})}}const ug=RI,PI=t=>({}),Fp=t=>({});function NI(t){let e;return{c(){e=$(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function BI(t){let e,n,i,l,r,s,o,a,u,f;i=new Gu({props:{class:"bx--accordion__arrow","aria-label":t[3]}});const c=t[7].title,d=He(c,t,t[6],Fp),h=d||NI(t),g=t[7].default,_=He(g,t,t[6],null);let k=[t[5]],y={};for(let T=0;T{!N&&c||n(1,u=N)});let g;on(()=>()=>{h()});function _(N){te.call(this,t,N)}function k(N){te.call(this,t,N)}function y(N){te.call(this,t,N)}function T(N){te.call(this,t,N)}function M(N){te.call(this,t,N)}function A(N){te.call(this,t,N)}const C=()=>{n(0,a=!a),n(4,g=a?"expanding":"collapsing")},D=({key:N})=>{a&&N==="Escape"&&n(0,a=!1)},R=()=>{n(4,g=void 0)};return t.$$set=N=>{e=Z(Z({},e),Te(N)),n(5,l=de(e,i)),"title"in N&&n(2,o=N.title),"open"in N&&n(0,a=N.open),"disabled"in N&&n(1,u=N.disabled),"iconDescription"in N&&n(3,f=N.iconDescription),"$$scope"in N&&n(6,s=N.$$scope)},[a,u,o,f,g,l,s,r,_,k,y,T,M,A,C,D,R]}class HI extends Oe{constructor(e){super(),Ee(this,e,zI,BI,Se,{title:2,open:0,disabled:1,iconDescription:3})}}const fg=HI;function Gp(t,e,n){const i=t.slice();return i[7]=e[n],i}function Vp(t,e){let n,i,l;return{key:t,first:null,c(){n=P("div"),i=P("span"),i.textContent=" ",l=F(),S(i,"bx--link",!0),S(n,"bx--breadcrumb-item",!0),this.first=n},m(r,s){O(r,n,s),w(n,i),w(n,l)},p(r,s){},d(r){r&&E(n)}}}function UI(t){let e,n=[],i=new Map,l,r,s=it(Array.from({length:t[1]},Wp));const o=f=>f[7];for(let f=0;fe;function FI(t,e,n){const i=["noTrailingSlash","count"];let l=de(e,i),{noTrailingSlash:r=!1}=e,{count:s=3}=e;function o(c){te.call(this,t,c)}function a(c){te.call(this,t,c)}function u(c){te.call(this,t,c)}function f(c){te.call(this,t,c)}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"noTrailingSlash"in c&&n(0,r=c.noTrailingSlash),"count"in c&&n(1,s=c.count)},[r,s,l,o,a,u,f]}class GI extends Oe{constructor(e){super(),Ee(this,e,FI,UI,Se,{noTrailingSlash:0,count:1})}}const VI=GI;function WI(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{"aria-label":"Breadcrumb"},t[2]],u={};for(let f=0;f{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function qI(t,e,n){const i=["noTrailingSlash","skeleton"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{noTrailingSlash:o=!1}=e,{skeleton:a=!1}=e;function u(y){te.call(this,t,y)}function f(y){te.call(this,t,y)}function c(y){te.call(this,t,y)}function d(y){te.call(this,t,y)}function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(2,l=de(e,i)),"noTrailingSlash"in y&&n(0,o=y.noTrailingSlash),"skeleton"in y&&n(1,a=y.skeleton),"$$scope"in y&&n(3,s=y.$$scope)},[o,a,l,s,r,u,f,c,d,h,g,_,k]}class YI extends Oe{constructor(e){super(),Ee(this,e,qI,$I,Se,{noTrailingSlash:0,skeleton:1})}}const mr=YI,ZI=t=>({}),jp=t=>({}),XI=t=>({}),$p=t=>({});function KI(t){let e,n,i,l,r,s;const o=t[10].default,a=He(o,t,t[9],null);let u=!t[3]&&(t[8].icon||t[4])&&qp(t),f=[{rel:i=t[7].target==="_blank"?"noopener noreferrer":void 0},{href:t[2]},t[7]],c={};for(let d=0;d{u=null}),fe()),we(e,c=Pe(f,[(!l||h&128&&i!==(i=d[7].target==="_blank"?"noopener noreferrer":void 0))&&{rel:i},(!l||h&4)&&{href:d[2]},h&128&&d[7]])),S(e,"bx--link",!0),S(e,"bx--link--disabled",d[5]),S(e,"bx--link--inline",d[3]),S(e,"bx--link--visited",d[6]),S(e,"bx--link--sm",d[1]==="sm"),S(e,"bx--link--lg",d[1]==="lg")},i(d){l||(p(a,d),p(u),l=!0)},o(d){v(a,d),v(u),l=!1},d(d){d&&E(e),a&&a.d(d),u&&u.d(),t[20](null),r=!1,ut(s)}}}function JI(t){let e,n,i,l,r;const s=t[10].default,o=He(s,t,t[9],null);let a=!t[3]&&(t[8].icon||t[4])&&Yp(t),u=[t[7]],f={};for(let c=0;c{a=null}),fe()),we(e,f=Pe(u,[d&128&&c[7]])),S(e,"bx--link",!0),S(e,"bx--link--disabled",c[5]),S(e,"bx--link--inline",c[3]),S(e,"bx--link--visited",c[6])},i(c){i||(p(o,c),p(a),i=!0)},o(c){v(o,c),v(a),i=!1},d(c){c&&E(e),o&&o.d(c),a&&a.d(),t[19](null),l=!1,ut(r)}}}function qp(t){let e,n;const i=t[10].icon,l=He(i,t,t[9],jp),r=l||QI(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--link__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Fe(l,i,s,s[9],n?Ue(i,s[9],o,ZI):Ge(s[9]),jp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function QI(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function Yp(t){let e,n;const i=t[10].icon,l=He(i,t,t[9],$p),r=l||xI(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--link__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Fe(l,i,s,s[9],n?Ue(i,s[9],o,XI):Ge(s[9]),$p):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function xI(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function eR(t){let e,n,i,l;const r=[JI,KI],s=[];function o(a,u){return a[5]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function tR(t,e,n){const i=["size","href","inline","icon","disabled","visited","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{size:a=void 0}=e,{href:u=void 0}=e,{inline:f=!1}=e,{icon:c=void 0}=e,{disabled:d=!1}=e,{visited:h=!1}=e,{ref:g=null}=e;function _(G){te.call(this,t,G)}function k(G){te.call(this,t,G)}function y(G){te.call(this,t,G)}function T(G){te.call(this,t,G)}function M(G){te.call(this,t,G)}function A(G){te.call(this,t,G)}function C(G){te.call(this,t,G)}function D(G){te.call(this,t,G)}function R(G){xe[G?"unshift":"push"](()=>{g=G,n(0,g)})}function N(G){xe[G?"unshift":"push"](()=>{g=G,n(0,g)})}return t.$$set=G=>{e=Z(Z({},e),Te(G)),n(7,l=de(e,i)),"size"in G&&n(1,a=G.size),"href"in G&&n(2,u=G.href),"inline"in G&&n(3,f=G.inline),"icon"in G&&n(4,c=G.icon),"disabled"in G&&n(5,d=G.disabled),"visited"in G&&n(6,h=G.visited),"ref"in G&&n(0,g=G.ref),"$$scope"in G&&n(9,s=G.$$scope)},[g,a,u,f,c,d,h,l,o,s,r,_,k,y,T,M,A,C,D,R,N]}class nR extends Oe{constructor(e){super(),Ee(this,e,tR,eR,Se,{size:1,href:2,inline:3,icon:4,disabled:5,visited:6,ref:0})}}const UT=nR,iR=t=>({props:t&4}),Zp=t=>({props:{"aria-current":t[2]["aria-current"],class:"bx--link"}});function lR(t){let e;const n=t[3].default,i=He(n,t,t[8],Zp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&260)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,iR):Ge(l[8]),Zp)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function rR(t){let e,n;return e=new UT({props:{href:t[0],"aria-current":t[2]["aria-current"],$$slots:{default:[sR]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.href=i[0]),l&4&&(r["aria-current"]=i[2]["aria-current"]),l&256&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sR(t){let e;const n=t[3].default,i=He(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,null):Ge(l[8]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function oR(t){let e,n,i,l,r,s;const o=[rR,lR],a=[];function u(d,h){return d[0]?0:1}n=u(t),i=a[n]=o[n](t);let f=[t[2]],c={};for(let d=0;d{a[g]=null}),fe(),i=a[n],i?i.p(d,h):(i=a[n]=o[n](d),i.c()),p(i,1),i.m(e,null)),we(e,c=Pe(f,[h&4&&d[2]])),S(e,"bx--breadcrumb-item",!0),S(e,"bx--breadcrumb-item--current",d[1]&&d[2]["aria-current"]!=="page")},i(d){l||(p(i),l=!0)},o(d){v(i),l=!1},d(d){d&&E(e),a[n].d(),r=!1,ut(s)}}}function aR(t,e,n){const i=["href","isCurrentPage"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{href:o=void 0}=e,{isCurrentPage:a=!1}=e;pi("BreadcrumbItem",{});function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(2,l=de(e,i)),"href"in h&&n(0,o=h.href),"isCurrentPage"in h&&n(1,a=h.isCurrentPage),"$$scope"in h&&n(8,s=h.$$scope)},[o,a,l,r,u,f,c,d,s]}class uR extends Oe{constructor(e){super(),Ee(this,e,aR,oR,Se,{href:0,isCurrentPage:1})}}const xn=uR;function fR(t){let e,n,i,l=[t[2]],r={};for(let s=0;s{e=Z(Z({},e),Te(_)),n(2,l=de(e,i)),"href"in _&&n(0,r=_.href),"size"in _&&n(1,s=_.size)},[r,s,l,o,a,u,f,c,d,h,g]}class mR extends Oe{constructor(e){super(),Ee(this,e,hR,dR,Se,{href:0,size:1})}}const gR=mR,_R=t=>({props:t[0]&512}),Xp=t=>({props:t[9]});function pR(t){let e,n,i,l,r,s,o=t[8]&&Kp(t);const a=t[19].default,u=He(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon",style:g[8]?"margin-left: 0":void 0,"aria-label":g[3]}}}f&&(i=sn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{H(k,1)}),fe()}f?(i=sn(f,c(g)),U(i.$$.fragment),p(i.$$.fragment,1),z(i,e,null)):i=null}else if(f){const k={};_[0]&256&&(k.style=g[8]?"margin-left: 0":void 0),_[0]&8&&(k["aria-label"]=g[3]),i.$set(k)}we(e,h=Pe(d,[_[0]&512&&g[9]]))},i(g){l||(p(u,g),i&&p(i.$$.fragment,g),l=!0)},o(g){v(u,g),i&&v(i.$$.fragment,g),l=!1},d(g){g&&E(e),o&&o.d(),u&&u.d(g),i&&H(i),t[33](null),r=!1,ut(s)}}}function bR(t){let e,n,i,l,r,s,o=t[8]&&Jp(t);const a=t[19].default,u=He(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon","aria-label":g[3]}}}f&&(i=sn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{H(k,1)}),fe()}f?(i=sn(f,c(g)),U(i.$$.fragment),p(i.$$.fragment,1),z(i,e,null)):i=null}else if(f){const k={};_[0]&8&&(k["aria-label"]=g[3]),i.$set(k)}we(e,h=Pe(d,[_[0]&512&&g[9]]))},i(g){l||(p(u,g),i&&p(i.$$.fragment,g),l=!0)},o(g){v(u,g),i&&v(i.$$.fragment,g),l=!1},d(g){g&&E(e),o&&o.d(),u&&u.d(g),i&&H(i),t[32](null),r=!1,ut(s)}}}function vR(t){let e;const n=t[19].default,i=He(n,t,t[18],Xp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r[0]&262656)&&Fe(i,n,l,l[18],e?Ue(n,l[18],r,_R):Ge(l[18]),Xp)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function kR(t){let e,n;const i=[{href:t[7]},{size:t[1]},t[10],{style:t[8]&&"width: 3rem;"}];let l={};for(let r=0;r{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function yR(t,e,n){let i,l;const r=["kind","size","expressive","isSelected","icon","iconDescription","tooltipAlignment","tooltipPosition","as","skeleton","disabled","href","tabindex","type","ref"];let s=de(e,r),{$$slots:o={},$$scope:a}=e;const u=di(o);let{kind:f="primary"}=e,{size:c="default"}=e,{expressive:d=!1}=e,{isSelected:h=!1}=e,{icon:g=void 0}=e,{iconDescription:_=void 0}=e,{tooltipAlignment:k="center"}=e,{tooltipPosition:y="bottom"}=e,{as:T=!1}=e,{skeleton:M=!1}=e,{disabled:A=!1}=e,{href:C=void 0}=e,{tabindex:D="0"}=e,{type:R="button"}=e,{ref:N=null}=e;const G=jn("ComposedModal");function B(oe){te.call(this,t,oe)}function j(oe){te.call(this,t,oe)}function q(oe){te.call(this,t,oe)}function V(oe){te.call(this,t,oe)}function K(oe){te.call(this,t,oe)}function x(oe){te.call(this,t,oe)}function ie(oe){te.call(this,t,oe)}function X(oe){te.call(this,t,oe)}function ce(oe){te.call(this,t,oe)}function ae(oe){te.call(this,t,oe)}function ee(oe){te.call(this,t,oe)}function he(oe){te.call(this,t,oe)}function ne(oe){xe[oe?"unshift":"push"](()=>{N=oe,n(0,N)})}function re(oe){xe[oe?"unshift":"push"](()=>{N=oe,n(0,N)})}return t.$$set=oe=>{e=Z(Z({},e),Te(oe)),n(10,s=de(e,r)),"kind"in oe&&n(11,f=oe.kind),"size"in oe&&n(1,c=oe.size),"expressive"in oe&&n(12,d=oe.expressive),"isSelected"in oe&&n(13,h=oe.isSelected),"icon"in oe&&n(2,g=oe.icon),"iconDescription"in oe&&n(3,_=oe.iconDescription),"tooltipAlignment"in oe&&n(14,k=oe.tooltipAlignment),"tooltipPosition"in oe&&n(15,y=oe.tooltipPosition),"as"in oe&&n(4,T=oe.as),"skeleton"in oe&&n(5,M=oe.skeleton),"disabled"in oe&&n(6,A=oe.disabled),"href"in oe&&n(7,C=oe.href),"tabindex"in oe&&n(16,D=oe.tabindex),"type"in oe&&n(17,R=oe.type),"ref"in oe&&n(0,N=oe.ref),"$$scope"in oe&&n(18,a=oe.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&G&&N&&G.declareRef(N),t.$$.dirty[0]&4&&n(8,i=g&&!u.default),n(9,l={type:C&&!A?void 0:R,tabindex:D,disabled:A===!0?!0:void 0,href:C,"aria-pressed":i&&f==="ghost"&&!C?h:void 0,...s,class:["bx--btn",d&&"bx--btn--expressive",(c==="small"&&!d||c==="sm"&&!d||c==="small"&&!d)&&"bx--btn--sm",c==="field"&&!d||c==="md"&&!d&&"bx--btn--md",c==="field"&&"bx--btn--field",c==="small"&&"bx--btn--sm",c==="lg"&&"bx--btn--lg",c==="xl"&&"bx--btn--xl",f&&`bx--btn--${f}`,A&&"bx--btn--disabled",i&&"bx--btn--icon-only",i&&"bx--tooltip__trigger",i&&"bx--tooltip--a11y",i&&y&&`bx--btn--icon-only--${y}`,i&&k&&`bx--tooltip--align-${k}`,i&&h&&f==="ghost"&&"bx--btn--selected",s.class].filter(Boolean).join(" ")})},[N,c,g,_,T,M,A,C,i,l,s,f,d,h,k,y,D,R,a,o,B,j,q,V,K,x,ie,X,ce,ae,ee,he,ne,re]}class TR extends Oe{constructor(e){super(),Ee(this,e,yR,wR,Se,{kind:11,size:1,expressive:12,isSelected:13,icon:2,iconDescription:3,tooltipAlignment:14,tooltipPosition:15,as:4,skeleton:5,disabled:6,href:7,tabindex:16,type:17,ref:0},null,[-1,-1])}}const bt=TR;function SR(t){let e,n;const i=t[3].default,l=He(i,t,t[2],null);let r=[t[1]],s={};for(let o=0;o{e=Z(Z({},e),Te(a)),n(1,l=de(e,i)),"stacked"in a&&n(0,o=a.stacked),"$$scope"in a&&n(2,s=a.$$scope)},[o,l,s,r]}class OR extends Oe{constructor(e){super(),Ee(this,e,ER,SR,Se,{stacked:0})}}const MR=OR;function CR(t){let e,n,i,l,r=[t[0]],s={};for(let o=0;o{e=Z(Z({},e),Te(u)),n(0,l=de(e,i))},[l,r,s,o,a]}class LR extends Oe{constructor(e){super(),Ee(this,e,AR,CR,Se,{})}}const DR=LR,IR=t=>({}),Qp=t=>({});function RR(t){let e,n,i,l,r,s,o,a;const u=t[19].labelText,f=He(u,t,t[18],Qp),c=f||NR(t);let d=[t[16]],h={};for(let g=0;g{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function zR(t,e,n){let i,l;const r=["value","checked","group","indeterminate","skeleton","required","readonly","disabled","labelText","hideLabel","name","title","id","ref"];let s=de(e,r),{$$slots:o={},$$scope:a}=e,{value:u=""}=e,{checked:f=!1}=e,{group:c=void 0}=e,{indeterminate:d=!1}=e,{skeleton:h=!1}=e,{required:g=!1}=e,{readonly:_=!1}=e,{disabled:k=!1}=e,{labelText:y=""}=e,{hideLabel:T=!1}=e,{name:M=""}=e,{title:A=void 0}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{ref:D=null}=e;const R=nn();let N=null;function G(ne){te.call(this,t,ne)}function B(ne){te.call(this,t,ne)}function j(ne){te.call(this,t,ne)}function q(ne){te.call(this,t,ne)}function V(ne){te.call(this,t,ne)}function K(ne){te.call(this,t,ne)}function x(ne){te.call(this,t,ne)}function ie(ne){te.call(this,t,ne)}function X(ne){te.call(this,t,ne)}function ce(ne){te.call(this,t,ne)}function ae(ne){xe[ne?"unshift":"push"](()=>{D=ne,n(3,D)})}const ee=()=>{i?n(1,c=c.includes(u)?c.filter(ne=>ne!==u):[...c,u]):n(0,f=!f)};function he(ne){xe[ne?"unshift":"push"](()=>{N=ne,n(14,N)})}return t.$$set=ne=>{e=Z(Z({},e),Te(ne)),n(16,s=de(e,r)),"value"in ne&&n(4,u=ne.value),"checked"in ne&&n(0,f=ne.checked),"group"in ne&&n(1,c=ne.group),"indeterminate"in ne&&n(5,d=ne.indeterminate),"skeleton"in ne&&n(6,h=ne.skeleton),"required"in ne&&n(7,g=ne.required),"readonly"in ne&&n(8,_=ne.readonly),"disabled"in ne&&n(9,k=ne.disabled),"labelText"in ne&&n(10,y=ne.labelText),"hideLabel"in ne&&n(11,T=ne.hideLabel),"name"in ne&&n(12,M=ne.name),"title"in ne&&n(2,A=ne.title),"id"in ne&&n(13,C=ne.id),"ref"in ne&&n(3,D=ne.ref),"$$scope"in ne&&n(18,a=ne.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&2&&n(15,i=Array.isArray(c)),t.$$.dirty[0]&32787&&n(0,f=i?c.includes(u):f),t.$$.dirty[0]&1&&R("check",f),t.$$.dirty[0]&16384&&n(17,l=(N==null?void 0:N.offsetWidth)<(N==null?void 0:N.scrollWidth)),t.$$.dirty[0]&147460&&n(2,A=!A&&l?N==null?void 0:N.innerText:A)},[f,c,A,D,u,d,h,g,_,k,y,T,M,C,N,i,s,l,a,o,G,B,j,q,V,K,x,ie,X,ce,ae,ee,he]}class HR extends Oe{constructor(e){super(),Ee(this,e,zR,BR,Se,{value:4,checked:0,group:1,indeterminate:5,skeleton:6,required:7,readonly:8,disabled:9,labelText:10,hideLabel:11,name:12,title:2,id:13,ref:3},null,[-1,-1])}}const FT=HR;function UR(t){let e,n,i,l,r,s,o,a,u,f=[{type:"checkbox"},{checked:i=t[2]?!1:t[1]},{indeterminate:t[2]},{id:t[4]},t[5],{"aria-checked":l=t[2]?void 0:t[1]}],c={};for(let d=0;d{u=d,n(0,u)})}return t.$$set=d=>{n(6,e=Z(Z({},e),Te(d))),n(5,l=de(e,i)),"checked"in d&&n(1,r=d.checked),"indeterminate"in d&&n(2,s=d.indeterminate),"title"in d&&n(3,o=d.title),"id"in d&&n(4,a=d.id),"ref"in d&&n(0,u=d.ref)},e=Te(e),[u,r,s,o,a,l,e,f,c]}class GR extends Oe{constructor(e){super(),Ee(this,e,FR,UR,Se,{checked:1,indeterminate:2,title:3,id:4,ref:0})}}const GT=GR;function VR(t){let e,n,i,l;const r=t[6].default,s=He(r,t,t[5],null);let o=[{role:"tablist"},t[1]],a={};for(let u=0;u{M&&n(2,u=l.length),n(4,l=[...l,{id:y,text:T,selected:M}])},update:y=>{n(2,u=l.map(({id:T})=>T).indexOf(y))},change:y=>{let T=i+y;T<0?T=l.length-1:T>=l.length&&(T=0),n(2,u=T)}}),hr(()=>{u!==i&&n(3,i=u)});function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(1,s=de(e,r)),"selectedIndex"in y&&n(2,u=y.selectedIndex),"size"in y&&n(0,f=y.size),"$$scope"in y&&n(5,a=y.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&l[i]&&(c("change",i),d.set(l[i].id))},n(3,i=-1),n(4,l=[]),[f,s,u,i,l,a,o,h,g,_,k]}class jR extends Oe{constructor(e){super(),Ee(this,e,WR,VR,Se,{selectedIndex:2,size:0})}}const $R=jR;function qR(t){let e;return{c(){e=$(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function YR(t){let e,n,i,l,r,s;const o=t[8].default,a=He(o,t,t[7],null),u=a||qR(t);let f=[{type:"button"},{role:"tab"},{tabindex:i=t[0]?"0":"-1"},{"aria-selected":t[0]},{disabled:t[3]},{id:t[4]},t[6]],c={};for(let d=0;d{n(0,a=D===f)});hr(()=>{a&&c.focus()}),on(()=>()=>h());function g(D){te.call(this,t,D)}function _(D){te.call(this,t,D)}function k(D){te.call(this,t,D)}function y(D){te.call(this,t,D)}function T(D){te.call(this,t,D)}function M(D){xe[D?"unshift":"push"](()=>{c=D,n(1,c)})}const A=()=>{d.update(f)},C=({key:D})=>{D==="ArrowRight"?d.change(1):D==="ArrowLeft"&&d.change(-1)};return t.$$set=D=>{e=Z(Z({},e),Te(D)),n(6,l=de(e,i)),"text"in D&&n(2,o=D.text),"selected"in D&&n(0,a=D.selected),"disabled"in D&&n(3,u=D.disabled),"id"in D&&n(4,f=D.id),"ref"in D&&n(1,c=D.ref),"$$scope"in D&&n(7,s=D.$$scope)},[a,c,o,u,f,d,l,s,r,g,_,k,y,T,M,A,C]}class XR extends Oe{constructor(e){super(),Ee(this,e,ZR,YR,Se,{text:2,selected:0,disabled:3,id:4,ref:1})}}const xp=XR;function eb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function KR(t){let e,n,i,l=t[1]&&eb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class QR extends Oe{constructor(e){super(),Ee(this,e,JR,KR,Se,{size:0,title:1})}}const xR=QR;function eP(t){let e,n,i,l,r,s,o,a;n=new xR({props:{class:"bx--snippet__icon"}});let u=[{type:"button"},{"aria-live":"polite"},{"aria-label":t[2]},{title:t[2]},t[8]],f={};for(let c=0;c{try{await navigator.clipboard.writeText(y)}catch(T){console.log(T)}}}=e;const f=nn();let c,d;on(()=>()=>clearTimeout(d));function h(y){te.call(this,t,y)}function g(y){te.call(this,t,y)}const _=()=>{a!==void 0&&(u(a),f("copy")),c!=="fade-in"&&(n(5,c="fade-in"),n(6,d=setTimeout(()=>{n(5,c="fade-out")},s)))},k=({animationName:y})=>{y==="hide-feedback"&&n(5,c=void 0)};return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(8,l=de(e,i)),"feedback"in y&&n(0,r=y.feedback),"feedbackTimeout"in y&&n(1,s=y.feedbackTimeout),"iconDescription"in y&&n(2,o=y.iconDescription),"text"in y&&n(3,a=y.text),"copy"in y&&n(4,u=y.copy)},[r,s,o,a,u,c,d,f,l,h,g,_,k]}class nP extends Oe{constructor(e){super(),Ee(this,e,tP,eP,Se,{feedback:0,feedbackTimeout:1,iconDescription:2,text:3,copy:4})}}const iP=nP;function tb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function lP(t){let e,n,i,l=t[1]&&tb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class sP extends Oe{constructor(e){super(),Ee(this,e,rP,lP,Se,{size:0,title:1})}}const Ds=sP;function nb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function oP(t){let e,n,i,l,r=t[1]&&nb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class uP extends Oe{constructor(e){super(),Ee(this,e,aP,oP,Se,{size:0,title:1})}}const Vu=uP;function ib(t){let e,n;return{c(){e=P("div"),n=$(t[6]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function lb(t){let e,n;return{c(){e=P("div"),n=$(t[8]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&256&&Y(n,i[8])},d(i){i&&E(e)}}}function fP(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=He(u,t,t[10],null);let c=[{role:"listbox"},{tabindex:"-1"},{"data-invalid":n=t[5]||void 0},t[9]],d={};for(let _=0;_{t.key==="Escape"&&t.stopPropagation()};function dP(t,e,n){const i=["size","type","open","light","disabled","invalid","invalidText","warn","warnText"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{type:a="default"}=e,{open:u=!1}=e,{light:f=!1}=e,{disabled:c=!1}=e,{invalid:d=!1}=e,{invalidText:h=""}=e,{warn:g=!1}=e,{warnText:_=""}=e;function k(T){te.call(this,t,T)}function y(T){te.call(this,t,T)}return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(9,l=de(e,i)),"size"in T&&n(0,o=T.size),"type"in T&&n(1,a=T.type),"open"in T&&n(2,u=T.open),"light"in T&&n(3,f=T.light),"disabled"in T&&n(4,c=T.disabled),"invalid"in T&&n(5,d=T.invalid),"invalidText"in T&&n(6,h=T.invalidText),"warn"in T&&n(7,g=T.warn),"warnText"in T&&n(8,_=T.warnText),"$$scope"in T&&n(10,s=T.$$scope)},[o,a,u,f,c,d,h,g,_,l,s,r,k,y]}class hP extends Oe{constructor(e){super(),Ee(this,e,dP,fP,Se,{size:0,type:1,open:2,light:3,disabled:4,invalid:5,invalidText:6,warn:7,warnText:8})}}const mP=hP;function gP(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=He(u,t,t[10],null);let c=[{role:t[2]},{"aria-expanded":t[6]},{"aria-owns":n=t[6]&&t[5]||void 0},{"aria-controls":i=t[6]&&t[5]||void 0},{"aria-disabled":t[1]},{"aria-label":l=t[6]?t[4]("close"):t[4]("open")},{tabindex:r=t[1]?"-1":t[3]},t[7]],d={};for(let h=0;hk[B]}=e,{id:g="ccs-"+Math.random().toString(36)}=e,{ref:_=null}=e;const k={[d.close]:"Close menu",[d.open]:"Open menu"},y=jn("MultiSelect");function T(B){te.call(this,t,B)}function M(B){te.call(this,t,B)}function A(B){te.call(this,t,B)}function C(B){te.call(this,t,B)}function D(B){te.call(this,t,B)}function R(B){te.call(this,t,B)}function N(B){te.call(this,t,B)}function G(B){xe[B?"unshift":"push"](()=>{_=B,n(0,_)})}return t.$$set=B=>{n(22,e=Z(Z({},e),Te(B))),n(7,s=de(e,r)),"disabled"in B&&n(1,u=B.disabled),"role"in B&&n(2,f=B.role),"tabindex"in B&&n(3,c=B.tabindex),"translateWithId"in B&&n(4,h=B.translateWithId),"id"in B&&n(9,g=B.id),"ref"in B&&n(0,_=B.ref),"$$scope"in B&&n(10,a=B.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&y&&_&&y.declareRef({key:"field",ref:_}),n(6,i=e["aria-expanded"]),t.$$.dirty&512&&n(5,l=`menu-${g}`)},e=Te(e),[_,u,f,c,h,l,i,s,d,g,a,o,T,M,A,C,D,R,N,G]}class pP extends Oe{constructor(e){super(),Ee(this,e,_P,gP,Se,{disabled:1,role:2,tabindex:3,translationIds:8,translateWithId:4,id:9,ref:0})}get translationIds(){return this.$$.ctx[8]}}const bP=pP;function vP(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{role:"listbox"},{id:n="menu-"+t[1]},t[2]],u={};for(let f=0;f{a=c,n(0,a)})}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"id"in c&&n(1,o=c.id),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class wP extends Oe{constructor(e){super(),Ee(this,e,kP,vP,Se,{id:1,ref:0})}}const yP=wP;function rb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function TP(t){let e,n,i=t[1]&&rb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let EP=class extends Oe{constructor(e){super(),Ee(this,e,SP,TP,Se,{size:0,title:1})}};const co=EP;function OP(t){let e,n,i,l,r;n=new co({props:{"aria-label":t[1],title:t[1]}});let s=[t[2]],o={};for(let a=0;af[d]}=e;const f={[a.close]:"Close menu",[a.open]:"Open menu"};function c(d){te.call(this,t,d)}return t.$$set=d=>{e=Z(Z({},e),Te(d)),n(2,s=de(e,r)),"open"in d&&n(0,o=d.open),"translateWithId"in d&&n(4,u=d.translateWithId)},t.$$.update=()=>{t.$$.dirty&1&&n(5,i=o?a.close:a.open),t.$$.dirty&48&&n(1,l=(u==null?void 0:u(i))??f[i])},[o,l,s,a,u,i,c]}class CP extends Oe{constructor(e){super(),Ee(this,e,MP,OP,Se,{open:0,translationIds:3,translateWithId:4})}get translationIds(){return this.$$.ctx[3]}}const VT=CP;function AP(t){let e,n,i,l,r,s;const o=t[8].default,a=He(o,t,t[7],null);let u=[{role:"option"},{tabindex:"-1"},{"aria-selected":t[0]},{disabled:i=t[2]?!0:void 0},t[5]],f={};for(let c=0;c{d=y,n(3,d)})}return t.$$set=y=>{e=Z(Z({},e),Te(y)),n(5,s=de(e,r)),"active"in y&&n(0,u=y.active),"highlighted"in y&&n(1,f=y.highlighted),"disabled"in y&&n(2,c=y.disabled),"$$scope"in y&&n(7,a=y.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(6,i=(d==null?void 0:d.offsetWidth)<(d==null?void 0:d.scrollWidth)),t.$$.dirty&72&&n(4,l=i?d==null?void 0:d.innerText:void 0),t.$$.dirty&10&&f&&d&&!d.matches(":hover")&&d.scrollIntoView({block:"nearest"})},[u,f,c,d,l,s,i,a,o,h,g,_,k]}class DP extends Oe{constructor(e){super(),Ee(this,e,LP,AP,Se,{active:0,highlighted:1,disabled:2})}}const IP=DP;function sb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function RP(t){let e,n,i=t[1]&&sb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let NP=class extends Oe{constructor(e){super(),Ee(this,e,PP,RP,Se,{size:0,title:1})}};const Dl=NP;function BP(t){let e,n,i,l,r,s,o,a=t[1]!==void 0&&ob(t);i=new Dl({});let u=[{role:"button"},{"aria-label":t[4]},{title:t[4]},{tabindex:l=t[2]?"-1":"0"},t[6]],f={};for(let c=0;c{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function UP(t,e,n){let i,l;const r=["selectionCount","disabled","translationIds","translateWithId","ref"];let s=de(e,r),{selectionCount:o=void 0}=e,{disabled:a=!1}=e;const u={clearAll:"clearAll",clearSelection:"clearSelection"};let{translateWithId:f=C=>d[C]}=e,{ref:c=null}=e;const d={[u.clearAll]:"Clear all selected items",[u.clearSelection]:"Clear selected item"},h=nn(),g=jn("MultiSelect");function _(C){xe[C?"unshift":"push"](()=>{c=C,n(0,c)})}const k=C=>{a||h("clear",C)},y=C=>{!a&&C.key==="Enter"&&h("clear",C)};function T(C){xe[C?"unshift":"push"](()=>{c=C,n(0,c)})}const M=C=>{a||h("clear",C)},A=C=>{!a&&C.key==="Enter"&&h("clear",C)};return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(6,s=de(e,r)),"selectionCount"in C&&n(1,o=C.selectionCount),"disabled"in C&&n(2,a=C.disabled),"translateWithId"in C&&n(7,f=C.translateWithId),"ref"in C&&n(0,c=C.ref)},t.$$.update=()=>{t.$$.dirty&1&&g&&c&&g.declareRef({key:"selection",ref:c}),t.$$.dirty&2&&n(8,i=o?u.clearAll:u.clearSelection),t.$$.dirty&384&&n(4,l=(f==null?void 0:f(i))??d[i])},[c,o,a,u,l,h,s,f,i,_,k,y,T,M,A]}class FP extends Oe{constructor(e){super(),Ee(this,e,UP,HP,Se,{selectionCount:1,disabled:2,translationIds:3,translateWithId:7,ref:0})}get translationIds(){return this.$$.ctx[3]}}const WT=FP,J1=new Set,jT=Wt(0),ab=()=>jT.set([...J1].filter(t=>YD(t)).length),$T=t=>on(()=>{J1.add(t);const e=t.subscribe(ab);return()=>{e(),J1.delete(t),ab()}});jT.subscribe(t=>{typeof document<"u"&&document.body.classList.toggle("bx--body--with-modal-open",t>0)});function GP(t){let e,n,i,l,r,s;const o=t[18].default,a=He(o,t,t[17],null);let u=[{role:"presentation"},t[14]],f={};for(let c=0;cn(9,o=ee));let M=null,A=null,C=!1;pi("ComposedModal",{closeModal:()=>{n(0,c=!1)},submit:()=>{y("submit"),y("click:button--primary")},declareRef:ee=>{M=ee},updateLabel:ee=>{T.set(ee)}});function D(ee){var ne;if(_==null)return;const he=((ne=ee||A)==null?void 0:ne.querySelector(_))||M;he!=null&&he.focus()}let R=!1;const N=Wt(c);ct(t,N,ee=>n(32,s=ee)),$T(N),on(()=>{Ou().then(()=>{D()})}),hr(()=>{R?c||(R=!1,y("close")):c&&(R=!0,y("open"))});function G(ee){te.call(this,t,ee)}function B(ee){te.call(this,t,ee)}function j(ee){te.call(this,t,ee)}function q(ee){te.call(this,t,ee)}function V(ee){te.call(this,t,ee)}function K(ee){xe[ee?"unshift":"push"](()=>{A=ee,n(6,A)})}const x=()=>{n(7,C=!0)};function ie(ee){xe[ee?"unshift":"push"](()=>{k=ee,n(1,k)})}const X=ee=>{if(c){if(ee.key==="Escape")n(0,c=!1);else if(ee.key==="Tab"){const he=` a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true] -`,ne=Array.from(k.querySelectorAll(he));let re=ne.indexOf(document.activeElement);re===-1&&ee.shiftKey&&(re=0),re+=ne.length+(ee.shiftKey?-1:1),re%=ne.length,ne[re].focus(),ee.preventDefault()}}},ce=()=>{!C&&!h&&n(0,c=!1),n(7,C=!1)},ae=({propertyName:ee,currentTarget:he})=>{ee==="transform"&&y("transitionend",{open:c}),i&&(D(he),n(8,i=!1))};return t.$$set=ee=>{n(15,e=Z(Z({},e),Te(ee))),n(14,r=de(e,l)),"size"in ee&&n(2,f=ee.size),"open"in ee&&n(0,c=ee.open),"danger"in ee&&n(3,d=ee.danger),"preventCloseOnClickOutside"in ee&&n(4,h=ee.preventCloseOnClickOutside),"containerClass"in ee&&n(5,g=ee.containerClass),"selectorPrimaryFocus"in ee&&n(16,_=ee.selectorPrimaryFocus),"ref"in ee&&n(1,k=ee.ref),"$$scope"in ee&&n(17,u=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(8,i=c),t.$$.dirty[0]&1&&ro(N,s=c,s)},e=Te(e),[c,k,f,d,h,g,A,C,i,o,y,T,D,N,r,e,_,u,a,G,B,$,q,V,K,x,ie,X,ce,ae]}class WP extends Oe{constructor(e){super(),Ee(this,e,VP,GP,Se,{size:2,open:0,danger:3,preventCloseOnClickOutside:4,containerClass:5,selectorPrimaryFocus:16,ref:1},null,[-1,-1])}}const Ed=WP;function ub(t){let e,n;return{c(){e=P("h2"),n=j(t[1]),I(e,"class",t[2]),S(e,"bx--modal-header__label",!0),S(e,"bx--type-delta",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1]),l&4&&I(e,"class",i[2]),l&4&&S(e,"bx--modal-header__label",!0),l&4&&S(e,"bx--type-delta",!0)},d(i){i&&E(e)}}}function fb(t){let e,n;return{c(){e=P("h3"),n=j(t[0]),I(e,"class",t[3]),S(e,"bx--modal-header__heading",!0),S(e,"bx--type-beta",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1&&Y(n,i[0]),l&8&&I(e,"class",i[3]),l&8&&S(e,"bx--modal-header__heading",!0),l&8&&S(e,"bx--type-beta",!0)},d(i){i&&E(e)}}}function jP(t){let e,n,i,l,r,s,o,a,u,f=t[1]&&ub(t),c=t[0]&&fb(t);const d=t[10].default,h=He(d,t,t[9],null);s=new Dl({props:{size:20,class:"bx--modal-close__icon "+t[5],"aria-hidden":"true"}});let g=[t[8]],_={};for(let k=0;k{e=Z(Z({},e),Te(y)),n(8,l=de(e,i)),"title"in y&&n(0,o=y.title),"label"in y&&n(1,a=y.label),"labelClass"in y&&n(2,u=y.labelClass),"titleClass"in y&&n(3,f=y.titleClass),"closeClass"in y&&n(4,c=y.closeClass),"closeIconClass"in y&&n(5,d=y.closeIconClass),"iconDescription"in y&&n(6,h=y.iconDescription),"$$scope"in y&&n(9,s=y.$$scope)},t.$$.update=()=>{t.$$.dirty&2&&_(a)},[o,a,u,f,c,d,h,g,l,s,r,k]}class qP extends Oe{constructor(e){super(),Ee(this,e,$P,jP,Se,{title:0,label:1,labelClass:2,titleClass:3,closeClass:4,closeIconClass:5,iconDescription:6})}}const Od=qP;function cb(t){let e;return{c(){e=P("div"),S(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function YP(t){let e,n,i,l,r,s;const o=t[4].default,a=He(o,t,t[3],null);let u=[{tabindex:n=t[1]?"0":void 0},{role:i=t[1]?"region":void 0},t[2]],f={};for(let d=0;d{e=Z(Z({},e),Te(u)),n(2,l=de(e,i)),"hasForm"in u&&n(0,o=u.hasForm),"hasScrollingContent"in u&&n(1,a=u.hasScrollingContent),"$$scope"in u&&n(3,s=u.$$scope)},[o,a,l,s,r]}class XP extends Oe{constructor(e){super(),Ee(this,e,ZP,YP,Se,{hasForm:0,hasScrollingContent:1})}}const Md=XP;function db(t,e,n){const i=t.slice();return i[16]=e[n],i}function KP(t){let e,n;return e=new bt({props:{kind:"secondary",class:t[6],$$slots:{default:[QP]},$$scope:{ctx:t}}}),e.$on("click",t[14]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&64&&(r.class=i[6]),l&32784&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function JP(t){let e,n,i=it(t[5]),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0?0:_[4]?1:-1}~(n=u(t))&&(i=a[n]=o[n](t));let f=t[0]&&mb(t);const c=t[12].default,d=He(c,t,t[15],null);let h=[t[11]],g={};for(let _=0;_{a[y]=null}),fe()),~n?(i=a[n],i?i.p(_,k):(i=a[n]=o[n](_),i.c()),p(i,1),i.m(e,l)):i=null),_[0]?f?(f.p(_,k),k&1&&p(f,1)):(f=mb(_),f.c(),p(f,1),f.m(e,r)):f&&(ue(),v(f,1,1,()=>{f=null}),fe()),d&&d.p&&(!s||k&32768)&&Fe(d,c,_,_[15],s?Ue(c,_[15],k,null):Ge(_[15]),null),we(e,g=Pe(h,[k&2048&&_[11]])),S(e,"bx--modal-footer",!0),S(e,"bx--modal-footer--three-button",_[5].length===2)},i(_){s||(p(i),p(f),p(d,_),s=!0)},o(_){v(i),v(f),v(d,_),s=!1},d(_){_&&E(e),~n&&a[n].d(),f&&f.d(),d&&d.d(_)}}}function nN(t,e,n){const i=["primaryButtonText","primaryButtonIcon","primaryButtonDisabled","primaryClass","secondaryButtonText","secondaryButtons","secondaryClass","danger"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{primaryButtonText:o=""}=e,{primaryButtonIcon:a=void 0}=e,{primaryButtonDisabled:u=!1}=e,{primaryClass:f=void 0}=e,{secondaryButtonText:c=""}=e,{secondaryButtons:d=[]}=e,{secondaryClass:h=void 0}=e,{danger:g=!1}=e;const _=on(),{closeModal:k,submit:y}=jn("ComposedModal"),T=A=>{_("click:button--secondary",{text:A.text})},M=()=>{k(),_("click:button--secondary",{text:c})};return t.$$set=A=>{e=Z(Z({},e),Te(A)),n(11,l=de(e,i)),"primaryButtonText"in A&&n(0,o=A.primaryButtonText),"primaryButtonIcon"in A&&n(1,a=A.primaryButtonIcon),"primaryButtonDisabled"in A&&n(2,u=A.primaryButtonDisabled),"primaryClass"in A&&n(3,f=A.primaryClass),"secondaryButtonText"in A&&n(4,c=A.secondaryButtonText),"secondaryButtons"in A&&n(5,d=A.secondaryButtons),"secondaryClass"in A&&n(6,h=A.secondaryClass),"danger"in A&&n(7,g=A.danger),"$$scope"in A&&n(15,s=A.$$scope)},[o,a,u,f,c,d,h,g,_,k,y,l,r,T,M,s]}class iN extends Oe{constructor(e){super(),Ee(this,e,nN,tN,Se,{primaryButtonText:0,primaryButtonIcon:1,primaryButtonDisabled:2,primaryClass:3,secondaryButtonText:4,secondaryButtons:5,secondaryClass:6,danger:7})}}const Cd=iN;function lN(t){let e,n,i,l,r;return{c(){e=P("span"),n=F(),i=P("span"),l=F(),r=P("span")},m(s,o){O(s,e,o),O(s,n,o),O(s,i,o),O(s,l,o),O(s,r,o)},d(s){s&&(E(e),E(n),E(i),E(l),E(r))}}}function rN(t){let e;return{c(){e=P("span")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function sN(t){let e,n,i,l;function r(f,c){if(f[0]==="single")return rN;if(f[0]==="multi")return lN}let s=r(t),o=s&&s(t),a=[t[1]],u={};for(let f=0;f{e=Z(Z({},e),Te(f)),n(1,l=de(e,i)),"type"in f&&n(0,r=f.type)},[r,l,s,o,a,u]}class aN extends Oe{constructor(e){super(),Ee(this,e,oN,sN,Se,{type:0})}}const uN=aN;function fN(t){let e,n,i,l,r,s,o,a=`${t[19]}px`,u,f,c,d,h;const g=t[25].default,_=He(g,t,t[44],null),k=_||hN(t);let y=!t[6]&&gb(t),T=t[2]&&_b(t),M=[t[22]],A={};for(let C=0;C{y=null}),fe()):y?(y.p(C,D),D[0]&64&&p(y,1)):(y=gb(C),y.c(),p(y,1),y.m(e,f)),C[2]?T?(T.p(C,D),D[0]&4&&p(T,1)):(T=_b(C),T.c(),p(T,1),T.m(e,null)):T&&(ue(),v(T,1,1,()=>{T=null}),fe()),we(e,A=Pe(M,[D[0]&4194304&&C[22]])),S(e,"bx--snippet",!0),S(e,"bx--snippet--expand",C[0]),S(e,"bx--snippet--light",C[9]),S(e,"bx--snippet--no-copy",C[6]),S(e,"bx--snippet--wraptext",C[8]),S(e,"bx--snippet--single",C[3]==="single"),S(e,"bx--snippet--inline",C[3]==="inline"),S(e,"bx--snippet--multi",C[3]==="multi"),S(e,"bx--snippet--disabled",C[3]!=="inline"&&C[7])},i(C){c||(p(k,C),p(y),p(T),c=!0)},o(C){v(k,C),v(y),v(T),c=!1},d(C){C&&E(e),k&&k.d(C),t[39](null),y&&y.d(),T&&T.d(),d=!1,ut(h)}}}function cN(t){let e,n,i,l;const r=[_N,gN],s=[];function o(a,u){return a[6]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function dN(t){let e,n;const i=[{type:t[3]},t[22]];let l={};for(let r=0;r{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function kN(t,e,n){let i,l,r;const s=["type","code","copy","expanded","hideCopyButton","disabled","wrapText","light","skeleton","copyButtonDescription","copyLabel","feedback","feedbackTimeout","showLessText","showMoreText","showMoreLess","id","ref"];let o=de(e,s),{$$slots:a={},$$scope:u}=e,{type:f="single"}=e,{code:c=void 0}=e,{copy:d=async De=>{try{await navigator.clipboard.writeText(De)}catch(vt){console.log(vt)}}}=e,{expanded:h=!1}=e,{hideCopyButton:g=!1}=e,{disabled:_=!1}=e,{wrapText:k=!1}=e,{light:y=!1}=e,{skeleton:T=!1}=e,{copyButtonDescription:M=void 0}=e,{copyLabel:A=void 0}=e,{feedback:C="Copied!"}=e,{feedbackTimeout:D=2e3}=e,{showLessText:R="Show less"}=e,{showMoreText:N="Show more"}=e,{showMoreLess:G=!1}=e,{id:B="ccs-"+Math.random().toString(36)}=e,{ref:$=null}=e;const q=on();let V,K;function x(){const{height:De}=$.getBoundingClientRect();De>0&&n(2,G=$.getBoundingClientRect().height>255)}sn(()=>()=>clearTimeout(K));function ie(De){te.call(this,t,De)}function X(De){te.call(this,t,De)}function ce(De){te.call(this,t,De)}function ae(De){te.call(this,t,De)}function ee(De){te.call(this,t,De)}function he(De){te.call(this,t,De)}function ne(De){te.call(this,t,De)}function re(De){te.call(this,t,De)}function oe(De){te.call(this,t,De)}function Re(De){te.call(this,t,De)}function qe(De){te.call(this,t,De)}const Ce=()=>{d(c),q("copy"),V!=="fade-in"&&(n(16,V="fade-in"),n(17,K=setTimeout(()=>{n(16,V="fade-out")},D)))},Ze=({animationName:De})=>{De==="hide-feedback"&&n(16,V=void 0)};function be(De){xe[De?"unshift":"push"](()=>{$=De,n(1,$)})}function Ae(De){te.call(this,t,De)}function ve(De){te.call(this,t,De)}function me(De){te.call(this,t,De)}const lt=()=>{n(0,h=!h)};return t.$$set=De=>{e=Z(Z({},e),Te(De)),n(22,o=de(e,s)),"type"in De&&n(3,f=De.type),"code"in De&&n(4,c=De.code),"copy"in De&&n(5,d=De.copy),"expanded"in De&&n(0,h=De.expanded),"hideCopyButton"in De&&n(6,g=De.hideCopyButton),"disabled"in De&&n(7,_=De.disabled),"wrapText"in De&&n(8,k=De.wrapText),"light"in De&&n(9,y=De.light),"skeleton"in De&&n(10,T=De.skeleton),"copyButtonDescription"in De&&n(11,M=De.copyButtonDescription),"copyLabel"in De&&n(12,A=De.copyLabel),"feedback"in De&&n(13,C=De.feedback),"feedbackTimeout"in De&&n(14,D=De.feedbackTimeout),"showLessText"in De&&n(23,R=De.showLessText),"showMoreText"in De&&n(24,N=De.showMoreText),"showMoreLess"in De&&n(2,G=De.showMoreLess),"id"in De&&n(15,B=De.id),"ref"in De&&n(1,$=De.ref),"$$scope"in De&&n(44,u=De.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&25165825&&n(20,i=h?R:N),t.$$.dirty[0]&1&&n(19,l=h?16*15:48),t.$$.dirty[0]&1&&n(18,r=h?"none":16*15+"px"),t.$$.dirty[0]&26&&f==="multi"&&$&&(c===void 0&&x(),c&&Ou().then(x)),t.$$.dirty[0]&9&&f==="multi"&&q(h?"expand":"collapse")},[h,$,G,f,c,d,g,_,k,y,T,M,A,C,D,B,V,K,r,l,i,q,o,R,N,a,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae,ve,me,lt,u]}class wN extends Oe{constructor(e){super(),Ee(this,e,kN,vN,Se,{type:3,code:4,copy:5,expanded:0,hideCopyButton:6,disabled:7,wrapText:8,light:9,skeleton:10,copyButtonDescription:11,copyLabel:12,feedback:13,feedbackTimeout:14,showLessText:23,showMoreText:24,showMoreLess:2,id:15,ref:1},null,[-1,-1])}}const Q1=wN,yN=t=>({}),pb=t=>({});function bb(t){let e,n;const i=t[16].labelText,l=He(i,t,t[15],pb),r=l||TN(t);return{c(){e=P("span"),r&&r.c(),S(e,"bx--visually-hidden",t[7])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&32768)&&Fe(l,i,s,s[15],n?Ue(i,s[15],o,yN):Ge(s[15]),pb):r&&r.p&&(!n||o&64)&&r.p(s,n?o:-1),(!n||o&128)&&S(e,"bx--visually-hidden",s[7])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function TN(t){let e;return{c(){e=j(t[6])},m(n,i){O(n,e,i)},p(n,i){i&64&&Y(e,n[6])},d(n){n&&E(e)}}}function SN(t){let e,n,i,l,r,s,o,a,u,f=(t[6]||t[13].labelText)&&bb(t),c=[t[12]],d={};for(let h=0;h{f=null}),fe()),(!o||g&256)&&I(l,"for",h[8]),we(e,d=Pe(c,[g&4096&&h[12]])),S(e,"bx--radio-button-wrapper",!0),S(e,"bx--radio-button-wrapper--label-left",h[5]==="left")},i(h){o||(p(f),o=!0)},o(h){v(f),o=!1},d(h){h&&E(e),t[18](null),f&&f.d(),a=!1,ut(u)}}}function EN(t,e,n){const i=["value","checked","disabled","required","labelPosition","labelText","hideLabel","id","name","ref"];let l=de(e,i),r,{$$slots:s={},$$scope:o}=e;const a=di(s);let{value:u=""}=e,{checked:f=!1}=e,{disabled:c=!1}=e,{required:d=!1}=e,{labelPosition:h="right"}=e,{labelText:g=""}=e,{hideLabel:_=!1}=e,{id:k="ccs-"+Math.random().toString(36)}=e,{name:y=""}=e,{ref:T=null}=e;const M=jn("RadioButtonGroup"),A=M?M.selectedValue:Wt(f?u:void 0);ct(t,A,N=>n(14,r=N)),M&&M.add({id:k,checked:f,disabled:c,value:u});function C(N){te.call(this,t,N)}function D(N){xe[N?"unshift":"push"](()=>{T=N,n(1,T)})}const R=()=>{M&&M.update(u)};return t.$$set=N=>{e=Z(Z({},e),Te(N)),n(12,l=de(e,i)),"value"in N&&n(2,u=N.value),"checked"in N&&n(0,f=N.checked),"disabled"in N&&n(3,c=N.disabled),"required"in N&&n(4,d=N.required),"labelPosition"in N&&n(5,h=N.labelPosition),"labelText"in N&&n(6,g=N.labelText),"hideLabel"in N&&n(7,_=N.hideLabel),"id"in N&&n(8,k=N.id),"name"in N&&n(9,y=N.name),"ref"in N&&n(1,T=N.ref),"$$scope"in N&&n(15,o=N.$$scope)},t.$$.update=()=>{t.$$.dirty&16388&&n(0,f=r===u)},[f,T,u,c,d,h,g,_,k,y,M,A,l,a,r,o,s,C,D,R]}class ON extends Oe{constructor(e){super(),Ee(this,e,EN,SN,Se,{value:2,checked:0,disabled:3,required:4,labelPosition:5,labelText:6,hideLabel:7,id:8,name:9,ref:1})}}const la=ON;function MN(t){let e,n;const i=t[8].default,l=He(i,t,t[7],null);let r=[t[6],{style:t[5]}],s={};for(let o=0;o{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function LN(t,e,n){const i=["size","zebra","useStaticWidth","sortable","stickyHeader","tableStyle"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{zebra:a=!1}=e,{useStaticWidth:u=!1}=e,{sortable:f=!1}=e,{stickyHeader:c=!1}=e,{tableStyle:d=void 0}=e;return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(6,l=de(e,i)),"size"in h&&n(0,o=h.size),"zebra"in h&&n(1,a=h.zebra),"useStaticWidth"in h&&n(2,u=h.useStaticWidth),"sortable"in h&&n(3,f=h.sortable),"stickyHeader"in h&&n(4,c=h.stickyHeader),"tableStyle"in h&&n(5,d=h.tableStyle),"$$scope"in h&&n(7,s=h.$$scope)},[o,a,u,f,c,d,l,s,r]}class DN extends Oe{constructor(e){super(),Ee(this,e,LN,AN,Se,{size:0,zebra:1,useStaticWidth:2,sortable:3,stickyHeader:4,tableStyle:5})}}const IN=DN;function RN(t){let e,n;const i=t[2].default,l=He(i,t,t[1],null);let r=[{"aria-live":"polite"},t[0]],s={};for(let o=0;o{e=Z(Z({},e),Te(o)),n(0,l=de(e,i)),"$$scope"in o&&n(1,s=o.$$scope)},[l,s,r]}class NN extends Oe{constructor(e){super(),Ee(this,e,PN,RN,Se,{})}}const BN=NN;function zN(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class UN extends Oe{constructor(e){super(),Ee(this,e,HN,zN,Se,{})}}const cg=UN;function vb(t){let e,n,i,l,r,s;return{c(){e=P("div"),n=P("h4"),i=j(t[0]),l=F(),r=P("p"),s=j(t[1]),S(n,"bx--data-table-header__title",!0),S(r,"bx--data-table-header__description",!0),S(e,"bx--data-table-header",!0)},m(o,a){O(o,e,a),w(e,n),w(n,i),w(e,l),w(e,r),w(r,s)},p(o,a){a&1&&Y(i,o[0]),a&2&&Y(s,o[1])},d(o){o&&E(e)}}}function FN(t){let e,n,i,l=t[0]&&vb(t);const r=t[6].default,s=He(r,t,t[5],null);let o=[t[4]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(4,l=de(e,i)),"title"in c&&n(0,o=c.title),"description"in c&&n(1,a=c.description),"stickyHeader"in c&&n(2,u=c.stickyHeader),"useStaticWidth"in c&&n(3,f=c.useStaticWidth),"$$scope"in c&&n(5,s=c.$$scope)},[o,a,u,f,l,s,r]}class VN extends Oe{constructor(e){super(),Ee(this,e,GN,FN,Se,{title:0,description:1,stickyHeader:2,useStaticWidth:3})}}const WN=VN;function jN(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class qN extends Oe{constructor(e){super(),Ee(this,e,$N,jN,Se,{})}}const YN=qN;function kb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function ZN(t){let e,n,i=t[1]&&kb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class KN extends Oe{constructor(e){super(),Ee(this,e,XN,ZN,Se,{size:0,title:1})}}const JN=KN;function wb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function QN(t){let e,n,i=t[1]&&wb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class eB extends Oe{constructor(e){super(),Ee(this,e,xN,QN,Se,{size:0,title:1})}}const tB=eB;function nB(t){let e,n,i,l,r;const s=t[9].default,o=He(s,t,t[8],null);let a=[{scope:t[3]},{"data-header":t[4]},t[6]],u={};for(let f=0;f{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function rB(t,e,n){let i;const l=["sortable","sortDirection","active","scope","translateWithId","id"];let r=de(e,l),{$$slots:s={},$$scope:o}=e,{sortable:a=!1}=e,{sortDirection:u="none"}=e,{active:f=!1}=e,{scope:c="col"}=e,{translateWithId:d=()=>""}=e,{id:h="ccs-"+Math.random().toString(36)}=e;function g(D){te.call(this,t,D)}function _(D){te.call(this,t,D)}function k(D){te.call(this,t,D)}function y(D){te.call(this,t,D)}function T(D){te.call(this,t,D)}function M(D){te.call(this,t,D)}function A(D){te.call(this,t,D)}function C(D){te.call(this,t,D)}return t.$$set=D=>{e=Z(Z({},e),Te(D)),n(6,r=de(e,l)),"sortable"in D&&n(0,a=D.sortable),"sortDirection"in D&&n(1,u=D.sortDirection),"active"in D&&n(2,f=D.active),"scope"in D&&n(3,c=D.scope),"translateWithId"in D&&n(7,d=D.translateWithId),"id"in D&&n(4,h=D.id),"$$scope"in D&&n(8,o=D.$$scope)},t.$$.update=()=>{t.$$.dirty&128&&n(5,i=d())},[a,u,f,c,h,i,r,d,o,s,g,_,k,y,T,M,A,C]}class sB extends Oe{constructor(e){super(),Ee(this,e,rB,lB,Se,{sortable:0,sortDirection:1,active:2,scope:3,translateWithId:7,id:4})}}const oB=sB;function aB(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class fB extends Oe{constructor(e){super(),Ee(this,e,uB,aB,Se,{})}}const qT=fB;function yb(t,e,n){const i=t.slice();return i[66]=e[n],i[68]=n,i}const cB=t=>({row:t[0]&201850880}),Tb=t=>({row:t[66]});function Sb(t,e,n){const i=t.slice();return i[69]=e[n],i[71]=n,i}const dB=t=>({row:t[0]&201850880,cell:t[0]&470286336,rowIndex:t[0]&201850880,cellIndex:t[0]&470286336}),Eb=t=>({row:t[66],cell:t[69],rowIndex:t[68],cellIndex:t[71]}),hB=t=>({row:t[0]&201850880,cell:t[0]&470286336,rowIndex:t[0]&201850880,cellIndex:t[0]&470286336}),Ob=t=>({row:t[66],cell:t[69],rowIndex:t[68],cellIndex:t[71]});function Mb(t,e,n){const i=t.slice();return i[72]=e[n],i}const mB=t=>({header:t[0]&64}),Cb=t=>({header:t[72]}),gB=t=>({}),Ab=t=>({}),_B=t=>({}),Lb=t=>({});function Db(t){let e,n,i,l=(t[8]||t[38].title)&&Ib(t),r=(t[9]||t[38].description)&&Rb(t);return{c(){e=P("div"),l&&l.c(),n=F(),r&&r.c(),S(e,"bx--data-table-header",!0)},m(s,o){O(s,e,o),l&&l.m(e,null),w(e,n),r&&r.m(e,null),i=!0},p(s,o){s[8]||s[38].title?l?(l.p(s,o),o[0]&256|o[1]&128&&p(l,1)):(l=Ib(s),l.c(),p(l,1),l.m(e,n)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),s[9]||s[38].description?r?(r.p(s,o),o[0]&512|o[1]&128&&p(r,1)):(r=Rb(s),r.c(),p(r,1),r.m(e,null)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&E(e),l&&l.d(),r&&r.d()}}}function Ib(t){let e,n;const i=t[48].title,l=He(i,t,t[62],Lb),r=l||pB(t);return{c(){e=P("h4"),r&&r.c(),S(e,"bx--data-table-header__title",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&1)&&Fe(l,i,s,s[62],n?Ue(i,s[62],o,_B):Ge(s[62]),Lb):r&&r.p&&(!n||o[0]&256)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function pB(t){let e;return{c(){e=j(t[8])},m(n,i){O(n,e,i)},p(n,i){i[0]&256&&Y(e,n[8])},d(n){n&&E(e)}}}function Rb(t){let e,n;const i=t[48].description,l=He(i,t,t[62],Ab),r=l||bB(t);return{c(){e=P("p"),r&&r.c(),S(e,"bx--data-table-header__description",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&1)&&Fe(l,i,s,s[62],n?Ue(i,s[62],o,gB):Ge(s[62]),Ab):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function bB(t){let e;return{c(){e=j(t[9])},m(n,i){O(n,e,i)},p(n,i){i[0]&512&&Y(e,n[9])},d(n){n&&E(e)}}}function Pb(t){let e,n,i,l=t[12]&&Nb(t);return{c(){e=P("th"),l&&l.c(),I(e,"scope","col"),I(e,"data-previous-value",n=t[22]?"collapsed":void 0),S(e,"bx--table-expand",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),i=!0},p(r,s){r[12]?l?(l.p(r,s),s[0]&4096&&p(l,1)):(l=Nb(r),l.c(),p(l,1),l.m(e,null)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),(!i||s[0]&4194304&&n!==(n=r[22]?"collapsed":void 0))&&I(e,"data-previous-value",n)},i(r){i||(p(l),i=!0)},o(r){v(l),i=!1},d(r){r&&E(e),l&&l.d()}}}function Nb(t){let e,n,i,l,r;return n=new Gu({props:{class:"bx--table-expand__svg"}}),{c(){e=P("button"),U(n.$$.fragment),I(e,"type","button"),S(e,"bx--table-expand__button",!0)},m(s,o){O(s,e,o),z(n,e,null),i=!0,l||(r=J(e,"click",t[49]),l=!0)},p:_e,i(s){i||(p(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&E(e),H(n),l=!1,r()}}}function Bb(t){let e;return{c(){e=P("th"),I(e,"scope","col")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function zb(t){let e,n,i,l;function r(o){t[50](o)}let s={"aria-label":"Select all rows",checked:t[30],indeterminate:t[29]};return t[24]!==void 0&&(s.ref=t[24]),n=new GT({props:s}),xe.push(()=>At(n,"ref",r)),n.$on("change",t[51]),{c(){e=P("th"),U(n.$$.fragment),I(e,"scope","col"),S(e,"bx--table-column-checkbox",!0)},m(o,a){O(o,e,a),z(n,e,null),l=!0},p(o,a){const u={};a[0]&1073741824&&(u.checked=o[30]),a[0]&536870912&&(u.indeterminate=o[29]),!i&&a[0]&16777216&&(i=!0,u.ref=o[24],Ct(()=>i=!1)),n.$set(u)},i(o){l||(p(n.$$.fragment,o),l=!0)},o(o){v(n.$$.fragment,o),l=!1},d(o){o&&E(e),H(n)}}}function vB(t){let e,n;function i(){return t[52](t[72])}return e=new oB({props:{id:t[72].key,style:t[36](t[72]),sortable:t[11]&&t[72].sort!==!1,sortDirection:t[0]===t[72].key?t[1]:"none",active:t[0]===t[72].key,$$slots:{default:[yB]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&64&&(s.id=t[72].key),r[0]&64&&(s.style=t[36](t[72])),r[0]&2112&&(s.sortable=t[11]&&t[72].sort!==!1),r[0]&67&&(s.sortDirection=t[0]===t[72].key?t[1]:"none"),r[0]&65&&(s.active=t[0]===t[72].key),r[0]&64|r[2]&1&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function kB(t){let e,n;return{c(){e=P("th"),I(e,"scope","col"),I(e,"style",n=t[36](t[72]))},m(i,l){O(i,e,l)},p(i,l){l[0]&64&&n!==(n=i[36](i[72]))&&I(e,"style",n)},i:_e,o:_e,d(i){i&&E(e)}}}function wB(t){let e=t[72].value+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[72].value+"")&&Y(n,e)},d(i){i&&E(n)}}}function yB(t){let e,n;const i=t[48]["cell-header"],l=He(i,t,t[62],Cb),r=l||wB(t);return{c(){r&&r.c(),e=F()},m(s,o){r&&r.m(s,o),O(s,e,o),n=!0},p(s,o){l?l.p&&(!n||o[0]&64|o[2]&1)&&Fe(l,i,s,s[62],n?Ue(i,s[62],o,mB):Ge(s[62]),Cb):r&&r.p&&(!n||o[0]&64)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function Hb(t,e){let n,i,l,r,s;const o=[kB,vB],a=[];function u(f,c){return f[72].empty?0:1}return i=u(e),l=a[i]=o[i](e),{key:t,first:null,c(){n=je(),l.c(),r=je(),this.first=n},m(f,c){O(f,n,c),a[i].m(f,c),O(f,r,c),s=!0},p(f,c){e=f;let d=i;i=u(e),i===d?a[i].p(e,c):(ue(),v(a[d],1,1,()=>{a[d]=null}),fe(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),p(l,1),l.m(r.parentNode,r))},i(f){s||(p(l),s=!0)},o(f){v(l),s=!1},d(f){f&&(E(n),E(r)),a[i].d(f)}}}function TB(t){let e,n,i,l=[],r=new Map,s,o,a=t[4]&&Pb(t),u=t[5]&&!t[15]&&Bb(),f=t[15]&&!t[14]&&zb(t),c=it(t[6]);const d=h=>h[72].key;for(let h=0;h{a=null}),fe()),h[5]&&!h[15]?u||(u=Bb(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),h[15]&&!h[14]?f?(f.p(h,g),g[0]&49152&&p(f,1)):(f=zb(h),f.c(),p(f,1),f.m(i.parentNode,i)):f&&(ue(),v(f,1,1,()=>{f=null}),fe()),g[0]&2115|g[1]&46|g[2]&1&&(c=it(h[6]),ue(),l=Pn(l,g,d,1,h,c,r,s.parentNode,Fn,Hb,s,Mb),fe())},i(h){if(!o){p(a),p(f);for(let g=0;g{l=null}),fe())},i(r){i||(p(l),i=!0)},o(r){v(l),i=!1},d(r){r&&E(n),l&&l.d(r)}}}function Gb(t){let e,n=!t[16].includes(t[66].id),i,l=n&&Vb(t);return{c(){e=P("td"),l&&l.c(),S(e,"bx--table-column-checkbox",!0),S(e,"bx--table-column-radio",t[14])},m(r,s){O(r,e,s),l&&l.m(e,null),i=!0},p(r,s){s[0]&201916416&&(n=!r[16].includes(r[66].id)),n?l?(l.p(r,s),s[0]&201916416&&p(l,1)):(l=Vb(r),l.c(),p(l,1),l.m(e,null)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),(!i||s[0]&16384)&&S(e,"bx--table-column-radio",r[14])},i(r){i||(p(l),i=!0)},o(r){v(l),i=!1},d(r){r&&E(e),l&&l.d()}}}function Vb(t){let e,n,i,l;const r=[MB,OB],s=[];function o(a,u){return a[14]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function OB(t){let e,n;function i(){return t[55](t[66])}return e=new GT({props:{name:"select-row-"+t[66].id,checked:t[3].includes(t[66].id)}}),e.$on("change",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&201850880&&(s.name="select-row-"+t[66].id),r[0]&201850888&&(s.checked=t[3].includes(t[66].id)),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function MB(t){let e,n;function i(){return t[54](t[66])}return e=new la({props:{name:"select-row-"+t[66].id,checked:t[3].includes(t[66].id)}}),e.$on("change",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&201850880&&(s.name="select-row-"+t[66].id),r[0]&201850888&&(s.checked=t[3].includes(t[66].id)),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function CB(t){let e,n;function i(){return t[56](t[66],t[69])}return e=new cg({props:{$$slots:{default:[DB]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&470286336|r[2]&1&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function AB(t){let e,n,i;const l=t[48].cell,r=He(l,t,t[62],Ob),s=r||IB(t);return{c(){e=P("td"),s&&s.c(),n=F(),S(e,"bx--table-column-menu",t[6][t[71]].columnMenu)},m(o,a){O(o,e,a),s&&s.m(e,null),w(e,n),i=!0},p(o,a){r?r.p&&(!i||a[0]&470286336|a[2]&1)&&Fe(r,l,o,o[62],i?Ue(l,o[62],a,hB):Ge(o[62]),Ob):s&&s.p&&(!i||a[0]&470286336)&&s.p(o,i?a:[-1,-1,-1]),(!i||a[0]&470286400)&&S(e,"bx--table-column-menu",o[6][o[71]].columnMenu)},i(o){i||(p(s,o),i=!0)},o(o){v(s,o),i=!1},d(o){o&&E(e),s&&s.d(o)}}}function LB(t){let e=(t[69].display?t[69].display(t[69].value):t[69].value)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&470286336&&e!==(e=(i[69].display?i[69].display(i[69].value):i[69].value)+"")&&Y(n,e)},d(i){i&&E(n)}}}function DB(t){let e,n;const i=t[48].cell,l=He(i,t,t[62],Eb),r=l||LB(t);return{c(){r&&r.c(),e=F()},m(s,o){r&&r.m(s,o),O(s,e,o),n=!0},p(s,o){l?l.p&&(!n||o[0]&470286336|o[2]&1)&&Fe(l,i,s,s[62],n?Ue(i,s[62],o,dB):Ge(s[62]),Eb):r&&r.p&&(!n||o[0]&470286336)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function IB(t){let e=(t[69].display?t[69].display(t[69].value):t[69].value)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&470286336&&e!==(e=(i[69].display?i[69].display(i[69].value):i[69].value)+"")&&Y(n,e)},d(i){i&&E(n)}}}function Wb(t,e){let n,i,l,r,s;const o=[AB,CB],a=[];function u(f,c){return f[6][f[71]].empty?0:1}return i=u(e),l=a[i]=o[i](e),{key:t,first:null,c(){n=je(),l.c(),r=je(),this.first=n},m(f,c){O(f,n,c),a[i].m(f,c),O(f,r,c),s=!0},p(f,c){e=f;let d=i;i=u(e),i===d?a[i].p(e,c):(ue(),v(a[d],1,1,()=>{a[d]=null}),fe(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),p(l,1),l.m(r.parentNode,r))},i(f){s||(p(l),s=!0)},o(f){v(l),s=!1},d(f){f&&(E(n),E(r)),a[i].d(f)}}}function RB(t){let e,n,i=[],l=new Map,r,s,o=t[4]&&Ub(t),a=t[5]&&Gb(t),u=it(t[28][t[66].id]);const f=c=>c[69].key;for(let c=0;c{o=null}),fe()),c[5]?a?(a.p(c,d),d[0]&32&&p(a,1)):(a=Gb(c),a.c(),p(a,1),a.m(n.parentNode,n)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),d[0]&470286400|d[1]&8|d[2]&1&&(u=it(c[28][c[66].id]),ue(),i=Pn(i,d,f,1,c,u,l,r.parentNode,Fn,Wb,r,Sb),fe())},i(c){if(!s){p(o),p(a);for(let d=0;d{o=null}),fe())},i(f){l||(p(o),l=!0)},o(f){v(o),l=!1},d(f){f&&E(e),o&&o.d(),r=!1,ut(s)}}}function $b(t){let e,n;return e=new cg({props:{colspan:t[5]?t[6].length+2:t[6].length+1,$$slots:{default:[PB]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&96&&(r.colspan=i[5]?i[6].length+2:i[6].length+1),l[0]&201850880|l[2]&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function PB(t){let e,n;const i=t[48]["expanded-row"],l=He(i,t,t[62],Tb);return{c(){e=P("div"),l&&l.c(),S(e,"bx--child-row-inner-container",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s[0]&201850880|s[2]&1)&&Fe(l,i,r,r[62],n?Ue(i,r[62],s,cB):Ge(r[62]),Tb)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function qb(t,e){let n,i,l,r,s;function o(...c){return e[57](e[66],...c)}function a(){return e[58](e[66])}function u(){return e[59](e[66])}i=new qT({props:{"data-row":e[66].id,"data-parent-row":e[4]?!0:void 0,class:(e[3].includes(e[66].id)?"bx--data-table--selected":"")+" "+(e[31][e[66].id]?"bx--expandable-row":"")+" "+(e[4]?"bx--parent-row":"")+" "+(e[4]&&e[23]===e[66].id?"bx--expandable-row--hover":""),$$slots:{default:[RB]},$$scope:{ctx:e}}}),i.$on("click",o),i.$on("mouseenter",a),i.$on("mouseleave",u);let f=e[4]&&jb(e);return{key:t,first:null,c(){n=je(),U(i.$$.fragment),l=F(),f&&f.c(),r=je(),this.first=n},m(c,d){O(c,n,d),z(i,c,d),O(c,l,d),f&&f.m(c,d),O(c,r,d),s=!0},p(c,d){e=c;const h={};d[0]&201850880&&(h["data-row"]=e[66].id),d[0]&16&&(h["data-parent-row"]=e[4]?!0:void 0),d[0]&210239512|d[1]&1&&(h.class=(e[3].includes(e[66].id)?"bx--data-table--selected":"")+" "+(e[31][e[66].id]?"bx--expandable-row":"")+" "+(e[4]?"bx--parent-row":"")+" "+(e[4]&&e[23]===e[66].id?"bx--expandable-row--hover":"")),d[0]&470376572|d[1]&1|d[2]&1&&(h.$$scope={dirty:d,ctx:e}),i.$set(h),e[4]?f?(f.p(e,d),d[0]&16&&p(f,1)):(f=jb(e),f.c(),p(f,1),f.m(r.parentNode,r)):f&&(ue(),v(f,1,1,()=>{f=null}),fe())},i(c){s||(p(i.$$.fragment,c),p(f),s=!0)},o(c){v(i.$$.fragment,c),v(f),s=!1},d(c){c&&(E(n),E(l),E(r)),H(i,c),f&&f.d(c)}}}function NB(t){let e=[],n=new Map,i,l,r=it(t[19]?t[26]:t[27]);const s=o=>o[66].id;for(let o=0;o{r=null}),fe()),o&&o.p&&(!l||u[2]&1)&&Fe(o,s,a,a[62],l?Ue(s,a[62],u,null):Ge(a[62]),null);const f={};u[0]&1024&&(f.zebra=a[10]),u[0]&128&&(f.size=a[7]),u[0]&131072&&(f.stickyHeader=a[17]),u[0]&2048&&(f.sortable=a[11]),u[0]&262144&&(f.useStaticWidth=a[18]),u[0]&33554432&&(f.tableStyle=a[25]&&"table-layout: fixed"),u[0]&2113534079|u[1]&3|u[2]&1&&(f.$$scope={dirty:u,ctx:a}),i.$set(f)},i(a){l||(p(r),p(o,a),p(i.$$.fragment,a),l=!0)},o(a){v(r),v(o,a),v(i.$$.fragment,a),l=!1},d(a){a&&(E(e),E(n)),r&&r.d(a),o&&o.d(a),H(i,a)}}}function HB(t){let e,n;const i=[{useStaticWidth:t[18]},t[37]];let l={$$slots:{default:[zB]},$$scope:{ctx:t}};for(let r=0;rn(47,C=ze));const vt=(ze,kt)=>kt in ze?ze[kt]:kt.split(/[\.\[\]\'\"]/).filter(Pt=>Pt).reduce((Pt,cn)=>Pt&&typeof Pt=="object"?Pt[cn]:Pt,ze);pi("DataTable",{batchSelectedIds:lt,tableRows:De,resetSelectedRowIds:()=>{n(30,a=!1),n(3,Re=[]),ht&&n(24,ht.checked=!1,ht)}});let dt=!1,ot=null,ht=null;const Bt=(ze,kt,Pt)=>kt&&Pt?ze.slice((kt-1)*Pt,kt*Pt):ze,Ot=ze=>{const kt=[ze.width&&`width: ${ze.width}`,ze.minWidth&&`min-width: ${ze.minWidth}`].filter(Boolean);if(kt.length!==0)return kt.join(";")},Zt=()=>{n(22,dt=!dt),n(2,ee=dt?s:[]),me("click:header--expand",{expanded:dt})};function Ve(ze){ht=ze,n(24,ht)}const Nt=ze=>{if(me("click:header--select",{indeterminate:u,selected:!u&&ze.target.checked}),u){ze.target.checked=!1,n(30,a=!1),n(3,Re=[]);return}ze.target.checked?n(3,Re=o):n(3,Re=[])},Tt=ze=>{if(me("click",{header:ze}),ze.sort===!1)me("click:header",{header:ze});else{let kt=ie===ze.key?X:"none";n(1,X=ve[kt]),n(0,ie=X==="none"?null:i[ze.key]),me("click:header",{header:ze,sortDirection:X})}},Gt=ze=>{const kt=!!l[ze.id];n(2,ee=kt?ee.filter(Pt=>Pt!==ze.id):[...ee,ze.id]),me("click:row--expand",{row:ze,expanded:!kt})},fn=ze=>{n(3,Re=[ze.id]),me("click:row--select",{row:ze,selected:!0})},an=ze=>{Re.includes(ze.id)?(n(3,Re=Re.filter(kt=>kt!==ze.id)),me("click:row--select",{row:ze,selected:!1})):(n(3,Re=[...Re,ze.id]),me("click:row--select",{row:ze,selected:!0}))},Qt=(ze,kt)=>{me("click",{row:ze,cell:kt}),me("click:cell",kt)},Ne=(ze,{target:kt})=>{[...kt.classList].some(Pt=>/^bx--(overflow-menu|checkbox|radio-button)/.test(Pt))||(me("click",{row:ze}),me("click:row",ze))},pe=ze=>{me("mouseenter:row",ze)},et=ze=>{me("mouseleave:row",ze)},gt=ze=>{he.includes(ze.id)||n(23,ot=ze.id)},Kt=ze=>{he.includes(ze.id)||n(23,ot=null)};return t.$$set=ze=>{e=Z(Z({},e),Te(ze)),n(37,A=de(e,M)),"headers"in ze&&n(6,G=ze.headers),"rows"in ze&&n(39,B=ze.rows),"size"in ze&&n(7,$=ze.size),"title"in ze&&n(8,q=ze.title),"description"in ze&&n(9,V=ze.description),"zebra"in ze&&n(10,K=ze.zebra),"sortable"in ze&&n(11,x=ze.sortable),"sortKey"in ze&&n(0,ie=ze.sortKey),"sortDirection"in ze&&n(1,X=ze.sortDirection),"expandable"in ze&&n(4,ce=ze.expandable),"batchExpansion"in ze&&n(12,ae=ze.batchExpansion),"expandedRowIds"in ze&&n(2,ee=ze.expandedRowIds),"nonExpandableRowIds"in ze&&n(13,he=ze.nonExpandableRowIds),"radio"in ze&&n(14,ne=ze.radio),"selectable"in ze&&n(5,re=ze.selectable),"batchSelection"in ze&&n(15,oe=ze.batchSelection),"selectedRowIds"in ze&&n(3,Re=ze.selectedRowIds),"nonSelectableRowIds"in ze&&n(16,qe=ze.nonSelectableRowIds),"stickyHeader"in ze&&n(17,Ce=ze.stickyHeader),"useStaticWidth"in ze&&n(18,Ze=ze.useStaticWidth),"pageSize"in ze&&n(40,be=ze.pageSize),"page"in ze&&n(41,Ae=ze.page),"$$scope"in ze&&n(62,R=ze.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&64&&n(32,i=G.reduce((ze,kt)=>({...ze,[kt.key]:kt.key}),{})),t.$$.dirty[0]&4&&n(31,l=ee.reduce((ze,kt)=>({...ze,[kt]:!0}),{})),t.$$.dirty[0]&8&<.set(Re),t.$$.dirty[0]&64&&n(45,f=G.map(({key:ze})=>ze)),t.$$.dirty[0]&64|t.$$.dirty[1]&16640&&n(28,c=B.reduce((ze,kt)=>(ze[kt.id]=f.map((Pt,cn)=>({key:Pt,value:vt(kt,Pt),display:G[cn].display})),ze),{})),t.$$.dirty[1]&256&&ro(De,C=B,C),t.$$.dirty[1]&65536&&n(46,r=C.map(ze=>ze.id)),t.$$.dirty[0]&8192|t.$$.dirty[1]&32768&&n(20,s=r.filter(ze=>!he.includes(ze))),t.$$.dirty[0]&65536|t.$$.dirty[1]&32768&&n(21,o=r.filter(ze=>!qe.includes(ze))),t.$$.dirty[0]&2097160&&n(30,a=o.length>0&&Re.length===o.length),t.$$.dirty[0]&2097160&&n(29,u=Re.length>0&&Re.lengthze.key===ie)),t.$$.dirty[0]&524291|t.$$.dirty[1]&77824&&g&&(X==="none"?n(42,d=C):n(42,d=[...C].sort((ze,kt)=>{const Pt=vt(h?ze:kt,ie),cn=vt(h?kt:ze,ie);return _!=null&&_.sort?_.sort(Pt,cn):typeof Pt=="number"&&typeof cn=="number"?Pt-cn:[Pt,cn].every(qn=>!qn&&qn!==0)?0:!Pt&&Pt!==0?h?1:-1:!cn&&cn!==0?h?-1:1:Pt.toString().localeCompare(cn.toString(),"en",{numeric:!0})}))),t.$$.dirty[1]&67072&&n(27,k=Bt(C,Ae,be)),t.$$.dirty[1]&3584&&n(26,y=Bt(d,Ae,be)),t.$$.dirty[0]&64&&n(25,T=G.some(ze=>ze.width||ze.minWidth))},[ie,X,ee,Re,ce,re,G,$,q,V,K,x,ae,he,ne,oe,qe,Ce,Ze,g,s,o,dt,ot,ht,T,y,k,c,u,a,l,i,ve,me,De,Ot,A,N,B,be,Ae,d,h,_,f,r,C,D,Zt,Ve,Nt,Tt,Gt,fn,an,Qt,Ne,pe,et,gt,Kt,R]}class FB extends Oe{constructor(e){super(),Ee(this,e,UB,HB,Se,{headers:6,rows:39,size:7,title:8,description:9,zebra:10,sortable:11,sortKey:0,sortDirection:1,expandable:4,batchExpansion:12,expandedRowIds:2,nonExpandableRowIds:13,radio:14,selectable:5,batchSelection:15,selectedRowIds:3,nonSelectableRowIds:16,stickyHeader:17,useStaticWidth:18,pageSize:40,page:41},null,[-1,-1,-1])}}const ml=FB;function GB(t){let e,n;const i=t[4].default,l=He(i,t,t[3],null);let r=[{"aria-label":"data table toolbar"},t[2]],s={};for(let o=0;o{u.set(c),a&&n(1,a.style.overflow=c?"visible":"inherit",a)}});function f(c){xe[c?"unshift":"push"](()=>{a=c,n(1,a)})}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"size"in c&&n(0,o=c.size),"$$scope"in c&&n(3,s=c.$$scope)},[o,a,l,s,r,f]}class WB extends Oe{constructor(e){super(),Ee(this,e,VB,GB,Se,{size:0})}}const dg=WB;function jB(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("div"),l&&l.c(),S(e,"bx--toolbar-content",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function $B(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class qB extends Oe{constructor(e){super(),Ee(this,e,$B,jB,Se,{})}}const hg=qB;function Yb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function YB(t){let e,n,i=t[1]&&Yb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class XB extends Oe{constructor(e){super(),Ee(this,e,ZB,YB,Se,{size:0,title:1})}}const KB=XB;function JB(t){let e,n,i,l,r,s,o=[t[1]],a={};for(let u=0;u{e=Z(Z({},e),Te(f)),n(1,l=de(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class xB extends Oe{constructor(e){super(),Ee(this,e,QB,JB,Se,{size:0})}}const ez=xB,tz=t=>({}),Zb=t=>({});function nz(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k;var y=t[14];function T(B,$){return{props:{class:"bx--search-magnifier-icon"}}}y&&(i=rn(y,T()));const M=t[20].labelText,A=He(M,t,t[19],Zb),C=A||lz(t);let D=[{type:"text"},{role:"searchbox"},{autofocus:u=t[11]===!0?!0:void 0},{autocomplete:t[10]},{disabled:t[7]},{id:t[15]},{placeholder:t[9]},t[18]],R={};for(let B=0;B{H(q,1)}),fe()}y?(i=rn(y,T()),U(i.$$.fragment),p(i.$$.fragment,1),z(i,n,null)):i=null}if(A?A.p&&(!g||$[0]&524288)&&Fe(A,M,B,B[19],g?Ue(M,B[19],$,tz):Ge(B[19]),Zb):C&&C.p&&(!g||$[0]&8192)&&C.p(B,g?$:[-1,-1]),(!g||$[0]&32768&&s!==(s=B[15]+"-search"))&&I(r,"id",s),(!g||$[0]&32768)&&I(r,"for",B[15]),we(a,R=Pe(D,[{type:"text"},{role:"searchbox"},(!g||$[0]&2048&&u!==(u=B[11]===!0?!0:void 0))&&{autofocus:u},(!g||$[0]&1024)&&{autocomplete:B[10]},(!g||$[0]&128)&&{disabled:B[7]},(!g||$[0]&32768)&&{id:B[15]},(!g||$[0]&512)&&{placeholder:B[9]},$[0]&262144&&B[18]])),$[0]&4&&a.value!==B[2]&&Ll(a,B[2]),S(a,"bx--search-input",!0),N!==(N=Dl)){if(d){ue();const q=d;v(q.$$.fragment,1,0,()=>{H(q,1)}),fe()}N?(d=rn(N,G(B)),U(d.$$.fragment),p(d.$$.fragment,1),z(d,c,null)):d=null}else if(N){const q={};$[0]&8&&(q.size=B[3]==="xl"?20:16),d.$set(q)}(!g||$[0]&4096)&&I(c,"aria-label",B[12]),(!g||$[0]&128)&&(c.disabled=B[7]),(!g||$[0]&4)&&S(c,"bx--search-close--hidden",B[2]===""),(!g||$[0]&32768&&h!==(h=B[15]+"-search"))&&I(e,"aria-labelledby",h),(!g||$[0]&16)&&I(e,"class",B[4]),(!g||$[0]&16)&&S(e,"bx--search",!0),(!g||$[0]&80)&&S(e,"bx--search--light",B[6]),(!g||$[0]&144)&&S(e,"bx--search--disabled",B[7]),(!g||$[0]&24)&&S(e,"bx--search--sm",B[3]==="sm"),(!g||$[0]&24)&&S(e,"bx--search--lg",B[3]==="lg"),(!g||$[0]&24)&&S(e,"bx--search--xl",B[3]==="xl"),(!g||$[0]&272)&&S(e,"bx--search--expandable",B[8]),(!g||$[0]&17)&&S(e,"bx--search--expanded",B[0])},i(B){g||(i&&p(i.$$.fragment,B),p(C,B),d&&p(d.$$.fragment,B),g=!0)},o(B){i&&v(i.$$.fragment,B),v(C,B),d&&v(d.$$.fragment,B),g=!1},d(B){B&&E(e),i&&H(i),t[33](null),C&&C.d(B),t[35](null),d&&H(d),_=!1,ut(k)}}}function iz(t){let e,n;const i=[{size:t[3]},t[18]];let l={};for(let r=0;r{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function sz(t,e,n){const i=["value","size","searchClass","skeleton","light","disabled","expandable","expanded","placeholder","autocomplete","autofocus","closeButtonLabelText","labelText","icon","id","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{value:o=""}=e,{size:a="xl"}=e,{searchClass:u=""}=e,{skeleton:f=!1}=e,{light:c=!1}=e,{disabled:d=!1}=e,{expandable:h=!1}=e,{expanded:g=!1}=e,{placeholder:_="Search..."}=e,{autocomplete:k="off"}=e,{autofocus:y=!1}=e,{closeButtonLabelText:T="Clear search input"}=e,{labelText:M=""}=e,{icon:A=KB}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{ref:D=null}=e;const R=on();let N=null;function G(be){te.call(this,t,be)}function B(be){te.call(this,t,be)}function $(be){te.call(this,t,be)}function q(be){te.call(this,t,be)}function V(be){te.call(this,t,be)}function K(be){te.call(this,t,be)}function x(be){te.call(this,t,be)}function ie(be){te.call(this,t,be)}function X(be){te.call(this,t,be)}function ce(be){te.call(this,t,be)}function ae(be){te.call(this,t,be)}function ee(be){te.call(this,t,be)}function he(be){xe[be?"unshift":"push"](()=>{N=be,n(16,N)})}const ne=()=>{h&&n(0,g=!0)};function re(be){xe[be?"unshift":"push"](()=>{D=be,n(1,D)})}function oe(){o=this.value,n(2,o)}const Re=()=>{h&&n(0,g=!0)},qe=()=>{g&&o.trim().length===0&&n(0,g=!1)},Ce=({key:be})=>{be==="Escape"&&(n(2,o=""),R("clear"))},Ze=()=>{n(2,o=""),D.focus(),R("clear")};return t.$$set=be=>{e=Z(Z({},e),Te(be)),n(18,l=de(e,i)),"value"in be&&n(2,o=be.value),"size"in be&&n(3,a=be.size),"searchClass"in be&&n(4,u=be.searchClass),"skeleton"in be&&n(5,f=be.skeleton),"light"in be&&n(6,c=be.light),"disabled"in be&&n(7,d=be.disabled),"expandable"in be&&n(8,h=be.expandable),"expanded"in be&&n(0,g=be.expanded),"placeholder"in be&&n(9,_=be.placeholder),"autocomplete"in be&&n(10,k=be.autocomplete),"autofocus"in be&&n(11,y=be.autofocus),"closeButtonLabelText"in be&&n(12,T=be.closeButtonLabelText),"labelText"in be&&n(13,M=be.labelText),"icon"in be&&n(14,A=be.icon),"id"in be&&n(15,C=be.id),"ref"in be&&n(1,D=be.ref),"$$scope"in be&&n(19,s=be.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&3&&g&&D&&D.focus(),t.$$.dirty[0]&1&&R(g?"expand":"collapse")},[g,D,o,a,u,f,c,d,h,_,k,y,T,M,A,C,N,R,l,s,r,G,B,$,q,V,K,x,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze]}class oz extends Oe{constructor(e){super(),Ee(this,e,sz,rz,Se,{value:2,size:3,searchClass:4,skeleton:5,light:6,disabled:7,expandable:8,expanded:0,placeholder:9,autocomplete:10,autofocus:11,closeButtonLabelText:12,labelText:13,icon:14,id:15,ref:1},null,[-1,-1])}}const YT=oz;function az(t){let e,n,i,l;const r=[{tabindex:t[5]},{disabled:t[4]},t[9],{searchClass:t[6]+" "+t[9].class}];function s(u){t[14](u)}function o(u){t[15](u)}let a={};for(let u=0;uAt(e,"ref",s)),xe.push(()=>At(e,"value",o)),e.$on("clear",t[16]),e.$on("clear",t[8]),e.$on("change",t[17]),e.$on("input",t[18]),e.$on("focus",t[19]),e.$on("focus",t[8]),e.$on("blur",t[20]),e.$on("blur",t[21]),e.$on("keyup",t[22]),e.$on("keydown",t[23]),e.$on("paste",t[24]),{c(){U(e.$$.fragment)},m(u,f){z(e,u,f),l=!0},p(u,[f]){const c=f&624?Pe(r,[f&32&&{tabindex:u[5]},f&16&&{disabled:u[4]},f&512&&Gi(u[9]),f&576&&{searchClass:u[6]+" "+u[9].class}]):{};!n&&f&4&&(n=!0,c.ref=u[2],Ct(()=>n=!1)),!i&&f&1&&(i=!0,c.value=u[0],Ct(()=>i=!1)),e.$set(c)},i(u){l||(p(e.$$.fragment,u),l=!0)},o(u){v(e.$$.fragment,u),l=!1},d(u){H(e,u)}}}function uz(t,e,n){let i,l;const r=["value","expanded","persistent","disabled","shouldFilterRows","filteredRowIds","tabindex","ref"];let s=de(e,r),o,{value:a=""}=e,{expanded:u=!1}=e,{persistent:f=!1}=e,{disabled:c=!1}=e,{shouldFilterRows:d=!1}=e,{filteredRowIds:h=[]}=e,{tabindex:g="0"}=e,{ref:_=null}=e;const{tableRows:k}=jn("DataTable")??{};ct(t,k,V=>n(13,o=V));async function y(){await Ou(),!(c||f||u)&&(n(1,u=!0),await Ou(),_.focus())}function T(V){_=V,n(2,_)}function M(V){a=V,n(0,a)}function A(V){te.call(this,t,V)}function C(V){te.call(this,t,V)}function D(V){te.call(this,t,V)}function R(V){te.call(this,t,V)}function N(V){te.call(this,t,V)}const G=()=>{n(1,u=!f&&!!a.length)};function B(V){te.call(this,t,V)}function $(V){te.call(this,t,V)}function q(V){te.call(this,t,V)}return t.$$set=V=>{e=Z(Z({},e),Te(V)),n(9,s=de(e,r)),"value"in V&&n(0,a=V.value),"expanded"in V&&n(1,u=V.expanded),"persistent"in V&&n(3,f=V.persistent),"disabled"in V&&n(4,c=V.disabled),"shouldFilterRows"in V&&n(11,d=V.shouldFilterRows),"filteredRowIds"in V&&n(10,h=V.filteredRowIds),"tabindex"in V&&n(5,g=V.tabindex),"ref"in V&&n(2,_=V.ref)},t.$$.update=()=>{if(t.$$.dirty&8192&&n(12,i=k?[...o]:[]),t.$$.dirty&6145&&d){let V=i;a.trim().length>0&&(d===!0?V=V.filter(K=>Object.entries(K).filter(([x])=>x!=="id").some(([x,ie])=>{if(typeof ie=="string"||typeof ie=="number")return(ie+"").toLowerCase().includes(a.trim().toLowerCase())})):typeof d=="function"&&(V=V.filter(K=>d(K,a)??!1))),k.set(V),n(10,h=V.map(K=>K.id))}t.$$.dirty&1&&n(1,u=!!a.length),t.$$.dirty&26&&n(6,l=[u&&"bx--toolbar-search-container-active",f?"bx--toolbar-search-container-persistent":"bx--toolbar-search-container-expandable",c&&"bx--toolbar-search-container-disabled"].filter(Boolean).join(" "))},[a,u,_,f,c,g,l,k,y,s,h,d,i,o,T,M,A,C,D,R,N,G,B,$,q]}class fz extends Oe{constructor(e){super(),Ee(this,e,uz,az,Se,{value:0,expanded:1,persistent:3,disabled:4,shouldFilterRows:11,filteredRowIds:10,tabindex:5,ref:2})}}const ZT=fz;function Xb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function cz(t){let e,n,i,l,r=t[1]&&Xb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class hz extends Oe{constructor(e){super(),Ee(this,e,dz,cz,Se,{size:0,title:1})}}const mz=hz;function Kb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function gz(t){let e,n,i,l,r=t[1]&&Kb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class pz extends Oe{constructor(e){super(),Ee(this,e,_z,gz,Se,{size:0,title:1})}}const bz=pz,vz=t=>({}),Jb=t=>({});function kz(t){let e,n,i;var l=t[1];function r(s,o){return{props:{"aria-label":s[10],title:s[10],class:"bx--overflow-menu__icon "+s[9]}}}return l&&(e=rn(l,r(t))),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o[0]&2&&l!==(l=s[1])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r(s)),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}else if(l){const a={};o[0]&1024&&(a["aria-label"]=s[10]),o[0]&1024&&(a.title=s[10]),o[0]&512&&(a.class="bx--overflow-menu__icon "+s[9]),e.$set(a)}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function Qb(t){let e,n;const i=t[24].default,l=He(i,t,t[23],null);return{c(){e=P("ul"),l&&l.c(),I(e,"role","menu"),I(e,"tabindex","-1"),I(e,"aria-label",t[13]),I(e,"data-floating-menu-direction",t[5]),I(e,"class",t[8]),S(e,"bx--overflow-menu-options",!0),S(e,"bx--overflow-menu--flip",t[7]),S(e,"bx--overflow-menu-options--open",t[0]),S(e,"bx--overflow-menu-options--light",t[6]),S(e,"bx--overflow-menu-options--sm",t[4]==="sm"),S(e,"bx--overflow-menu-options--xl",t[4]==="xl"),S(e,"bx--breadcrumb-menu-options",!!t[14])},m(r,s){O(r,e,s),l&&l.m(e,null),t[31](e),n=!0},p(r,s){l&&l.p&&(!n||s[0]&8388608)&&Fe(l,i,r,r[23],n?Ue(i,r[23],s,null):Ge(r[23]),null),(!n||s[0]&8192)&&I(e,"aria-label",r[13]),(!n||s[0]&32)&&I(e,"data-floating-menu-direction",r[5]),(!n||s[0]&256)&&I(e,"class",r[8]),(!n||s[0]&256)&&S(e,"bx--overflow-menu-options",!0),(!n||s[0]&384)&&S(e,"bx--overflow-menu--flip",r[7]),(!n||s[0]&257)&&S(e,"bx--overflow-menu-options--open",r[0]),(!n||s[0]&320)&&S(e,"bx--overflow-menu-options--light",r[6]),(!n||s[0]&272)&&S(e,"bx--overflow-menu-options--sm",r[4]==="sm"),(!n||s[0]&272)&&S(e,"bx--overflow-menu-options--xl",r[4]==="xl"),(!n||s[0]&16640)&&S(e,"bx--breadcrumb-menu-options",!!r[14])},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r),t[31](null)}}}function wz(t){let e,n,i,l,r,s,o,a;const u=t[24].menu,f=He(u,t,t[23],Jb),c=f||kz(t);let d=t[0]&&Qb(t),h=[{type:"button"},{"aria-haspopup":""},{"aria-expanded":t[0]},{"aria-label":t[13]},{id:t[11]},t[19]],g={};for(let _=0;_{d=null}),fe()),we(l,g=Pe(h,[{type:"button"},{"aria-haspopup":""},(!s||k[0]&1)&&{"aria-expanded":_[0]},(!s||k[0]&8192)&&{"aria-label":_[13]},(!s||k[0]&2048)&&{id:_[11]},k[0]&524288&&_[19]])),S(l,"bx--overflow-menu",!0),S(l,"bx--overflow-menu--open",_[0]),S(l,"bx--overflow-menu--light",_[6]),S(l,"bx--overflow-menu--sm",_[4]==="sm"),S(l,"bx--overflow-menu--xl",_[4]==="xl")},i(_){s||(p(c,_),p(d),s=!0)},o(_){v(c,_),v(d),s=!1},d(_){_&&(e.d(),E(i),E(l)),E(n),c&&c.d(_),d&&d.d(),t[32](null),o=!1,ut(a)}}}function yz(t,e,n){let i,l;const r=["size","direction","open","light","flipped","menuOptionsClass","icon","iconClass","iconDescription","id","buttonRef","menuRef"];let s=de(e,r),o,a,u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{direction:h="bottom"}=e,{open:g=!1}=e,{light:_=!1}=e,{flipped:k=!1}=e,{menuOptionsClass:y=void 0}=e,{icon:T=mz}=e,{iconClass:M=void 0}=e,{iconDescription:A="Open and close list of options"}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{buttonRef:D=null}=e,{menuRef:R=null}=e;const N=jn("BreadcrumbItem"),G=on(),B=Wt([]);ct(t,B,Ce=>n(22,a=Ce));const $=Wt(void 0);ct(t,$,Ce=>n(37,u=Ce));const q=Wt(void 0),V=Wt(-1);ct(t,V,Ce=>n(21,o=Ce));let K,x=!0;pi("OverflowMenu",{focusedId:q,add:({id:Ce,text:Ze,primaryFocus:be,disabled:Ae})=>{B.update(ve=>(be&&V.set(ve.length),[...ve,{id:Ce,text:Ze,primaryFocus:be,disabled:Ae,index:ve.length}]))},update:Ce=>{$.set(Ce)},change:Ce=>{let Ze=o+Ce;Ze<0?Ze=a.length-1:Ze>=a.length&&(Ze=0);let be=a[Ze].disabled;for(;be;)Ze=Ze+Ce,Ze<0?Ze=a.length-1:Ze>=a.length&&(Ze=0),be=a[Ze].disabled;V.set(Ze)}}),hr(()=>{if(u){const{index:Ce,text:Ze}=a.filter(be=>be.id===u)[0];G("close",{index:Ce,text:Ze}),n(0,g=!1)}if(g){const{width:Ce,height:Ze}=D.getBoundingClientRect();n(20,K=Ce),!x&&o<0&&R.focus(),k&&(n(3,R.style.left="auto",R),n(3,R.style.right=0,R)),h==="top"?(n(3,R.style.top="auto",R),n(3,R.style.bottom=Ze+"px",R)):h==="bottom"&&n(3,R.style.top=Ze+"px",R),N&&(n(3,R.style.top=Ze+10+"px",R),n(3,R.style.left="-11px",R))}g||(B.set([]),$.set(void 0),V.set(0)),x=!1});function ie(Ce){te.call(this,t,Ce)}function X(Ce){te.call(this,t,Ce)}function ce(Ce){te.call(this,t,Ce)}function ae(Ce){te.call(this,t,Ce)}function ee(Ce){te.call(this,t,Ce)}const he=({target:Ce})=>{D&&D.contains(Ce)||R&&!R.contains(Ce)&&n(0,g=!1)};function ne(Ce){xe[Ce?"unshift":"push"](()=>{R=Ce,n(3,R)})}function re(Ce){xe[Ce?"unshift":"push"](()=>{D=Ce,n(2,D)})}const oe=({target:Ce})=>{R&&R.contains(Ce)||(n(0,g=!g),g||G("close"))},Re=Ce=>{g&&(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(Ce.key)?Ce.preventDefault():Ce.key==="Escape"&&(Ce.stopPropagation(),G("close"),n(0,g=!1),D.focus()))},qe=Ce=>{g&&(D.contains(Ce.relatedTarget)||(G("close"),n(0,g=!1)))};return t.$$set=Ce=>{n(39,e=Z(Z({},e),Te(Ce))),n(19,s=de(e,r)),"size"in Ce&&n(4,d=Ce.size),"direction"in Ce&&n(5,h=Ce.direction),"open"in Ce&&n(0,g=Ce.open),"light"in Ce&&n(6,_=Ce.light),"flipped"in Ce&&n(7,k=Ce.flipped),"menuOptionsClass"in Ce&&n(8,y=Ce.menuOptionsClass),"icon"in Ce&&n(1,T=Ce.icon),"iconClass"in Ce&&n(9,M=Ce.iconClass),"iconDescription"in Ce&&n(10,A=Ce.iconDescription),"id"in Ce&&n(11,C=Ce.id),"buttonRef"in Ce&&n(2,D=Ce.buttonRef),"menuRef"in Ce&&n(3,R=Ce.menuRef),"$$scope"in Ce&&n(23,c=Ce.$$scope)},t.$$.update=()=>{n(13,i=e["aria-label"]||"menu"),t.$$.dirty[0]&6291456&&a[o]&&q.set(a[o].id),t.$$.dirty[0]&1050624&&n(12,l=``)},N&&n(1,T=bz),e=Te(e),[g,T,D,R,d,h,_,k,y,M,A,C,l,i,N,G,B,$,V,s,K,o,a,c,f,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe]}class Tz extends Oe{constructor(e){super(),Ee(this,e,yz,wz,Se,{size:4,direction:5,open:0,light:6,flipped:7,menuOptionsClass:8,icon:1,iconClass:9,iconDescription:10,id:11,buttonRef:2,menuRef:3},null,[-1,-1])}}const Wu=Tz;function Sz(t){let e,n,i,l;const r=t[16].default,s=He(r,t,t[15],null),o=s||Oz(t);let a=[t[7]],u={};for(let f=0;f{s[d]=null}),fe(),i=s[n],i?i.p(f,c):(i=s[n]=r[n](f),i.c()),p(i,1),i.m(e,null)),we(e,u=Pe(a,[{role:"none"},(!l||c&64)&&{id:f[6]},c&2048&&f[11]])),S(e,"bx--overflow-menu-options__option",!0),S(e,"bx--overflow-menu--divider",f[4]),S(e,"bx--overflow-menu-options__option--danger",f[5]),S(e,"bx--overflow-menu-options__option--disabled",f[3])},i(f){l||(p(i),l=!0)},o(f){v(i),l=!1},d(f){f&&E(e),s[n].d()}}}function Az(t,e,n){let i;const l=["text","href","primaryFocus","disabled","hasDivider","danger","requireTitle","id","ref"];let r=de(e,l),s,{$$slots:o={},$$scope:a}=e;const u=di(o);let{text:f="Provide text"}=e,{href:c=""}=e,{primaryFocus:d=!1}=e,{disabled:h=!1}=e,{hasDivider:g=!1}=e,{danger:_=!1}=e,{requireTitle:k=!0}=e,{id:y="ccs-"+Math.random().toString(36)}=e,{ref:T=null}=e;const{focusedId:M,add:A,update:C,change:D}=jn("OverflowMenu");ct(t,M,X=>n(14,s=X)),A({id:y,text:f,primaryFocus:d,disabled:h}),hr(()=>{T&&d&&T.focus()});function R(X){te.call(this,t,X)}function N(X){te.call(this,t,X)}function G(X){te.call(this,t,X)}function B(X){te.call(this,t,X)}function $(X){xe[X?"unshift":"push"](()=>{T=X,n(0,T)})}const q=()=>{C(y)},V=({key:X})=>{X==="ArrowDown"?D(1):X==="ArrowUp"&&D(-1)};function K(X){xe[X?"unshift":"push"](()=>{T=X,n(0,T)})}const x=()=>{C(y)},ie=({key:X})=>{X==="ArrowDown"?D(1):X==="ArrowUp"&&D(-1)};return t.$$set=X=>{e=Z(Z({},e),Te(X)),n(11,r=de(e,l)),"text"in X&&n(1,f=X.text),"href"in X&&n(2,c=X.href),"primaryFocus"in X&&n(12,d=X.primaryFocus),"disabled"in X&&n(3,h=X.disabled),"hasDivider"in X&&n(4,g=X.hasDivider),"danger"in X&&n(5,_=X.danger),"requireTitle"in X&&n(13,k=X.requireTitle),"id"in X&&n(6,y=X.id),"ref"in X&&n(0,T=X.ref),"$$scope"in X&&n(15,a=X.$$scope)},t.$$.update=()=>{t.$$.dirty&16448&&n(12,d=s===y),t.$$.dirty&8206&&n(7,i={role:"menuitem",tabindex:"-1",class:"bx--overflow-menu-options__btn",disabled:c?void 0:h,href:c||void 0,title:k?u.default?void 0:f:void 0})},[T,f,c,h,g,_,y,i,M,C,D,r,d,k,s,a,o,R,N,G,B,$,q,V,K,x,ie]}class Lz extends Oe{constructor(e){super(),Ee(this,e,Az,Cz,Se,{text:1,href:2,primaryFocus:12,disabled:3,hasDivider:4,danger:5,requireTitle:13,id:6,ref:0})}}const Al=Lz;function xb(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Dz(t){let e,n,i,l=t[1]&&xb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Rz extends Oe{constructor(e){super(),Ee(this,e,Iz,Dz,Se,{size:0,title:1})}}const XT=Rz;function Pz(t){let e,n,i,l,r,s,o=t[0]&&e2(t),a=[{"aria-atomic":"true"},{"aria-live":s=t[1]?"assertive":"off"},t[5]],u={};for(let f=0;f{e=Z(Z({},e),Te(f)),n(5,r=de(e,l)),"small"in f&&n(0,s=f.small),"active"in f&&n(1,o=f.active),"withOverlay"in f&&n(2,a=f.withOverlay),"description"in f&&n(3,u=f.description)},t.$$.update=()=>{t.$$.dirty&1&&n(4,i=s?"42":"44")},[s,o,a,u,i,r]}class Hz extends Oe{constructor(e){super(),Ee(this,e,zz,Bz,Se,{small:0,active:1,withOverlay:2,description:3})}}const KT=Hz;function Uz(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{o=_,n(0,o)})}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(1,l=de(e,i)),"ref"in _&&n(0,o=_.ref),"$$scope"in _&&n(2,s=_.$$scope)},[o,l,s,r,a,u,f,c,d,h,g]}class Gz extends Oe{constructor(e){super(),Ee(this,e,Fz,Uz,Se,{ref:0})}}const Vz=Gz;function Wz(t){let e;const n=t[1].default,i=He(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,null):Ge(l[8]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function jz(t){let e,n;const i=[t[0],{class:"bx--form--fluid "+t[0].class}];let l={$$slots:{default:[Wz]},$$scope:{ctx:t}};for(let r=0;r{e=Z(Z({},e),Te(h)),n(0,l=de(e,i)),"$$scope"in h&&n(8,s=h.$$scope)},[l,r,o,a,u,f,c,d,s]}class qz extends Oe{constructor(e){super(),Ee(this,e,$z,jz,Se,{})}}const JT=qz;function n2(t){let e,n,i;return{c(){e=P("legend"),n=j(t[4]),I(e,"id",i=t[5]||t[6]["aria-labelledby"]),S(e,"bx--label",!0)},m(l,r){O(l,e,r),w(e,n)},p(l,r){r&16&&Y(n,l[4]),r&96&&i!==(i=l[5]||l[6]["aria-labelledby"])&&I(e,"id",i)},d(l){l&&E(e)}}}function i2(t){let e,n;return{c(){e=P("div"),n=j(t[3]),S(e,"bx--form__requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&8&&Y(n,i[3])},d(i){i&&E(e)}}}function Yz(t){let e,n,i,l,r,s,o,a,u=t[4]&&n2(t);const f=t[8].default,c=He(f,t,t[7],null);let d=t[2]&&i2(t),h=[{"data-invalid":l=t[1]||void 0},{"aria-labelledby":r=t[6]["aria-labelledby"]||t[5]},t[6]],g={};for(let _=0;_{e=Z(Z({},e),Te(y)),n(6,l=de(e,i)),"noMargin"in y&&n(0,o=y.noMargin),"invalid"in y&&n(1,a=y.invalid),"message"in y&&n(2,u=y.message),"messageText"in y&&n(3,f=y.messageText),"legendText"in y&&n(4,c=y.legendText),"legendId"in y&&n(5,d=y.legendId),"$$scope"in y&&n(7,s=y.$$scope)},[o,a,u,f,c,d,l,s,r,h,g,_,k]}class Xz extends Oe{constructor(e){super(),Ee(this,e,Zz,Yz,Se,{noMargin:0,invalid:1,message:2,messageText:3,legendText:4,legendId:5})}}const dc=Xz;function Kz(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[{for:t[0]},t[1]],a={};for(let u=0;u{e=Z(Z({},e),Te(d)),n(1,l=de(e,i)),"id"in d&&n(0,o=d.id),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class Qz extends Oe{constructor(e){super(),Ee(this,e,Jz,Kz,Se,{id:0})}}const xz=Qz,eH=t=>({props:t&2}),l2=t=>({props:t[1]});function tH(t){let e,n;const i=t[9].default,l=He(i,t,t[8],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function lH(t,e,n){let i;const l=["as","condensed","narrow","noGutter","noGutterLeft","noGutterRight","padding"];let r=de(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{noGutter:c=!1}=e,{noGutterLeft:d=!1}=e,{noGutterRight:h=!1}=e,{padding:g=!1}=e;return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(10,r=de(e,l)),"as"in _&&n(0,a=_.as),"condensed"in _&&n(2,u=_.condensed),"narrow"in _&&n(3,f=_.narrow),"noGutter"in _&&n(4,c=_.noGutter),"noGutterLeft"in _&&n(5,d=_.noGutterLeft),"noGutterRight"in _&&n(6,h=_.noGutterRight),"padding"in _&&n(7,g=_.padding),"$$scope"in _&&n(8,o=_.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--row",u&&"bx--row--condensed",f&&"bx--row--narrow",c&&"bx--no-gutter",d&&"bx--no-gutter--left",h&&"bx--no-gutter--right",g&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,o,s]}class rH extends Oe{constructor(e){super(),Ee(this,e,lH,iH,Se,{as:0,condensed:2,narrow:3,noGutter:4,noGutterLeft:5,noGutterRight:6,padding:7})}}const Ac=rH,sH=t=>({props:t&2}),r2=t=>({props:t[1]});function oH(t){let e,n;const i=t[14].default,l=He(i,t,t[13],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function fH(t,e,n){let i,l;const r=["as","noGutter","noGutterLeft","noGutterRight","padding","aspectRatio","sm","md","lg","xlg","max"];let s=de(e,r),{$$slots:o={},$$scope:a}=e,{as:u=!1}=e,{noGutter:f=!1}=e,{noGutterLeft:c=!1}=e,{noGutterRight:d=!1}=e,{padding:h=!1}=e,{aspectRatio:g=void 0}=e,{sm:_=void 0}=e,{md:k=void 0}=e,{lg:y=void 0}=e,{xlg:T=void 0}=e,{max:M=void 0}=e;const A=["sm","md","lg","xlg","max"];return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(16,s=de(e,r)),"as"in C&&n(0,u=C.as),"noGutter"in C&&n(2,f=C.noGutter),"noGutterLeft"in C&&n(3,c=C.noGutterLeft),"noGutterRight"in C&&n(4,d=C.noGutterRight),"padding"in C&&n(5,h=C.padding),"aspectRatio"in C&&n(6,g=C.aspectRatio),"sm"in C&&n(7,_=C.sm),"md"in C&&n(8,k=C.md),"lg"in C&&n(9,y=C.lg),"xlg"in C&&n(10,T=C.xlg),"max"in C&&n(11,M=C.max),"$$scope"in C&&n(13,a=C.$$scope)},t.$$.update=()=>{t.$$.dirty&3968&&n(12,i=[_,k,y,T,M].map((C,D)=>{const R=A[D];if(C===!0)return`bx--col-${R}`;if(typeof C=="number")return`bx--col-${R}-${C}`;if(typeof C=="object"){let N=[];return typeof C.span=="number"?N=[...N,`bx--col-${R}-${C.span}`]:C.span===!0&&(N=[...N,`bx--col-${R}`]),typeof C.offset=="number"&&(N=[...N,`bx--offset-${R}-${C.offset}`]),N.join(" ")}}).filter(Boolean).join(" ")),n(1,l={...s,class:[s.class,i,!i&&"bx--col",f&&"bx--no-gutter",c&&"bx--no-gutter--left",d&&"bx--no-gutter--right",g&&`bx--aspect-ratio bx--aspect-ratio--${g}`,h&&"bx--col-padding"].filter(Boolean).join(" ")})},[u,l,f,c,d,h,g,_,k,y,T,M,i,a,o]}class cH extends Oe{constructor(e){super(),Ee(this,e,fH,uH,Se,{as:0,noGutter:2,noGutterLeft:3,noGutterRight:4,padding:5,aspectRatio:6,sm:7,md:8,lg:9,xlg:10,max:11})}}const Gr=cH;function dH(t){const e=t-1;return e*e*e+1}function s2(t,{delay:e=0,duration:n=400,easing:i=dH,axis:l="y"}={}){const r=getComputedStyle(t),s=+r.opacity,o=l==="y"?"height":"width",a=parseFloat(r[o]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(r[`padding${f[0]}`]),d=parseFloat(r[`padding${f[1]}`]),h=parseFloat(r[`margin${f[0]}`]),g=parseFloat(r[`margin${f[1]}`]),_=parseFloat(r[`border${f[0]}Width`]),k=parseFloat(r[`border${f[1]}Width`]);return{delay:e,duration:n,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*s};${o}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*_}px;border-${u[1]}-width: ${y*k}px;`}}function o2(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function hH(t){let e,n,i,l=t[1]&&o2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class gH extends Oe{constructor(e){super(),Ee(this,e,mH,hH,Se,{size:0,title:1})}}const QT=gH;function _H(t){let e,n;return e=new KT({props:{small:!0,description:t[2],withOverlay:!1,active:t[0]==="active"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.description=i[2]),l&1&&(r.active=i[0]==="active"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function pH(t){let e,n;return e=new XT({props:{class:"bx--inline-loading__checkmark-container",title:t[2]||t[0]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bH(t){let e,n;return e=new QT({props:{class:"bx--inline-loading--error",title:t[2]||t[0]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function a2(t){let e,n;return{c(){e=P("div"),n=j(t[1]),S(e,"bx--inline-loading__text",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function vH(t){let e,n,i,l,r,s,o,a;const u=[bH,pH,_H],f=[];function c(_,k){return _[0]==="error"?0:_[0]==="finished"?1:_[0]==="inactive"||_[0]==="active"?2:-1}~(i=c(t))&&(l=f[i]=u[i](t));let d=t[1]&&a2(t),h=[{"aria-live":"assertive"},t[3]],g={};for(let _=0;_{f[y]=null}),fe()),~i?(l=f[i],l?l.p(_,k):(l=f[i]=u[i](_),l.c()),p(l,1),l.m(n,null)):l=null),_[1]?d?d.p(_,k):(d=a2(_),d.c(),d.m(e,null)):d&&(d.d(1),d=null),we(e,g=Pe(h,[{"aria-live":"assertive"},k&8&&_[3]])),S(e,"bx--inline-loading",!0)},i(_){s||(p(l),s=!0)},o(_){v(l),s=!1},d(_){_&&E(e),~i&&f[i].d(),d&&d.d(),o=!1,ut(a)}}}function kH(t,e,n){const i=["status","description","iconDescription","successDelay"];let l=de(e,i),{status:r="active"}=e,{description:s=void 0}=e,{iconDescription:o=void 0}=e,{successDelay:a=1500}=e;const u=on();let f;sn(()=>()=>{clearTimeout(f)}),hr(()=>{r==="finished"&&(f=setTimeout(()=>{u("success")},a))});function c(_){te.call(this,t,_)}function d(_){te.call(this,t,_)}function h(_){te.call(this,t,_)}function g(_){te.call(this,t,_)}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(3,l=de(e,i)),"status"in _&&n(0,r=_.status),"description"in _&&n(1,s=_.description),"iconDescription"in _&&n(2,o=_.iconDescription),"successDelay"in _&&n(4,a=_.successDelay)},[r,s,o,l,a,c,d,h,g]}class wH extends Oe{constructor(e){super(),Ee(this,e,kH,vH,Se,{status:0,description:1,iconDescription:2,successDelay:4})}}const Wi=wH;function u2(t,e,n){const i=t.slice();return i[74]=e[n],i[76]=n,i}const yH=t=>({item:t[0]&1610616832,index:t[0]&1610616832}),f2=t=>({slot:"labelText",item:t[74],index:t[76]}),TH=t=>({}),c2=t=>({});function d2(t){let e,n;const i=t[46].titleText,l=He(i,t,t[68],c2),r=l||SH(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[26]),S(e,"bx--label",!0),S(e,"bx--label--disabled",t[11]),S(e,"bx--visually-hidden",t[25])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&64)&&Fe(l,i,s,s[68],n?Ue(i,s[68],o,TH):Ge(s[68]),c2):r&&r.p&&(!n||o[0]&131072)&&r.p(s,n?o:[-1,-1,-1]),(!n||o[0]&67108864)&&I(e,"for",s[26]),(!n||o[0]&2048)&&S(e,"bx--label--disabled",s[11]),(!n||o[0]&33554432)&&S(e,"bx--visually-hidden",s[25])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function SH(t){let e;return{c(){e=j(t[17])},m(n,i){O(n,e,i)},p(n,i){i[0]&131072&&Y(e,n[17])},d(n){n&&E(e)}}}function h2(t){let e,n;return e=new Ds({props:{class:"bx--list-box__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function m2(t){let e,n;return e=new Vu({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function g2(t){let e,n;return e=new WT({props:{selectionCount:t[31].length,translateWithId:t[16],disabled:t[11]}}),e.$on("clear",t[53]),e.$on("clear",t[54]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&1&&(r.selectionCount=i[31].length),l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _2(t){let e,n,i,l,r,s,o,a,u=[t[38],{role:"combobox"},{tabindex:"0"},{autocomplete:"off"},{"aria-autocomplete":"list"},{"aria-expanded":t[1]},{"aria-activedescendant":t[6]},{"aria-disabled":t[11]},{"aria-controls":t[34]},{disabled:t[11]},{placeholder:t[14]},{id:t[26]},{name:t[27]}],f={};for(let h=0;h{c=null}),fe()),h[0]?d?(d.p(h,g),g[0]&1&&p(d,1)):(d=b2(h),d.c(),p(d,1),d.m(l.parentNode,l)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const _={};g[0]&2&&(_.style="pointer-events: "+(h[1]?"auto":"none")),g[0]&32768&&(_.translateWithId=h[15]),g[0]&2&&(_.open=h[1]),r.$set(_)},i(h){s||(p(c),p(d),p(r.$$.fragment,h),s=!0)},o(h){v(c),v(d),v(r.$$.fragment,h),s=!1},d(h){h&&(E(e),E(n),E(i),E(l)),t[55](null),c&&c.d(h),d&&d.d(h),H(r,h),o=!1,ut(a)}}}function p2(t){let e,n;return e=new Ds({props:{class:"bx--list-box__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function b2(t){let e,n;return e=new WT({props:{translateWithId:t[16],disabled:t[11],open:t[1]}}),e.$on("clear",t[58]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),l[0]&2&&(r.open=i[1]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function v2(t){let e,n,i,l,r;return l=new VT({props:{open:t[1],translateWithId:t[15]}}),{c(){e=P("span"),n=j(t[24]),i=F(),U(l.$$.fragment),S(e,"bx--list-box__label",!0)},m(s,o){O(s,e,o),w(e,n),O(s,i,o),z(l,s,o),r=!0},p(s,o){(!r||o[0]&16777216)&&Y(n,s[24]);const a={};o[0]&2&&(a.open=s[1]),o[0]&32768&&(a.translateWithId=s[15]),l.$set(a)},i(s){r||(p(l.$$.fragment,s),r=!0)},o(s){v(l.$$.fragment,s),r=!1},d(s){s&&(E(e),E(i)),H(l,s)}}}function EH(t){let e,n,i,l,r=t[31].length>0&&g2(t),s=t[12]&&_2(t),o=!t[12]&&v2(t);return{c(){r&&r.c(),e=F(),s&&s.c(),n=F(),o&&o.c(),i=je()},m(a,u){r&&r.m(a,u),O(a,e,u),s&&s.m(a,u),O(a,n,u),o&&o.m(a,u),O(a,i,u),l=!0},p(a,u){a[31].length>0?r?(r.p(a,u),u[1]&1&&p(r,1)):(r=g2(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[12]?s?(s.p(a,u),u[0]&4096&&p(s,1)):(s=_2(a),s.c(),p(s,1),s.m(n.parentNode,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[12]?o&&(ue(),v(o,1,1,()=>{o=null}),fe()):o?(o.p(a,u),u[0]&4096&&p(o,1)):(o=v2(a),o.c(),p(o,1),o.m(i.parentNode,i))},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&(E(e),E(n),E(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function k2(t){let e,n;return e=new yP({props:{"aria-label":t[32],id:t[26],"aria-multiselectable":"true",$$slots:{default:[AH]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&2&&(r["aria-label"]=i[32]),l[0]&67108864&&(r.id=i[26]),l[0]&1879314834|l[2]&64&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OH(t){let e=t[7](t[74])+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&1610616960&&e!==(e=i[7](i[74])+"")&&Y(n,e)},d(i){i&&E(n)}}}function MH(t){let e;const n=t[46].default,i=He(n,t,t[68],f2),l=i||OH(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s[0]&1610616832|s[2]&64)&&Fe(i,n,r,r[68],e?Ue(n,r[68],s,yH):Ge(r[68]),f2):l&&l.p&&(!e||s[0]&1610616960)&&l.p(r,e?s:[-1,-1,-1])},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function CH(t){let e,n,i;const l=[{name:t[74].id},{title:t[18]?t[7](t[74]):void 0},t[8](t[74]),{readonly:!0},{tabindex:"-1"},{id:"checkbox-"+t[74].id},{checked:t[74].checked},{disabled:t[74].disabled}];function r(){return t[64](t[76])}let s={$$slots:{labelText:[MH]},$$scope:{ctx:t}};for(let o=0;oo[74].id;for(let o=0;o{o=null}),fe()),!f[19]&&f[21]?a?c[0]&2621440&&p(a,1):(a=m2(),a.c(),p(a,1),a.m(n.parentNode,n)):a&&(ue(),v(a,1,1,()=>{a=null}),fe());const d={};c[0]&2&&(d["aria-expanded"]=f[1]),c[0]&67108864&&(d.id=f[26]),c[0]&2048&&(d.disabled=f[11]),c[0]&32768&&(d.translateWithId=f[15]),c[0]&755628119|c[1]&137|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),f[1]?u?(u.p(f,c),c[0]&2&&p(u,1)):(u=k2(f),u.c(),p(u,1),u.m(r.parentNode,r)):u&&(ue(),v(u,1,1,()=>{u=null}),fe())},i(f){s||(p(o),p(a),p(i.$$.fragment,f),p(u),s=!0)},o(f){v(o),v(a),v(i.$$.fragment,f),v(u),s=!1},d(f){f&&(E(e),E(n),E(l),E(r)),o&&o.d(f),a&&a.d(f),H(i,f),u&&u.d(f)}}}function y2(t){let e,n;return{c(){e=P("div"),n=j(t[23]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[11])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&8388608&&Y(n,i[23]),l[0]&2048&&S(e,"bx--form__helper-text--disabled",i[11])},d(i){i&&E(e)}}}function DH(t){let e,n,i,l,r,s,o,a=(t[17]||t[37].titleText)&&d2(t);i=new mP({props:{role:void 0,disabled:t[11],invalid:t[19],invalidText:t[20],open:t[1],light:t[13],size:t[9],warn:t[21],warnText:t[22],class:"bx--multi-select "+(t[10]==="top"&&"bx--list-box--up")+" "+(t[12]&&"bx--combo-box")+` + `)},N&&n(1,T=bz),e=Te(e),[g,T,D,R,d,h,_,k,y,M,A,C,l,i,N,G,B,j,V,s,K,o,a,c,f,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe]}class Tz extends Oe{constructor(e){super(),Ee(this,e,yz,wz,Se,{size:4,direction:5,open:0,light:6,flipped:7,menuOptionsClass:8,icon:1,iconClass:9,iconDescription:10,id:11,buttonRef:2,menuRef:3},null,[-1,-1])}}const Wu=Tz;function Sz(t){let e,n,i,l;const r=t[16].default,s=He(r,t,t[15],null),o=s||Oz(t);let a=[t[7]],u={};for(let f=0;f{s[d]=null}),fe(),i=s[n],i?i.p(f,c):(i=s[n]=r[n](f),i.c()),p(i,1),i.m(e,null)),we(e,u=Pe(a,[{role:"none"},(!l||c&64)&&{id:f[6]},c&2048&&f[11]])),S(e,"bx--overflow-menu-options__option",!0),S(e,"bx--overflow-menu--divider",f[4]),S(e,"bx--overflow-menu-options__option--danger",f[5]),S(e,"bx--overflow-menu-options__option--disabled",f[3])},i(f){l||(p(i),l=!0)},o(f){v(i),l=!1},d(f){f&&E(e),s[n].d()}}}function Az(t,e,n){let i;const l=["text","href","primaryFocus","disabled","hasDivider","danger","requireTitle","id","ref"];let r=de(e,l),s,{$$slots:o={},$$scope:a}=e;const u=di(o);let{text:f="Provide text"}=e,{href:c=""}=e,{primaryFocus:d=!1}=e,{disabled:h=!1}=e,{hasDivider:g=!1}=e,{danger:_=!1}=e,{requireTitle:k=!0}=e,{id:y="ccs-"+Math.random().toString(36)}=e,{ref:T=null}=e;const{focusedId:M,add:A,update:C,change:D}=jn("OverflowMenu");ct(t,M,X=>n(14,s=X)),A({id:y,text:f,primaryFocus:d,disabled:h}),hr(()=>{T&&d&&T.focus()});function R(X){te.call(this,t,X)}function N(X){te.call(this,t,X)}function G(X){te.call(this,t,X)}function B(X){te.call(this,t,X)}function j(X){xe[X?"unshift":"push"](()=>{T=X,n(0,T)})}const q=()=>{C(y)},V=({key:X})=>{X==="ArrowDown"?D(1):X==="ArrowUp"&&D(-1)};function K(X){xe[X?"unshift":"push"](()=>{T=X,n(0,T)})}const x=()=>{C(y)},ie=({key:X})=>{X==="ArrowDown"?D(1):X==="ArrowUp"&&D(-1)};return t.$$set=X=>{e=Z(Z({},e),Te(X)),n(11,r=de(e,l)),"text"in X&&n(1,f=X.text),"href"in X&&n(2,c=X.href),"primaryFocus"in X&&n(12,d=X.primaryFocus),"disabled"in X&&n(3,h=X.disabled),"hasDivider"in X&&n(4,g=X.hasDivider),"danger"in X&&n(5,_=X.danger),"requireTitle"in X&&n(13,k=X.requireTitle),"id"in X&&n(6,y=X.id),"ref"in X&&n(0,T=X.ref),"$$scope"in X&&n(15,a=X.$$scope)},t.$$.update=()=>{t.$$.dirty&16448&&n(12,d=s===y),t.$$.dirty&8206&&n(7,i={role:"menuitem",tabindex:"-1",class:"bx--overflow-menu-options__btn",disabled:c?void 0:h,href:c||void 0,title:k?u.default?void 0:f:void 0})},[T,f,c,h,g,_,y,i,M,C,D,r,d,k,s,a,o,R,N,G,B,j,q,V,K,x,ie]}class Lz extends Oe{constructor(e){super(),Ee(this,e,Az,Cz,Se,{text:1,href:2,primaryFocus:12,disabled:3,hasDivider:4,danger:5,requireTitle:13,id:6,ref:0})}}const Al=Lz;function xb(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Dz(t){let e,n,i,l=t[1]&&xb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Rz extends Oe{constructor(e){super(),Ee(this,e,Iz,Dz,Se,{size:0,title:1})}}const XT=Rz;function Pz(t){let e,n,i,l,r,s,o=t[0]&&e2(t),a=[{"aria-atomic":"true"},{"aria-live":s=t[1]?"assertive":"off"},t[5]],u={};for(let f=0;f{e=Z(Z({},e),Te(f)),n(5,r=de(e,l)),"small"in f&&n(0,s=f.small),"active"in f&&n(1,o=f.active),"withOverlay"in f&&n(2,a=f.withOverlay),"description"in f&&n(3,u=f.description)},t.$$.update=()=>{t.$$.dirty&1&&n(4,i=s?"42":"44")},[s,o,a,u,i,r]}class Hz extends Oe{constructor(e){super(),Ee(this,e,zz,Bz,Se,{small:0,active:1,withOverlay:2,description:3})}}const KT=Hz;function Uz(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{o=_,n(0,o)})}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(1,l=de(e,i)),"ref"in _&&n(0,o=_.ref),"$$scope"in _&&n(2,s=_.$$scope)},[o,l,s,r,a,u,f,c,d,h,g]}class Gz extends Oe{constructor(e){super(),Ee(this,e,Fz,Uz,Se,{ref:0})}}const Vz=Gz;function Wz(t){let e;const n=t[1].default,i=He(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Fe(i,n,l,l[8],e?Ue(n,l[8],r,null):Ge(l[8]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function jz(t){let e,n;const i=[t[0],{class:"bx--form--fluid "+t[0].class}];let l={$$slots:{default:[Wz]},$$scope:{ctx:t}};for(let r=0;r{e=Z(Z({},e),Te(h)),n(0,l=de(e,i)),"$$scope"in h&&n(8,s=h.$$scope)},[l,r,o,a,u,f,c,d,s]}class qz extends Oe{constructor(e){super(),Ee(this,e,$z,jz,Se,{})}}const JT=qz;function n2(t){let e,n,i;return{c(){e=P("legend"),n=$(t[4]),I(e,"id",i=t[5]||t[6]["aria-labelledby"]),S(e,"bx--label",!0)},m(l,r){O(l,e,r),w(e,n)},p(l,r){r&16&&Y(n,l[4]),r&96&&i!==(i=l[5]||l[6]["aria-labelledby"])&&I(e,"id",i)},d(l){l&&E(e)}}}function i2(t){let e,n;return{c(){e=P("div"),n=$(t[3]),S(e,"bx--form__requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&8&&Y(n,i[3])},d(i){i&&E(e)}}}function Yz(t){let e,n,i,l,r,s,o,a,u=t[4]&&n2(t);const f=t[8].default,c=He(f,t,t[7],null);let d=t[2]&&i2(t),h=[{"data-invalid":l=t[1]||void 0},{"aria-labelledby":r=t[6]["aria-labelledby"]||t[5]},t[6]],g={};for(let _=0;_{e=Z(Z({},e),Te(y)),n(6,l=de(e,i)),"noMargin"in y&&n(0,o=y.noMargin),"invalid"in y&&n(1,a=y.invalid),"message"in y&&n(2,u=y.message),"messageText"in y&&n(3,f=y.messageText),"legendText"in y&&n(4,c=y.legendText),"legendId"in y&&n(5,d=y.legendId),"$$scope"in y&&n(7,s=y.$$scope)},[o,a,u,f,c,d,l,s,r,h,g,_,k]}class Xz extends Oe{constructor(e){super(),Ee(this,e,Zz,Yz,Se,{noMargin:0,invalid:1,message:2,messageText:3,legendText:4,legendId:5})}}const dc=Xz;function Kz(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[{for:t[0]},t[1]],a={};for(let u=0;u{e=Z(Z({},e),Te(d)),n(1,l=de(e,i)),"id"in d&&n(0,o=d.id),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class Qz extends Oe{constructor(e){super(),Ee(this,e,Jz,Kz,Se,{id:0})}}const xz=Qz,eH=t=>({props:t&2}),l2=t=>({props:t[1]});function tH(t){let e,n;const i=t[9].default,l=He(i,t,t[8],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function lH(t,e,n){let i;const l=["as","condensed","narrow","noGutter","noGutterLeft","noGutterRight","padding"];let r=de(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{noGutter:c=!1}=e,{noGutterLeft:d=!1}=e,{noGutterRight:h=!1}=e,{padding:g=!1}=e;return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(10,r=de(e,l)),"as"in _&&n(0,a=_.as),"condensed"in _&&n(2,u=_.condensed),"narrow"in _&&n(3,f=_.narrow),"noGutter"in _&&n(4,c=_.noGutter),"noGutterLeft"in _&&n(5,d=_.noGutterLeft),"noGutterRight"in _&&n(6,h=_.noGutterRight),"padding"in _&&n(7,g=_.padding),"$$scope"in _&&n(8,o=_.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--row",u&&"bx--row--condensed",f&&"bx--row--narrow",c&&"bx--no-gutter",d&&"bx--no-gutter--left",h&&"bx--no-gutter--right",g&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,o,s]}class rH extends Oe{constructor(e){super(),Ee(this,e,lH,iH,Se,{as:0,condensed:2,narrow:3,noGutter:4,noGutterLeft:5,noGutterRight:6,padding:7})}}const Ac=rH,sH=t=>({props:t&2}),r2=t=>({props:t[1]});function oH(t){let e,n;const i=t[14].default,l=He(i,t,t[13],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function fH(t,e,n){let i,l;const r=["as","noGutter","noGutterLeft","noGutterRight","padding","aspectRatio","sm","md","lg","xlg","max"];let s=de(e,r),{$$slots:o={},$$scope:a}=e,{as:u=!1}=e,{noGutter:f=!1}=e,{noGutterLeft:c=!1}=e,{noGutterRight:d=!1}=e,{padding:h=!1}=e,{aspectRatio:g=void 0}=e,{sm:_=void 0}=e,{md:k=void 0}=e,{lg:y=void 0}=e,{xlg:T=void 0}=e,{max:M=void 0}=e;const A=["sm","md","lg","xlg","max"];return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(16,s=de(e,r)),"as"in C&&n(0,u=C.as),"noGutter"in C&&n(2,f=C.noGutter),"noGutterLeft"in C&&n(3,c=C.noGutterLeft),"noGutterRight"in C&&n(4,d=C.noGutterRight),"padding"in C&&n(5,h=C.padding),"aspectRatio"in C&&n(6,g=C.aspectRatio),"sm"in C&&n(7,_=C.sm),"md"in C&&n(8,k=C.md),"lg"in C&&n(9,y=C.lg),"xlg"in C&&n(10,T=C.xlg),"max"in C&&n(11,M=C.max),"$$scope"in C&&n(13,a=C.$$scope)},t.$$.update=()=>{t.$$.dirty&3968&&n(12,i=[_,k,y,T,M].map((C,D)=>{const R=A[D];if(C===!0)return`bx--col-${R}`;if(typeof C=="number")return`bx--col-${R}-${C}`;if(typeof C=="object"){let N=[];return typeof C.span=="number"?N=[...N,`bx--col-${R}-${C.span}`]:C.span===!0&&(N=[...N,`bx--col-${R}`]),typeof C.offset=="number"&&(N=[...N,`bx--offset-${R}-${C.offset}`]),N.join(" ")}}).filter(Boolean).join(" ")),n(1,l={...s,class:[s.class,i,!i&&"bx--col",f&&"bx--no-gutter",c&&"bx--no-gutter--left",d&&"bx--no-gutter--right",g&&`bx--aspect-ratio bx--aspect-ratio--${g}`,h&&"bx--col-padding"].filter(Boolean).join(" ")})},[u,l,f,c,d,h,g,_,k,y,T,M,i,a,o]}class cH extends Oe{constructor(e){super(),Ee(this,e,fH,uH,Se,{as:0,noGutter:2,noGutterLeft:3,noGutterRight:4,padding:5,aspectRatio:6,sm:7,md:8,lg:9,xlg:10,max:11})}}const Gr=cH;function dH(t){const e=t-1;return e*e*e+1}function s2(t,{delay:e=0,duration:n=400,easing:i=dH,axis:l="y"}={}){const r=getComputedStyle(t),s=+r.opacity,o=l==="y"?"height":"width",a=parseFloat(r[o]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(r[`padding${f[0]}`]),d=parseFloat(r[`padding${f[1]}`]),h=parseFloat(r[`margin${f[0]}`]),g=parseFloat(r[`margin${f[1]}`]),_=parseFloat(r[`border${f[0]}Width`]),k=parseFloat(r[`border${f[1]}Width`]);return{delay:e,duration:n,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*s};${o}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*_}px;border-${u[1]}-width: ${y*k}px;`}}function o2(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function hH(t){let e,n,i,l=t[1]&&o2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class gH extends Oe{constructor(e){super(),Ee(this,e,mH,hH,Se,{size:0,title:1})}}const QT=gH;function _H(t){let e,n;return e=new KT({props:{small:!0,description:t[2],withOverlay:!1,active:t[0]==="active"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.description=i[2]),l&1&&(r.active=i[0]==="active"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function pH(t){let e,n;return e=new XT({props:{class:"bx--inline-loading__checkmark-container",title:t[2]||t[0]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bH(t){let e,n;return e=new QT({props:{class:"bx--inline-loading--error",title:t[2]||t[0]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function a2(t){let e,n;return{c(){e=P("div"),n=$(t[1]),S(e,"bx--inline-loading__text",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function vH(t){let e,n,i,l,r,s,o,a;const u=[bH,pH,_H],f=[];function c(_,k){return _[0]==="error"?0:_[0]==="finished"?1:_[0]==="inactive"||_[0]==="active"?2:-1}~(i=c(t))&&(l=f[i]=u[i](t));let d=t[1]&&a2(t),h=[{"aria-live":"assertive"},t[3]],g={};for(let _=0;_{f[y]=null}),fe()),~i?(l=f[i],l?l.p(_,k):(l=f[i]=u[i](_),l.c()),p(l,1),l.m(n,null)):l=null),_[1]?d?d.p(_,k):(d=a2(_),d.c(),d.m(e,null)):d&&(d.d(1),d=null),we(e,g=Pe(h,[{"aria-live":"assertive"},k&8&&_[3]])),S(e,"bx--inline-loading",!0)},i(_){s||(p(l),s=!0)},o(_){v(l),s=!1},d(_){_&&E(e),~i&&f[i].d(),d&&d.d(),o=!1,ut(a)}}}function kH(t,e,n){const i=["status","description","iconDescription","successDelay"];let l=de(e,i),{status:r="active"}=e,{description:s=void 0}=e,{iconDescription:o=void 0}=e,{successDelay:a=1500}=e;const u=nn();let f;on(()=>()=>{clearTimeout(f)}),hr(()=>{r==="finished"&&(f=setTimeout(()=>{u("success")},a))});function c(_){te.call(this,t,_)}function d(_){te.call(this,t,_)}function h(_){te.call(this,t,_)}function g(_){te.call(this,t,_)}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(3,l=de(e,i)),"status"in _&&n(0,r=_.status),"description"in _&&n(1,s=_.description),"iconDescription"in _&&n(2,o=_.iconDescription),"successDelay"in _&&n(4,a=_.successDelay)},[r,s,o,l,a,c,d,h,g]}class wH extends Oe{constructor(e){super(),Ee(this,e,kH,vH,Se,{status:0,description:1,iconDescription:2,successDelay:4})}}const Wi=wH;function u2(t,e,n){const i=t.slice();return i[74]=e[n],i[76]=n,i}const yH=t=>({item:t[0]&1610616832,index:t[0]&1610616832}),f2=t=>({slot:"labelText",item:t[74],index:t[76]}),TH=t=>({}),c2=t=>({});function d2(t){let e,n;const i=t[46].titleText,l=He(i,t,t[68],c2),r=l||SH(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[26]),S(e,"bx--label",!0),S(e,"bx--label--disabled",t[11]),S(e,"bx--visually-hidden",t[25])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&64)&&Fe(l,i,s,s[68],n?Ue(i,s[68],o,TH):Ge(s[68]),c2):r&&r.p&&(!n||o[0]&131072)&&r.p(s,n?o:[-1,-1,-1]),(!n||o[0]&67108864)&&I(e,"for",s[26]),(!n||o[0]&2048)&&S(e,"bx--label--disabled",s[11]),(!n||o[0]&33554432)&&S(e,"bx--visually-hidden",s[25])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function SH(t){let e;return{c(){e=$(t[17])},m(n,i){O(n,e,i)},p(n,i){i[0]&131072&&Y(e,n[17])},d(n){n&&E(e)}}}function h2(t){let e,n;return e=new Ds({props:{class:"bx--list-box__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function m2(t){let e,n;return e=new Vu({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function g2(t){let e,n;return e=new WT({props:{selectionCount:t[31].length,translateWithId:t[16],disabled:t[11]}}),e.$on("clear",t[53]),e.$on("clear",t[54]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&1&&(r.selectionCount=i[31].length),l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _2(t){let e,n,i,l,r,s,o,a,u=[t[38],{role:"combobox"},{tabindex:"0"},{autocomplete:"off"},{"aria-autocomplete":"list"},{"aria-expanded":t[1]},{"aria-activedescendant":t[6]},{"aria-disabled":t[11]},{"aria-controls":t[34]},{disabled:t[11]},{placeholder:t[14]},{id:t[26]},{name:t[27]}],f={};for(let h=0;h{c=null}),fe()),h[0]?d?(d.p(h,g),g[0]&1&&p(d,1)):(d=b2(h),d.c(),p(d,1),d.m(l.parentNode,l)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const _={};g[0]&2&&(_.style="pointer-events: "+(h[1]?"auto":"none")),g[0]&32768&&(_.translateWithId=h[15]),g[0]&2&&(_.open=h[1]),r.$set(_)},i(h){s||(p(c),p(d),p(r.$$.fragment,h),s=!0)},o(h){v(c),v(d),v(r.$$.fragment,h),s=!1},d(h){h&&(E(e),E(n),E(i),E(l)),t[55](null),c&&c.d(h),d&&d.d(h),H(r,h),o=!1,ut(a)}}}function p2(t){let e,n;return e=new Ds({props:{class:"bx--list-box__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function b2(t){let e,n;return e=new WT({props:{translateWithId:t[16],disabled:t[11],open:t[1]}}),e.$on("clear",t[58]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),l[0]&2&&(r.open=i[1]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function v2(t){let e,n,i,l,r;return l=new VT({props:{open:t[1],translateWithId:t[15]}}),{c(){e=P("span"),n=$(t[24]),i=F(),U(l.$$.fragment),S(e,"bx--list-box__label",!0)},m(s,o){O(s,e,o),w(e,n),O(s,i,o),z(l,s,o),r=!0},p(s,o){(!r||o[0]&16777216)&&Y(n,s[24]);const a={};o[0]&2&&(a.open=s[1]),o[0]&32768&&(a.translateWithId=s[15]),l.$set(a)},i(s){r||(p(l.$$.fragment,s),r=!0)},o(s){v(l.$$.fragment,s),r=!1},d(s){s&&(E(e),E(i)),H(l,s)}}}function EH(t){let e,n,i,l,r=t[31].length>0&&g2(t),s=t[12]&&_2(t),o=!t[12]&&v2(t);return{c(){r&&r.c(),e=F(),s&&s.c(),n=F(),o&&o.c(),i=je()},m(a,u){r&&r.m(a,u),O(a,e,u),s&&s.m(a,u),O(a,n,u),o&&o.m(a,u),O(a,i,u),l=!0},p(a,u){a[31].length>0?r?(r.p(a,u),u[1]&1&&p(r,1)):(r=g2(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[12]?s?(s.p(a,u),u[0]&4096&&p(s,1)):(s=_2(a),s.c(),p(s,1),s.m(n.parentNode,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[12]?o&&(ue(),v(o,1,1,()=>{o=null}),fe()):o?(o.p(a,u),u[0]&4096&&p(o,1)):(o=v2(a),o.c(),p(o,1),o.m(i.parentNode,i))},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&(E(e),E(n),E(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function k2(t){let e,n;return e=new yP({props:{"aria-label":t[32],id:t[26],"aria-multiselectable":"true",$$slots:{default:[AH]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&2&&(r["aria-label"]=i[32]),l[0]&67108864&&(r.id=i[26]),l[0]&1879314834|l[2]&64&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OH(t){let e=t[7](t[74])+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&1610616960&&e!==(e=i[7](i[74])+"")&&Y(n,e)},d(i){i&&E(n)}}}function MH(t){let e;const n=t[46].default,i=He(n,t,t[68],f2),l=i||OH(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s[0]&1610616832|s[2]&64)&&Fe(i,n,r,r[68],e?Ue(n,r[68],s,yH):Ge(r[68]),f2):l&&l.p&&(!e||s[0]&1610616960)&&l.p(r,e?s:[-1,-1,-1])},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function CH(t){let e,n,i;const l=[{name:t[74].id},{title:t[18]?t[7](t[74]):void 0},t[8](t[74]),{readonly:!0},{tabindex:"-1"},{id:"checkbox-"+t[74].id},{checked:t[74].checked},{disabled:t[74].disabled}];function r(){return t[64](t[76])}let s={$$slots:{labelText:[MH]},$$scope:{ctx:t}};for(let o=0;oo[74].id;for(let o=0;o{o=null}),fe()),!f[19]&&f[21]?a?c[0]&2621440&&p(a,1):(a=m2(),a.c(),p(a,1),a.m(n.parentNode,n)):a&&(ue(),v(a,1,1,()=>{a=null}),fe());const d={};c[0]&2&&(d["aria-expanded"]=f[1]),c[0]&67108864&&(d.id=f[26]),c[0]&2048&&(d.disabled=f[11]),c[0]&32768&&(d.translateWithId=f[15]),c[0]&755628119|c[1]&137|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),f[1]?u?(u.p(f,c),c[0]&2&&p(u,1)):(u=k2(f),u.c(),p(u,1),u.m(r.parentNode,r)):u&&(ue(),v(u,1,1,()=>{u=null}),fe())},i(f){s||(p(o),p(a),p(i.$$.fragment,f),p(u),s=!0)},o(f){v(o),v(a),v(i.$$.fragment,f),v(u),s=!1},d(f){f&&(E(e),E(n),E(l),E(r)),o&&o.d(f),a&&a.d(f),H(i,f),u&&u.d(f)}}}function y2(t){let e,n;return{c(){e=P("div"),n=$(t[23]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[11])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&8388608&&Y(n,i[23]),l[0]&2048&&S(e,"bx--form__helper-text--disabled",i[11])},d(i){i&&E(e)}}}function DH(t){let e,n,i,l,r,s,o,a=(t[17]||t[37].titleText)&&d2(t);i=new mP({props:{role:void 0,disabled:t[11],invalid:t[19],invalidText:t[20],open:t[1],light:t[13],size:t[9],warn:t[21],warnText:t[22],class:"bx--multi-select "+(t[10]==="top"&&"bx--list-box--up")+" "+(t[12]&&"bx--combo-box")+` `+(t[12]&&"bx--multi-select--filterable")+` `+(t[19]&&"bx--multi-select--invalid")+` `+(t[33]&&"bx--multi-select--inline")+` @@ -18,27 +18,27 @@ var HD=Object.defineProperty;var UD=(t,e,n)=>e in t?HD(t,e,{enumerable:!0,config `+(f[12]&&"bx--multi-select--filterable")+` `+(f[19]&&"bx--multi-select--invalid")+` `+(f[33]&&"bx--multi-select--inline")+` - `+(f[31].length>0&&"bx--multi-select--selected")),c[0]&2100165111|c[1]&139|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),!f[33]&&!f[19]&&!f[21]&&f[23]?u?u.p(f,c):(u=y2(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null),(!r||c[1]&4)&&S(e,"bx--multi-select__wrapper--inline",f[33]),(!r||c[1]&4)&&S(e,"bx--list-box__wrapper--inline",f[33]),(!r||c[0]&524288|c[1]&4)&&S(e,"bx--multi-select__wrapper--inline--invalid",f[33]&&f[19])},i(f){r||(p(a),p(i.$$.fragment,f),r=!0)},o(f){v(a),v(i.$$.fragment,f),r=!1},d(f){f&&E(e),a&&a.d(),H(i),u&&u.d(),t[67](null),s=!1,o()}}}function IH(t,e,n){let i,l,r,s,o,a,u;const f=["items","itemToString","itemToInput","selectedIds","value","size","type","direction","selectionFeedback","disabled","filterable","filterItem","open","light","locale","placeholder","sortItem","translateWithId","translateWithIdSelection","titleText","useTitleInItem","invalid","invalidText","warn","warnText","helperText","label","hideLabel","id","name","inputRef","multiSelectRef","fieldRef","selectionRef","highlightedId"];let c=de(e,f),{$$slots:d={},$$scope:h}=e;const g=di(d);let{items:_=[]}=e,{itemToString:k=Be=>Be.text||Be.id}=e,{itemToInput:y=Be=>{}}=e,{selectedIds:T=[]}=e,{value:M=""}=e,{size:A=void 0}=e,{type:C="default"}=e,{direction:D="bottom"}=e,{selectionFeedback:R="top-after-reopen"}=e,{disabled:N=!1}=e,{filterable:G=!1}=e,{filterItem:B=(Be,Et)=>Be.text.toLowerCase().includes(Et.trim().toLowerCase())}=e,{open:$=!1}=e,{light:q=!1}=e,{locale:V="en"}=e,{placeholder:K=""}=e,{sortItem:x=(Be,Et)=>Be.text.localeCompare(Et.text,V,{numeric:!0})}=e,{translateWithId:ie=void 0}=e,{translateWithIdSelection:X=void 0}=e,{titleText:ce=""}=e,{useTitleInItem:ae=!1}=e,{invalid:ee=!1}=e,{invalidText:he=""}=e,{warn:ne=!1}=e,{warnText:re=""}=e,{helperText:oe=""}=e,{label:Re=""}=e,{hideLabel:qe=!1}=e,{id:Ce="ccs-"+Math.random().toString(36)}=e,{name:Ze=void 0}=e,{inputRef:be=null}=e,{multiSelectRef:Ae=null}=e,{fieldRef:ve=null}=e,{selectionRef:me=null}=e,{highlightedId:lt=null}=e;const De=on();let vt=!1,dt=-1,ot=[];pi("MultiSelect",{declareRef:({key:Be,ref:Et})=>{switch(Be){case"field":n(4,ve=Et);break;case"selection":n(5,me=Et);break}}});function ht(Be){let Et=dt+Be;const kn=G?u.length:_.length;if(kn===0)return;Et<0?Et=kn-1:Et>=kn&&(Et=0);let Xe=_[Et].disabled;for(;Xe;)Et=Et+Be,Et<0?Et=_.length-1:Et>=_.length&&(Et=0),Xe=_[Et].disabled;n(28,dt=Et)}function Bt(){return[...o.length>1?o.sort(x):o,...a.sort(x)]}hr(()=>{o.length!==ot.length&&(R==="top"&&n(29,s=Bt()),ot=o,n(40,T=o.map(({id:Be})=>Be)),De("select",{selectedIds:T,selected:o,unselected:a})),$||((!vt||R!=="fixed")&&(n(29,s=Bt()),vt=!0),n(28,dt=-1),n(0,M="")),n(39,_=s)});function Ot(Be){te.call(this,t,Be)}function Zt(Be){te.call(this,t,Be)}function Ve(Be){te.call(this,t,Be)}function Nt(Be){te.call(this,t,Be)}function Tt(Be){te.call(this,t,Be)}const Gt=({target:Be})=>{$&&Ae&&!Ae.contains(Be)&&n(1,$=!1)};function fn(Be){te.call(this,t,Be)}const an=()=>{n(29,s=s.map(Be=>({...Be,checked:!1}))),ve&&ve.blur()};function Qt(Be){xe[Be?"unshift":"push"](()=>{be=Be,n(2,be)})}function Ne(){M=this.value,n(0,M)}const pe=({key:Be})=>{if(Be==="Enter"){if(lt){const Et=s.findIndex(kn=>kn.id===lt);n(29,s=s.map((kn,Xe)=>Xe!==Et?kn:{...kn,checked:!kn.checked}))}}else Be==="Tab"?(n(1,$=!1),be.blur()):Be==="ArrowDown"?ht(1):Be==="ArrowUp"?ht(-1):Be==="Escape"?n(1,$=!1):Be===" "&&($||n(1,$=!0))},et=()=>{n(0,M=""),n(1,$=!1)},gt=Be=>{Be.stopPropagation(),n(1,$=!$)},Kt=()=>{N||(G?(n(1,$=!0),be.focus()):n(1,$=!$))},ze=Be=>{if(G)return;const Et=Be.key;[" ","ArrowUp","ArrowDown"].includes(Et)&&Be.preventDefault(),Et===" "?n(1,$=!$):Et==="Tab"?me&&o.length>0?me.focus():(n(1,$=!1),ve.blur()):Et==="ArrowDown"?ht(1):Et==="ArrowUp"?ht(-1):Et==="Enter"?dt>-1&&n(29,s=s.map((kn,Xe)=>Xe!==dt?kn:{...kn,checked:!kn.checked})):Et==="Escape"&&n(1,$=!1)},kt=()=>{G&&(n(1,$=!0),be&&be.focus())},Pt=Be=>{G||De("blur",Be)},cn=Be=>{Be===u.length-1&&n(1,$=!1)},qn=(Be,Et)=>{if(Be.disabled){Et.stopPropagation();return}n(29,s=s.map(kn=>kn.id===Be.id?{...kn,checked:!kn.checked}:kn)),ve.focus()},nl=(Be,Et)=>{Be.disabled||n(28,dt=Et)};function Bl(Be){xe[Be?"unshift":"push"](()=>{Ae=Be,n(3,Ae)})}return t.$$set=Be=>{n(73,e=Z(Z({},e),Te(Be))),n(38,c=de(e,f)),"items"in Be&&n(39,_=Be.items),"itemToString"in Be&&n(7,k=Be.itemToString),"itemToInput"in Be&&n(8,y=Be.itemToInput),"selectedIds"in Be&&n(40,T=Be.selectedIds),"value"in Be&&n(0,M=Be.value),"size"in Be&&n(9,A=Be.size),"type"in Be&&n(41,C=Be.type),"direction"in Be&&n(10,D=Be.direction),"selectionFeedback"in Be&&n(42,R=Be.selectionFeedback),"disabled"in Be&&n(11,N=Be.disabled),"filterable"in Be&&n(12,G=Be.filterable),"filterItem"in Be&&n(43,B=Be.filterItem),"open"in Be&&n(1,$=Be.open),"light"in Be&&n(13,q=Be.light),"locale"in Be&&n(44,V=Be.locale),"placeholder"in Be&&n(14,K=Be.placeholder),"sortItem"in Be&&n(45,x=Be.sortItem),"translateWithId"in Be&&n(15,ie=Be.translateWithId),"translateWithIdSelection"in Be&&n(16,X=Be.translateWithIdSelection),"titleText"in Be&&n(17,ce=Be.titleText),"useTitleInItem"in Be&&n(18,ae=Be.useTitleInItem),"invalid"in Be&&n(19,ee=Be.invalid),"invalidText"in Be&&n(20,he=Be.invalidText),"warn"in Be&&n(21,ne=Be.warn),"warnText"in Be&&n(22,re=Be.warnText),"helperText"in Be&&n(23,oe=Be.helperText),"label"in Be&&n(24,Re=Be.label),"hideLabel"in Be&&n(25,qe=Be.hideLabel),"id"in Be&&n(26,Ce=Be.id),"name"in Be&&n(27,Ze=Be.name),"inputRef"in Be&&n(2,be=Be.inputRef),"multiSelectRef"in Be&&n(3,Ae=Be.multiSelectRef),"fieldRef"in Be&&n(4,ve=Be.fieldRef),"selectionRef"in Be&&n(5,me=Be.selectionRef),"highlightedId"in Be&&n(6,lt=Be.highlightedId),"$$scope"in Be&&n(68,h=Be.$$scope)},t.$$.update=()=>{var Be;t.$$.dirty[0]&67108864&&n(34,i=`menu-${Ce}`),t.$$.dirty[1]&1024&&n(33,l=C==="inline"),n(32,r=e["aria-label"]||"Choose an item"),t.$$.dirty[1]&768&&n(29,s=_.map(Et=>({...Et,checked:T.includes(Et.id)}))),t.$$.dirty[0]&536870912&&n(31,o=s.filter(({checked:Et})=>Et)),t.$$.dirty[0]&536870912&&(a=s.filter(({checked:Et})=>!Et)),t.$$.dirty[0]&536870913|t.$$.dirty[1]&4096&&n(30,u=s.filter(Et=>B(Et,M))),t.$$.dirty[0]&1879052288&&n(6,lt=dt>-1?((Be=(G?u:s)[dt])==null?void 0:Be.id)??null:null)},e=Te(e),[M,$,be,Ae,ve,me,lt,k,y,A,D,N,G,q,K,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,dt,s,u,o,r,l,i,De,ht,g,c,_,T,C,R,B,V,x,d,Ot,Zt,Ve,Nt,Tt,Gt,fn,an,Qt,Ne,pe,et,gt,Kt,ze,kt,Pt,cn,qn,nl,Bl,h]}class RH extends Oe{constructor(e){super(),Ee(this,e,IH,DH,Se,{items:39,itemToString:7,itemToInput:8,selectedIds:40,value:0,size:9,type:41,direction:10,selectionFeedback:42,disabled:11,filterable:12,filterItem:43,open:1,light:13,locale:44,placeholder:14,sortItem:45,translateWithId:15,translateWithIdSelection:16,titleText:17,useTitleInItem:18,invalid:19,invalidText:20,warn:21,warnText:22,helperText:23,label:24,hideLabel:25,id:26,name:27,inputRef:2,multiSelectRef:3,fieldRef:4,selectionRef:5,highlightedId:6},null,[-1,-1,-1])}}const ju=RH;function T2(t,e,n){const i=t.slice();return i[55]=e[n],i}const PH=t=>({}),S2=t=>({}),NH=t=>({}),E2=t=>({});function O2(t){let e,n,i,l,r;return n=new Dl({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=P("button"),U(n.$$.fragment),I(e,"type","button"),I(e,"aria-label",t[8]),S(e,"bx--modal-close",!0)},m(s,o){O(s,e,o),z(n,e,null),t[37](e),i=!0,l||(r=J(e,"click",t[38]),l=!0)},p(s,o){(!i||o[0]&256)&&I(e,"aria-label",s[8])},i(s){i||(p(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&E(e),H(n),t[37](null),l=!1,r()}}}function M2(t){let e,n;const i=t[31].label,l=He(i,t,t[50],E2),r=l||BH(t);return{c(){e=P("h2"),r&&r.c(),I(e,"id",t[25]),S(e,"bx--modal-header__label",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[1]&524288)&&Fe(l,i,s,s[50],n?Ue(i,s[50],o,NH):Ge(s[50]),E2):r&&r.p&&(!n||o[0]&128)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&33554432)&&I(e,"id",s[25])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function BH(t){let e;return{c(){e=j(t[7])},m(n,i){O(n,e,i)},p(n,i){i[0]&128&&Y(e,n[7])},d(n){n&&E(e)}}}function zH(t){let e;return{c(){e=j(t[6])},m(n,i){O(n,e,i)},p(n,i){i[0]&64&&Y(e,n[6])},d(n){n&&E(e)}}}function C2(t){let e,n,i,l,r;return n=new Dl({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=P("button"),U(n.$$.fragment),I(e,"type","button"),I(e,"aria-label",t[8]),S(e,"bx--modal-close",!0)},m(s,o){O(s,e,o),z(n,e,null),t[39](e),i=!0,l||(r=J(e,"click",t[40]),l=!0)},p(s,o){(!i||o[0]&256)&&I(e,"aria-label",s[8])},i(s){i||(p(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&E(e),H(n),t[39](null),l=!1,r()}}}function A2(t){let e;return{c(){e=P("div"),S(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function L2(t){let e,n,i,l,r,s;const o=[UH,HH],a=[];function u(f,c){return f[16].length>0?0:f[15]?1:-1}return~(n=u(t))&&(i=a[n]=o[n](t)),r=new bt({props:{kind:t[3]?"danger":"primary",disabled:t[12],icon:t[13],$$slots:{default:[VH]},$$scope:{ctx:t}}}),r.$on("click",t[43]),{c(){e=P("div"),i&&i.c(),l=F(),U(r.$$.fragment),S(e,"bx--modal-footer",!0),S(e,"bx--modal-footer--three-button",t[16].length===2)},m(f,c){O(f,e,c),~n&&a[n].m(e,null),w(e,l),z(r,e,null),s=!0},p(f,c){let d=n;n=u(f),n===d?~n&&a[n].p(f,c):(i&&(ue(),v(a[d],1,1,()=>{a[d]=null}),fe()),~n?(i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),p(i,1),i.m(e,l)):i=null);const h={};c[0]&8&&(h.kind=f[3]?"danger":"primary"),c[0]&4096&&(h.disabled=f[12]),c[0]&8192&&(h.icon=f[13]),c[0]&2048|c[1]&524288&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!s||c[0]&65536)&&S(e,"bx--modal-footer--three-button",f[16].length===2)},i(f){s||(p(i),p(r.$$.fragment,f),s=!0)},o(f){v(i),v(r.$$.fragment,f),s=!1},d(f){f&&E(e),~n&&a[n].d(),H(r)}}}function HH(t){let e,n;return e=new bt({props:{kind:"secondary",$$slots:{default:[FH]},$$scope:{ctx:t}}}),e.$on("click",t[42]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&32768|l[1]&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function UH(t){let e,n,i=it(t[16]),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{C=null}),fe()),X[7]?D?(D.p(X,ce),ce[0]&128&&p(D,1)):(D=M2(X),D.c(),p(D,1),D.m(i,r)):D&&(ue(),v(D,1,1,()=>{D=null}),fe()),N?N.p&&(!T||ce[1]&524288)&&Fe(N,R,X,X[50],T?Ue(R,X[50],ce,PH):Ge(X[50]),S2):G&&G.p&&(!T||ce[0]&64)&&G.p(X,T?ce:[-1,-1]),(!T||ce[0]&16777216)&&I(s,"id",X[24]),X[5]?B&&(ue(),v(B,1,1,()=>{B=null}),fe()):B?(B.p(X,ce),ce[0]&32&&p(B,1)):(B=C2(X),B.c(),p(B,1),B.m(i,null)),q&&q.p&&(!T||ce[1]&524288)&&Fe(q,$,X,X[50],T?Ue($,X[50],ce,null):Ge(X[50]),null),(!T||ce[0]&8388608)&&I(u,"id",X[23]),(!T||ce[0]&1024&&f!==(f=X[10]?"0":void 0))&&I(u,"tabindex",f),(!T||ce[0]&1024&&c!==(c=X[10]?"region":void 0))&&I(u,"role",c),(!T||ce[0]&4195328&&d!==(d=X[10]?X[22]:void 0))&&I(u,"aria-label",d),(!T||ce[0]&50331776&&h!==(h=X[7]?X[25]:X[24]))&&I(u,"aria-labelledby",h),(!T||ce[0]&512)&&S(u,"bx--modal-content--with-form",X[9]),(!T||ce[0]&1024)&&S(u,"bx--modal-scroll-content",X[10]),X[10]?V||(V=A2(),V.c(),V.m(n,_)):V&&(V.d(1),V=null),X[5]?K&&(ue(),v(K,1,1,()=>{K=null}),fe()):K?(K.p(X,ce),ce[0]&32&&p(K,1)):(K=L2(X),K.c(),p(K,1),K.m(n,null)),(!T||ce[0]&48&&k!==(k=X[4]?X[5]?"alert":"alertdialog":"dialog"))&&I(n,"role",k),(!T||ce[0]&8388656&&y!==(y=X[4]&&!X[5]?X[23]:void 0))&&I(n,"aria-describedby",y),(!T||ce[0]&4194304)&&I(n,"aria-label",X[22]),(!T||ce[0]&4)&&S(n,"bx--modal-container--xs",X[2]==="xs"),(!T||ce[0]&4)&&S(n,"bx--modal-container--sm",X[2]==="sm"),(!T||ce[0]&4)&&S(n,"bx--modal-container--lg",X[2]==="lg"),we(e,ie=Pe(x,[{role:"presentation"},(!T||ce[0]&262144)&&{id:X[18]},ce[0]&268435456&&X[28]])),S(e,"bx--modal",!0),S(e,"bx--modal-tall",!X[5]),S(e,"is-visible",X[0]),S(e,"bx--modal--danger",X[3])},i(X){T||(p(C),p(D),p(G,X),p(B),p(q,X),p(K),T=!0)},o(X){v(C),v(D),v(G,X),v(B),v(q,X),v(K),T=!1},d(X){X&&E(e),C&&C.d(),D&&D.d(),G&&G.d(X),B&&B.d(),q&&q.d(X),V&&V.d(),K&&K.d(),t[44](null),t[46](null),M=!1,ut(A)}}}function jH(t,e,n){let i,l,r,s;const o=["size","open","danger","alert","passiveModal","modalHeading","modalLabel","modalAriaLabel","iconDescription","hasForm","hasScrollingContent","primaryButtonText","primaryButtonDisabled","primaryButtonIcon","shouldSubmitOnEnter","secondaryButtonText","secondaryButtons","selectorPrimaryFocus","preventCloseOnClickOutside","id","ref"];let a=de(e,o),u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{open:h=!1}=e,{danger:g=!1}=e,{alert:_=!1}=e,{passiveModal:k=!1}=e,{modalHeading:y=void 0}=e,{modalLabel:T=void 0}=e,{modalAriaLabel:M=void 0}=e,{iconDescription:A="Close the modal"}=e,{hasForm:C=!1}=e,{hasScrollingContent:D=!1}=e,{primaryButtonText:R=""}=e,{primaryButtonDisabled:N=!1}=e,{primaryButtonIcon:G=void 0}=e,{shouldSubmitOnEnter:B=!0}=e,{secondaryButtonText:$=""}=e,{secondaryButtons:q=[]}=e,{selectorPrimaryFocus:V="[data-modal-primary-focus]"}=e,{preventCloseOnClickOutside:K=!1}=e,{id:x="ccs-"+Math.random().toString(36)}=e,{ref:ie=null}=e;const X=on();let ce=null,ae=null,ee=!1,he=!1;function ne(Ve){((Ve||ae).querySelector(V)||ce).focus()}const re=Wt(h);ct(t,re,Ve=>n(52,u=Ve)),$T(re),hr(()=>{ee?h||(ee=!1,X("close")):h&&(ee=!0,ne(),X("open"))});function oe(Ve){te.call(this,t,Ve)}function Re(Ve){te.call(this,t,Ve)}function qe(Ve){te.call(this,t,Ve)}function Ce(Ve){te.call(this,t,Ve)}function Ze(Ve){te.call(this,t,Ve)}function be(Ve){xe[Ve?"unshift":"push"](()=>{ce=Ve,n(19,ce)})}const Ae=()=>{n(0,h=!1)};function ve(Ve){xe[Ve?"unshift":"push"](()=>{ce=Ve,n(19,ce)})}const me=()=>{n(0,h=!1)},lt=Ve=>{X("click:button--secondary",{text:Ve.text})},De=()=>{X("click:button--secondary",{text:$})},vt=()=>{X("submit"),X("click:button--primary")};function dt(Ve){xe[Ve?"unshift":"push"](()=>{ae=Ve,n(20,ae)})}const ot=()=>{n(21,he=!0)};function ht(Ve){xe[Ve?"unshift":"push"](()=>{ie=Ve,n(1,ie)})}const Bt=Ve=>{if(h)if(Ve.key==="Escape")n(0,h=!1);else if(Ve.key==="Tab"){const Nt=` + `+(f[31].length>0&&"bx--multi-select--selected")),c[0]&2100165111|c[1]&139|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),!f[33]&&!f[19]&&!f[21]&&f[23]?u?u.p(f,c):(u=y2(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null),(!r||c[1]&4)&&S(e,"bx--multi-select__wrapper--inline",f[33]),(!r||c[1]&4)&&S(e,"bx--list-box__wrapper--inline",f[33]),(!r||c[0]&524288|c[1]&4)&&S(e,"bx--multi-select__wrapper--inline--invalid",f[33]&&f[19])},i(f){r||(p(a),p(i.$$.fragment,f),r=!0)},o(f){v(a),v(i.$$.fragment,f),r=!1},d(f){f&&E(e),a&&a.d(),H(i),u&&u.d(),t[67](null),s=!1,o()}}}function IH(t,e,n){let i,l,r,s,o,a,u;const f=["items","itemToString","itemToInput","selectedIds","value","size","type","direction","selectionFeedback","disabled","filterable","filterItem","open","light","locale","placeholder","sortItem","translateWithId","translateWithIdSelection","titleText","useTitleInItem","invalid","invalidText","warn","warnText","helperText","label","hideLabel","id","name","inputRef","multiSelectRef","fieldRef","selectionRef","highlightedId"];let c=de(e,f),{$$slots:d={},$$scope:h}=e;const g=di(d);let{items:_=[]}=e,{itemToString:k=Be=>Be.text||Be.id}=e,{itemToInput:y=Be=>{}}=e,{selectedIds:T=[]}=e,{value:M=""}=e,{size:A=void 0}=e,{type:C="default"}=e,{direction:D="bottom"}=e,{selectionFeedback:R="top-after-reopen"}=e,{disabled:N=!1}=e,{filterable:G=!1}=e,{filterItem:B=(Be,Et)=>Be.text.toLowerCase().includes(Et.trim().toLowerCase())}=e,{open:j=!1}=e,{light:q=!1}=e,{locale:V="en"}=e,{placeholder:K=""}=e,{sortItem:x=(Be,Et)=>Be.text.localeCompare(Et.text,V,{numeric:!0})}=e,{translateWithId:ie=void 0}=e,{translateWithIdSelection:X=void 0}=e,{titleText:ce=""}=e,{useTitleInItem:ae=!1}=e,{invalid:ee=!1}=e,{invalidText:he=""}=e,{warn:ne=!1}=e,{warnText:re=""}=e,{helperText:oe=""}=e,{label:Re=""}=e,{hideLabel:qe=!1}=e,{id:Ce="ccs-"+Math.random().toString(36)}=e,{name:Ze=void 0}=e,{inputRef:be=null}=e,{multiSelectRef:Ae=null}=e,{fieldRef:ve=null}=e,{selectionRef:me=null}=e,{highlightedId:lt=null}=e;const De=nn();let vt=!1,dt=-1,ot=[];pi("MultiSelect",{declareRef:({key:Be,ref:Et})=>{switch(Be){case"field":n(4,ve=Et);break;case"selection":n(5,me=Et);break}}});function ht(Be){let Et=dt+Be;const kn=G?u.length:_.length;if(kn===0)return;Et<0?Et=kn-1:Et>=kn&&(Et=0);let Xe=_[Et].disabled;for(;Xe;)Et=Et+Be,Et<0?Et=_.length-1:Et>=_.length&&(Et=0),Xe=_[Et].disabled;n(28,dt=Et)}function Bt(){return[...o.length>1?o.sort(x):o,...a.sort(x)]}hr(()=>{o.length!==ot.length&&(R==="top"&&n(29,s=Bt()),ot=o,n(40,T=o.map(({id:Be})=>Be)),De("select",{selectedIds:T,selected:o,unselected:a})),j||((!vt||R!=="fixed")&&(n(29,s=Bt()),vt=!0),n(28,dt=-1),n(0,M="")),n(39,_=s)});function Ot(Be){te.call(this,t,Be)}function Zt(Be){te.call(this,t,Be)}function Ve(Be){te.call(this,t,Be)}function Nt(Be){te.call(this,t,Be)}function Tt(Be){te.call(this,t,Be)}const Gt=({target:Be})=>{j&&Ae&&!Ae.contains(Be)&&n(1,j=!1)};function fn(Be){te.call(this,t,Be)}const an=()=>{n(29,s=s.map(Be=>({...Be,checked:!1}))),ve&&ve.blur()};function Qt(Be){xe[Be?"unshift":"push"](()=>{be=Be,n(2,be)})}function Ne(){M=this.value,n(0,M)}const pe=({key:Be})=>{if(Be==="Enter"){if(lt){const Et=s.findIndex(kn=>kn.id===lt);n(29,s=s.map((kn,Xe)=>Xe!==Et?kn:{...kn,checked:!kn.checked}))}}else Be==="Tab"?(n(1,j=!1),be.blur()):Be==="ArrowDown"?ht(1):Be==="ArrowUp"?ht(-1):Be==="Escape"?n(1,j=!1):Be===" "&&(j||n(1,j=!0))},et=()=>{n(0,M=""),n(1,j=!1)},gt=Be=>{Be.stopPropagation(),n(1,j=!j)},Kt=()=>{N||(G?(n(1,j=!0),be.focus()):n(1,j=!j))},ze=Be=>{if(G)return;const Et=Be.key;[" ","ArrowUp","ArrowDown"].includes(Et)&&Be.preventDefault(),Et===" "?n(1,j=!j):Et==="Tab"?me&&o.length>0?me.focus():(n(1,j=!1),ve.blur()):Et==="ArrowDown"?ht(1):Et==="ArrowUp"?ht(-1):Et==="Enter"?dt>-1&&n(29,s=s.map((kn,Xe)=>Xe!==dt?kn:{...kn,checked:!kn.checked})):Et==="Escape"&&n(1,j=!1)},kt=()=>{G&&(n(1,j=!0),be&&be.focus())},Pt=Be=>{G||De("blur",Be)},cn=Be=>{Be===u.length-1&&n(1,j=!1)},qn=(Be,Et)=>{if(Be.disabled){Et.stopPropagation();return}n(29,s=s.map(kn=>kn.id===Be.id?{...kn,checked:!kn.checked}:kn)),ve.focus()},nl=(Be,Et)=>{Be.disabled||n(28,dt=Et)};function Bl(Be){xe[Be?"unshift":"push"](()=>{Ae=Be,n(3,Ae)})}return t.$$set=Be=>{n(73,e=Z(Z({},e),Te(Be))),n(38,c=de(e,f)),"items"in Be&&n(39,_=Be.items),"itemToString"in Be&&n(7,k=Be.itemToString),"itemToInput"in Be&&n(8,y=Be.itemToInput),"selectedIds"in Be&&n(40,T=Be.selectedIds),"value"in Be&&n(0,M=Be.value),"size"in Be&&n(9,A=Be.size),"type"in Be&&n(41,C=Be.type),"direction"in Be&&n(10,D=Be.direction),"selectionFeedback"in Be&&n(42,R=Be.selectionFeedback),"disabled"in Be&&n(11,N=Be.disabled),"filterable"in Be&&n(12,G=Be.filterable),"filterItem"in Be&&n(43,B=Be.filterItem),"open"in Be&&n(1,j=Be.open),"light"in Be&&n(13,q=Be.light),"locale"in Be&&n(44,V=Be.locale),"placeholder"in Be&&n(14,K=Be.placeholder),"sortItem"in Be&&n(45,x=Be.sortItem),"translateWithId"in Be&&n(15,ie=Be.translateWithId),"translateWithIdSelection"in Be&&n(16,X=Be.translateWithIdSelection),"titleText"in Be&&n(17,ce=Be.titleText),"useTitleInItem"in Be&&n(18,ae=Be.useTitleInItem),"invalid"in Be&&n(19,ee=Be.invalid),"invalidText"in Be&&n(20,he=Be.invalidText),"warn"in Be&&n(21,ne=Be.warn),"warnText"in Be&&n(22,re=Be.warnText),"helperText"in Be&&n(23,oe=Be.helperText),"label"in Be&&n(24,Re=Be.label),"hideLabel"in Be&&n(25,qe=Be.hideLabel),"id"in Be&&n(26,Ce=Be.id),"name"in Be&&n(27,Ze=Be.name),"inputRef"in Be&&n(2,be=Be.inputRef),"multiSelectRef"in Be&&n(3,Ae=Be.multiSelectRef),"fieldRef"in Be&&n(4,ve=Be.fieldRef),"selectionRef"in Be&&n(5,me=Be.selectionRef),"highlightedId"in Be&&n(6,lt=Be.highlightedId),"$$scope"in Be&&n(68,h=Be.$$scope)},t.$$.update=()=>{var Be;t.$$.dirty[0]&67108864&&n(34,i=`menu-${Ce}`),t.$$.dirty[1]&1024&&n(33,l=C==="inline"),n(32,r=e["aria-label"]||"Choose an item"),t.$$.dirty[1]&768&&n(29,s=_.map(Et=>({...Et,checked:T.includes(Et.id)}))),t.$$.dirty[0]&536870912&&n(31,o=s.filter(({checked:Et})=>Et)),t.$$.dirty[0]&536870912&&(a=s.filter(({checked:Et})=>!Et)),t.$$.dirty[0]&536870913|t.$$.dirty[1]&4096&&n(30,u=s.filter(Et=>B(Et,M))),t.$$.dirty[0]&1879052288&&n(6,lt=dt>-1?((Be=(G?u:s)[dt])==null?void 0:Be.id)??null:null)},e=Te(e),[M,j,be,Ae,ve,me,lt,k,y,A,D,N,G,q,K,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,dt,s,u,o,r,l,i,De,ht,g,c,_,T,C,R,B,V,x,d,Ot,Zt,Ve,Nt,Tt,Gt,fn,an,Qt,Ne,pe,et,gt,Kt,ze,kt,Pt,cn,qn,nl,Bl,h]}class RH extends Oe{constructor(e){super(),Ee(this,e,IH,DH,Se,{items:39,itemToString:7,itemToInput:8,selectedIds:40,value:0,size:9,type:41,direction:10,selectionFeedback:42,disabled:11,filterable:12,filterItem:43,open:1,light:13,locale:44,placeholder:14,sortItem:45,translateWithId:15,translateWithIdSelection:16,titleText:17,useTitleInItem:18,invalid:19,invalidText:20,warn:21,warnText:22,helperText:23,label:24,hideLabel:25,id:26,name:27,inputRef:2,multiSelectRef:3,fieldRef:4,selectionRef:5,highlightedId:6},null,[-1,-1,-1])}}const ju=RH;function T2(t,e,n){const i=t.slice();return i[55]=e[n],i}const PH=t=>({}),S2=t=>({}),NH=t=>({}),E2=t=>({});function O2(t){let e,n,i,l,r;return n=new Dl({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=P("button"),U(n.$$.fragment),I(e,"type","button"),I(e,"aria-label",t[8]),S(e,"bx--modal-close",!0)},m(s,o){O(s,e,o),z(n,e,null),t[37](e),i=!0,l||(r=J(e,"click",t[38]),l=!0)},p(s,o){(!i||o[0]&256)&&I(e,"aria-label",s[8])},i(s){i||(p(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&E(e),H(n),t[37](null),l=!1,r()}}}function M2(t){let e,n;const i=t[31].label,l=He(i,t,t[50],E2),r=l||BH(t);return{c(){e=P("h2"),r&&r.c(),I(e,"id",t[25]),S(e,"bx--modal-header__label",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[1]&524288)&&Fe(l,i,s,s[50],n?Ue(i,s[50],o,NH):Ge(s[50]),E2):r&&r.p&&(!n||o[0]&128)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&33554432)&&I(e,"id",s[25])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function BH(t){let e;return{c(){e=$(t[7])},m(n,i){O(n,e,i)},p(n,i){i[0]&128&&Y(e,n[7])},d(n){n&&E(e)}}}function zH(t){let e;return{c(){e=$(t[6])},m(n,i){O(n,e,i)},p(n,i){i[0]&64&&Y(e,n[6])},d(n){n&&E(e)}}}function C2(t){let e,n,i,l,r;return n=new Dl({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=P("button"),U(n.$$.fragment),I(e,"type","button"),I(e,"aria-label",t[8]),S(e,"bx--modal-close",!0)},m(s,o){O(s,e,o),z(n,e,null),t[39](e),i=!0,l||(r=J(e,"click",t[40]),l=!0)},p(s,o){(!i||o[0]&256)&&I(e,"aria-label",s[8])},i(s){i||(p(n.$$.fragment,s),i=!0)},o(s){v(n.$$.fragment,s),i=!1},d(s){s&&E(e),H(n),t[39](null),l=!1,r()}}}function A2(t){let e;return{c(){e=P("div"),S(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function L2(t){let e,n,i,l,r,s;const o=[UH,HH],a=[];function u(f,c){return f[16].length>0?0:f[15]?1:-1}return~(n=u(t))&&(i=a[n]=o[n](t)),r=new bt({props:{kind:t[3]?"danger":"primary",disabled:t[12],icon:t[13],$$slots:{default:[VH]},$$scope:{ctx:t}}}),r.$on("click",t[43]),{c(){e=P("div"),i&&i.c(),l=F(),U(r.$$.fragment),S(e,"bx--modal-footer",!0),S(e,"bx--modal-footer--three-button",t[16].length===2)},m(f,c){O(f,e,c),~n&&a[n].m(e,null),w(e,l),z(r,e,null),s=!0},p(f,c){let d=n;n=u(f),n===d?~n&&a[n].p(f,c):(i&&(ue(),v(a[d],1,1,()=>{a[d]=null}),fe()),~n?(i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),p(i,1),i.m(e,l)):i=null);const h={};c[0]&8&&(h.kind=f[3]?"danger":"primary"),c[0]&4096&&(h.disabled=f[12]),c[0]&8192&&(h.icon=f[13]),c[0]&2048|c[1]&524288&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!s||c[0]&65536)&&S(e,"bx--modal-footer--three-button",f[16].length===2)},i(f){s||(p(i),p(r.$$.fragment,f),s=!0)},o(f){v(i),v(r.$$.fragment,f),s=!1},d(f){f&&E(e),~n&&a[n].d(),H(r)}}}function HH(t){let e,n;return e=new bt({props:{kind:"secondary",$$slots:{default:[FH]},$$scope:{ctx:t}}}),e.$on("click",t[42]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&32768|l[1]&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function UH(t){let e,n,i=it(t[16]),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{C=null}),fe()),X[7]?D?(D.p(X,ce),ce[0]&128&&p(D,1)):(D=M2(X),D.c(),p(D,1),D.m(i,r)):D&&(ue(),v(D,1,1,()=>{D=null}),fe()),N?N.p&&(!T||ce[1]&524288)&&Fe(N,R,X,X[50],T?Ue(R,X[50],ce,PH):Ge(X[50]),S2):G&&G.p&&(!T||ce[0]&64)&&G.p(X,T?ce:[-1,-1]),(!T||ce[0]&16777216)&&I(s,"id",X[24]),X[5]?B&&(ue(),v(B,1,1,()=>{B=null}),fe()):B?(B.p(X,ce),ce[0]&32&&p(B,1)):(B=C2(X),B.c(),p(B,1),B.m(i,null)),q&&q.p&&(!T||ce[1]&524288)&&Fe(q,j,X,X[50],T?Ue(j,X[50],ce,null):Ge(X[50]),null),(!T||ce[0]&8388608)&&I(u,"id",X[23]),(!T||ce[0]&1024&&f!==(f=X[10]?"0":void 0))&&I(u,"tabindex",f),(!T||ce[0]&1024&&c!==(c=X[10]?"region":void 0))&&I(u,"role",c),(!T||ce[0]&4195328&&d!==(d=X[10]?X[22]:void 0))&&I(u,"aria-label",d),(!T||ce[0]&50331776&&h!==(h=X[7]?X[25]:X[24]))&&I(u,"aria-labelledby",h),(!T||ce[0]&512)&&S(u,"bx--modal-content--with-form",X[9]),(!T||ce[0]&1024)&&S(u,"bx--modal-scroll-content",X[10]),X[10]?V||(V=A2(),V.c(),V.m(n,_)):V&&(V.d(1),V=null),X[5]?K&&(ue(),v(K,1,1,()=>{K=null}),fe()):K?(K.p(X,ce),ce[0]&32&&p(K,1)):(K=L2(X),K.c(),p(K,1),K.m(n,null)),(!T||ce[0]&48&&k!==(k=X[4]?X[5]?"alert":"alertdialog":"dialog"))&&I(n,"role",k),(!T||ce[0]&8388656&&y!==(y=X[4]&&!X[5]?X[23]:void 0))&&I(n,"aria-describedby",y),(!T||ce[0]&4194304)&&I(n,"aria-label",X[22]),(!T||ce[0]&4)&&S(n,"bx--modal-container--xs",X[2]==="xs"),(!T||ce[0]&4)&&S(n,"bx--modal-container--sm",X[2]==="sm"),(!T||ce[0]&4)&&S(n,"bx--modal-container--lg",X[2]==="lg"),we(e,ie=Pe(x,[{role:"presentation"},(!T||ce[0]&262144)&&{id:X[18]},ce[0]&268435456&&X[28]])),S(e,"bx--modal",!0),S(e,"bx--modal-tall",!X[5]),S(e,"is-visible",X[0]),S(e,"bx--modal--danger",X[3])},i(X){T||(p(C),p(D),p(G,X),p(B),p(q,X),p(K),T=!0)},o(X){v(C),v(D),v(G,X),v(B),v(q,X),v(K),T=!1},d(X){X&&E(e),C&&C.d(),D&&D.d(),G&&G.d(X),B&&B.d(),q&&q.d(X),V&&V.d(),K&&K.d(),t[44](null),t[46](null),M=!1,ut(A)}}}function jH(t,e,n){let i,l,r,s;const o=["size","open","danger","alert","passiveModal","modalHeading","modalLabel","modalAriaLabel","iconDescription","hasForm","hasScrollingContent","primaryButtonText","primaryButtonDisabled","primaryButtonIcon","shouldSubmitOnEnter","secondaryButtonText","secondaryButtons","selectorPrimaryFocus","preventCloseOnClickOutside","id","ref"];let a=de(e,o),u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{open:h=!1}=e,{danger:g=!1}=e,{alert:_=!1}=e,{passiveModal:k=!1}=e,{modalHeading:y=void 0}=e,{modalLabel:T=void 0}=e,{modalAriaLabel:M=void 0}=e,{iconDescription:A="Close the modal"}=e,{hasForm:C=!1}=e,{hasScrollingContent:D=!1}=e,{primaryButtonText:R=""}=e,{primaryButtonDisabled:N=!1}=e,{primaryButtonIcon:G=void 0}=e,{shouldSubmitOnEnter:B=!0}=e,{secondaryButtonText:j=""}=e,{secondaryButtons:q=[]}=e,{selectorPrimaryFocus:V="[data-modal-primary-focus]"}=e,{preventCloseOnClickOutside:K=!1}=e,{id:x="ccs-"+Math.random().toString(36)}=e,{ref:ie=null}=e;const X=nn();let ce=null,ae=null,ee=!1,he=!1;function ne(Ve){((Ve||ae).querySelector(V)||ce).focus()}const re=Wt(h);ct(t,re,Ve=>n(52,u=Ve)),$T(re),hr(()=>{ee?h||(ee=!1,X("close")):h&&(ee=!0,ne(),X("open"))});function oe(Ve){te.call(this,t,Ve)}function Re(Ve){te.call(this,t,Ve)}function qe(Ve){te.call(this,t,Ve)}function Ce(Ve){te.call(this,t,Ve)}function Ze(Ve){te.call(this,t,Ve)}function be(Ve){xe[Ve?"unshift":"push"](()=>{ce=Ve,n(19,ce)})}const Ae=()=>{n(0,h=!1)};function ve(Ve){xe[Ve?"unshift":"push"](()=>{ce=Ve,n(19,ce)})}const me=()=>{n(0,h=!1)},lt=Ve=>{X("click:button--secondary",{text:Ve.text})},De=()=>{X("click:button--secondary",{text:j})},vt=()=>{X("submit"),X("click:button--primary")};function dt(Ve){xe[Ve?"unshift":"push"](()=>{ae=Ve,n(20,ae)})}const ot=()=>{n(21,he=!0)};function ht(Ve){xe[Ve?"unshift":"push"](()=>{ie=Ve,n(1,ie)})}const Bt=Ve=>{if(h)if(Ve.key==="Escape")n(0,h=!1);else if(Ve.key==="Tab"){const Nt=` a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true] -`,Tt=Array.from(ie.querySelectorAll(Nt));let Gt=Tt.indexOf(document.activeElement);Gt===-1&&Ve.shiftKey&&(Gt=0),Gt+=Tt.length+(Ve.shiftKey?-1:1),Gt%=Tt.length,Tt[Gt].focus(),Ve.preventDefault()}else B&&Ve.key==="Enter"&&!N&&(X("submit"),X("click:button--primary"))},Ot=()=>{!he&&!K&&n(0,h=!1),n(21,he=!1)},Zt=Ve=>{Ve.propertyName==="transform"&&X("transitionend",{open:h})};return t.$$set=Ve=>{n(54,e=Z(Z({},e),Te(Ve))),n(28,a=de(e,o)),"size"in Ve&&n(2,d=Ve.size),"open"in Ve&&n(0,h=Ve.open),"danger"in Ve&&n(3,g=Ve.danger),"alert"in Ve&&n(4,_=Ve.alert),"passiveModal"in Ve&&n(5,k=Ve.passiveModal),"modalHeading"in Ve&&n(6,y=Ve.modalHeading),"modalLabel"in Ve&&n(7,T=Ve.modalLabel),"modalAriaLabel"in Ve&&n(29,M=Ve.modalAriaLabel),"iconDescription"in Ve&&n(8,A=Ve.iconDescription),"hasForm"in Ve&&n(9,C=Ve.hasForm),"hasScrollingContent"in Ve&&n(10,D=Ve.hasScrollingContent),"primaryButtonText"in Ve&&n(11,R=Ve.primaryButtonText),"primaryButtonDisabled"in Ve&&n(12,N=Ve.primaryButtonDisabled),"primaryButtonIcon"in Ve&&n(13,G=Ve.primaryButtonIcon),"shouldSubmitOnEnter"in Ve&&n(14,B=Ve.shouldSubmitOnEnter),"secondaryButtonText"in Ve&&n(15,$=Ve.secondaryButtonText),"secondaryButtons"in Ve&&n(16,q=Ve.secondaryButtons),"selectorPrimaryFocus"in Ve&&n(30,V=Ve.selectorPrimaryFocus),"preventCloseOnClickOutside"in Ve&&n(17,K=Ve.preventCloseOnClickOutside),"id"in Ve&&n(18,x=Ve.id),"ref"in Ve&&n(1,ie=Ve.ref),"$$scope"in Ve&&n(50,c=Ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&ro(re,u=h,u),t.$$.dirty[0]&262144&&n(25,i=`bx--modal-header__label--modal-${x}`),t.$$.dirty[0]&262144&&n(24,l=`bx--modal-header__heading--modal-${x}`),t.$$.dirty[0]&262144&&n(23,r=`bx--modal-body--${x}`),n(22,s=T||e["aria-label"]||M||y)},e=Te(e),[h,ie,d,g,_,k,y,T,A,C,D,R,N,G,B,$,q,K,x,ce,ae,he,s,r,l,i,X,re,a,M,V,f,oe,Re,qe,Ce,Ze,be,Ae,ve,me,lt,De,vt,dt,ot,ht,Bt,Ot,Zt,c]}class $H extends Oe{constructor(e){super(),Ee(this,e,jH,WH,Se,{size:2,open:0,danger:3,alert:4,passiveModal:5,modalHeading:6,modalLabel:7,modalAriaLabel:29,iconDescription:8,hasForm:9,hasScrollingContent:10,primaryButtonText:11,primaryButtonDisabled:12,primaryButtonIcon:13,shouldSubmitOnEnter:14,secondaryButtonText:15,secondaryButtons:16,selectorPrimaryFocus:30,preventCloseOnClickOutside:17,id:18,ref:1},null,[-1,-1])}}const xT=$H;function qH(t){let e,n,i,l,r;var s=t[1];function o(f,c){return{props:{size:20,title:f[2],class:(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")}}}s&&(n=rn(s,o(t)));let a=[{type:"button"},{"aria-label":t[3]},{title:t[3]},t[4]],u={};for(let f=0;f{H(d,1)}),fe()}s?(n=rn(s,o(f)),U(n.$$.fragment),p(n.$$.fragment,1),z(n,e,null)):n=null}else if(s){const d={};c&4&&(d.title=f[2]),c&1&&(d.class=(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")),n.$set(d)}we(e,u=Pe(a,[{type:"button"},(!i||c&8)&&{"aria-label":f[3]},(!i||c&8)&&{title:f[3]},c&16&&f[4]])),S(e,"bx--toast-notification__close-button",f[0]==="toast"),S(e,"bx--inline-notification__close-button",f[0]==="inline")},i(f){i||(n&&p(n.$$.fragment,f),i=!0)},o(f){n&&v(n.$$.fragment,f),i=!1},d(f){f&&E(e),n&&H(n),l=!1,ut(r)}}}function YH(t,e,n){const i=["notificationType","icon","title","iconDescription"];let l=de(e,i),{notificationType:r="toast"}=e,{icon:s=Dl}=e,{title:o=void 0}=e,{iconDescription:a="Close icon"}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"notificationType"in h&&n(0,r=h.notificationType),"icon"in h&&n(1,s=h.icon),"title"in h&&n(2,o=h.title),"iconDescription"in h&&n(3,a=h.iconDescription)},[r,s,o,a,l,u,f,c,d]}class ZH extends Oe{constructor(e){super(),Ee(this,e,YH,qH,Se,{notificationType:0,icon:1,title:2,iconDescription:3})}}const e5=ZH;function I2(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function XH(t){let e,n,i,l=t[1]&&I2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class JH extends Oe{constructor(e){super(),Ee(this,e,KH,XH,Se,{size:0,title:1})}}const QH=JH;function R2(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function xH(t){let e,n,i,l=t[1]&&R2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class tU extends Oe{constructor(e){super(),Ee(this,e,eU,xH,Se,{size:0,title:1})}}const nU=tU;function iU(t){let e,n,i;var l=t[3][t[0]];function r(s,o){return{props:{size:20,title:s[2],class:(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")}}}return l&&(e=rn(l,r(t))),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,[o]){if(o&1&&l!==(l=s[3][s[0]])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r(s)),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}else if(l){const a={};o&4&&(a.title=s[2]),o&2&&(a.class=(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")),e.$set(a)}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function lU(t,e,n){let{kind:i="error"}=e,{notificationType:l="toast"}=e,{iconDescription:r}=e;const s={error:QT,"info-square":nU,info:QH,success:XT,warning:Ds,"warning-alt":Vu};return t.$$set=o=>{"kind"in o&&n(0,i=o.kind),"notificationType"in o&&n(1,l=o.notificationType),"iconDescription"in o&&n(2,r=o.iconDescription)},[i,l,r,s]}class rU extends Oe{constructor(e){super(),Ee(this,e,lU,iU,Se,{kind:0,notificationType:1,iconDescription:2})}}const t5=rU,sU=t=>({}),P2=t=>({}),oU=t=>({}),N2=t=>({}),aU=t=>({}),B2=t=>({});function z2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;n=new t5({props:{kind:t[0],iconDescription:t[6]}});const _=t[15].title,k=He(_,t,t[14],B2),y=k||uU(t),T=t[15].subtitle,M=He(T,t,t[14],N2),A=M||fU(t),C=t[15].caption,D=He(C,t,t[14],P2),R=D||cU(t),N=t[15].default,G=He(N,t,t[14],null);let B=!t[8]&&H2(t),$=[{role:t[2]},{kind:t[0]},t[12]],q={};for(let V=0;V<$.length;V+=1)q=Z(q,$[V]);return{c(){e=P("div"),U(n.$$.fragment),i=F(),l=P("div"),r=P("h3"),y&&y.c(),s=F(),o=P("div"),A&&A.c(),a=F(),u=P("div"),R&&R.c(),f=F(),G&&G.c(),c=F(),B&&B.c(),S(r,"bx--toast-notification__title",!0),S(o,"bx--toast-notification__subtitle",!0),S(u,"bx--toast-notification__caption",!0),S(l,"bx--toast-notification__details",!0),we(e,q),S(e,"bx--toast-notification",!0),S(e,"bx--toast-notification--low-contrast",t[1]),S(e,"bx--toast-notification--error",t[0]==="error"),S(e,"bx--toast-notification--info",t[0]==="info"),S(e,"bx--toast-notification--info-square",t[0]==="info-square"),S(e,"bx--toast-notification--success",t[0]==="success"),S(e,"bx--toast-notification--warning",t[0]==="warning"),S(e,"bx--toast-notification--warning-alt",t[0]==="warning-alt"),An(e,"width",t[9]?"100%":void 0)},m(V,K){O(V,e,K),z(n,e,null),w(e,i),w(e,l),w(l,r),y&&y.m(r,null),w(l,s),w(l,o),A&&A.m(o,null),w(l,a),w(l,u),R&&R.m(u,null),w(l,f),G&&G.m(l,null),w(e,c),B&&B.m(e,null),d=!0,h||(g=[J(e,"click",t[16]),J(e,"mouseover",t[17]),J(e,"mouseenter",t[18]),J(e,"mouseleave",t[19])],h=!0)},p(V,K){const x={};K&1&&(x.kind=V[0]),K&64&&(x.iconDescription=V[6]),n.$set(x),k?k.p&&(!d||K&16384)&&Fe(k,_,V,V[14],d?Ue(_,V[14],K,aU):Ge(V[14]),B2):y&&y.p&&(!d||K&8)&&y.p(V,d?K:-1),M?M.p&&(!d||K&16384)&&Fe(M,T,V,V[14],d?Ue(T,V[14],K,oU):Ge(V[14]),N2):A&&A.p&&(!d||K&16)&&A.p(V,d?K:-1),D?D.p&&(!d||K&16384)&&Fe(D,C,V,V[14],d?Ue(C,V[14],K,sU):Ge(V[14]),P2):R&&R.p&&(!d||K&32)&&R.p(V,d?K:-1),G&&G.p&&(!d||K&16384)&&Fe(G,N,V,V[14],d?Ue(N,V[14],K,null):Ge(V[14]),null),V[8]?B&&(ue(),v(B,1,1,()=>{B=null}),fe()):B?(B.p(V,K),K&256&&p(B,1)):(B=H2(V),B.c(),p(B,1),B.m(e,null)),we(e,q=Pe($,[(!d||K&4)&&{role:V[2]},(!d||K&1)&&{kind:V[0]},K&4096&&V[12]])),S(e,"bx--toast-notification",!0),S(e,"bx--toast-notification--low-contrast",V[1]),S(e,"bx--toast-notification--error",V[0]==="error"),S(e,"bx--toast-notification--info",V[0]==="info"),S(e,"bx--toast-notification--info-square",V[0]==="info-square"),S(e,"bx--toast-notification--success",V[0]==="success"),S(e,"bx--toast-notification--warning",V[0]==="warning"),S(e,"bx--toast-notification--warning-alt",V[0]==="warning-alt"),An(e,"width",V[9]?"100%":void 0)},i(V){d||(p(n.$$.fragment,V),p(y,V),p(A,V),p(R,V),p(G,V),p(B),d=!0)},o(V){v(n.$$.fragment,V),v(y,V),v(A,V),v(R,V),v(G,V),v(B),d=!1},d(V){V&&E(e),H(n),y&&y.d(V),A&&A.d(V),R&&R.d(V),G&&G.d(V),B&&B.d(),h=!1,ut(g)}}}function uU(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function fU(t){let e;return{c(){e=j(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function cU(t){let e;return{c(){e=j(t[5])},m(n,i){O(n,e,i)},p(n,i){i&32&&Y(e,n[5])},d(n){n&&E(e)}}}function H2(t){let e,n;return e=new e5({props:{iconDescription:t[7]}}),e.$on("click",t[11]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function dU(t){let e,n,i=t[10]&&z2(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[10]?i?(i.p(l,r),r&1024&&p(i,1)):(i=z2(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function hU(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","caption","statusIconDescription","closeButtonDescription","hideCloseButton","fullWidth"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{caption:h=""}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e,{hideCloseButton:k=!1}=e,{fullWidth:y=!1}=e;const T=on();let M=!0,A;function C(B){T("close",{timeout:B===!0},{cancelable:!0})&&n(10,M=!1)}sn(()=>(u&&(A=setTimeout(()=>C(!0),u)),()=>{clearTimeout(A)}));function D(B){te.call(this,t,B)}function R(B){te.call(this,t,B)}function N(B){te.call(this,t,B)}function G(B){te.call(this,t,B)}return t.$$set=B=>{e=Z(Z({},e),Te(B)),n(12,l=de(e,i)),"kind"in B&&n(0,o=B.kind),"lowContrast"in B&&n(1,a=B.lowContrast),"timeout"in B&&n(13,u=B.timeout),"role"in B&&n(2,f=B.role),"title"in B&&n(3,c=B.title),"subtitle"in B&&n(4,d=B.subtitle),"caption"in B&&n(5,h=B.caption),"statusIconDescription"in B&&n(6,g=B.statusIconDescription),"closeButtonDescription"in B&&n(7,_=B.closeButtonDescription),"hideCloseButton"in B&&n(8,k=B.hideCloseButton),"fullWidth"in B&&n(9,y=B.fullWidth),"$$scope"in B&&n(14,s=B.$$scope)},[o,a,f,c,d,h,g,_,k,y,M,C,l,u,s,r,D,R,N,G]}class mU extends Oe{constructor(e){super(),Ee(this,e,hU,dU,Se,{kind:0,lowContrast:1,timeout:13,role:2,title:3,subtitle:4,caption:5,statusIconDescription:6,closeButtonDescription:7,hideCloseButton:8,fullWidth:9})}}const gU=mU,_U=t=>({}),U2=t=>({}),pU=t=>({}),F2=t=>({}),bU=t=>({}),G2=t=>({});function V2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;i=new t5({props:{notificationType:"inline",kind:t[0],iconDescription:t[6]}});const _=t[13].title,k=He(_,t,t[12],G2),y=k||vU(t),T=t[13].subtitle,M=He(T,t,t[12],F2),A=M||kU(t),C=t[13].default,D=He(C,t,t[12],null),R=t[13].actions,N=He(R,t,t[12],U2);let G=!t[5]&&W2(t),B=[{role:t[2]},{kind:t[0]},t[10]],$={};for(let q=0;q{G=null}),fe()):G?(G.p(q,V),V&32&&p(G,1)):(G=W2(q),G.c(),p(G,1),G.m(e,null)),we(e,$=Pe(B,[(!d||V&4)&&{role:q[2]},(!d||V&1)&&{kind:q[0]},V&1024&&q[10]])),S(e,"bx--inline-notification",!0),S(e,"bx--inline-notification--low-contrast",q[1]),S(e,"bx--inline-notification--hide-close-button",q[5]),S(e,"bx--inline-notification--error",q[0]==="error"),S(e,"bx--inline-notification--info",q[0]==="info"),S(e,"bx--inline-notification--info-square",q[0]==="info-square"),S(e,"bx--inline-notification--success",q[0]==="success"),S(e,"bx--inline-notification--warning",q[0]==="warning"),S(e,"bx--inline-notification--warning-alt",q[0]==="warning-alt")},i(q){d||(p(i.$$.fragment,q),p(y,q),p(A,q),p(D,q),p(N,q),p(G),d=!0)},o(q){v(i.$$.fragment,q),v(y,q),v(A,q),v(D,q),v(N,q),v(G),d=!1},d(q){q&&E(e),H(i),y&&y.d(q),A&&A.d(q),D&&D.d(q),N&&N.d(q),G&&G.d(),h=!1,ut(g)}}}function vU(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function kU(t){let e;return{c(){e=j(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function W2(t){let e,n;return e=new e5({props:{iconDescription:t[7],notificationType:"inline"}}),e.$on("click",t[9]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wU(t){let e,n,i=t[8]&&V2(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[8]?i?(i.p(l,r),r&256&&p(i,1)):(i=V2(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function yU(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","hideCloseButton","statusIconDescription","closeButtonDescription"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{hideCloseButton:h=!1}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e;const k=on();let y=!0,T;function M(N){k("close",{timeout:N===!0},{cancelable:!0})&&n(8,y=!1)}sn(()=>(u&&(T=setTimeout(()=>M(!0),u)),()=>{clearTimeout(T)}));function A(N){te.call(this,t,N)}function C(N){te.call(this,t,N)}function D(N){te.call(this,t,N)}function R(N){te.call(this,t,N)}return t.$$set=N=>{e=Z(Z({},e),Te(N)),n(10,l=de(e,i)),"kind"in N&&n(0,o=N.kind),"lowContrast"in N&&n(1,a=N.lowContrast),"timeout"in N&&n(11,u=N.timeout),"role"in N&&n(2,f=N.role),"title"in N&&n(3,c=N.title),"subtitle"in N&&n(4,d=N.subtitle),"hideCloseButton"in N&&n(5,h=N.hideCloseButton),"statusIconDescription"in N&&n(6,g=N.statusIconDescription),"closeButtonDescription"in N&&n(7,_=N.closeButtonDescription),"$$scope"in N&&n(12,s=N.$$scope)},[o,a,f,c,d,h,g,_,y,M,l,u,s,r,A,C,D,R]}class TU extends Oe{constructor(e){super(),Ee(this,e,yU,wU,Se,{kind:0,lowContrast:1,timeout:11,role:2,title:3,subtitle:4,hideCloseButton:5,statusIconDescription:6,closeButtonDescription:7})}}const nn=TU;function j2(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function SU(t){let e,n,i=t[1]&&j2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class OU extends Oe{constructor(e){super(),Ee(this,e,EU,SU,Se,{size:0,title:1})}}const MU=OU,CU=t=>({}),$2=t=>({});function q2(t){let e,n;const i=t[26].labelText,l=He(i,t,t[25],$2),r=l||AU(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[5]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[14]),S(e,"bx--label--disabled",t[4])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&33554432)&&Fe(l,i,s,s[25],n?Ue(i,s[25],o,CU):Ge(s[25]),$2):r&&r.p&&(!n||o[0]&8192)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&32)&&I(e,"for",s[5]),(!n||o[0]&16384)&&S(e,"bx--visually-hidden",s[14]),(!n||o[0]&16)&&S(e,"bx--label--disabled",s[4])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function AU(t){let e;return{c(){e=j(t[13])},m(n,i){O(n,e,i)},p(n,i){i[0]&8192&&Y(e,n[13])},d(n){n&&E(e)}}}function Y2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y;const T=t[26].default,M=He(T,t,t[25],null);u=new ho({props:{class:"bx--select__arrow"}});let A=t[7]&&Z2(),C=t[7]&&X2(t),D=!t[7]&&!t[9]&&t[11]&&K2(t);return{c(){e=P("div"),n=P("div"),i=P("select"),M&&M.c(),a=F(),U(u.$$.fragment),f=F(),A&&A.c(),d=F(),C&&C.c(),h=F(),D&&D.c(),g=je(),I(i,"aria-describedby",l=t[7]?t[16]:void 0),I(i,"aria-invalid",r=t[7]||void 0),i.disabled=s=t[4]||void 0,i.required=o=t[15]||void 0,I(i,"id",t[5]),I(i,"name",t[6]),S(i,"bx--select-input",!0),S(i,"bx--select-input--sm",t[1]==="sm"),S(i,"bx--select-input--xl",t[1]==="xl"),I(n,"data-invalid",c=t[7]||void 0),S(n,"bx--select-input__wrapper",!0),S(e,"bx--select-input--inline__wrapper",!0)},m(R,N){O(R,e,N),w(e,n),w(n,i),M&&M.m(i,null),t[35](i),w(n,a),z(u,n,null),w(n,f),A&&A.m(n,null),w(e,d),C&&C.m(e,null),O(R,h,N),D&&D.m(R,N),O(R,g,N),_=!0,k||(y=[J(i,"change",t[21]),J(i,"change",t[31]),J(i,"input",t[32]),J(i,"focus",t[33]),J(i,"blur",t[34])],k=!0)},p(R,N){M&&M.p&&(!_||N[0]&33554432)&&Fe(M,T,R,R[25],_?Ue(T,R[25],N,null):Ge(R[25]),null),(!_||N[0]&65664&&l!==(l=R[7]?R[16]:void 0))&&I(i,"aria-describedby",l),(!_||N[0]&128&&r!==(r=R[7]||void 0))&&I(i,"aria-invalid",r),(!_||N[0]&16&&s!==(s=R[4]||void 0))&&(i.disabled=s),(!_||N[0]&32768&&o!==(o=R[15]||void 0))&&(i.required=o),(!_||N[0]&32)&&I(i,"id",R[5]),(!_||N[0]&64)&&I(i,"name",R[6]),(!_||N[0]&2)&&S(i,"bx--select-input--sm",R[1]==="sm"),(!_||N[0]&2)&&S(i,"bx--select-input--xl",R[1]==="xl"),R[7]?A?N[0]&128&&p(A,1):(A=Z2(),A.c(),p(A,1),A.m(n,null)):A&&(ue(),v(A,1,1,()=>{A=null}),fe()),(!_||N[0]&128&&c!==(c=R[7]||void 0))&&I(n,"data-invalid",c),R[7]?C?C.p(R,N):(C=X2(R),C.c(),C.m(e,null)):C&&(C.d(1),C=null),!R[7]&&!R[9]&&R[11]?D?D.p(R,N):(D=K2(R),D.c(),D.m(g.parentNode,g)):D&&(D.d(1),D=null)},i(R){_||(p(M,R),p(u.$$.fragment,R),p(A),_=!0)},o(R){v(M,R),v(u.$$.fragment,R),v(A),_=!1},d(R){R&&(E(e),E(h),E(g)),M&&M.d(R),t[35](null),H(u),A&&A.d(),C&&C.d(),D&&D.d(R),k=!1,ut(y)}}}function Z2(t){let e,n;return e=new Ds({props:{class:"bx--select__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function X2(t){let e,n;return{c(){e=P("div"),n=j(t[8]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&256&&Y(n,i[8]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function K2(t){let e,n;return{c(){e=P("div"),n=j(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[4])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&16&&S(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&E(e)}}}function J2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T;const M=t[26].default,A=He(M,t,t[25],null);a=new ho({props:{class:"bx--select__arrow"}});let C=t[7]&&Q2(),D=!t[7]&&t[9]&&x2(),R=!t[7]&&t[11]&&ev(t),N=t[7]&&tv(t),G=!t[7]&&t[9]&&nv(t);return{c(){e=P("div"),n=P("select"),A&&A.c(),o=F(),U(a.$$.fragment),u=F(),C&&C.c(),f=F(),D&&D.c(),d=F(),R&&R.c(),h=F(),N&&N.c(),g=F(),G&&G.c(),_=je(),I(n,"id",t[5]),I(n,"name",t[6]),I(n,"aria-describedby",i=t[7]?t[16]:void 0),n.disabled=l=t[4]||void 0,n.required=r=t[15]||void 0,I(n,"aria-invalid",s=t[7]||void 0),S(n,"bx--select-input",!0),S(n,"bx--select-input--sm",t[1]==="sm"),S(n,"bx--select-input--xl",t[1]==="xl"),I(e,"data-invalid",c=t[7]||void 0),S(e,"bx--select-input__wrapper",!0)},m(B,$){O(B,e,$),w(e,n),A&&A.m(n,null),t[36](n),w(e,o),z(a,e,null),w(e,u),C&&C.m(e,null),w(e,f),D&&D.m(e,null),O(B,d,$),R&&R.m(B,$),O(B,h,$),N&&N.m(B,$),O(B,g,$),G&&G.m(B,$),O(B,_,$),k=!0,y||(T=[J(n,"change",t[21]),J(n,"change",t[27]),J(n,"input",t[28]),J(n,"focus",t[29]),J(n,"blur",t[30])],y=!0)},p(B,$){A&&A.p&&(!k||$[0]&33554432)&&Fe(A,M,B,B[25],k?Ue(M,B[25],$,null):Ge(B[25]),null),(!k||$[0]&32)&&I(n,"id",B[5]),(!k||$[0]&64)&&I(n,"name",B[6]),(!k||$[0]&65664&&i!==(i=B[7]?B[16]:void 0))&&I(n,"aria-describedby",i),(!k||$[0]&16&&l!==(l=B[4]||void 0))&&(n.disabled=l),(!k||$[0]&32768&&r!==(r=B[15]||void 0))&&(n.required=r),(!k||$[0]&128&&s!==(s=B[7]||void 0))&&I(n,"aria-invalid",s),(!k||$[0]&2)&&S(n,"bx--select-input--sm",B[1]==="sm"),(!k||$[0]&2)&&S(n,"bx--select-input--xl",B[1]==="xl"),B[7]?C?$[0]&128&&p(C,1):(C=Q2(),C.c(),p(C,1),C.m(e,f)):C&&(ue(),v(C,1,1,()=>{C=null}),fe()),!B[7]&&B[9]?D?$[0]&640&&p(D,1):(D=x2(),D.c(),p(D,1),D.m(e,null)):D&&(ue(),v(D,1,1,()=>{D=null}),fe()),(!k||$[0]&128&&c!==(c=B[7]||void 0))&&I(e,"data-invalid",c),!B[7]&&B[11]?R?R.p(B,$):(R=ev(B),R.c(),R.m(h.parentNode,h)):R&&(R.d(1),R=null),B[7]?N?N.p(B,$):(N=tv(B),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),!B[7]&&B[9]?G?G.p(B,$):(G=nv(B),G.c(),G.m(_.parentNode,_)):G&&(G.d(1),G=null)},i(B){k||(p(A,B),p(a.$$.fragment,B),p(C),p(D),k=!0)},o(B){v(A,B),v(a.$$.fragment,B),v(C),v(D),k=!1},d(B){B&&(E(e),E(d),E(h),E(g),E(_)),A&&A.d(B),t[36](null),H(a),C&&C.d(),D&&D.d(),R&&R.d(B),N&&N.d(B),G&&G.d(B),y=!1,ut(T)}}}function Q2(t){let e,n;return e=new Ds({props:{class:"bx--select__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function x2(t){let e,n;return e=new Vu({props:{class:"bx--select__invalid-icon bx--select__invalid-icon--warning"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ev(t){let e,n;return{c(){e=P("div"),n=j(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[4])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&16&&S(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&E(e)}}}function tv(t){let e,n;return{c(){e=P("div"),n=j(t[8]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&256&&Y(n,i[8]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function nv(t){let e,n;return{c(){e=P("div"),n=j(t[10]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&1024&&Y(n,i[10]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function LU(t){let e,n,i,l,r,s=!t[12]&&q2(t),o=t[2]&&Y2(t),a=!t[2]&&J2(t),u=[t[22]],f={};for(let c=0;c{s=null}),fe()):s?(s.p(c,d),d[0]&4096&&p(s,1)):(s=q2(c),s.c(),p(s,1),s.m(n,i)),c[2]?o?(o.p(c,d),d[0]&4&&p(o,1)):(o=Y2(c),o.c(),p(o,1),o.m(n,l)):o&&(ue(),v(o,1,1,()=>{o=null}),fe()),c[2]?a&&(ue(),v(a,1,1,()=>{a=null}),fe()):a?(a.p(c,d),d[0]&4&&p(a,1)):(a=J2(c),a.c(),p(a,1),a.m(n,null)),(!r||d[0]&4)&&S(n,"bx--select--inline",c[2]),(!r||d[0]&8)&&S(n,"bx--select--light",c[3]),(!r||d[0]&128)&&S(n,"bx--select--invalid",c[7]),(!r||d[0]&16)&&S(n,"bx--select--disabled",c[4]),(!r||d[0]&512)&&S(n,"bx--select--warning",c[9]),we(e,f=Pe(u,[d[0]&4194304&&c[22]])),S(e,"bx--form-item",!0)},i(c){r||(p(s),p(o),p(a),r=!0)},o(c){v(s),v(o),v(a),r=!1},d(c){c&&E(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function DU(t,e,n){let i;const l=["selected","size","inline","light","disabled","id","name","invalid","invalidText","warn","warnText","helperText","noLabel","labelText","hideLabel","ref","required"];let r=de(e,l),s,o,a,u,{$$slots:f={},$$scope:c}=e,{selected:d=void 0}=e,{size:h=void 0}=e,{inline:g=!1}=e,{light:_=!1}=e,{disabled:k=!1}=e,{id:y="ccs-"+Math.random().toString(36)}=e,{name:T=void 0}=e,{invalid:M=!1}=e,{invalidText:A=""}=e,{warn:C=!1}=e,{warnText:D=""}=e,{helperText:R=""}=e,{noLabel:N=!1}=e,{labelText:G=""}=e,{hideLabel:B=!1}=e,{ref:$=null}=e,{required:q=!1}=e;const V=on(),K=Wt(d);ct(t,K,Ae=>n(38,o=Ae));const x=Wt(null);ct(t,x,Ae=>n(40,u=Ae));const ie=Wt(null);ct(t,ie,Ae=>n(24,s=Ae));const X=Wt({});ct(t,X,Ae=>n(39,a=Ae)),pi("Select",{selectedValue:K,setDefaultValue:(Ae,ve)=>{s===null?(x.set(Ae),ie.set(ve)):u===Ae&&K.set(ve),X.update(me=>({...me,[ve]:typeof ve}))}});const ce=({target:Ae})=>{let ve=Ae.value;a[ve]==="number"&&(ve=Number(ve)),K.set(ve)};let ae;hr(()=>{n(23,d=o),ae!==void 0&&d!==ae&&V("update",o),ae=d});function ee(Ae){te.call(this,t,Ae)}function he(Ae){te.call(this,t,Ae)}function ne(Ae){te.call(this,t,Ae)}function re(Ae){te.call(this,t,Ae)}function oe(Ae){te.call(this,t,Ae)}function Re(Ae){te.call(this,t,Ae)}function qe(Ae){te.call(this,t,Ae)}function Ce(Ae){te.call(this,t,Ae)}function Ze(Ae){xe[Ae?"unshift":"push"](()=>{$=Ae,n(0,$)})}function be(Ae){xe[Ae?"unshift":"push"](()=>{$=Ae,n(0,$)})}return t.$$set=Ae=>{e=Z(Z({},e),Te(Ae)),n(22,r=de(e,l)),"selected"in Ae&&n(23,d=Ae.selected),"size"in Ae&&n(1,h=Ae.size),"inline"in Ae&&n(2,g=Ae.inline),"light"in Ae&&n(3,_=Ae.light),"disabled"in Ae&&n(4,k=Ae.disabled),"id"in Ae&&n(5,y=Ae.id),"name"in Ae&&n(6,T=Ae.name),"invalid"in Ae&&n(7,M=Ae.invalid),"invalidText"in Ae&&n(8,A=Ae.invalidText),"warn"in Ae&&n(9,C=Ae.warn),"warnText"in Ae&&n(10,D=Ae.warnText),"helperText"in Ae&&n(11,R=Ae.helperText),"noLabel"in Ae&&n(12,N=Ae.noLabel),"labelText"in Ae&&n(13,G=Ae.labelText),"hideLabel"in Ae&&n(14,B=Ae.hideLabel),"ref"in Ae&&n(0,$=Ae.ref),"required"in Ae&&n(15,q=Ae.required),"$$scope"in Ae&&n(25,c=Ae.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32&&n(16,i=`error-${y}`),t.$$.dirty[0]&25165824&&K.set(d??s)},[$,h,g,_,k,y,T,M,A,C,D,R,N,G,B,q,i,K,x,ie,X,ce,r,d,s,c,f,ee,he,ne,re,oe,Re,qe,Ce,Ze,be]}class IU extends Oe{constructor(e){super(),Ee(this,e,DU,LU,Se,{selected:23,size:1,inline:2,light:3,disabled:4,id:5,name:6,invalid:7,invalidText:8,warn:9,warnText:10,helperText:11,noLabel:12,labelText:13,hideLabel:14,ref:0,required:15},null,[-1,-1])}}const Wr=IU;function RU(t){let e,n=(t[1]||t[0])+"",i,l,r;return{c(){e=P("option"),i=j(n),e.__value=t[0],Ll(e,e.__value),e.disabled=t[3],e.hidden=t[2],e.selected=t[4],I(e,"class",l=t[5].class),I(e,"style",r=t[5].style),S(e,"bx--select-option",!0)},m(s,o){O(s,e,o),w(e,i)},p(s,[o]){o&3&&n!==(n=(s[1]||s[0])+"")&&Y(i,n),o&1&&(e.__value=s[0],Ll(e,e.__value)),o&8&&(e.disabled=s[3]),o&4&&(e.hidden=s[2]),o&16&&(e.selected=s[4]),o&32&&l!==(l=s[5].class)&&I(e,"class",l),o&32&&r!==(r=s[5].style)&&I(e,"style",r),o&32&&S(e,"bx--select-option",!0)},i:_e,o:_e,d(s){s&&E(e)}}}function PU(t,e,n){const i=["value","text","hidden","disabled"];let l=de(e,i),{value:r=""}=e,{text:s=""}=e,{hidden:o=!1}=e,{disabled:a=!1}=e;const u="ccs-"+Math.random().toString(36),f=jn("Select")||jn("TimePickerSelect");let c=!1;const d=f.selectedValue.subscribe(h=>{n(4,c=h===r)});return sn(()=>()=>d()),t.$$set=h=>{e=Z(Z({},e),Te(h)),n(5,l=de(e,i)),"value"in h&&n(0,r=h.value),"text"in h&&n(1,s=h.text),"hidden"in h&&n(2,o=h.hidden),"disabled"in h&&n(3,a=h.disabled)},t.$$.update=()=>{var h;t.$$.dirty&1&&((h=f==null?void 0:f.setDefaultValue)==null||h.call(f,u,r))},[r,s,o,a,c,l]}class NU extends Oe{constructor(e){super(),Ee(this,e,PU,RU,Se,{value:0,text:1,hidden:2,disabled:3})}}const Rn=NU;function BU(t){let e,n,i,l;const r=t[7].default,s=He(r,t,t[6],null);let o=[t[3]],a={};for(let u=0;uA.reduce((C,D)=>({...C,[D.id]:D}),{}));ct(t,g,A=>n(12,r=A));const _=Wt(c);pi("ProgressIndicator",{steps:h,stepsById:g,preventChangeOnClick:{subscribe:_.subscribe},add:A=>{h.update(C=>A.id in r?C.map(D=>D.id===A.id?{...D,...A}:D):[...C,{...A,index:C.length,current:C.length===a,complete:A.complete}])},change:A=>{c||(n(4,a=A),d("change",A))}});function k(A){te.call(this,t,A)}function y(A){te.call(this,t,A)}function T(A){te.call(this,t,A)}function M(A){te.call(this,t,A)}return t.$$set=A=>{e=Z(Z({},e),Te(A)),n(3,l=de(e,i)),"currentIndex"in A&&n(4,a=A.currentIndex),"vertical"in A&&n(0,u=A.vertical),"spaceEqually"in A&&n(1,f=A.spaceEqually),"preventChangeOnClick"in A&&n(5,c=A.preventChangeOnClick),"$$scope"in A&&n(6,o=A.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&h.update(A=>A.map((C,D)=>({...C,current:D===a}))),t.$$.dirty&32&&_.set(c)},[u,f,g,l,a,c,o,s,k,y,T,M]}class HU extends Oe{constructor(e){super(),Ee(this,e,zU,BU,Se,{currentIndex:4,vertical:0,spaceEqually:1,preventChangeOnClick:5})}}const UU=HU;function iv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function FU(t){let e,n,i,l=t[1]&&iv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class VU extends Oe{constructor(e){super(),Ee(this,e,GU,FU,Se,{size:0,title:1})}}const WU=VU;function lv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function jU(t){let e,n,i,l=t[1]&&lv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class qU extends Oe{constructor(e){super(),Ee(this,e,$U,jU,Se,{size:0,title:1})}}const YU=qU;function rv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function ZU(t){let e,n,i=t[1]&&rv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class KU extends Oe{constructor(e){super(),Ee(this,e,XU,ZU,Se,{size:0,title:1})}}const JU=KU;function sv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function QU(t){let e,n,i=t[1]&&sv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class eF extends Oe{constructor(e){super(),Ee(this,e,xU,QU,Se,{size:0,title:1})}}const tF=eF,nF=t=>({}),ov=t=>({props:{class:"bx--progress-label"}});function iF(t){let e,n;return e=new JU({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lF(t){let e,n;return e=new WU({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rF(t){let e,n;return e=new tF({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sF(t){let e,n;return e=new YU({props:{class:"bx--progress__warning",title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oF(t){let e,n;return{c(){e=P("p"),n=j(t[5]),S(e,"bx--progress-label",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&32&&Y(n,i[5])},d(i){i&&E(e)}}}function av(t){let e,n;return{c(){e=P("p"),n=j(t[6]),S(e,"bx--progress-optional",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function aF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;const g=[sF,rF,lF,iF],_=[];function k(R,N){return R[3]?0:R[1]?1:R[0]?2:3}i=k(t),l=_[i]=g[i](t);const y=t[14].default,T=He(y,t,t[13],ov),M=T||oF(t);let A=t[6]&&av(t),C=[{id:t[7]},t[12]],D={};for(let R=0;R{_[G]=null}),fe(),l=_[i],l?l.p(R,N):(l=_[i]=g[i](R),l.c()),p(l,1),l.m(n,r)),T?T.p&&(!c||N&8192)&&Fe(T,y,R,R[13],c?Ue(y,R[13],N,nF):Ge(R[13]),ov):M&&M.p&&(!c||N&32)&&M.p(R,c?N:-1),R[6]?A?A.p(R,N):(A=av(R),A.c(),A.m(s,null)):A&&(A.d(1),A=null),(!c||N&4)&&(n.disabled=R[2]),(!c||N&4)&&I(n,"aria-disabled",R[2]),(!c||N&6&&f!==(f=!R[1]&&!R[2]?"0":"-1"))&&I(n,"tabindex",f),(!c||N&514)&&S(n,"bx--progress-step-button--unclickable",R[1]||R[9]),we(e,D=Pe(C,[(!c||N&128)&&{id:R[7]},N&4096&&R[12]])),S(e,"bx--progress-step",!0),S(e,"bx--progress-step--current",R[1]),S(e,"bx--progress-step--complete",R[0]),S(e,"bx--progress-step--incomplete",!R[0]&&!R[1]),S(e,"bx--progress-step--disabled",R[2])},i(R){c||(p(l),p(M,R),c=!0)},o(R){v(l),v(M,R),c=!1},d(R){R&&E(e),_[i].d(),M&&M.d(R),A&&A.d(),d=!1,ut(h)}}}function uF(t,e,n){const i=["complete","current","disabled","invalid","description","label","secondaryLabel","id"];let l=de(e,i),r,{$$slots:s={},$$scope:o}=e,{complete:a=!1}=e,{current:u=!1}=e,{disabled:f=!1}=e,{invalid:c=!1}=e,{description:d=""}=e,{label:h=""}=e,{secondaryLabel:g=""}=e,{id:_="ccs-"+Math.random().toString(36)}=e,k={};const{stepsById:y,add:T,change:M,preventChangeOnClick:A}=jn("ProgressIndicator");ct(t,A,V=>n(9,r=V));const C=y.subscribe(V=>{V[_]&&(n(8,k=V[_]),n(1,u=k.current),n(0,a=k.complete))});sn(()=>()=>{C()});function D(V){te.call(this,t,V)}function R(V){te.call(this,t,V)}function N(V){te.call(this,t,V)}function G(V){te.call(this,t,V)}function B(V){te.call(this,t,V)}const $=()=>{k.complete&&M(k.index)},q=V=>{k.complete&&(V.key===" "||V.key==="Enter")&&M(k.index)};return t.$$set=V=>{e=Z(Z({},e),Te(V)),n(12,l=de(e,i)),"complete"in V&&n(0,a=V.complete),"current"in V&&n(1,u=V.current),"disabled"in V&&n(2,f=V.disabled),"invalid"in V&&n(3,c=V.invalid),"description"in V&&n(4,d=V.description),"label"in V&&n(5,h=V.label),"secondaryLabel"in V&&n(6,g=V.secondaryLabel),"id"in V&&n(7,_=V.id),"$$scope"in V&&n(13,o=V.$$scope)},t.$$.update=()=>{t.$$.dirty&133&&T({id:_,complete:a,disabled:f})},[a,u,f,c,d,h,g,_,k,r,M,A,l,o,s,D,R,N,G,B,$,q]}class fF extends Oe{constructor(e){super(),Ee(this,e,uF,aF,Se,{complete:0,current:1,disabled:2,invalid:3,description:4,label:5,secondaryLabel:6,id:7})}}const cF=fF,dF=t=>({}),uv=t=>({});function fv(t){let e,n;const i=t[11].legendText,l=He(i,t,t[10],uv),r=l||hF(t);return{c(){e=P("legend"),r&&r.c(),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[2])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&1024)&&Fe(l,i,s,s[10],n?Ue(i,s[10],o,dF):Ge(s[10]),uv):r&&r.p&&(!n||o&2)&&r.p(s,n?o:-1),(!n||o&4)&&S(e,"bx--visually-hidden",s[2])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function hF(t){let e;return{c(){e=j(t[1])},m(n,i){O(n,e,i)},p(n,i){i&2&&Y(e,n[1])},d(n){n&&E(e)}}}function mF(t){let e,n,i,l,r,s,o=(t[1]||t[8].legendText)&&fv(t);const a=t[11].default,u=He(a,t,t[10],null);let f=[{id:t[5]},t[7]],c={};for(let d=0;d{o=null}),fe()),u&&u.p&&(!l||h&1024)&&Fe(u,a,d,d[10],l?Ue(a,d[10],h,null):Ge(d[10]),null),(!l||h&1)&&(n.disabled=d[0]),(!l||h&16)&&S(n,"bx--radio-button-group--vertical",d[4]==="vertical"),(!l||h&8)&&S(n,"bx--radio-button-group--label-left",d[3]==="left"),(!l||h&8)&&S(n,"bx--radio-button-group--label-right",d[3]==="right"),we(e,c=Pe(f,[(!l||h&32)&&{id:d[5]},h&128&&d[7]])),S(e,"bx--form-item",!0)},i(d){l||(p(o),p(u,d),l=!0)},o(d){v(o),v(u,d),l=!1},d(d){d&&E(e),o&&o.d(),u&&u.d(d),r=!1,ut(s)}}}function gF(t,e,n){const i=["selected","disabled","legendText","hideLegend","labelPosition","orientation","id"];let l=de(e,i),r,{$$slots:s={},$$scope:o}=e;const a=di(s);let{selected:u=void 0}=e,{disabled:f=!1}=e,{legendText:c=""}=e,{hideLegend:d=!1}=e,{labelPosition:h="right"}=e,{orientation:g="horizontal"}=e,{id:_=void 0}=e;const k=on(),y=Wt(u);ct(t,y,D=>n(16,r=D)),pi("RadioButtonGroup",{selectedValue:y,add:({checked:D,value:R})=>{D&&y.set(R)},update:D=>{n(9,u=D)}}),sn(()=>{ro(y,r=u,r)}),aI(()=>{ro(y,r=u,r)}),y.subscribe(D=>{n(9,u=D),k("change",D)});function T(D){te.call(this,t,D)}function M(D){te.call(this,t,D)}function A(D){te.call(this,t,D)}function C(D){te.call(this,t,D)}return t.$$set=D=>{e=Z(Z({},e),Te(D)),n(7,l=de(e,i)),"selected"in D&&n(9,u=D.selected),"disabled"in D&&n(0,f=D.disabled),"legendText"in D&&n(1,c=D.legendText),"hideLegend"in D&&n(2,d=D.hideLegend),"labelPosition"in D&&n(3,h=D.labelPosition),"orientation"in D&&n(4,g=D.orientation),"id"in D&&n(5,_=D.id),"$$scope"in D&&n(10,o=D.$$scope)},[f,c,d,h,g,_,y,l,a,u,o,s,T,M,A,C]}class _F extends Oe{constructor(e){super(),Ee(this,e,gF,mF,Se,{selected:9,disabled:0,legendText:1,hideLegend:2,labelPosition:3,orientation:4,id:5})}}const n5=_F;function pF(t){let e,n,i,l;const r=t[8].default,s=He(r,t,t[7],null);let o=[{role:"table"},t[4]],a={};for(let u=0;un(6,r=T)),pi("StructuredListWrapper",{selectedValue:h,update:T=>{h.set(T)}});function g(T){te.call(this,t,T)}function _(T){te.call(this,t,T)}function k(T){te.call(this,t,T)}function y(T){te.call(this,t,T)}return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(4,l=de(e,i)),"selected"in T&&n(5,a=T.selected),"condensed"in T&&n(0,u=T.condensed),"flush"in T&&n(1,f=T.flush),"selection"in T&&n(2,c=T.selection),"$$scope"in T&&n(7,o=T.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(5,a=r),t.$$.dirty&64&&d("change",r)},[u,f,c,h,l,a,r,o,s,g,_,k,y]}class vF extends Oe{constructor(e){super(),Ee(this,e,bF,pF,Se,{selected:5,condensed:0,flush:1,selection:2})}}const $u=vF;function kF(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class yF extends Oe{constructor(e){super(),Ee(this,e,wF,kF,Se,{})}}const qu=yF;function TF(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class EF extends Oe{constructor(e){super(),Ee(this,e,SF,TF,Se,{})}}const i5=EF;function OF(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{role:n=t[0]?"columnheader":"cell"},t[2]],u={};for(let f=0;f{e=Z(Z({},e),Te(h)),n(2,l=de(e,i)),"head"in h&&n(0,o=h.head),"noWrap"in h&&n(1,a=h.noWrap),"$$scope"in h&&n(3,s=h.$$scope)},[o,a,l,s,r,u,f,c,d]}class CF extends Oe{constructor(e){super(),Ee(this,e,MF,OF,Se,{head:0,noWrap:1})}}const qt=CF;function AF(t){let e,n,i,l;const r=t[5].default,s=He(r,t,t[4],null);let o=[{role:"row"},t[3]],a={};for(let u=0;u{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function IF(t,e,n){const i=["head","label","tabindex"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{head:o=!1}=e,{label:a=!1}=e,{tabindex:u="0"}=e;function f(M){te.call(this,t,M)}function c(M){te.call(this,t,M)}function d(M){te.call(this,t,M)}function h(M){te.call(this,t,M)}function g(M){te.call(this,t,M)}function _(M){te.call(this,t,M)}function k(M){te.call(this,t,M)}function y(M){te.call(this,t,M)}function T(M){te.call(this,t,M)}return t.$$set=M=>{e=Z(Z({},e),Te(M)),n(3,l=de(e,i)),"head"in M&&n(0,o=M.head),"label"in M&&n(1,a=M.label),"tabindex"in M&&n(2,u=M.tabindex),"$$scope"in M&&n(4,s=M.$$scope)},[o,a,u,l,s,r,f,c,d,h,g,_,k,y,T]}class RF extends Oe{constructor(e){super(),Ee(this,e,IF,DF,Se,{head:0,label:1,tabindex:2})}}const si=RF,PF=t=>({}),cv=t=>({});function dv(t){let e=t[3].label+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&8&&e!==(e=i[3].label+"")&&Y(n,e)},d(i){i&&E(n)}}}function NF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h=t[3]&&dv(t);r=new ho({props:{"aria-hidden":"true",title:t[1]}});const g=t[20].default,_=He(g,t,t[19],null);let k=[{role:"navigation"},t[10]],y={};for(let A=0;An(18,u=ee));const A=ur(M,ee=>ee.reduce((he,ne)=>({...he,[ne.id]:ne}),{}));ct(t,A,ee=>n(28,f=ee));const C=Wt(_),D=Wt(void 0);ct(t,D,ee=>n(16,o=ee));const R=Wt([]);ct(t,R,ee=>n(17,a=ee));const N=ur(R,ee=>ee.reduce((he,ne)=>({...he,[ne.id]:ne}),{})),G=Wt(void 0);let B=null;pi("Tabs",{tabs:M,contentById:N,selectedTab:D,selectedContent:G,useAutoWidth:C,add:ee=>{M.update(he=>[...he,{...ee,index:he.length}])},addContent:ee=>{R.update(he=>[...he,{...ee,index:he.length}])},update:ee=>{n(14,q=f[ee].index)},change:async ee=>{let he=q+ee;he<0?he=u.length-1:he>=u.length&&(he=0);let ne=u[he].disabled;for(;ne;)he=he+ee,he<0?he=u.length-1:he>=u.length&&(he=0),ne=u[he].disabled;n(14,q=he),await Ou();const re=B==null?void 0:B.querySelectorAll("[role='tab']")[q];re==null||re.focus()}}),hr(()=>{n(12,h=q),V>-1&&V!==q&&T("change",q),V=q});let $=!0,q=h,V=-1;function K(ee){te.call(this,t,ee)}function x(ee){te.call(this,t,ee)}const ie=()=>{n(5,$=!$)},X=()=>{n(5,$=!$)},ce=()=>{n(5,$=!$)};function ae(ee){xe[ee?"unshift":"push"](()=>{B=ee,n(4,B)})}return t.$$set=ee=>{n(11,e=Z(Z({},e),Te(ee))),n(10,s=de(e,r)),"selected"in ee&&n(12,h=ee.selected),"type"in ee&&n(0,g=ee.type),"autoWidth"in ee&&n(13,_=ee.autoWidth),"iconDescription"in ee&&n(1,k=ee.iconDescription),"triggerHref"in ee&&n(2,y=ee.triggerHref),"$$scope"in ee&&n(19,d=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&4096&&n(14,q=h),t.$$.dirty[0]&278528&&n(3,i=u[q]||void 0),t.$$.dirty[0]&147456&&n(15,l=a[q]||void 0),t.$$.dirty[0]&32776&&(i&&D.set(i.id),l&&G.set(l.id)),t.$$.dirty[0]&65536&&o&&n(5,$=!0),t.$$.dirty[0]&8192&&C.set(_)},e=Te(e),[g,k,y,i,B,$,M,A,D,R,s,e,h,_,q,l,o,a,u,d,c,K,x,ie,X,ce,ae]}class zF extends Oe{constructor(e){super(),Ee(this,e,BF,NF,Se,{selected:12,type:0,autoWidth:13,iconDescription:1,triggerHref:2},null,[-1,-1])}}const mg=zF;function HF(t){let e;return{c(){e=j(t[1])},m(n,i){O(n,e,i)},p(n,i){i&2&&Y(e,n[1])},d(n){n&&E(e)}}}function UF(t){let e,n,i,l,r,s;const o=t[15].default,a=He(o,t,t[14],null),u=a||HF(t);let f=[{tabindex:"-1"},{role:"presentation"},t[12]],c={};for(let d=0;dn(13,s=q)),ct(t,y,q=>n(7,o=q)),T({id:g,label:f,disabled:d});function C(q){te.call(this,t,q)}function D(q){te.call(this,t,q)}function R(q){te.call(this,t,q)}function N(q){te.call(this,t,q)}function G(q){xe[q?"unshift":"push"](()=>{_=q,n(0,_)})}const B=()=>{d||M(g)},$=({key:q})=>{d||(q==="ArrowRight"?A(1):q==="ArrowLeft"?A(-1):(q===" "||q==="Enter")&&M(g))};return t.$$set=q=>{e=Z(Z({},e),Te(q)),n(12,r=de(e,l)),"label"in q&&n(1,f=q.label),"href"in q&&n(2,c=q.href),"disabled"in q&&n(3,d=q.disabled),"tabindex"in q&&n(4,h=q.tabindex),"id"in q&&n(5,g=q.id),"ref"in q&&n(0,_=q.ref),"$$scope"in q&&n(14,u=q.$$scope)},t.$$.update=()=>{t.$$.dirty&8224&&n(6,i=s===g)},[_,f,c,d,h,g,i,o,k,y,M,A,r,s,u,a,C,D,R,N,G,B,$]}class GF extends Oe{constructor(e){super(),Ee(this,e,FF,UF,Se,{label:1,href:2,disabled:3,tabindex:4,id:5,ref:0})}}const ql=GF;function VF(t){let e,n,i,l;const r=t[12].default,s=He(r,t,t[11],null);let o=[{role:"tabpanel"},{"aria-labelledby":t[1]},{"aria-hidden":n=!t[2]},{hidden:i=t[2]?void 0:""},{id:t[0]},t[6]],a={};for(let u=0;un(10,f=T)),ct(t,k,T=>n(8,a=T)),ct(t,y,T=>n(9,u=T)),_({id:h}),t.$$set=T=>{e=Z(Z({},e),Te(T)),n(6,o=de(e,s)),"id"in T&&n(0,h=T.id),"$$scope"in T&&n(11,d=T.$$scope)},t.$$.update=()=>{t.$$.dirty&1025&&n(2,i=f===h),t.$$.dirty&513&&n(7,l=u[h].index),t.$$.dirty&384&&n(1,r=a[l].id)},[h,r,i,g,k,y,o,l,a,u,f,d,c]}class jF extends Oe{constructor(e){super(),Ee(this,e,WF,VF,Se,{id:0})}}const Yl=jF;function $F(t){let e,n,i,l=[t[1]],r={};for(let s=0;s{e=Z(Z({},e),Te(f)),n(1,l=de(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class YF extends Oe{constructor(e){super(),Ee(this,e,qF,$F,Se,{size:0})}}const ZF=YF,XF=t=>({}),hv=t=>({}),KF=t=>({}),mv=t=>({}),JF=t=>({}),gv=t=>({props:{class:"bx--tag__label"}});function QF(t){let e,n,i,l,r,s,o=(t[11].icon||t[7])&&_v(t);const a=t[13].default,u=He(a,t,t[12],null);let f=[{id:t[8]},t[10]],c={};for(let d=0;d{o=null}),fe()),u&&u.p&&(!l||h&4096)&&Fe(u,a,d,d[12],l?Ue(a,d[12],h,null):Ge(d[12]),null),we(e,c=Pe(f,[(!l||h&256)&&{id:d[8]},h&1024&&d[10]])),S(e,"bx--tag",!0),S(e,"bx--tag--disabled",d[3]),S(e,"bx--tag--sm",d[1]==="sm"),S(e,"bx--tag--red",d[0]==="red"),S(e,"bx--tag--magenta",d[0]==="magenta"),S(e,"bx--tag--purple",d[0]==="purple"),S(e,"bx--tag--blue",d[0]==="blue"),S(e,"bx--tag--cyan",d[0]==="cyan"),S(e,"bx--tag--teal",d[0]==="teal"),S(e,"bx--tag--green",d[0]==="green"),S(e,"bx--tag--gray",d[0]==="gray"),S(e,"bx--tag--cool-gray",d[0]==="cool-gray"),S(e,"bx--tag--warm-gray",d[0]==="warm-gray"),S(e,"bx--tag--high-contrast",d[0]==="high-contrast"),S(e,"bx--tag--outline",d[0]==="outline")},i(d){l||(p(o),p(u,d),l=!0)},o(d){v(o),v(u,d),l=!1},d(d){d&&E(e),o&&o.d(),u&&u.d(d),r=!1,ut(s)}}}function xF(t){let e,n,i,l,r,s,o,a=(t[11].icon||t[7])&&pv(t);const u=t[13].default,f=He(u,t,t[12],null);let c=[{type:"button"},{id:t[8]},{disabled:t[3]},{"aria-disabled":t[3]},{tabindex:l=t[3]?"-1":void 0},t[10]],d={};for(let h=0;h{a=null}),fe()),f&&f.p&&(!r||g&4096)&&Fe(f,u,h,h[12],r?Ue(u,h[12],g,null):Ge(h[12]),null),we(e,d=Pe(c,[{type:"button"},(!r||g&256)&&{id:h[8]},(!r||g&8)&&{disabled:h[3]},(!r||g&8)&&{"aria-disabled":h[3]},(!r||g&8&&l!==(l=h[3]?"-1":void 0))&&{tabindex:l},g&1024&&h[10]])),S(e,"bx--tag",!0),S(e,"bx--tag--interactive",!0),S(e,"bx--tag--disabled",h[3]),S(e,"bx--tag--sm",h[1]==="sm"),S(e,"bx--tag--red",h[0]==="red"),S(e,"bx--tag--magenta",h[0]==="magenta"),S(e,"bx--tag--purple",h[0]==="purple"),S(e,"bx--tag--blue",h[0]==="blue"),S(e,"bx--tag--cyan",h[0]==="cyan"),S(e,"bx--tag--teal",h[0]==="teal"),S(e,"bx--tag--green",h[0]==="green"),S(e,"bx--tag--gray",h[0]==="gray"),S(e,"bx--tag--cool-gray",h[0]==="cool-gray"),S(e,"bx--tag--warm-gray",h[0]==="warm-gray"),S(e,"bx--tag--high-contrast",h[0]==="high-contrast"),S(e,"bx--tag--outline",h[0]==="outline")},i(h){r||(p(a),p(f,h),r=!0)},o(h){v(a),v(f,h),r=!1},d(h){h&&E(e),a&&a.d(),f&&f.d(h),s=!1,ut(o)}}}function eG(t){let e,n,i,l,r,s,o;const a=t[13].default,u=He(a,t,t[12],gv),f=u||lG(t);l=new Dl({});let c=[{"aria-label":t[6]},{id:t[8]},t[10]],d={};for(let h=0;h{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function pv(t){let e,n;const i=t[13].icon,l=He(i,t,t[12],mv),r=l||iG(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--tag__custom-icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&4096)&&Fe(l,i,s,s[12],n?Ue(i,s[12],o,KF):Ge(s[12]),mv):r&&r.p&&(!n||o&128)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function iG(t){let e,n,i;var l=t[7];function r(s,o){return{}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&128&&l!==(l=s[7])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function lG(t){let e,n;return{c(){e=P("span"),n=j(t[0]),S(e,"bx--tag__label",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1&&Y(n,i[0])},d(i){i&&E(e)}}}function rG(t){let e,n,i,l;const r=[tG,eG,xF,QF],s=[];function o(a,u){return a[5]?0:a[2]?1:a[4]?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function sG(t,e,n){const i=["type","size","filter","disabled","interactive","skeleton","title","icon","id"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{type:a=void 0}=e,{size:u="default"}=e,{filter:f=!1}=e,{disabled:c=!1}=e,{interactive:d=!1}=e,{skeleton:h=!1}=e,{title:g="Clear filter"}=e,{icon:_=void 0}=e,{id:k="ccs-"+Math.random().toString(36)}=e;const y=on();function T(ae){te.call(this,t,ae)}function M(ae){te.call(this,t,ae)}function A(ae){te.call(this,t,ae)}function C(ae){te.call(this,t,ae)}function D(ae){te.call(this,t,ae)}function R(ae){te.call(this,t,ae)}function N(ae){te.call(this,t,ae)}function G(ae){te.call(this,t,ae)}function B(ae){te.call(this,t,ae)}function $(ae){te.call(this,t,ae)}function q(ae){te.call(this,t,ae)}function V(ae){te.call(this,t,ae)}function K(ae){te.call(this,t,ae)}function x(ae){te.call(this,t,ae)}function ie(ae){te.call(this,t,ae)}function X(ae){te.call(this,t,ae)}const ce=()=>{y("close")};return t.$$set=ae=>{e=Z(Z({},e),Te(ae)),n(10,l=de(e,i)),"type"in ae&&n(0,a=ae.type),"size"in ae&&n(1,u=ae.size),"filter"in ae&&n(2,f=ae.filter),"disabled"in ae&&n(3,c=ae.disabled),"interactive"in ae&&n(4,d=ae.interactive),"skeleton"in ae&&n(5,h=ae.skeleton),"title"in ae&&n(6,g=ae.title),"icon"in ae&&n(7,_=ae.icon),"id"in ae&&n(8,k=ae.id),"$$scope"in ae&&n(12,s=ae.$$scope)},[a,u,f,c,d,h,g,_,k,y,l,o,s,r,T,M,A,C,D,R,N,G,B,$,q,V,K,x,ie,X,ce]}class oG extends Oe{constructor(e){super(),Ee(this,e,sG,rG,Se,{type:0,size:1,filter:2,disabled:3,interactive:4,skeleton:5,title:6,icon:7,id:8})}}const Rt=oG,aG=t=>({}),bv=t=>({});function vv(t){let e,n,i,l;const r=t[20].labelText,s=He(r,t,t[19],bv),o=s||uG(t);let a=t[5]&&kv(t);return{c(){e=P("div"),n=P("label"),o&&o.c(),i=F(),a&&a.c(),I(n,"for",t[14]),S(n,"bx--label",!0),S(n,"bx--visually-hidden",t[11]),S(n,"bx--label--disabled",t[7]),S(e,"bx--text-area__label-wrapper",!0)},m(u,f){O(u,e,f),w(e,n),o&&o.m(n,null),w(e,i),a&&a.m(e,null),l=!0},p(u,f){s?s.p&&(!l||f[0]&524288)&&Fe(s,r,u,u[19],l?Ue(r,u[19],f,aG):Ge(u[19]),bv):o&&o.p&&(!l||f[0]&1024)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&16384)&&I(n,"for",u[14]),(!l||f[0]&2048)&&S(n,"bx--visually-hidden",u[11]),(!l||f[0]&128)&&S(n,"bx--label--disabled",u[7]),u[5]?a?a.p(u,f):(a=kv(u),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){l||(p(o,u),l=!0)},o(u){v(o,u),l=!1},d(u){u&&E(e),o&&o.d(u),a&&a.d()}}}function uG(t){let e;return{c(){e=j(t[10])},m(n,i){O(n,e,i)},p(n,i){i[0]&1024&&Y(e,n[10])},d(n){n&&E(e)}}}function kv(t){let e,n=t[0].length+"",i,l,r;return{c(){e=P("div"),i=j(n),l=j("/"),r=j(t[5]),S(e,"bx--label",!0),S(e,"bx--label--disabled",t[7])},m(s,o){O(s,e,o),w(e,i),w(e,l),w(e,r)},p(s,o){o[0]&1&&n!==(n=s[0].length+"")&&Y(i,n),o[0]&32&&Y(r,s[5]),o[0]&128&&S(e,"bx--label--disabled",s[7])},d(s){s&&E(e)}}}function wv(t){let e,n;return e=new Ds({props:{class:"bx--text-area__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function yv(t){let e,n;return{c(){e=P("div"),n=j(t[9]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[7])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&512&&Y(n,i[9]),l[0]&128&&S(e,"bx--form__helper-text--disabled",i[7])},d(i){i&&E(e)}}}function Tv(t){let e,n;return{c(){e=P("div"),n=j(t[13]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&8192&&Y(n,i[13]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function fG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=(t[10]||t[17].labelText)&&!t[11]&&vv(t),k=t[12]&&wv(),y=[{"aria-invalid":s=t[12]||void 0},{"aria-describedby":o=t[12]?t[16]:void 0},{disabled:t[7]},{id:t[14]},{name:t[15]},{cols:t[3]},{rows:t[4]},{placeholder:t[2]},{readOnly:t[8]},{maxlength:a=t[5]??void 0},t[18]],T={};for(let C=0;C{_=null}),fe()),C[12]?k?D[0]&4096&&p(k,1):(k=wv(),k.c(),p(k,1),k.m(i,l)):k&&(ue(),v(k,1,1,()=>{k=null}),fe()),we(r,T=Pe(y,[(!d||D[0]&4096&&s!==(s=C[12]||void 0))&&{"aria-invalid":s},(!d||D[0]&69632&&o!==(o=C[12]?C[16]:void 0))&&{"aria-describedby":o},(!d||D[0]&128)&&{disabled:C[7]},(!d||D[0]&16384)&&{id:C[14]},(!d||D[0]&32768)&&{name:C[15]},(!d||D[0]&8)&&{cols:C[3]},(!d||D[0]&16)&&{rows:C[4]},(!d||D[0]&4)&&{placeholder:C[2]},(!d||D[0]&256)&&{readOnly:C[8]},(!d||D[0]&32&&a!==(a=C[5]??void 0))&&{maxlength:a},D[0]&262144&&C[18]])),D[0]&1&&Ll(r,C[0]),S(r,"bx--text-area",!0),S(r,"bx--text-area--light",C[6]),S(r,"bx--text-area--invalid",C[12]),(!d||D[0]&4096&&u!==(u=C[12]||void 0))&&I(i,"data-invalid",u),!C[12]&&C[9]?M?M.p(C,D):(M=yv(C),M.c(),M.m(e,c)):M&&(M.d(1),M=null),C[12]?A?A.p(C,D):(A=Tv(C),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i(C){d||(p(_),p(k),d=!0)},o(C){v(_),v(k),d=!1},d(C){C&&E(e),_&&_.d(),k&&k.d(),t[32](null),M&&M.d(),A&&A.d(),h=!1,ut(g)}}}function cG(t,e,n){let i;const l=["value","placeholder","cols","rows","maxCount","light","disabled","readonly","helperText","labelText","hideLabel","invalid","invalidText","id","name","ref"];let r=de(e,l),{$$slots:s={},$$scope:o}=e;const a=di(s);let{value:u=""}=e,{placeholder:f=""}=e,{cols:c=50}=e,{rows:d=4}=e,{maxCount:h=void 0}=e,{light:g=!1}=e,{disabled:_=!1}=e,{readonly:k=!1}=e,{helperText:y=""}=e,{labelText:T=""}=e,{hideLabel:M=!1}=e,{invalid:A=!1}=e,{invalidText:C=""}=e,{id:D="ccs-"+Math.random().toString(36)}=e,{name:R=void 0}=e,{ref:N=null}=e;function G(ne){te.call(this,t,ne)}function B(ne){te.call(this,t,ne)}function $(ne){te.call(this,t,ne)}function q(ne){te.call(this,t,ne)}function V(ne){te.call(this,t,ne)}function K(ne){te.call(this,t,ne)}function x(ne){te.call(this,t,ne)}function ie(ne){te.call(this,t,ne)}function X(ne){te.call(this,t,ne)}function ce(ne){te.call(this,t,ne)}function ae(ne){te.call(this,t,ne)}function ee(ne){xe[ne?"unshift":"push"](()=>{N=ne,n(1,N)})}function he(){u=this.value,n(0,u)}return t.$$set=ne=>{e=Z(Z({},e),Te(ne)),n(18,r=de(e,l)),"value"in ne&&n(0,u=ne.value),"placeholder"in ne&&n(2,f=ne.placeholder),"cols"in ne&&n(3,c=ne.cols),"rows"in ne&&n(4,d=ne.rows),"maxCount"in ne&&n(5,h=ne.maxCount),"light"in ne&&n(6,g=ne.light),"disabled"in ne&&n(7,_=ne.disabled),"readonly"in ne&&n(8,k=ne.readonly),"helperText"in ne&&n(9,y=ne.helperText),"labelText"in ne&&n(10,T=ne.labelText),"hideLabel"in ne&&n(11,M=ne.hideLabel),"invalid"in ne&&n(12,A=ne.invalid),"invalidText"in ne&&n(13,C=ne.invalidText),"id"in ne&&n(14,D=ne.id),"name"in ne&&n(15,R=ne.name),"ref"in ne&&n(1,N=ne.ref),"$$scope"in ne&&n(19,o=ne.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&n(16,i=`error-${D}`)},[u,N,f,c,d,h,g,_,k,y,T,M,A,C,D,R,i,a,r,o,s,G,B,$,q,V,K,x,ie,X,ce,ae,ee,he]}class dG extends Oe{constructor(e){super(),Ee(this,e,cG,fG,Se,{value:0,placeholder:2,cols:3,rows:4,maxCount:5,light:6,disabled:7,readonly:8,helperText:9,labelText:10,hideLabel:11,invalid:12,invalidText:13,id:14,name:15,ref:1},null,[-1,-1])}}const l5=dG,hG=t=>({}),Sv=t=>({}),mG=t=>({}),Ev=t=>({});function Ov(t){let e,n,i,l=t[9]&&Mv(t),r=!t[22]&&t[6]&&Cv(t);return{c(){e=P("div"),l&&l.c(),n=F(),r&&r.c(),S(e,"bx--text-input__label-helper-wrapper",!0)},m(s,o){O(s,e,o),l&&l.m(e,null),w(e,n),r&&r.m(e,null),i=!0},p(s,o){s[9]?l?(l.p(s,o),o[0]&512&&p(l,1)):(l=Mv(s),l.c(),p(l,1),l.m(e,n)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),!s[22]&&s[6]?r?r.p(s,o):(r=Cv(s),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(s){i||(p(l),i=!0)},o(s){v(l),i=!1},d(s){s&&E(e),l&&l.d(),r&&r.d()}}}function Mv(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Ev),r=l||gG(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[7]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[10]),S(e,"bx--label--disabled",t[5]),S(e,"bx--label--inline",t[16]),S(e,"bx--label--inline--sm",t[2]==="sm"),S(e,"bx--label--inline--xl",t[2]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,mG):Ge(s[27]),Ev):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&I(e,"for",s[7]),(!n||o[0]&1024)&&S(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&S(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&S(e,"bx--label--inline",s[16]),(!n||o[0]&4)&&S(e,"bx--label--inline--sm",s[2]==="sm"),(!n||o[0]&4)&&S(e,"bx--label--inline--xl",s[2]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function gG(t){let e;return{c(){e=j(t[9])},m(n,i){O(n,e,i)},p(n,i){i[0]&512&&Y(e,n[9])},d(n){n&&E(e)}}}function Cv(t){let e,n;return{c(){e=P("div"),n=j(t[6]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[5]),S(e,"bx--form__helper-text--inline",t[16])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&64&&Y(n,i[6]),l[0]&32&&S(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&S(e,"bx--form__helper-text--inline",i[16])},d(i){i&&E(e)}}}function Av(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Sv),r=l||_G(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[7]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[10]),S(e,"bx--label--disabled",t[5]),S(e,"bx--label--inline",t[16]),S(e,"bx--label--inline-sm",t[16]&&t[2]==="sm"),S(e,"bx--label--inline-xl",t[16]&&t[2]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,hG):Ge(s[27]),Sv):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&I(e,"for",s[7]),(!n||o[0]&1024)&&S(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&S(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&S(e,"bx--label--inline",s[16]),(!n||o[0]&65540)&&S(e,"bx--label--inline-sm",s[16]&&s[2]==="sm"),(!n||o[0]&65540)&&S(e,"bx--label--inline-xl",s[16]&&s[2]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function _G(t){let e;return{c(){e=j(t[9])},m(n,i){O(n,e,i)},p(n,i){i[0]&512&&Y(e,n[9])},d(n){n&&E(e)}}}function pG(t){let e,n,i,l=t[11]&&Lv(),r=!t[11]&&t[13]&&Dv();return{c(){l&&l.c(),e=F(),r&&r.c(),n=je()},m(s,o){l&&l.m(s,o),O(s,e,o),r&&r.m(s,o),O(s,n,o),i=!0},p(s,o){s[11]?l?o[0]&2048&&p(l,1):(l=Lv(),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),!s[11]&&s[13]?r?o[0]&10240&&p(r,1):(r=Dv(),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function bG(t){let e,n;return e=new MU({props:{class:"bx--text-input__readonly-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Lv(t){let e,n;return e=new Ds({props:{class:"bx--text-input__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Dv(t){let e,n;return e=new Vu({props:{class:`bx--text-input__invalid-icon - bx--text-input__invalid-icon--warning`}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Iv(t){let e;return{c(){e=P("hr"),S(e,"bx--text-input__divider",!0)},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Rv(t){let e,n;return{c(){e=P("div"),n=j(t[12]),I(e,"id",t[19]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&4096&&Y(n,i[12]),l[0]&524288&&I(e,"id",i[19])},d(i){i&&E(e)}}}function Pv(t){let e,n;return{c(){e=P("div"),n=j(t[14]),I(e,"id",t[18]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&16384&&Y(n,i[14]),l[0]&262144&&I(e,"id",i[18])},d(i){i&&E(e)}}}function Nv(t){let e,n;return{c(){e=P("div"),n=j(t[6]),I(e,"id",t[20]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[5]),S(e,"bx--form__helper-text--inline",t[16])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&64&&Y(n,i[6]),l[0]&1048576&&I(e,"id",i[20]),l[0]&32&&S(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&S(e,"bx--form__helper-text--inline",i[16])},d(i){i&&E(e)}}}function Bv(t){let e,n;return{c(){e=P("div"),n=j(t[12]),I(e,"id",t[19]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&4096&&Y(n,i[12]),l[0]&524288&&I(e,"id",i[19])},d(i){i&&E(e)}}}function zv(t){let e,n;return{c(){e=P("div"),n=j(t[14]),I(e,"id",t[18]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&16384&&Y(n,i[14]),l[0]&262144&&I(e,"id",i[18])},d(i){i&&E(e)}}}function vG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G=t[16]&&Ov(t),B=!t[16]&&(t[9]||t[26].labelText)&&Av(t);const $=[bG,pG],q=[];function V(ne,re){return ne[17]?0:1}s=V(t),o=q[s]=$[s](t);let K=[{"data-invalid":f=t[21]||void 0},{"aria-invalid":c=t[21]||void 0},{"data-warn":d=t[13]||void 0},{"aria-describedby":h=t[21]?t[19]:t[13]?t[18]:t[6]?t[20]:void 0},{disabled:t[5]},{id:t[7]},{name:t[8]},{placeholder:t[3]},{required:t[15]},{readOnly:t[17]},t[25]],x={};for(let ne=0;ne{G=null}),fe()),!ne[16]&&(ne[9]||ne[26].labelText)?B?(B.p(ne,re),re[0]&67174912&&p(B,1)):(B=Av(ne),B.c(),p(B,1),B.m(e,i)):B&&(ue(),v(B,1,1,()=>{B=null}),fe());let oe=s;s=V(ne),s===oe?q[s].p(ne,re):(ue(),v(q[oe],1,1,()=>{q[oe]=null}),fe(),o=q[s],o?o.p(ne,re):(o=q[s]=$[s](ne),o.c()),p(o,1),o.m(r,a)),we(u,x=Pe(K,[(!D||re[0]&2097152&&f!==(f=ne[21]||void 0))&&{"data-invalid":f},(!D||re[0]&2097152&&c!==(c=ne[21]||void 0))&&{"aria-invalid":c},(!D||re[0]&8192&&d!==(d=ne[13]||void 0))&&{"data-warn":d},(!D||re[0]&3940416&&h!==(h=ne[21]?ne[19]:ne[13]?ne[18]:ne[6]?ne[20]:void 0))&&{"aria-describedby":h},(!D||re[0]&32)&&{disabled:ne[5]},(!D||re[0]&128)&&{id:ne[7]},(!D||re[0]&256)&&{name:ne[8]},(!D||re[0]&8)&&{placeholder:ne[3]},(!D||re[0]&32768)&&{required:ne[15]},(!D||re[0]&131072)&&{readOnly:ne[17]},re[0]&33554432&&ne[25]])),re[0]&1&&u.value!==ne[0]&&Ll(u,ne[0]),S(u,"bx--text-input",!0),S(u,"bx--text-input--light",ne[4]),S(u,"bx--text-input--invalid",ne[21]),S(u,"bx--text-input--warning",ne[13]),S(u,"bx--text-input--sm",ne[2]==="sm"),S(u,"bx--text-input--xl",ne[2]==="xl"),ne[22]?ie||(ie=Iv(),ie.c(),ie.m(r,_)):ie&&(ie.d(1),ie=null),ne[22]&&!ne[16]&&ne[11]?X?X.p(ne,re):(X=Rv(ne),X.c(),X.m(r,k)):X&&(X.d(1),X=null),ne[22]&&!ne[16]&&ne[13]?ce?ce.p(ne,re):(ce=Pv(ne),ce.c(),ce.m(r,null)):ce&&(ce.d(1),ce=null),(!D||re[0]&2097152&&y!==(y=ne[21]||void 0))&&I(r,"data-invalid",y),(!D||re[0]&8192&&T!==(T=ne[13]||void 0))&&I(r,"data-warn",T),(!D||re[0]&10240)&&S(r,"bx--text-input__field-wrapper--warning",!ne[11]&&ne[13]),!ne[11]&&!ne[13]&&!ne[22]&&!ne[16]&&ne[6]?ae?ae.p(ne,re):(ae=Nv(ne),ae.c(),ae.m(l,A)):ae&&(ae.d(1),ae=null),!ne[22]&&ne[11]?ee?ee.p(ne,re):(ee=Bv(ne),ee.c(),ee.m(l,C)):ee&&(ee.d(1),ee=null),!ne[22]&&!ne[11]&&ne[13]?he?he.p(ne,re):(he=zv(ne),he.c(),he.m(l,null)):he&&(he.d(1),he=null),(!D||re[0]&65536)&&S(l,"bx--text-input__field-outer-wrapper--inline",ne[16]),(!D||re[0]&65536)&&S(e,"bx--text-input-wrapper--inline",ne[16]),(!D||re[0]&16)&&S(e,"bx--text-input-wrapper--light",ne[4]),(!D||re[0]&131072)&&S(e,"bx--text-input-wrapper--readonly",ne[17])},i(ne){D||(p(G),p(B),p(o),D=!0)},o(ne){v(G),v(B),v(o),D=!1},d(ne){ne&&E(e),G&&G.d(),B&&B.d(),q[s].d(),t[38](null),ie&&ie.d(),X&&X.d(),ce&&ce.d(),ae&&ae.d(),ee&&ee.d(),he&&he.d(),R=!1,ut(N)}}}function kG(t,e,n){let i,l,r,s,o;const a=["size","value","placeholder","light","disabled","helperText","id","name","labelText","hideLabel","invalid","invalidText","warn","warnText","ref","required","inline","readonly"];let u=de(e,a),{$$slots:f={},$$scope:c}=e;const d=di(f);let{size:h=void 0}=e,{value:g=""}=e,{placeholder:_=""}=e,{light:k=!1}=e,{disabled:y=!1}=e,{helperText:T=""}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{labelText:C=""}=e,{hideLabel:D=!1}=e,{invalid:R=!1}=e,{invalidText:N=""}=e,{warn:G=!1}=e,{warnText:B=""}=e,{ref:$=null}=e,{required:q=!1}=e,{inline:V=!1}=e,{readonly:K=!1}=e;const x=jn("Form"),ie=on();function X(ve){return u.type!=="number"?ve:ve!=""?Number(ve):null}const ce=ve=>{n(0,g=X(ve.target.value)),ie("input",g)},ae=ve=>{ie("change",X(ve.target.value))};function ee(ve){te.call(this,t,ve)}function he(ve){te.call(this,t,ve)}function ne(ve){te.call(this,t,ve)}function re(ve){te.call(this,t,ve)}function oe(ve){te.call(this,t,ve)}function Re(ve){te.call(this,t,ve)}function qe(ve){te.call(this,t,ve)}function Ce(ve){te.call(this,t,ve)}function Ze(ve){te.call(this,t,ve)}function be(ve){xe[ve?"unshift":"push"](()=>{$=ve,n(1,$)})}function Ae(){g=this.value,n(0,g)}return t.$$set=ve=>{e=Z(Z({},e),Te(ve)),n(25,u=de(e,a)),"size"in ve&&n(2,h=ve.size),"value"in ve&&n(0,g=ve.value),"placeholder"in ve&&n(3,_=ve.placeholder),"light"in ve&&n(4,k=ve.light),"disabled"in ve&&n(5,y=ve.disabled),"helperText"in ve&&n(6,T=ve.helperText),"id"in ve&&n(7,M=ve.id),"name"in ve&&n(8,A=ve.name),"labelText"in ve&&n(9,C=ve.labelText),"hideLabel"in ve&&n(10,D=ve.hideLabel),"invalid"in ve&&n(11,R=ve.invalid),"invalidText"in ve&&n(12,N=ve.invalidText),"warn"in ve&&n(13,G=ve.warn),"warnText"in ve&&n(14,B=ve.warnText),"ref"in ve&&n(1,$=ve.ref),"required"in ve&&n(15,q=ve.required),"inline"in ve&&n(16,V=ve.inline),"readonly"in ve&&n(17,K=ve.readonly),"$$scope"in ve&&n(27,c=ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&133120&&n(21,l=R&&!K),t.$$.dirty[0]&128&&n(20,r=`helper-${M}`),t.$$.dirty[0]&128&&n(19,s=`error-${M}`),t.$$.dirty[0]&128&&n(18,o=`warn-${M}`)},n(22,i=!!x&&x.isFluid),[g,$,h,_,k,y,T,M,A,C,D,R,N,G,B,q,V,K,o,s,r,l,i,ce,ae,u,d,c,f,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae]}class wG extends Oe{constructor(e){super(),Ee(this,e,kG,vG,Se,{size:2,value:0,placeholder:3,light:4,disabled:5,helperText:6,id:7,name:8,labelText:9,hideLabel:10,invalid:11,invalidText:12,warn:13,warnText:14,ref:1,required:15,inline:16,readonly:17},null,[-1,-1])}}const ei=wG;function Hv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function yG(t){let e,n,i,l=t[1]&&Hv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class SG extends Oe{constructor(e){super(),Ee(this,e,TG,yG,Se,{size:0,title:1})}}const EG=SG;function Uv(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function OG(t){let e,n,i,l=t[1]&&Uv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class CG extends Oe{constructor(e){super(),Ee(this,e,MG,OG,Se,{size:0,title:1})}}const AG=CG,LG=t=>({}),Fv=t=>({}),DG=t=>({}),Gv=t=>({});function Vv(t){let e,n,i,l;const r=t[28].labelText,s=He(r,t,t[27],Gv),o=s||IG(t);let a=!t[24]&&t[11]&&Wv(t);return{c(){e=P("label"),o&&o.c(),n=F(),a&&a.c(),i=je(),I(e,"for",t[19]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[13]),S(e,"bx--label--disabled",t[10]),S(e,"bx--label--inline",t[18]),S(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),S(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(u,f){O(u,e,f),o&&o.m(e,null),O(u,n,f),a&&a.m(u,f),O(u,i,f),l=!0},p(u,f){s?s.p&&(!l||f[0]&134217728)&&Fe(s,r,u,u[27],l?Ue(r,u[27],f,DG):Ge(u[27]),Gv):o&&o.p&&(!l||f[0]&4096)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&524288)&&I(e,"for",u[19]),(!l||f[0]&8192)&&S(e,"bx--visually-hidden",u[13]),(!l||f[0]&1024)&&S(e,"bx--label--disabled",u[10]),(!l||f[0]&262144)&&S(e,"bx--label--inline",u[18]),(!l||f[0]&262152)&&S(e,"bx--label--inline--sm",u[18]&&u[3]==="sm"),(!l||f[0]&262152)&&S(e,"bx--label--inline--xl",u[18]&&u[3]==="xl"),!u[24]&&u[11]?a?a.p(u,f):(a=Wv(u),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},i(u){l||(p(o,u),l=!0)},o(u){v(o,u),l=!1},d(u){u&&(E(e),E(n),E(i)),o&&o.d(u),a&&a.d(u)}}}function IG(t){let e;return{c(){e=j(t[12])},m(n,i){O(n,e,i)},p(n,i){i[0]&4096&&Y(e,n[12])},d(n){n&&E(e)}}}function Wv(t){let e,n;return{c(){e=P("div"),n=j(t[11]),I(e,"id",t[23]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[10]),S(e,"bx--form__helper-text--inline",t[18])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&8388608&&I(e,"id",i[23]),l[0]&1024&&S(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&S(e,"bx--form__helper-text--inline",i[18])},d(i){i&&E(e)}}}function jv(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Fv),r=l||RG(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[19]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[13]),S(e,"bx--label--disabled",t[10]),S(e,"bx--label--inline",t[18]),S(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),S(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,LG):Ge(s[27]),Fv):r&&r.p&&(!n||o[0]&4096)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&524288)&&I(e,"for",s[19]),(!n||o[0]&8192)&&S(e,"bx--visually-hidden",s[13]),(!n||o[0]&1024)&&S(e,"bx--label--disabled",s[10]),(!n||o[0]&262144)&&S(e,"bx--label--inline",s[18]),(!n||o[0]&262152)&&S(e,"bx--label--inline--sm",s[18]&&s[3]==="sm"),(!n||o[0]&262152)&&S(e,"bx--label--inline--xl",s[18]&&s[3]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function RG(t){let e;return{c(){e=j(t[12])},m(n,i){O(n,e,i)},p(n,i){i[0]&4096&&Y(e,n[12])},d(n){n&&E(e)}}}function $v(t){let e,n;return e=new Ds({props:{class:"bx--text-input__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qv(t){let e,n;return e=new Vu({props:{class:`bx--text-input__invalid-icon - bx--text-input__invalid-icon--warning`}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Yv(t){let e,n,i,l;return{c(){e=P("hr"),n=F(),i=P("div"),l=j(t[15]),I(e,"class","bx--text-input__divider"),I(i,"class","bx--form-requirement"),I(i,"id",t[22])},m(r,s){O(r,e,s),O(r,n,s),O(r,i,s),w(i,l)},p(r,s){s[0]&32768&&Y(l,r[15]),s[0]&4194304&&I(i,"id",r[22])},d(r){r&&(E(e),E(n),E(i))}}}function Zv(t){let e,n,i,l,r,s,o,a=!t[10]&&Xv(t);const u=[zG,BG],f=[];function c(d,h){return d[1]==="text"?0:1}return i=c(t),l=f[i]=u[i](t),{c(){e=P("button"),a&&a.c(),n=F(),l.c(),I(e,"type","button"),e.disabled=t[10],S(e,"bx--text-input--password__visibility__toggle",!0),S(e,"bx--btn",!0),S(e,"bx--btn--icon-only",!0),S(e,"bx--btn--disabled",t[10]),S(e,"bx--tooltip__trigger",!0),S(e,"bx--tooltip--a11y",!0),S(e,"bx--tooltip--top",t[8]==="top"),S(e,"bx--tooltip--right",t[8]==="right"),S(e,"bx--tooltip--bottom",t[8]==="bottom"),S(e,"bx--tooltip--left",t[8]==="left"),S(e,"bx--tooltip--align-start",t[7]==="start"),S(e,"bx--tooltip--align-center",t[7]==="center"),S(e,"bx--tooltip--align-end",t[7]==="end")},m(d,h){O(d,e,h),a&&a.m(e,null),w(e,n),f[i].m(e,null),r=!0,s||(o=J(e,"click",t[42]),s=!0)},p(d,h){d[10]?a&&(a.d(1),a=null):a?a.p(d,h):(a=Xv(d),a.c(),a.m(e,n));let g=i;i=c(d),i!==g&&(ue(),v(f[g],1,1,()=>{f[g]=null}),fe(),l=f[i],l||(l=f[i]=u[i](d),l.c()),p(l,1),l.m(e,null)),(!r||h[0]&1024)&&(e.disabled=d[10]),(!r||h[0]&1024)&&S(e,"bx--btn--disabled",d[10]),(!r||h[0]&256)&&S(e,"bx--tooltip--top",d[8]==="top"),(!r||h[0]&256)&&S(e,"bx--tooltip--right",d[8]==="right"),(!r||h[0]&256)&&S(e,"bx--tooltip--bottom",d[8]==="bottom"),(!r||h[0]&256)&&S(e,"bx--tooltip--left",d[8]==="left"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-start",d[7]==="start"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-center",d[7]==="center"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-end",d[7]==="end")},i(d){r||(p(l),r=!0)},o(d){v(l),r=!1},d(d){d&&E(e),a&&a.d(),f[i].d(),s=!1,o()}}}function Xv(t){let e;function n(r,s){return r[1]==="text"?NG:PG}let i=n(t),l=i(t);return{c(){e=P("span"),l.c(),S(e,"bx--assistive-text",!0)},m(r,s){O(r,e,s),l.m(e,null)},p(r,s){i===(i=n(r))&&l?l.p(r,s):(l.d(1),l=i(r),l&&(l.c(),l.m(e,null)))},d(r){r&&E(e),l.d()}}}function PG(t){let e;return{c(){e=j(t[6])},m(n,i){O(n,e,i)},p(n,i){i[0]&64&&Y(e,n[6])},d(n){n&&E(e)}}}function NG(t){let e;return{c(){e=j(t[5])},m(n,i){O(n,e,i)},p(n,i){i[0]&32&&Y(e,n[5])},d(n){n&&E(e)}}}function BG(t){let e,n;return e=new EG({props:{class:"bx--icon-visibility-on"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function zG(t){let e,n;return e=new AG({props:{class:"bx--icon-visibility-off"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Kv(t){let e,n;return{c(){e=P("div"),n=j(t[15]),I(e,"id",t[22]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&32768&&Y(n,i[15]),l[0]&4194304&&I(e,"id",i[22])},d(i){i&&E(e)}}}function Jv(t){let e,n;return{c(){e=P("div"),n=j(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[10]),S(e,"bx--form__helper-text--inline",t[18])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&1024&&S(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&S(e,"bx--form__helper-text--inline",i[18])},d(i){i&&E(e)}}}function Qv(t){let e,n;return{c(){e=P("div"),n=j(t[17]),I(e,"id",t[21]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&131072&&Y(n,i[17]),l[0]&2097152&&I(e,"id",i[21])},d(i){i&&E(e)}}}function HG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D=t[18]&&Vv(t),R=!t[18]&&(t[12]||t[25].labelText)&&jv(t),N=t[14]&&$v(),G=!t[14]&&t[16]&&qv(),B=[{"data-invalid":u=t[14]||void 0},{"aria-invalid":f=t[14]||void 0},{"aria-describedby":c=t[14]?t[22]:t[16]?t[21]:t[11]?t[23]:void 0},{id:t[19]},{name:t[20]},{placeholder:t[4]},{type:t[1]},{value:d=t[0]??""},{disabled:t[10]},t[26]],$={};for(let X=0;X{D=null}),fe()),!X[18]&&(X[12]||X[25].labelText)?R?(R.p(X,ce),ce[0]&33820672&&p(R,1)):(R=jv(X),R.c(),p(R,1),R.m(e,i)):R&&(ue(),v(R,1,1,()=>{R=null}),fe()),X[14]?N?ce[0]&16384&&p(N,1):(N=$v(),N.c(),p(N,1),N.m(r,s)):N&&(ue(),v(N,1,1,()=>{N=null}),fe()),!X[14]&&X[16]?G?ce[0]&81920&&p(G,1):(G=qv(),G.c(),p(G,1),G.m(r,o)):G&&(ue(),v(G,1,1,()=>{G=null}),fe()),we(a,$=Pe(B,[(!M||ce[0]&16384&&u!==(u=X[14]||void 0))&&{"data-invalid":u},(!M||ce[0]&16384&&f!==(f=X[14]||void 0))&&{"aria-invalid":f},(!M||ce[0]&14764032&&c!==(c=X[14]?X[22]:X[16]?X[21]:X[11]?X[23]:void 0))&&{"aria-describedby":c},(!M||ce[0]&524288)&&{id:X[19]},(!M||ce[0]&1048576)&&{name:X[20]},(!M||ce[0]&16)&&{placeholder:X[4]},(!M||ce[0]&2)&&{type:X[1]},(!M||ce[0]&1&&d!==(d=X[0]??"")&&a.value!==d)&&{value:d},(!M||ce[0]&1024)&&{disabled:X[10]},ce[0]&67108864&&X[26]])),"value"in $&&(a.value=$.value),S(a,"bx--text-input",!0),S(a,"bx--password-input",!0),S(a,"bx--text-input--light",X[9]),S(a,"bx--text-input--invalid",X[14]),S(a,"bx--text-input--warning",X[16]),S(a,"bx--text-input--sm",X[3]==="sm"),S(a,"bx--text-input--xl",X[3]==="xl"),X[24]&&X[14]?q?q.p(X,ce):(q=Yv(X),q.c(),q.m(r,g)):q&&(q.d(1),q=null),X[24]&&X[14]?V&&(ue(),v(V,1,1,()=>{V=null}),fe()):V?(V.p(X,ce),ce[0]&16793600&&p(V,1)):(V=Zv(X),V.c(),p(V,1),V.m(r,null)),(!M||ce[0]&16384&&_!==(_=X[14]||void 0))&&I(r,"data-invalid",_),(!M||ce[0]&65536)&&S(r,"bx--text-input__field-wrapper--warning",X[16]),!X[24]&&X[14]?K?K.p(X,ce):(K=Kv(X),K.c(),K.m(l,y)):K&&(K.d(1),K=null),!X[14]&&!X[16]&&!X[24]&&!X[18]&&X[11]?x?x.p(X,ce):(x=Jv(X),x.c(),x.m(l,T)):x&&(x.d(1),x=null),!X[24]&&!X[14]&&X[16]?ie?ie.p(X,ce):(ie=Qv(X),ie.c(),ie.m(l,null)):ie&&(ie.d(1),ie=null),(!M||ce[0]&262144)&&S(l,"bx--text-input__field-outer-wrapper--inline",X[18]),(!M||ce[0]&16777216)&&S(e,"bx--password-input-wrapper",!X[24]),(!M||ce[0]&512)&&S(e,"bx--text-input-wrapper--light",X[9]),(!M||ce[0]&262144)&&S(e,"bx--text-input-wrapper--inline",X[18])},i(X){M||(p(D),p(R),p(N),p(G),p(V),M=!0)},o(X){v(D),v(R),v(N),v(G),v(V),M=!1},d(X){X&&E(e),D&&D.d(),R&&R.d(),N&&N.d(),G&&G.d(),t[40](null),q&&q.d(),V&&V.d(),K&&K.d(),x&&x.d(),ie&&ie.d(),A=!1,ut(C)}}}function UG(t,e,n){let i,l,r,s;const o=["size","value","type","placeholder","hidePasswordLabel","showPasswordLabel","tooltipAlignment","tooltipPosition","light","disabled","helperText","labelText","hideLabel","invalid","invalidText","warn","warnText","inline","id","name","ref"];let a=de(e,o),{$$slots:u={},$$scope:f}=e;const c=di(u);let{size:d=void 0}=e,{value:h=""}=e,{type:g="password"}=e,{placeholder:_=""}=e,{hidePasswordLabel:k="Hide password"}=e,{showPasswordLabel:y="Show password"}=e,{tooltipAlignment:T="center"}=e,{tooltipPosition:M="bottom"}=e,{light:A=!1}=e,{disabled:C=!1}=e,{helperText:D=""}=e,{labelText:R=""}=e,{hideLabel:N=!1}=e,{invalid:G=!1}=e,{invalidText:B=""}=e,{warn:$=!1}=e,{warnText:q=""}=e,{inline:V=!1}=e,{id:K="ccs-"+Math.random().toString(36)}=e,{name:x=void 0}=e,{ref:ie=null}=e;const X=jn("Form");function ce(me){te.call(this,t,me)}function ae(me){te.call(this,t,me)}function ee(me){te.call(this,t,me)}function he(me){te.call(this,t,me)}function ne(me){te.call(this,t,me)}function re(me){te.call(this,t,me)}function oe(me){te.call(this,t,me)}function Re(me){te.call(this,t,me)}function qe(me){te.call(this,t,me)}function Ce(me){te.call(this,t,me)}function Ze(me){te.call(this,t,me)}function be(me){xe[me?"unshift":"push"](()=>{ie=me,n(2,ie)})}const Ae=({target:me})=>{n(0,h=me.value)},ve=()=>{n(1,g=g==="password"?"text":"password")};return t.$$set=me=>{e=Z(Z({},e),Te(me)),n(26,a=de(e,o)),"size"in me&&n(3,d=me.size),"value"in me&&n(0,h=me.value),"type"in me&&n(1,g=me.type),"placeholder"in me&&n(4,_=me.placeholder),"hidePasswordLabel"in me&&n(5,k=me.hidePasswordLabel),"showPasswordLabel"in me&&n(6,y=me.showPasswordLabel),"tooltipAlignment"in me&&n(7,T=me.tooltipAlignment),"tooltipPosition"in me&&n(8,M=me.tooltipPosition),"light"in me&&n(9,A=me.light),"disabled"in me&&n(10,C=me.disabled),"helperText"in me&&n(11,D=me.helperText),"labelText"in me&&n(12,R=me.labelText),"hideLabel"in me&&n(13,N=me.hideLabel),"invalid"in me&&n(14,G=me.invalid),"invalidText"in me&&n(15,B=me.invalidText),"warn"in me&&n(16,$=me.warn),"warnText"in me&&n(17,q=me.warnText),"inline"in me&&n(18,V=me.inline),"id"in me&&n(19,K=me.id),"name"in me&&n(20,x=me.name),"ref"in me&&n(2,ie=me.ref),"$$scope"in me&&n(27,f=me.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&524288&&n(23,l=`helper-${K}`),t.$$.dirty[0]&524288&&n(22,r=`error-${K}`),t.$$.dirty[0]&524288&&n(21,s=`warn-${K}`)},n(24,i=!!X&&X.isFluid),[h,g,ie,d,_,k,y,T,M,A,C,D,R,N,G,B,$,q,V,K,x,s,r,l,i,c,a,f,u,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae,ve]}class FG extends Oe{constructor(e){super(),Ee(this,e,UG,HG,Se,{size:3,value:0,type:1,placeholder:4,hidePasswordLabel:5,showPasswordLabel:6,tooltipAlignment:7,tooltipPosition:8,light:9,disabled:10,helperText:11,labelText:12,hideLabel:13,invalid:14,invalidText:15,warn:16,warnText:17,inline:18,id:19,name:20,ref:2},null,[-1,-1])}}const x1=FG,GG=t=>({}),xv=t=>({}),VG=t=>({}),ek=t=>({}),WG=t=>({}),tk=t=>({});function jG(t){let e;return{c(){e=j(t[5])},m(n,i){O(n,e,i)},p(n,i){i&32&&Y(e,n[5])},d(n){n&&E(e)}}}function $G(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function qG(t){let e;return{c(){e=j(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function YG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;const _=t[12].labelText,k=He(_,t,t[11],tk),y=k||jG(t),T=t[12].labelA,M=He(T,t,t[11],ek),A=M||$G(t),C=t[12].labelB,D=He(C,t,t[11],xv),R=D||qG(t);let N=[t[9]],G={};for(let B=0;B{n(0,a=!a)},B=$=>{($.key===" "||$.key==="Enter")&&($.preventDefault(),n(0,a=!a))};return t.$$set=$=>{n(10,e=Z(Z({},e),Te($))),n(9,l=de(e,i)),"size"in $&&n(1,o=$.size),"toggled"in $&&n(0,a=$.toggled),"disabled"in $&&n(2,u=$.disabled),"labelA"in $&&n(3,f=$.labelA),"labelB"in $&&n(4,c=$.labelB),"labelText"in $&&n(5,d=$.labelText),"hideLabel"in $&&n(6,h=$.hideLabel),"id"in $&&n(7,g=$.id),"name"in $&&n(8,_=$.name),"$$scope"in $&&n(11,s=$.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&k("toggle",{toggled:a})},e=Te(e),[a,o,u,f,c,d,h,g,_,l,e,s,r,y,T,M,A,C,D,R,N,G,B]}class XG extends Oe{constructor(e){super(),Ee(this,e,ZG,YG,Se,{size:1,toggled:0,disabled:2,labelA:3,labelB:4,labelText:5,hideLabel:6,id:7,name:8})}}const Ad=XG;function KG(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{e=Z(Z({},e),Te(d)),n(1,l=de(e,i)),"light"in d&&n(0,o=d.light),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class QG extends Oe{constructor(e){super(),Ee(this,e,JG,KG,Se,{light:0})}}const ya=QG,xG=t=>({}),nk=t=>({});function ik(t){let e,n;const i=t[17].labelText,l=He(i,t,t[16],nk),r=l||eV(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[12]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[9]),S(e,"bx--label--disabled",t[7])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Fe(l,i,s,s[16],n?Ue(i,s[16],o,xG):Ge(s[16]),nk):r&&r.p&&(!n||o&256)&&r.p(s,n?o:-1),(!n||o&4096)&&I(e,"for",s[12]),(!n||o&512)&&S(e,"bx--visually-hidden",s[9]),(!n||o&128)&&S(e,"bx--label--disabled",s[7])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function eV(t){let e;return{c(){e=j(t[8])},m(n,i){O(n,e,i)},p(n,i){i&256&&Y(e,n[8])},d(n){n&&E(e)}}}function lk(t){let e,n;return{c(){e=P("div"),n=j(t[11]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2048&&Y(n,i[11])},d(i){i&&E(e)}}}function tV(t){let e,n,i,l,r,s,o,a,u,f,c,d=(t[8]||t[14].labelText)&&ik(t),h=[{type:"text"},{"data-invalid":s=t[10]||void 0},{pattern:t[4]},{placeholder:t[3]},{maxlength:t[5]},{id:t[12]},{name:t[13]},{disabled:t[7]},t[15]],g={};for(let T=0;T{d=null}),fe()),we(r,g=Pe(h,[{type:"text"},(!u||M&1024&&s!==(s=T[10]||void 0))&&{"data-invalid":s},(!u||M&16)&&{pattern:T[4]},(!u||M&8)&&{placeholder:T[3]},(!u||M&32)&&{maxlength:T[5]},(!u||M&4096)&&{id:T[12]},(!u||M&8192)&&{name:T[13]},(!u||M&128)&&{disabled:T[7]},M&32768&&T[15]])),M&1&&r.value!==T[0]&&Ll(r,T[0]),S(r,"bx--time-picker__input-field",!0),S(r,"bx--text-input",!0),S(r,"bx--text-input--light",T[6]),S(r,"bx--text-input--invalid",T[10]),k&&k.p&&(!u||M&65536)&&Fe(k,_,T,T[16],u?Ue(_,T[16],M,null):Ge(T[16]),null),(!u||M&64)&&S(n,"bx--time-picker--light",T[6]),(!u||M&1024)&&S(n,"bx--time-picker--invalid",T[10]),(!u||M&4)&&S(n,"bx--time-picker--sm",T[2]==="sm"),(!u||M&4)&&S(n,"bx--time-picker--xl",T[2]==="xl"),(!u||M&64)&&S(n,"bx--select--light",T[6]),T[10]?y?y.p(T,M):(y=lk(T),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(T){u||(p(d),p(k,T),u=!0)},o(T){v(d),v(k,T),u=!1},d(T){T&&E(e),d&&d.d(),t[29](null),k&&k.d(T),y&&y.d(),f=!1,ut(c)}}}function nV(t,e,n){const i=["size","value","placeholder","pattern","maxlength","light","disabled","labelText","hideLabel","invalid","invalidText","id","name","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{size:a=void 0}=e,{value:u=""}=e,{placeholder:f="hh:mm"}=e,{pattern:c="(1[012]|[1-9]):[0-5][0-9](\\s)?"}=e,{maxlength:d=5}=e,{light:h=!1}=e,{disabled:g=!1}=e,{labelText:_=""}=e,{hideLabel:k=!1}=e,{invalid:y=!1}=e,{invalidText:T=""}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{ref:C=null}=e;function D(ae){te.call(this,t,ae)}function R(ae){te.call(this,t,ae)}function N(ae){te.call(this,t,ae)}function G(ae){te.call(this,t,ae)}function B(ae){te.call(this,t,ae)}function $(ae){te.call(this,t,ae)}function q(ae){te.call(this,t,ae)}function V(ae){te.call(this,t,ae)}function K(ae){te.call(this,t,ae)}function x(ae){te.call(this,t,ae)}function ie(ae){te.call(this,t,ae)}function X(ae){xe[ae?"unshift":"push"](()=>{C=ae,n(1,C)})}function ce(){u=this.value,n(0,u)}return t.$$set=ae=>{e=Z(Z({},e),Te(ae)),n(15,l=de(e,i)),"size"in ae&&n(2,a=ae.size),"value"in ae&&n(0,u=ae.value),"placeholder"in ae&&n(3,f=ae.placeholder),"pattern"in ae&&n(4,c=ae.pattern),"maxlength"in ae&&n(5,d=ae.maxlength),"light"in ae&&n(6,h=ae.light),"disabled"in ae&&n(7,g=ae.disabled),"labelText"in ae&&n(8,_=ae.labelText),"hideLabel"in ae&&n(9,k=ae.hideLabel),"invalid"in ae&&n(10,y=ae.invalid),"invalidText"in ae&&n(11,T=ae.invalidText),"id"in ae&&n(12,M=ae.id),"name"in ae&&n(13,A=ae.name),"ref"in ae&&n(1,C=ae.ref),"$$scope"in ae&&n(16,s=ae.$$scope)},[u,C,a,f,c,d,h,g,_,k,y,T,M,A,o,l,s,r,D,R,N,G,B,$,q,V,K,x,ie,X,ce]}class iV extends Oe{constructor(e){super(),Ee(this,e,nV,tV,Se,{size:2,value:0,placeholder:3,pattern:4,maxlength:5,light:6,disabled:7,labelText:8,hideLabel:9,invalid:10,invalidText:11,id:12,name:13,ref:1})}}const Lc=iV;function rk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function lV(t){let e,n,i=t[1]&&rk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class sV extends Oe{constructor(e){super(),Ee(this,e,rV,lV,Se,{size:0,title:1})}}const r5=sV,em=Wt(!1),tm=Wt(!1),nm=Wt(!1);function oV(t){let e,n,i,l,r;var s=t[0]?t[4]:t[3];function o(f,c){return{props:{size:20}}}s&&(n=rn(s,o()));let a=[{type:"button"},{title:t[2]},{"aria-label":t[2]},t[5]],u={};for(let f=0;f{H(d,1)}),fe()}s?(n=rn(s,o()),U(n.$$.fragment),p(n.$$.fragment,1),z(n,e,null)):n=null}we(e,u=Pe(a,[{type:"button"},(!i||c&4)&&{title:f[2]},(!i||c&4)&&{"aria-label":f[2]},c&32&&f[5]])),S(e,"bx--header__action",!0),S(e,"bx--header__menu-trigger",!0),S(e,"bx--header__menu-toggle",!0)},i(f){i||(n&&p(n.$$.fragment,f),i=!0)},o(f){n&&v(n.$$.fragment,f),i=!1},d(f){f&&E(e),n&&H(n),t[7](null),l=!1,ut(r)}}}function aV(t,e,n){const i=["ariaLabel","isOpen","iconMenu","iconClose","ref"];let l=de(e,i),{ariaLabel:r=void 0}=e,{isOpen:s=!1}=e,{iconMenu:o=r5}=e,{iconClose:a=Dl}=e,{ref:u=null}=e;function f(h){te.call(this,t,h)}function c(h){xe[h?"unshift":"push"](()=>{u=h,n(1,u)})}const d=()=>n(0,s=!s);return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(5,l=de(e,i)),"ariaLabel"in h&&n(2,r=h.ariaLabel),"isOpen"in h&&n(0,s=h.isOpen),"iconMenu"in h&&n(3,o=h.iconMenu),"iconClose"in h&&n(4,a=h.iconClose),"ref"in h&&n(1,u=h.ref)},[s,u,r,o,a,l,f,c,d]}class uV extends Oe{constructor(e){super(),Ee(this,e,aV,oV,Se,{ariaLabel:2,isOpen:0,iconMenu:3,iconClose:4,ref:1})}}const fV=uV,cV=t=>({}),sk=t=>({}),dV=t=>({}),ok=t=>({}),hV=t=>({}),ak=t=>({});function uk(t){let e,n,i;function l(s){t[20](s)}let r={iconClose:t[8],iconMenu:t[7]};return t[0]!==void 0&&(r.isOpen=t[0]),e=new fV({props:r}),xe.push(()=>At(e,"isOpen",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&256&&(a.iconClose=s[8]),o&128&&(a.iconMenu=s[7]),!n&&o&1&&(n=!0,a.isOpen=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function fk(t){let e,n;const i=t[17].company,l=He(i,t,t[16],ok),r=l||mV(t);return{c(){e=P("span"),r&&r.c(),S(e,"bx--header__name--prefix",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Fe(l,i,s,s[16],n?Ue(i,s[16],o,dV):Ge(s[16]),ok):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function mV(t){let e,n;return{c(){e=j(t[3]),n=j(" ")},m(i,l){O(i,e,l),O(i,n,l)},p(i,l){l&8&&Y(e,i[3])},d(i){i&&(E(e),E(n))}}}function gV(t){let e;return{c(){e=j(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function _V(t){let e,n,i,l,r,s,o,a,u;Es(t[19]);const f=t[17]["skip-to-content"],c=He(f,t,t[16],ak);let d=(t[11]&&t[9]{d=null}),fe()),C[3]||C[13].company?h?(h.p(C,D),D&8200&&p(h,1)):(h=fk(C),h.c(),p(h,1),h.m(l,r)):h&&(ue(),v(h,1,1,()=>{h=null}),fe()),_?_.p&&(!o||D&65536)&&Fe(_,g,C,C[16],o?Ue(g,C[16],D,cV):Ge(C[16]),sk):k&&k.p&&(!o||D&16)&&k.p(C,o?D:-1),we(l,T=Pe(y,[(!o||D&4)&&{href:C[2]},D&4096&&C[12]])),S(l,"bx--header__name",!0),A&&A.p&&(!o||D&65536)&&Fe(A,M,C,C[16],o?Ue(M,C[16],D,null):Ge(C[16]),null),(!o||D&1024)&&I(e,"aria-label",C[10])},i(C){o||(p(c,C),p(d),p(h),p(k,C),p(A,C),o=!0)},o(C){v(c,C),v(d),v(h),v(k,C),v(A,C),o=!1},d(C){C&&E(e),c&&c.d(C),d&&d.d(),h&&h.d(),k&&k.d(C),t[21](null),A&&A.d(C),a=!1,ut(u)}}}function pV(t,e,n){let i;const l=["expandedByDefault","isSideNavOpen","uiShellAriaLabel","href","company","platformName","persistentHamburgerMenu","expansionBreakpoint","ref","iconMenu","iconClose"];let r=de(e,l),s;ct(t,em,B=>n(11,s=B));let{$$slots:o={},$$scope:a}=e;const u=di(o);let{expandedByDefault:f=!0}=e,{isSideNavOpen:c=!1}=e,{uiShellAriaLabel:d=void 0}=e,{href:h=void 0}=e,{company:g=void 0}=e,{platformName:_=""}=e,{persistentHamburgerMenu:k=!1}=e,{expansionBreakpoint:y=1056}=e,{ref:T=null}=e,{iconMenu:M=r5}=e,{iconClose:A=Dl}=e,C;function D(B){te.call(this,t,B)}function R(){n(9,C=window.innerWidth)}function N(B){c=B,n(0,c),n(14,f),n(9,C),n(6,y),n(5,k)}function G(B){xe[B?"unshift":"push"](()=>{T=B,n(1,T)})}return t.$$set=B=>{n(22,e=Z(Z({},e),Te(B))),n(12,r=de(e,l)),"expandedByDefault"in B&&n(14,f=B.expandedByDefault),"isSideNavOpen"in B&&n(0,c=B.isSideNavOpen),"uiShellAriaLabel"in B&&n(15,d=B.uiShellAriaLabel),"href"in B&&n(2,h=B.href),"company"in B&&n(3,g=B.company),"platformName"in B&&n(4,_=B.platformName),"persistentHamburgerMenu"in B&&n(5,k=B.persistentHamburgerMenu),"expansionBreakpoint"in B&&n(6,y=B.expansionBreakpoint),"ref"in B&&n(1,T=B.ref),"iconMenu"in B&&n(7,M=B.iconMenu),"iconClose"in B&&n(8,A=B.iconClose),"$$scope"in B&&n(16,a=B.$$scope)},t.$$.update=()=>{t.$$.dirty&16992&&n(0,c=f&&C>=y&&!k),n(10,i=g?`${g} `:""+(d||e["aria-label"]||_))},e=Te(e),[c,T,h,g,_,k,y,M,A,C,i,s,r,u,f,d,a,o,D,R,N,G]}class bV extends Oe{constructor(e){super(),Ee(this,e,pV,_V,Se,{expandedByDefault:14,isSideNavOpen:0,uiShellAriaLabel:15,href:2,company:3,platformName:4,persistentHamburgerMenu:5,expansionBreakpoint:6,ref:1,iconMenu:7,iconClose:8})}}const vV=bV;function ck(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function kV(t){let e,n,i=t[1]&&ck(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class yV extends Oe{constructor(e){super(),Ee(this,e,wV,kV,Se,{size:0,title:1})}}const TV=yV,SV=t=>({}),dk=t=>({}),EV=t=>({}),hk=t=>({}),OV=t=>({}),mk=t=>({});function MV(t){let e;const n=t[11].icon,i=He(n,t,t[10],hk),l=i||AV(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Fe(i,n,r,r[10],e?Ue(n,r[10],s,EV):Ge(r[10]),hk):l&&l.p&&(!e||s&4)&&l.p(r,e?s:-1)},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function CV(t){let e;const n=t[11].closeIcon,i=He(n,t,t[10],mk),l=i||LV(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Fe(i,n,r,r[10],e?Ue(n,r[10],s,OV):Ge(r[10]),mk):l&&l.p&&(!e||s&8)&&l.p(r,e?s:-1)},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function AV(t){let e,n,i;var l=t[2];function r(s,o){return{props:{size:20}}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&4&&l!==(l=s[2])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function LV(t){let e,n,i;var l=t[3];function r(s,o){return{props:{size:20}}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function gk(t){let e,n;return{c(){e=P("span"),n=j(t[4]),I(e,"class","svelte-187bdaq")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&16&&Y(n,i[4])},d(i){i&&E(e)}}}function DV(t){let e,n=t[4]&&gk(t);return{c(){n&&n.c(),e=je()},m(i,l){n&&n.m(i,l),O(i,e,l)},p(i,l){i[4]?n?n.p(i,l):(n=gk(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&E(e),n&&n.d(i)}}}function _k(t){let e,n,i;const l=t[11].default,r=He(l,t,t[10],null);return{c(){e=P("div"),r&&r.c(),S(e,"bx--header-panel",!0),S(e,"bx--header-panel--expanded",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),t[16](e),i=!0},p(s,o){t=s,r&&r.p&&(!i||o&1024)&&Fe(r,l,t,t[10],i?Ue(l,t[10],o,null):Ge(t[10]),null)},i(s){i||(p(r,s),s&&Es(()=>{i&&(n||(n=Dp(e,s2,{...t[5],duration:t[5]===!1?0:t[5].duration},!0)),n.run(1))}),i=!0)},o(s){v(r,s),s&&(n||(n=Dp(e,s2,{...t[5],duration:t[5]===!1?0:t[5].duration},!1)),n.run(0)),i=!1},d(s){s&&E(e),r&&r.d(s),t[16](null),s&&n&&n.end()}}}function IV(t){let e,n,i,l,r,s,o,a,u;const f=[CV,MV],c=[];function d(M,A){return M[0]?0:1}n=d(t),i=c[n]=f[n](t);const h=t[11].text,g=He(h,t,t[10],dk),_=g||DV(t);let k=[{type:"button"},t[9]],y={};for(let M=0;M{c[C]=null}),fe(),i=c[n],i?i.p(M,A):(i=c[n]=f[n](M),i.c()),p(i,1),i.m(e,l)),g?g.p&&(!o||A&1024)&&Fe(g,h,M,M[10],o?Ue(h,M[10],A,SV):Ge(M[10]),dk):_&&_.p&&(!o||A&16)&&_.p(M,o?A:-1),we(e,y=Pe(k,[{type:"button"},A&512&&M[9]])),S(e,"bx--header__action",!0),S(e,"bx--header__action--active",M[0]),S(e,"action-text",M[4]),S(e,"svelte-187bdaq",!0),M[0]?T?(T.p(M,A),A&1&&p(T,1)):(T=_k(M),T.c(),p(T,1),T.m(s.parentNode,s)):T&&(ue(),v(T,1,1,()=>{T=null}),fe())},i(M){o||(p(i),p(_,M),p(T),o=!0)},o(M){v(i),v(_,M),v(T),o=!1},d(M){M&&(E(e),E(r),E(s)),c[n].d(),_&&_.d(M),t[14](null),T&&T.d(M),a=!1,ut(u)}}}function RV(t,e,n){const i=["isOpen","icon","closeIcon","text","ref","transition","preventCloseOnClickOutside"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{isOpen:o=!1}=e,{icon:a=TV}=e,{closeIcon:u=Dl}=e,{text:f=void 0}=e,{ref:c=null}=e,{transition:d={duration:200}}=e,{preventCloseOnClickOutside:h=!1}=e;const g=on();let _=null;function k(C){te.call(this,t,C)}const y=({target:C})=>{o&&!c.contains(C)&&!_.contains(C)&&!h&&(n(0,o=!1),g("close"))};function T(C){xe[C?"unshift":"push"](()=>{c=C,n(1,c)})}const M=()=>{n(0,o=!o),g(o?"open":"close")};function A(C){xe[C?"unshift":"push"](()=>{_=C,n(7,_)})}return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(9,l=de(e,i)),"isOpen"in C&&n(0,o=C.isOpen),"icon"in C&&n(2,a=C.icon),"closeIcon"in C&&n(3,u=C.closeIcon),"text"in C&&n(4,f=C.text),"ref"in C&&n(1,c=C.ref),"transition"in C&&n(5,d=C.transition),"preventCloseOnClickOutside"in C&&n(6,h=C.preventCloseOnClickOutside),"$$scope"in C&&n(10,s=C.$$scope)},[o,c,a,u,f,d,h,_,g,l,s,r,k,y,T,M,A]}class PV extends Oe{constructor(e){super(),Ee(this,e,RV,IV,Se,{isOpen:0,icon:2,closeIcon:3,text:4,ref:1,transition:5,preventCloseOnClickOutside:6})}}const NV=PV;function BV(t){let e,n,i;const l=t[3].default,r=He(l,t,t[2],null);let s=[t[0],{role:"menubar"}],o={};for(let f=0;f{n(4,e=Z(Z({},e),Te(a))),n(1,r=de(e,l)),"$$scope"in a&&n(2,o=a.$$scope)},t.$$.update=()=>{n(0,i={"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"]})},e=Te(e),[i,r,o,s]}class HV extends Oe{constructor(e){super(),Ee(this,e,zV,BV,Se,{})}}const UV=HV;function FV(t){let e;return{c(){e=j(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function GV(t){let e,n,i,l,r,s,o,a;const u=t[9].default,f=He(u,t,t[8],null),c=f||FV(t);let d=[{role:"menuitem"},{tabindex:"0"},{href:t[1]},{rel:l=t[7].target==="_blank"?"noopener noreferrer":void 0},{"aria-current":r=t[3]?"page":void 0},t[7]],h={};for(let g=0;g{n(4,h=Object.keys(G))});sn(()=>()=>{g&&g()});function _(G){te.call(this,t,G)}function k(G){te.call(this,t,G)}function y(G){te.call(this,t,G)}function T(G){te.call(this,t,G)}function M(G){te.call(this,t,G)}function A(G){te.call(this,t,G)}function C(G){te.call(this,t,G)}function D(G){te.call(this,t,G)}function R(G){xe[G?"unshift":"push"](()=>{f=G,n(0,f)})}const N=()=>{h.indexOf(c)===h.length-1&&(d==null||d.closeMenu())};return t.$$set=G=>{e=Z(Z({},e),Te(G)),n(7,l=de(e,i)),"href"in G&&n(1,o=G.href),"text"in G&&n(2,a=G.text),"isSelected"in G&&n(3,u=G.isSelected),"ref"in G&&n(0,f=G.ref),"$$scope"in G&&n(8,s=G.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&(d==null||d.updateSelectedItems({id:c,isSelected:u}))},[f,o,a,u,h,c,d,l,s,r,_,k,y,T,M,A,C,D,R,N]}class WV extends Oe{constructor(e){super(),Ee(this,e,VV,GV,Se,{href:1,text:2,isSelected:3,ref:0})}}const s5=WV;function jV(t){let e,n,i,l,r,s,o,a,u,f;r=new ho({props:{class:"bx--header__menu-arrow"}});let c=[{role:"menuitem"},{tabindex:"0"},{"aria-haspopup":"menu"},{"aria-expanded":t[0]},{"aria-label":t[3]},{href:t[2]},t[7]],d={};for(let _=0;_n(8,s=V));let g=null;pi("HeaderNavMenu",{selectedItems:h,updateSelectedItems(V){h.update(K=>({...K,[V.id]:V.isSelected}))},closeMenu(){n(0,u=!1)}});function _(V){te.call(this,t,V)}function k(V){te.call(this,t,V)}function y(V){te.call(this,t,V)}function T(V){te.call(this,t,V)}function M(V){te.call(this,t,V)}function A(V){te.call(this,t,V)}function C(V){te.call(this,t,V)}function D(V){te.call(this,t,V)}const R=({target:V})=>{d.contains(V)||n(0,u=!1)};function N(V){xe[V?"unshift":"push"](()=>{d=V,n(1,d)})}const G=V=>{V.key===" "&&V.preventDefault(),(V.key==="Enter"||V.key===" ")&&n(0,u=!u)};function B(V){xe[V?"unshift":"push"](()=>{g=V,n(4,g)})}const $=V=>{g.contains(V.target)||V.preventDefault(),n(0,u=!u)},q=V=>{V.key==="Enter"&&(V.stopPropagation(),n(0,u=!u))};return t.$$set=V=>{e=Z(Z({},e),Te(V)),n(7,r=de(e,l)),"expanded"in V&&n(0,u=V.expanded),"href"in V&&n(2,f=V.href),"text"in V&&n(3,c=V.text),"ref"in V&&n(1,d=V.ref),"$$scope"in V&&n(9,a=V.$$scope)},t.$$.update=()=>{t.$$.dirty&256&&n(5,i=Object.values(s).filter(Boolean).length>0)},[u,d,f,c,g,i,h,r,s,a,o,_,k,y,T,M,A,C,D,R,N,G,B,$,q]}class qV extends Oe{constructor(e){super(),Ee(this,e,$V,jV,Se,{expanded:0,href:2,text:3,ref:1})}}const YV=qV;function pk(t){let e,n,i;const l=t[2].default,r=He(l,t,t[1],null);return{c(){e=P("li"),n=P("span"),r&&r.c(),I(n,"class","svelte-1tbdbmc"),I(e,"class","svelte-1tbdbmc")},m(s,o){O(s,e,o),w(e,n),r&&r.m(n,null),i=!0},p(s,o){r&&r.p&&(!i||o&2)&&Fe(r,l,s,s[1],i?Ue(l,s[1],o,null):Ge(s[1]),null)},i(s){i||(p(r,s),i=!0)},o(s){v(r,s),i=!1},d(s){s&&E(e),r&&r.d(s)}}}function ZV(t){let e,n,i,l=t[0].default&&pk(t);return{c(){l&&l.c(),e=F(),n=P("hr"),S(n,"bx--switcher__item--divider",!0)},m(r,s){l&&l.m(r,s),O(r,e,s),O(r,n,s),i=!0},p(r,[s]){r[0].default?l?(l.p(r,s),s&1&&p(l,1)):(l=pk(r),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe())},i(r){i||(p(l),i=!0)},o(r){v(l),i=!1},d(r){r&&(E(e),E(n)),l&&l.d(r)}}}function XV(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);return t.$$set=s=>{"$$scope"in s&&n(1,l=s.$$scope)},[r,l,i]}class KV extends Oe{constructor(e){super(),Ee(this,e,XV,ZV,Se,{})}}const JV=KV;function QV(t){let e,n,i,l,r,s;const o=t[4].default,a=He(o,t,t[3],null);let u=[{href:t[1]},{rel:i=t[2].target==="_blank"?"noopener noreferrer":void 0},t[2]],f={};for(let c=0;c{a=c,n(0,a)})}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"href"in c&&n(1,o=c.href),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class eW extends Oe{constructor(e){super(),Ee(this,e,xV,QV,Se,{href:1,ref:0})}}const bk=eW;function tW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("ul"),l&&l.c(),S(e,"bx--switcher__item",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function nW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class iW extends Oe{constructor(e){super(),Ee(this,e,nW,tW,Se,{})}}const lW=iW;function rW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("div"),l&&l.c(),S(e,"bx--header__global",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function sW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class oW extends Oe{constructor(e){super(),Ee(this,e,sW,rW,Se,{})}}const aW=oW;function vk(t){let e,n,i;return{c(){e=P("div"),S(e,"bx--side-nav__overlay",!0),S(e,"bx--side-nav__overlay-active",t[0]),An(e,"z-index",t[0]?6e3:void 0)},m(l,r){O(l,e,r),n||(i=J(e,"click",t[11]),n=!0)},p(l,r){r&1&&S(e,"bx--side-nav__overlay-active",l[0]),r&1&&An(e,"z-index",l[0]?6e3:void 0)},d(l){l&&E(e),n=!1,i()}}}function uW(t){let e,n,i,l,r,s;Es(t[10]);let o=!t[1]&&vk(t);const a=t[9].default,u=He(a,t,t[8],null);let f=[{"aria-hidden":i=!t[0]},{"aria-label":t[3]},t[7]],c={};for(let d=0;d=t[4]?!1:t[0]),S(n,"bx--side-nav--collapsed",!t[0]&&!t[2]),S(n,"bx--side-nav--rail",t[2])},m(d,h){o&&o.m(d,h),O(d,e,h),O(d,n,h),u&&u.m(n,null),l=!0,r||(s=J(window,"resize",t[10]),r=!0)},p(d,[h]){d[1]?o&&(o.d(1),o=null):o?o.p(d,h):(o=vk(d),o.c(),o.m(e.parentNode,e)),u&&u.p&&(!l||h&256)&&Fe(u,a,d,d[8],l?Ue(a,d[8],h,null):Ge(d[8]),null),we(n,c=Pe(f,[(!l||h&1&&i!==(i=!d[0]))&&{"aria-hidden":i},(!l||h&8)&&{"aria-label":d[3]},h&128&&d[7]])),S(n,"bx--side-nav__navigation",!0),S(n,"bx--side-nav",!0),S(n,"bx--side-nav--ux",!0),S(n,"bx--side-nav--expanded",d[2]&&d[5]>=d[4]?!1:d[0]),S(n,"bx--side-nav--collapsed",!d[0]&&!d[2]),S(n,"bx--side-nav--rail",d[2])},i(d){l||(p(u,d),l=!0)},o(d){v(u,d),l=!1},d(d){d&&(E(e),E(n)),o&&o.d(d),u&&u.d(d),r=!1,s()}}}function fW(t,e,n){const i=["fixed","rail","ariaLabel","isOpen","expansionBreakpoint"];let l=de(e,i),r,s;ct(t,nm,T=>n(12,r=T)),ct(t,tm,T=>n(13,s=T));let{$$slots:o={},$$scope:a}=e,{fixed:u=!1}=e,{rail:f=!1}=e,{ariaLabel:c=void 0}=e,{isOpen:d=!1}=e,{expansionBreakpoint:h=1056}=e;const g=on();let _;sn(()=>(em.set(!0),()=>em.set(!1)));function k(){n(5,_=window.innerWidth)}const y=()=>{g("click:overlay"),n(0,d=!1)};return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(7,l=de(e,i)),"fixed"in T&&n(1,u=T.fixed),"rail"in T&&n(2,f=T.rail),"ariaLabel"in T&&n(3,c=T.ariaLabel),"isOpen"in T&&n(0,d=T.isOpen),"expansionBreakpoint"in T&&n(4,h=T.expansionBreakpoint),"$$scope"in T&&n(8,a=T.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&g(d?"open":"close"),t.$$.dirty&1&&ro(tm,s=!d,s),t.$$.dirty&4&&ro(nm,r=f,r)},[d,u,f,c,h,_,g,l,a,o,k,y]}class cW extends Oe{constructor(e){super(),Ee(this,e,fW,uW,Se,{fixed:1,rail:2,ariaLabel:3,isOpen:0,expansionBreakpoint:4})}}const dW=cW;function hW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("ul"),l&&l.c(),S(e,"bx--side-nav__items",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function mW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class gW extends Oe{constructor(e){super(),Ee(this,e,mW,hW,Se,{})}}const _W=gW,pW=t=>({}),kk=t=>({});function wk(t){let e,n;const i=t[8].icon,l=He(i,t,t[7],kk),r=l||bW(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--side-nav__icon",!0),S(e,"bx--side-nav__icon--small",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&128)&&Fe(l,i,s,s[7],n?Ue(i,s[7],o,pW):Ge(s[7]),kk):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function bW(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function vW(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function kW(t){let e,n,i,l,r,s,o,a,u,f=(t[6].icon||t[4])&&wk(t);const c=t[8].default,d=He(c,t,t[7],null),h=d||vW(t);let g=[{"aria-current":r=t[1]?"page":void 0},{href:t[2]},{rel:s=t[5].target==="_blank"?"noopener noreferrer":void 0},t[5]],_={};for(let k=0;k{f=null}),fe()),d?d.p&&(!o||y&128)&&Fe(d,c,k,k[7],o?Ue(c,k[7],y,null):Ge(k[7]),null):h&&h.p&&(!o||y&8)&&h.p(k,o?y:-1),we(n,_=Pe(g,[(!o||y&2&&r!==(r=k[1]?"page":void 0))&&{"aria-current":r},(!o||y&4)&&{href:k[2]},(!o||y&32&&s!==(s=k[5].target==="_blank"?"noopener noreferrer":void 0))&&{rel:s},y&32&&k[5]])),S(n,"bx--side-nav__link",!0),S(n,"bx--side-nav__link--current",k[1])},i(k){o||(p(f),p(h,k),o=!0)},o(k){v(f),v(h,k),o=!1},d(k){k&&E(e),f&&f.d(),h&&h.d(k),t[10](null),a=!1,u()}}}function wW(t,e,n){const i=["isSelected","href","text","icon","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{isSelected:a=!1}=e,{href:u=void 0}=e,{text:f=void 0}=e,{icon:c=void 0}=e,{ref:d=null}=e;function h(_){te.call(this,t,_)}function g(_){xe[_?"unshift":"push"](()=>{d=_,n(0,d)})}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(5,l=de(e,i)),"isSelected"in _&&n(1,a=_.isSelected),"href"in _&&n(2,u=_.href),"text"in _&&n(3,f=_.text),"icon"in _&&n(4,c=_.icon),"ref"in _&&n(0,d=_.ref),"$$scope"in _&&n(7,s=_.$$scope)},[d,a,u,f,c,l,o,s,r,h,g]}class yW extends Oe{constructor(e){super(),Ee(this,e,wW,kW,Se,{isSelected:1,href:2,text:3,icon:4,ref:0})}}const TW=yW,SW=t=>({}),yk=t=>({});function Tk(t){let e,n;const i=t[7].icon,l=He(i,t,t[6],yk),r=l||EW(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--side-nav__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&64)&&Fe(l,i,s,s[6],n?Ue(i,s[6],o,SW):Ge(s[6]),yk):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function EW(t){let e,n,i;var l=t[3];function r(s,o){return{}}return l&&(e=rn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=rn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function OW(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g=(t[5].icon||t[3])&&Tk(t);a=new ho({});let _=[{type:"button"},{"aria-expanded":t[0]},t[4]],k={};for(let M=0;M<_.length;M+=1)k=Z(k,_[M]);const y=t[7].default,T=He(y,t,t[6],null);return{c(){e=P("li"),n=P("button"),g&&g.c(),i=F(),l=P("span"),r=j(t[2]),s=F(),o=P("div"),U(a.$$.fragment),u=F(),f=P("ul"),T&&T.c(),S(l,"bx--side-nav__submenu-title",!0),S(o,"bx--side-nav__icon",!0),S(o,"bx--side-nav__icon--small",!0),S(o,"bx--side-nav__submenu-chevron",!0),we(n,k),S(n,"bx--side-nav__submenu",!0),I(f,"role","menu"),S(f,"bx--side-nav__menu",!0),An(f,"max-height",t[0]?"none":void 0),S(e,"bx--side-nav__item",!0),S(e,"bx--side-nav__item--icon",t[3])},m(M,A){O(M,e,A),w(e,n),g&&g.m(n,null),w(n,i),w(n,l),w(l,r),w(n,s),w(n,o),z(a,o,null),n.autofocus&&n.focus(),t[9](n),w(e,u),w(e,f),T&&T.m(f,null),c=!0,d||(h=[J(n,"click",t[8]),J(n,"click",t[10])],d=!0)},p(M,[A]){M[5].icon||M[3]?g?(g.p(M,A),A&40&&p(g,1)):(g=Tk(M),g.c(),p(g,1),g.m(n,i)):g&&(ue(),v(g,1,1,()=>{g=null}),fe()),(!c||A&4)&&Y(r,M[2]),we(n,k=Pe(_,[{type:"button"},(!c||A&1)&&{"aria-expanded":M[0]},A&16&&M[4]])),S(n,"bx--side-nav__submenu",!0),T&&T.p&&(!c||A&64)&&Fe(T,y,M,M[6],c?Ue(y,M[6],A,null):Ge(M[6]),null),A&1&&An(f,"max-height",M[0]?"none":void 0),(!c||A&8)&&S(e,"bx--side-nav__item--icon",M[3])},i(M){c||(p(g),p(a.$$.fragment,M),p(T,M),c=!0)},o(M){v(g),v(a.$$.fragment,M),v(T,M),c=!1},d(M){M&&E(e),g&&g.d(),H(a),t[9](null),T&&T.d(M),d=!1,ut(h)}}}function MW(t,e,n){const i=["expanded","text","icon","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{expanded:a=!1}=e,{text:u=void 0}=e,{icon:f=void 0}=e,{ref:c=null}=e;function d(_){te.call(this,t,_)}function h(_){xe[_?"unshift":"push"](()=>{c=_,n(1,c)})}const g=()=>{n(0,a=!a)};return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(4,l=de(e,i)),"expanded"in _&&n(0,a=_.expanded),"text"in _&&n(2,u=_.text),"icon"in _&&n(3,f=_.icon),"ref"in _&&n(1,c=_.ref),"$$scope"in _&&n(6,s=_.$$scope)},[a,c,u,f,l,o,s,r,d,h,g]}class CW extends Oe{constructor(e){super(),Ee(this,e,MW,OW,Se,{expanded:0,text:2,icon:3,ref:1})}}const AW=CW;function LW(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function DW(t){let e,n,i,l,r,s,o;const a=t[6].default,u=He(a,t,t[5],null),f=u||LW(t);let c=[{"aria-current":l=t[1]?"page":void 0},{href:t[2]},t[4]],d={};for(let h=0;h{f=h,n(0,f)})}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"isSelected"in h&&n(1,o=h.isSelected),"href"in h&&n(2,a=h.href),"text"in h&&n(3,u=h.text),"ref"in h&&n(0,f=h.ref),"$$scope"in h&&n(5,s=h.$$scope)},[f,o,a,u,l,s,r,c,d]}class RW extends Oe{constructor(e){super(),Ee(this,e,IW,DW,Se,{isSelected:1,href:2,text:3,ref:0})}}const PW=RW;function NW(t){let e,n;const i=t[6].default,l=He(i,t,t[5],null);let r=[{id:t[0]},t[2]],s={};for(let o=0;on(3,s=c)),ct(t,tm,c=>n(4,o=c));let{$$slots:a={},$$scope:u}=e,{id:f="main-content"}=e;return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,r=de(e,l)),"id"in c&&n(0,f=c.id),"$$scope"in c&&n(5,u=c.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&n(1,i=o&&!s)},[f,i,r,s,o,u,a]}class zW extends Oe{constructor(e){super(),Ee(this,e,BW,NW,Se,{id:0})}}const HW=zW;function UW(t){let e;return{c(){e=j("Skip to main content")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function FW(t){let e,n,i,l;const r=t[4].default,s=He(r,t,t[3],null),o=s||UW();let a=[{href:t[0]},{tabindex:t[1]},t[2]],u={};for(let f=0;f{e=Z(Z({},e),Te(f)),n(2,l=de(e,i)),"href"in f&&n(0,o=f.href),"tabindex"in f&&n(1,a=f.tabindex),"$$scope"in f&&n(3,s=f.$$scope)},[o,a,l,s,r,u]}class VW extends Oe{constructor(e){super(),Ee(this,e,GW,FW,Se,{href:0,tabindex:1})}}const WW=VW;function jW(t){let e,n=[{role:"separator"},t[0]],i={};for(let l=0;l{e=Z(Z({},e),Te(r)),n(0,l=de(e,i))},[l]}class qW extends Oe{constructor(e){super(),Ee(this,e,$W,jW,Se,{})}}const YW=qW,im={},lm={},ZW={},o5=()=>jn(im),a5=/^:(.+)/,Sk=4,XW=3,KW=2,JW=1,QW=1,rm=t=>t.replace(/(^\/+|\/+$)/g,"").split("/"),h1=t=>t.replace(/(^\/+|\/+$)/g,""),xW=(t,e)=>{const n=t.default?0:rm(t.path).reduce((i,l)=>(i+=Sk,l===""?i+=QW:a5.test(l)?i+=KW:l[0]==="*"?i-=Sk+JW:i+=XW,i),0);return{route:t,score:n,index:e}},ej=t=>t.map(xW).sort((e,n)=>e.scoren.score?-1:e.index-n.index),Ek=(t,e)=>{let n,i;const[l]=e.split("?"),r=rm(l),s=r[0]==="",o=ej(t);for(let a=0,u=o.length;a"u"){c=!0;break}const T=a5.exec(k);if(T&&!s){const M=decodeURIComponent(y);h[T[1]]=M}else if(k!==y){c=!0;break}}if(!c){n={route:f,params:h,uri:"/"+r.slice(0,_).join("/")};break}}return n||i||null},Ok=(t,e)=>`${h1(e==="/"?t:`${h1(t)}/${h1(e)}`)}/`,u5=()=>typeof window<"u"&&"document"in window&&"location"in window,tj=t=>({params:t&4}),Mk=t=>({params:t[2]});function Ck(t){let e,n,i,l;const r=[ij,nj],s=[];function o(a,u){return a[0]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function nj(t){let e;const n=t[8].default,i=He(n,t,t[7],Mk);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&132)&&Fe(i,n,l,l[7],e?Ue(n,l[7],r,tj):Ge(l[7]),Mk)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function ij(t){let e,n,i,l={ctx:t,current:null,token:null,hasCatch:!1,pending:sj,then:rj,catch:lj,value:12,blocks:[,,,]};return Ip(n=t[0],l),{c(){e=je(),l.block.c()},m(r,s){O(r,e,s),l.block.m(r,l.anchor=s),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(r,s){t=r,l.ctx=t,s&1&&n!==(n=t[0])&&Ip(n,l)||hI(l,t,s)},i(r){i||(p(l.block),i=!0)},o(r){for(let s=0;s<3;s+=1){const o=l.blocks[s];v(o)}i=!1},d(r){r&&E(e),l.block.d(r),l.token=null,l=null}}}function lj(t){return{c:_e,m:_e,p:_e,i:_e,o:_e,d:_e}}function rj(t){var o;let e,n,i;const l=[t[2],t[3]];var r=((o=t[12])==null?void 0:o.default)||t[12];function s(a,u){let f={};if(u!==void 0&&u&12)f=Pe(l,[u&4&&Gi(a[2]),u&8&&Gi(a[3])]);else for(let c=0;c{H(c,1)}),fe()}r?(e=rn(r,s(a,u)),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}else if(r){const c=u&12?Pe(l,[u&4&&Gi(a[2]),u&8&&Gi(a[3])]):{};e.$set(c)}},i(a){i||(e&&p(e.$$.fragment,a),i=!0)},o(a){e&&v(e.$$.fragment,a),i=!1},d(a){a&&E(n),e&&H(e,a)}}}function sj(t){return{c:_e,m:_e,p:_e,i:_e,o:_e,d:_e}}function oj(t){let e,n,i=t[1]&&t[1].route===t[5]&&Ck(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[1]&&l[1].route===l[5]?i?(i.p(l,r),r&2&&p(i,1)):(i=Ck(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function aj(t,e,n){let i,{$$slots:l={},$$scope:r}=e,{path:s=""}=e,{component:o=null}=e,a={},u={};const{registerRoute:f,unregisterRoute:c,activeRoute:d}=jn(lm);ct(t,d,g=>n(1,i=g));const h={path:s,default:s===""};return f(h),Ls(()=>{c(h)}),t.$$set=g=>{n(11,e=Z(Z({},e),Te(g))),"path"in g&&n(6,s=g.path),"component"in g&&n(0,o=g.component),"$$scope"in g&&n(7,r=g.$$scope)},t.$$.update=()=>{if(i&&i.route===h){n(2,a=i.params);const{component:g,path:_,...k}=e;n(3,u=k),g&&(g.toString().startsWith("class ")?n(0,o=g):n(0,o=g())),u5()&&(window==null||window.scrollTo(0,0))}},e=Te(e),[o,i,a,u,d,h,s,r,l]}class yi extends Oe{constructor(e){super(),Ee(this,e,aj,oj,Se,{path:6,component:0})}}const m1=t=>({...t.location,state:t.history.state,key:t.history.state&&t.history.state.key||"initial"}),uj=t=>{const e=[];let n=m1(t);return{get location(){return n},listen(i){e.push(i);const l=()=>{n=m1(t),i({location:n,action:"POP"})};return t.addEventListener("popstate",l),()=>{t.removeEventListener("popstate",l);const r=e.indexOf(i);e.splice(r,1)}},navigate(i,{state:l,replace:r=!1}={}){l={...l,key:Date.now()+""};try{r?t.history.replaceState(l,"",i):t.history.pushState(l,"",i)}catch{t.location[r?"replace":"assign"](i)}n=m1(t),e.forEach(s=>s({location:n,action:"PUSH"})),document.activeElement.blur()}}},fj=(t="/")=>{let e=0;const n=[{pathname:t,search:""}],i=[];return{get location(){return n[e]},addEventListener(l,r){},removeEventListener(l,r){},history:{get entries(){return n},get index(){return e},get state(){return i[e]},pushState(l,r,s){const[o,a=""]=s.split("?");e++,n.push({pathname:o,search:a}),i.push(l)},replaceState(l,r,s){const[o,a=""]=s.split("?");n[e]={pathname:o,search:a},i[e]=l}}}},f5=uj(u5()?window:fj()),{navigate:cj}=f5,dj=t=>({route:t&2,location:t&1}),Ak=t=>({route:t[1]&&t[1].uri,location:t[0]});function hj(t){let e;const n=t[12].default,i=He(n,t,t[11],Ak);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,[r]){i&&i.p&&(!e||r&2051)&&Fe(i,n,l,l[11],e?Ue(n,l[11],r,dj):Ge(l[11]),Ak)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function mj(t,e,n){let i,l,r,s,{$$slots:o={},$$scope:a}=e,{basepath:u="/"}=e,{url:f=null}=e,{history:c=f5}=e;pi(ZW,c);const d=jn(im),h=jn(lm),g=Wt([]);ct(t,g,D=>n(9,l=D));const _=Wt(null);ct(t,_,D=>n(1,s=D));let k=!1;const y=d||Wt(f?{pathname:f}:c.location);ct(t,y,D=>n(0,i=D));const T=h?h.routerBase:Wt({path:u,uri:u});ct(t,T,D=>n(10,r=D));const M=ur([T,_],([D,R])=>{if(!R)return D;const{path:N}=D,{route:G,uri:B}=R;return{path:G.default?N:G.path.replace(/\*.*$/,""),uri:B}}),A=D=>{const{path:R}=r;let{path:N}=D;if(D._path=N,D.path=Ok(R,N),typeof window>"u"){if(k)return;const G=Ek([D],i.pathname);G&&(_.set(G),k=!0)}else g.update(G=>[...G,D])},C=D=>{g.update(R=>R.filter(N=>N!==D))};return d||(sn(()=>c.listen(R=>{y.set(R.location)})),pi(im,y)),pi(lm,{activeRoute:_,base:T,routerBase:M,registerRoute:A,unregisterRoute:C}),t.$$set=D=>{"basepath"in D&&n(6,u=D.basepath),"url"in D&&n(7,f=D.url),"history"in D&&n(8,c=D.history),"$$scope"in D&&n(11,a=D.$$scope)},t.$$.update=()=>{if(t.$$.dirty&1024){const{path:D}=r;g.update(R=>R.map(N=>Object.assign(N,{path:Ok(D,N._path)})))}if(t.$$.dirty&513){const D=Ek(l,i.pathname);_.set(D)}},[i,s,g,_,y,T,u,f,c,l,r,a,o]}class gj extends Oe{constructor(e){super(),Ee(this,e,mj,hj,Se,{basepath:6,url:7,history:8})}}var xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function c5(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _j(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,l.get?l:{enumerable:!0,get:function(){return t[i]}})}),n}var pj=function(e){return bj(e)&&!vj(e)};function bj(t){return!!t&&typeof t=="object"}function vj(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||yj(t)}var kj=typeof Symbol=="function"&&Symbol.for,wj=kj?Symbol.for("react.element"):60103;function yj(t){return t.$$typeof===wj}function Tj(t){return Array.isArray(t)?[]:{}}function Mu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ra(Tj(t),t,e):t}function Sj(t,e,n){return t.concat(e).map(function(i){return Mu(i,n)})}function Ej(t,e){if(!e.customMerge)return ra;var n=e.customMerge(t);return typeof n=="function"?n:ra}function Oj(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Lk(t){return Object.keys(t).concat(Oj(t))}function d5(t,e){try{return e in t}catch{return!1}}function Mj(t,e){return d5(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function Cj(t,e,n){var i={};return n.isMergeableObject(t)&&Lk(t).forEach(function(l){i[l]=Mu(t[l],n)}),Lk(e).forEach(function(l){Mj(t,l)||(d5(t,l)&&n.isMergeableObject(e[l])?i[l]=Ej(l,n)(t[l],e[l],n):i[l]=Mu(e[l],n))}),i}function ra(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||Sj,n.isMergeableObject=n.isMergeableObject||pj,n.cloneUnlessOtherwiseSpecified=Mu;var i=Array.isArray(e),l=Array.isArray(t),r=i===l;return r?i?n.arrayMerge(t,e,n):Cj(t,e,n):Mu(e,n)}ra.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,l){return ra(i,l,n)},{})};var Aj=ra,Lj=Aj;const Dj=c5(Lj);var sm=function(t,e){return sm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(n[l]=i[l])},sm(t,e)};function Ld(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var pn=function(){return pn=Object.assign||function(e){for(var n,i=1,l=arguments.length;i0}),n=[],i=0,l=e;i1)throw new RangeError("integer-width stems only accept a single optional option");l.options[0].replace(Uj,function(a,u,f,c,d,h){if(u)e.minimumIntegerDigits=f.length;else{if(c&&d)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if(y5.test(l.stem)){e.minimumIntegerDigits=l.stem.length;continue}if(Ik.test(l.stem)){if(l.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");l.stem.replace(Ik,function(a,u,f,c,d,h){return f==="*"?e.minimumFractionDigits=u.length:c&&c[0]==="#"?e.maximumFractionDigits=c.length:d&&h?(e.minimumFractionDigits=d.length,e.maximumFractionDigits=d.length+h.length):(e.minimumFractionDigits=u.length,e.maximumFractionDigits=u.length),""});var r=l.options[0];r==="w"?e=pn(pn({},e),{trailingZeroDisplay:"stripIfInteger"}):r&&(e=pn(pn({},e),Rk(r)));continue}if(w5.test(l.stem)){e=pn(pn({},e),Rk(l.stem));continue}var s=T5(l.stem);s&&(e=pn(pn({},e),s));var o=Fj(l.stem);o&&(e=pn(pn({},e),o))}return e}var xf={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Vj(t,e){for(var n="",i=0;i>1),a="a",u=Wj(e);for((u=="H"||u=="k")&&(o=0);o-- >0;)n+=a;for(;s-- >0;)n=u+n}else l==="J"?n+="H":n+=l}return n}function Wj(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=t.language,i;n!=="root"&&(i=t.maximize().region);var l=xf[i||""]||xf[n||""]||xf["".concat(n,"-001")]||xf["001"];return l[0]}var _1,jj=new RegExp("^".concat(k5.source,"*")),$j=new RegExp("".concat(k5.source,"*$"));function ln(t,e){return{start:t,end:e}}var qj=!!String.prototype.startsWith,Yj=!!String.fromCodePoint,Zj=!!Object.fromEntries,Xj=!!String.prototype.codePointAt,Kj=!!String.prototype.trimStart,Jj=!!String.prototype.trimEnd,Qj=!!Number.isSafeInteger,xj=Qj?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},am=!0;try{var e$=E5("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");am=((_1=e$.exec("a"))===null||_1===void 0?void 0:_1[0])==="a"}catch{am=!1}var Nk=qj?function(e,n,i){return e.startsWith(n,i)}:function(e,n,i){return e.slice(i,i+n.length)===n},um=Yj?String.fromCodePoint:function(){for(var e=[],n=0;nr;){if(s=e[r++],s>1114111)throw RangeError(s+" is not a valid code point");i+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return i},Bk=Zj?Object.fromEntries:function(e){for(var n={},i=0,l=e;i=i)){var l=e.charCodeAt(n),r;return l<55296||l>56319||n+1===i||(r=e.charCodeAt(n+1))<56320||r>57343?l:(l-55296<<10)+(r-56320)+65536}},t$=Kj?function(e){return e.trimStart()}:function(e){return e.replace(jj,"")},n$=Jj?function(e){return e.trimEnd()}:function(e){return e.replace($j,"")};function E5(t,e){return new RegExp(t,e)}var fm;if(am){var zk=E5("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");fm=function(e,n){var i;zk.lastIndex=n;var l=zk.exec(e);return(i=l[1])!==null&&i!==void 0?i:""}}else fm=function(e,n){for(var i=[];;){var l=S5(e,n);if(l===void 0||O5(l)||s$(l))break;i.push(l),n+=l>=65536?2:1}return um.apply(void 0,i)};var i$=function(){function t(e,n){n===void 0&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,n,i){for(var l=[];!this.isEOF();){var r=this.char();if(r===123){var s=this.parseArgument(e,i);if(s.err)return s;l.push(s.val)}else{if(r===125&&e>0)break;if(r===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),l.push({type:Hn.pound,location:ln(o,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(tn.UNMATCHED_CLOSING_TAG,ln(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&cm(this.peek()||0)){var s=this.parseTag(e,n);if(s.err)return s;l.push(s.val)}else{var s=this.parseLiteral(e,n);if(s.err)return s;l.push(s.val)}}}return{val:l,err:null}},t.prototype.parseTag=function(e,n){var i=this.clonePosition();this.bump();var l=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Hn.literal,value:"<".concat(l,"/>"),location:ln(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,n,!0);if(r.err)return r;var s=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:Hn.tag,value:l,children:s,location:ln(i,this.clonePosition())},err:null}:this.error(tn.INVALID_TAG,ln(o,this.clonePosition())))}else return this.error(tn.UNCLOSED_TAG,ln(i,this.clonePosition()))}else return this.error(tn.INVALID_TAG,ln(i,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&r$(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,n){for(var i=this.clonePosition(),l="";;){var r=this.tryParseQuote(n);if(r){l+=r;continue}var s=this.tryParseUnquoted(e,n);if(s){l+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){l+=o;continue}break}var a=ln(i,this.clonePosition());return{val:{type:Hn.literal,value:l,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!l$(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return um.apply(void 0,n)},t.prototype.tryParseUnquoted=function(e,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&e>0?null:(this.bump(),um(i))},t.prototype.parseArgument=function(e,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,ln(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(tn.EMPTY_ARGUMENT,ln(i,this.clonePosition()));var l=this.parseIdentifierIfPossible().value;if(!l)return this.error(tn.MALFORMED_ARGUMENT,ln(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,ln(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Hn.argument,value:l,location:ln(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,ln(i,this.clonePosition())):this.parseArgumentOptions(e,n,l,i);default:return this.error(tn.MALFORMED_ARGUMENT,ln(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),n=this.offset(),i=fm(this.message,n),l=n+i.length;this.bumpTo(l);var r=this.clonePosition(),s=ln(e,r);return{value:i,location:s}},t.prototype.parseArgumentOptions=function(e,n,i,l){var r,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(tn.EXPECT_ARGUMENT_TYPE,ln(s,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var d=n$(c.val);if(d.length===0)return this.error(tn.EXPECT_ARGUMENT_STYLE,ln(this.clonePosition(),this.clonePosition()));var h=ln(f,this.clonePosition());u={style:d,styleLocation:h}}var g=this.tryParseArgumentClose(l);if(g.err)return g;var _=ln(l,this.clonePosition());if(u&&Nk(u==null?void 0:u.style,"::",0)){var k=t$(u.style.slice(2));if(o==="number"){var c=this.parseNumberSkeletonFromString(k,u.styleLocation);return c.err?c:{val:{type:Hn.number,value:i,location:_,style:c.val},err:null}}else{if(k.length===0)return this.error(tn.EXPECT_DATE_TIME_SKELETON,_);var y=k;this.locale&&(y=Vj(k,this.locale));var d={type:sa.dateTime,pattern:y,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Nj(y):{}},T=o==="date"?Hn.date:Hn.time;return{val:{type:T,value:i,location:_,style:d},err:null}}}return{val:{type:o==="number"?Hn.number:o==="date"?Hn.date:Hn.time,value:i,location:_,style:(r=u==null?void 0:u.style)!==null&&r!==void 0?r:null},err:null}}case"plural":case"selectordinal":case"select":{var M=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(tn.EXPECT_SELECT_ARGUMENT_OPTIONS,ln(M,pn({},M)));this.bumpSpace();var A=this.parseIdentifierIfPossible(),C=0;if(o!=="select"&&A.value==="offset"){if(!this.bumpIf(":"))return this.error(tn.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ln(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(tn.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,tn.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),A=this.parseIdentifierIfPossible(),C=c.val}var D=this.tryParsePluralOrSelectOptions(e,o,n,A);if(D.err)return D;var g=this.tryParseArgumentClose(l);if(g.err)return g;var R=ln(l,this.clonePosition());return o==="select"?{val:{type:Hn.select,value:i,options:Bk(D.val),location:R},err:null}:{val:{type:Hn.plural,value:i,options:Bk(D.val),offset:C,pluralType:o==="plural"?"cardinal":"ordinal",location:R},err:null}}default:return this.error(tn.INVALID_ARGUMENT_TYPE,ln(s,a))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,ln(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var l=this.clonePosition();if(!this.bumpUntil("'"))return this.error(tn.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,ln(l,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,n){var i=[];try{i=zj(e)}catch{return this.error(tn.INVALID_NUMBER_SKELETON,n)}return{val:{type:sa.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Gj(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,n,i,l){for(var r,s=!1,o=[],a=new Set,u=l.value,f=l.location;;){if(u.length===0){var c=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var d=this.tryParseDecimalInteger(tn.EXPECT_PLURAL_ARGUMENT_SELECTOR,tn.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;f=ln(c,this.clonePosition()),u=this.message.slice(c.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?tn.DUPLICATE_SELECT_ARGUMENT_SELECTOR:tn.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?tn.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:tn.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,ln(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,n,i);if(g.err)return g;var _=this.tryParseArgumentClose(h);if(_.err)return _;o.push([u,{value:g.val,location:ln(h,this.clonePosition())}]),a.add(u),this.bumpSpace(),r=this.parseIdentifierIfPossible(),u=r.value,f=r.location}return o.length===0?this.error(n==="select"?tn.EXPECT_SELECT_ARGUMENT_SELECTOR:tn.EXPECT_PLURAL_ARGUMENT_SELECTOR,ln(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(tn.MISSING_OTHER_CLAUSE,ln(this.clonePosition(),this.clonePosition())):{val:o,err:null}},t.prototype.tryParseDecimalInteger=function(e,n){var i=1,l=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var r=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)r=!0,s=s*10+(o-48),this.bump();else break}var a=ln(l,this.clonePosition());return r?(s*=i,xj(s)?{val:s,err:null}:this.error(n,a)):this.error(e,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var n=S5(this.message,e);if(n===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return n},t.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(Nk(this.message,e,this.offset())){for(var n=0;n=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&O5(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(e>=65536?2:1));return i??null},t}();function cm(t){return t>=97&&t<=122||t>=65&&t<=90}function l$(t){return cm(t)||t===47}function r$(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function O5(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function s$(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function dm(t){t.forEach(function(e){if(delete e.location,_5(e)||p5(e))for(var n in e.options)delete e.options[n].location,dm(e.options[n].value);else h5(e)&&v5(e.style)||(m5(e)||g5(e))&&om(e.style)?delete e.style.location:b5(e)&&dm(e.children)})}function o$(t,e){e===void 0&&(e={}),e=pn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new i$(t,e).parse();if(n.err){var i=SyntaxError(tn[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return e!=null&&e.captureLocation||dm(n.val),n.val}function p1(t,e){var n=e&&e.cache?e.cache:h$,i=e&&e.serializer?e.serializer:d$,l=e&&e.strategy?e.strategy:u$;return l(t,{cache:n,serializer:i})}function a$(t){return t==null||typeof t=="number"||typeof t=="boolean"}function M5(t,e,n,i){var l=a$(i)?i:n(i),r=e.get(l);return typeof r>"u"&&(r=t.call(this,i),e.set(l,r)),r}function C5(t,e,n){var i=Array.prototype.slice.call(arguments,3),l=n(i),r=e.get(l);return typeof r>"u"&&(r=t.apply(this,i),e.set(l,r)),r}function gg(t,e,n,i,l){return n.bind(e,t,i,l)}function u$(t,e){var n=t.length===1?M5:C5;return gg(t,this,n,e.cache.create(),e.serializer)}function f$(t,e){return gg(t,this,C5,e.cache.create(),e.serializer)}function c$(t,e){return gg(t,this,M5,e.cache.create(),e.serializer)}var d$=function(){return JSON.stringify(arguments)};function _g(){this.cache=Object.create(null)}_g.prototype.get=function(t){return this.cache[t]};_g.prototype.set=function(t,e){this.cache[t]=e};var h$={create:function(){return new _g}},b1={variadic:f$,monadic:c$},oa;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(oa||(oa={}));var Dd=function(t){Ld(e,t);function e(n,i,l){var r=t.call(this,n)||this;return r.code=i,r.originalMessage=l,r}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Hk=function(t){Ld(e,t);function e(n,i,l,r){return t.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(l).join('", "'),'"'),oa.INVALID_VALUE,r)||this}return e}(Dd),m$=function(t){Ld(e,t);function e(n,i,l){return t.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),oa.INVALID_VALUE,l)||this}return e}(Dd),g$=function(t){Ld(e,t);function e(n,i){return t.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),oa.MISSING_VALUE,i)||this}return e}(Dd),Fi;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(Fi||(Fi={}));function _$(t){return t.length<2?t:t.reduce(function(e,n){var i=e[e.length-1];return!i||i.type!==Fi.literal||n.type!==Fi.literal?e.push(n):i.value+=n.value,e},[])}function p$(t){return typeof t=="function"}function hc(t,e,n,i,l,r,s){if(t.length===1&&Dk(t[0]))return[{type:Fi.literal,value:t[0].value}];for(var o=[],a=0,u=t;a{!he&&!K&&n(0,h=!1),n(21,he=!1)},Zt=Ve=>{Ve.propertyName==="transform"&&X("transitionend",{open:h})};return t.$$set=Ve=>{n(54,e=Z(Z({},e),Te(Ve))),n(28,a=de(e,o)),"size"in Ve&&n(2,d=Ve.size),"open"in Ve&&n(0,h=Ve.open),"danger"in Ve&&n(3,g=Ve.danger),"alert"in Ve&&n(4,_=Ve.alert),"passiveModal"in Ve&&n(5,k=Ve.passiveModal),"modalHeading"in Ve&&n(6,y=Ve.modalHeading),"modalLabel"in Ve&&n(7,T=Ve.modalLabel),"modalAriaLabel"in Ve&&n(29,M=Ve.modalAriaLabel),"iconDescription"in Ve&&n(8,A=Ve.iconDescription),"hasForm"in Ve&&n(9,C=Ve.hasForm),"hasScrollingContent"in Ve&&n(10,D=Ve.hasScrollingContent),"primaryButtonText"in Ve&&n(11,R=Ve.primaryButtonText),"primaryButtonDisabled"in Ve&&n(12,N=Ve.primaryButtonDisabled),"primaryButtonIcon"in Ve&&n(13,G=Ve.primaryButtonIcon),"shouldSubmitOnEnter"in Ve&&n(14,B=Ve.shouldSubmitOnEnter),"secondaryButtonText"in Ve&&n(15,j=Ve.secondaryButtonText),"secondaryButtons"in Ve&&n(16,q=Ve.secondaryButtons),"selectorPrimaryFocus"in Ve&&n(30,V=Ve.selectorPrimaryFocus),"preventCloseOnClickOutside"in Ve&&n(17,K=Ve.preventCloseOnClickOutside),"id"in Ve&&n(18,x=Ve.id),"ref"in Ve&&n(1,ie=Ve.ref),"$$scope"in Ve&&n(50,c=Ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&lo(re,u=h,u),t.$$.dirty[0]&262144&&n(25,i=`bx--modal-header__label--modal-${x}`),t.$$.dirty[0]&262144&&n(24,l=`bx--modal-header__heading--modal-${x}`),t.$$.dirty[0]&262144&&n(23,r=`bx--modal-body--${x}`),n(22,s=T||e["aria-label"]||M||y)},e=Te(e),[h,ie,d,g,_,k,y,T,A,C,D,R,N,G,B,j,q,K,x,ce,ae,he,s,r,l,i,X,re,a,M,V,f,oe,Re,qe,Ce,Ze,be,Ae,ve,me,lt,De,vt,dt,ot,ht,Bt,Ot,Zt,c]}class $H extends Oe{constructor(e){super(),Ee(this,e,jH,WH,Se,{size:2,open:0,danger:3,alert:4,passiveModal:5,modalHeading:6,modalLabel:7,modalAriaLabel:29,iconDescription:8,hasForm:9,hasScrollingContent:10,primaryButtonText:11,primaryButtonDisabled:12,primaryButtonIcon:13,shouldSubmitOnEnter:14,secondaryButtonText:15,secondaryButtons:16,selectorPrimaryFocus:30,preventCloseOnClickOutside:17,id:18,ref:1},null,[-1,-1])}}const xT=$H;function qH(t){let e,n,i,l,r;var s=t[1];function o(f,c){return{props:{size:20,title:f[2],class:(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")}}}s&&(n=sn(s,o(t)));let a=[{type:"button"},{"aria-label":t[3]},{title:t[3]},t[4]],u={};for(let f=0;f{H(d,1)}),fe()}s?(n=sn(s,o(f)),U(n.$$.fragment),p(n.$$.fragment,1),z(n,e,null)):n=null}else if(s){const d={};c&4&&(d.title=f[2]),c&1&&(d.class=(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")),n.$set(d)}we(e,u=Pe(a,[{type:"button"},(!i||c&8)&&{"aria-label":f[3]},(!i||c&8)&&{title:f[3]},c&16&&f[4]])),S(e,"bx--toast-notification__close-button",f[0]==="toast"),S(e,"bx--inline-notification__close-button",f[0]==="inline")},i(f){i||(n&&p(n.$$.fragment,f),i=!0)},o(f){n&&v(n.$$.fragment,f),i=!1},d(f){f&&E(e),n&&H(n),l=!1,ut(r)}}}function YH(t,e,n){const i=["notificationType","icon","title","iconDescription"];let l=de(e,i),{notificationType:r="toast"}=e,{icon:s=Dl}=e,{title:o=void 0}=e,{iconDescription:a="Close icon"}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"notificationType"in h&&n(0,r=h.notificationType),"icon"in h&&n(1,s=h.icon),"title"in h&&n(2,o=h.title),"iconDescription"in h&&n(3,a=h.iconDescription)},[r,s,o,a,l,u,f,c,d]}class ZH extends Oe{constructor(e){super(),Ee(this,e,YH,qH,Se,{notificationType:0,icon:1,title:2,iconDescription:3})}}const e5=ZH;function I2(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function XH(t){let e,n,i,l=t[1]&&I2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class JH extends Oe{constructor(e){super(),Ee(this,e,KH,XH,Se,{size:0,title:1})}}const QH=JH;function R2(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function xH(t){let e,n,i,l=t[1]&&R2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class tU extends Oe{constructor(e){super(),Ee(this,e,eU,xH,Se,{size:0,title:1})}}const nU=tU;function iU(t){let e,n,i;var l=t[3][t[0]];function r(s,o){return{props:{size:20,title:s[2],class:(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")}}}return l&&(e=sn(l,r(t))),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,[o]){if(o&1&&l!==(l=s[3][s[0]])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r(s)),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}else if(l){const a={};o&4&&(a.title=s[2]),o&2&&(a.class=(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")),e.$set(a)}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function lU(t,e,n){let{kind:i="error"}=e,{notificationType:l="toast"}=e,{iconDescription:r}=e;const s={error:QT,"info-square":nU,info:QH,success:XT,warning:Ds,"warning-alt":Vu};return t.$$set=o=>{"kind"in o&&n(0,i=o.kind),"notificationType"in o&&n(1,l=o.notificationType),"iconDescription"in o&&n(2,r=o.iconDescription)},[i,l,r,s]}class rU extends Oe{constructor(e){super(),Ee(this,e,lU,iU,Se,{kind:0,notificationType:1,iconDescription:2})}}const t5=rU,sU=t=>({}),P2=t=>({}),oU=t=>({}),N2=t=>({}),aU=t=>({}),B2=t=>({});function z2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;n=new t5({props:{kind:t[0],iconDescription:t[6]}});const _=t[15].title,k=He(_,t,t[14],B2),y=k||uU(t),T=t[15].subtitle,M=He(T,t,t[14],N2),A=M||fU(t),C=t[15].caption,D=He(C,t,t[14],P2),R=D||cU(t),N=t[15].default,G=He(N,t,t[14],null);let B=!t[8]&&H2(t),j=[{role:t[2]},{kind:t[0]},t[12]],q={};for(let V=0;V{B=null}),fe()):B?(B.p(V,K),K&256&&p(B,1)):(B=H2(V),B.c(),p(B,1),B.m(e,null)),we(e,q=Pe(j,[(!d||K&4)&&{role:V[2]},(!d||K&1)&&{kind:V[0]},K&4096&&V[12]])),S(e,"bx--toast-notification",!0),S(e,"bx--toast-notification--low-contrast",V[1]),S(e,"bx--toast-notification--error",V[0]==="error"),S(e,"bx--toast-notification--info",V[0]==="info"),S(e,"bx--toast-notification--info-square",V[0]==="info-square"),S(e,"bx--toast-notification--success",V[0]==="success"),S(e,"bx--toast-notification--warning",V[0]==="warning"),S(e,"bx--toast-notification--warning-alt",V[0]==="warning-alt"),An(e,"width",V[9]?"100%":void 0)},i(V){d||(p(n.$$.fragment,V),p(y,V),p(A,V),p(R,V),p(G,V),p(B),d=!0)},o(V){v(n.$$.fragment,V),v(y,V),v(A,V),v(R,V),v(G,V),v(B),d=!1},d(V){V&&E(e),H(n),y&&y.d(V),A&&A.d(V),R&&R.d(V),G&&G.d(V),B&&B.d(),h=!1,ut(g)}}}function uU(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function fU(t){let e;return{c(){e=$(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function cU(t){let e;return{c(){e=$(t[5])},m(n,i){O(n,e,i)},p(n,i){i&32&&Y(e,n[5])},d(n){n&&E(e)}}}function H2(t){let e,n;return e=new e5({props:{iconDescription:t[7]}}),e.$on("click",t[11]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function dU(t){let e,n,i=t[10]&&z2(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[10]?i?(i.p(l,r),r&1024&&p(i,1)):(i=z2(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function hU(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","caption","statusIconDescription","closeButtonDescription","hideCloseButton","fullWidth"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{caption:h=""}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e,{hideCloseButton:k=!1}=e,{fullWidth:y=!1}=e;const T=nn();let M=!0,A;function C(B){T("close",{timeout:B===!0},{cancelable:!0})&&n(10,M=!1)}on(()=>(u&&(A=setTimeout(()=>C(!0),u)),()=>{clearTimeout(A)}));function D(B){te.call(this,t,B)}function R(B){te.call(this,t,B)}function N(B){te.call(this,t,B)}function G(B){te.call(this,t,B)}return t.$$set=B=>{e=Z(Z({},e),Te(B)),n(12,l=de(e,i)),"kind"in B&&n(0,o=B.kind),"lowContrast"in B&&n(1,a=B.lowContrast),"timeout"in B&&n(13,u=B.timeout),"role"in B&&n(2,f=B.role),"title"in B&&n(3,c=B.title),"subtitle"in B&&n(4,d=B.subtitle),"caption"in B&&n(5,h=B.caption),"statusIconDescription"in B&&n(6,g=B.statusIconDescription),"closeButtonDescription"in B&&n(7,_=B.closeButtonDescription),"hideCloseButton"in B&&n(8,k=B.hideCloseButton),"fullWidth"in B&&n(9,y=B.fullWidth),"$$scope"in B&&n(14,s=B.$$scope)},[o,a,f,c,d,h,g,_,k,y,M,C,l,u,s,r,D,R,N,G]}class mU extends Oe{constructor(e){super(),Ee(this,e,hU,dU,Se,{kind:0,lowContrast:1,timeout:13,role:2,title:3,subtitle:4,caption:5,statusIconDescription:6,closeButtonDescription:7,hideCloseButton:8,fullWidth:9})}}const gU=mU,_U=t=>({}),U2=t=>({}),pU=t=>({}),F2=t=>({}),bU=t=>({}),G2=t=>({});function V2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;i=new t5({props:{notificationType:"inline",kind:t[0],iconDescription:t[6]}});const _=t[13].title,k=He(_,t,t[12],G2),y=k||vU(t),T=t[13].subtitle,M=He(T,t,t[12],F2),A=M||kU(t),C=t[13].default,D=He(C,t,t[12],null),R=t[13].actions,N=He(R,t,t[12],U2);let G=!t[5]&&W2(t),B=[{role:t[2]},{kind:t[0]},t[10]],j={};for(let q=0;q{G=null}),fe()):G?(G.p(q,V),V&32&&p(G,1)):(G=W2(q),G.c(),p(G,1),G.m(e,null)),we(e,j=Pe(B,[(!d||V&4)&&{role:q[2]},(!d||V&1)&&{kind:q[0]},V&1024&&q[10]])),S(e,"bx--inline-notification",!0),S(e,"bx--inline-notification--low-contrast",q[1]),S(e,"bx--inline-notification--hide-close-button",q[5]),S(e,"bx--inline-notification--error",q[0]==="error"),S(e,"bx--inline-notification--info",q[0]==="info"),S(e,"bx--inline-notification--info-square",q[0]==="info-square"),S(e,"bx--inline-notification--success",q[0]==="success"),S(e,"bx--inline-notification--warning",q[0]==="warning"),S(e,"bx--inline-notification--warning-alt",q[0]==="warning-alt")},i(q){d||(p(i.$$.fragment,q),p(y,q),p(A,q),p(D,q),p(N,q),p(G),d=!0)},o(q){v(i.$$.fragment,q),v(y,q),v(A,q),v(D,q),v(N,q),v(G),d=!1},d(q){q&&E(e),H(i),y&&y.d(q),A&&A.d(q),D&&D.d(q),N&&N.d(q),G&&G.d(),h=!1,ut(g)}}}function vU(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function kU(t){let e;return{c(){e=$(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function W2(t){let e,n;return e=new e5({props:{iconDescription:t[7],notificationType:"inline"}}),e.$on("click",t[9]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wU(t){let e,n,i=t[8]&&V2(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[8]?i?(i.p(l,r),r&256&&p(i,1)):(i=V2(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function yU(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","hideCloseButton","statusIconDescription","closeButtonDescription"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{hideCloseButton:h=!1}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e;const k=nn();let y=!0,T;function M(N){k("close",{timeout:N===!0},{cancelable:!0})&&n(8,y=!1)}on(()=>(u&&(T=setTimeout(()=>M(!0),u)),()=>{clearTimeout(T)}));function A(N){te.call(this,t,N)}function C(N){te.call(this,t,N)}function D(N){te.call(this,t,N)}function R(N){te.call(this,t,N)}return t.$$set=N=>{e=Z(Z({},e),Te(N)),n(10,l=de(e,i)),"kind"in N&&n(0,o=N.kind),"lowContrast"in N&&n(1,a=N.lowContrast),"timeout"in N&&n(11,u=N.timeout),"role"in N&&n(2,f=N.role),"title"in N&&n(3,c=N.title),"subtitle"in N&&n(4,d=N.subtitle),"hideCloseButton"in N&&n(5,h=N.hideCloseButton),"statusIconDescription"in N&&n(6,g=N.statusIconDescription),"closeButtonDescription"in N&&n(7,_=N.closeButtonDescription),"$$scope"in N&&n(12,s=N.$$scope)},[o,a,f,c,d,h,g,_,y,M,l,u,s,r,A,C,D,R]}class TU extends Oe{constructor(e){super(),Ee(this,e,yU,wU,Se,{kind:0,lowContrast:1,timeout:11,role:2,title:3,subtitle:4,hideCloseButton:5,statusIconDescription:6,closeButtonDescription:7})}}const ln=TU;function j2(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function SU(t){let e,n,i=t[1]&&j2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class OU extends Oe{constructor(e){super(),Ee(this,e,EU,SU,Se,{size:0,title:1})}}const MU=OU,CU=t=>({}),$2=t=>({});function q2(t){let e,n;const i=t[26].labelText,l=He(i,t,t[25],$2),r=l||AU(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[5]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[14]),S(e,"bx--label--disabled",t[4])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&33554432)&&Fe(l,i,s,s[25],n?Ue(i,s[25],o,CU):Ge(s[25]),$2):r&&r.p&&(!n||o[0]&8192)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&32)&&I(e,"for",s[5]),(!n||o[0]&16384)&&S(e,"bx--visually-hidden",s[14]),(!n||o[0]&16)&&S(e,"bx--label--disabled",s[4])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function AU(t){let e;return{c(){e=$(t[13])},m(n,i){O(n,e,i)},p(n,i){i[0]&8192&&Y(e,n[13])},d(n){n&&E(e)}}}function Y2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y;const T=t[26].default,M=He(T,t,t[25],null);u=new co({props:{class:"bx--select__arrow"}});let A=t[7]&&Z2(),C=t[7]&&X2(t),D=!t[7]&&!t[9]&&t[11]&&K2(t);return{c(){e=P("div"),n=P("div"),i=P("select"),M&&M.c(),a=F(),U(u.$$.fragment),f=F(),A&&A.c(),d=F(),C&&C.c(),h=F(),D&&D.c(),g=je(),I(i,"aria-describedby",l=t[7]?t[16]:void 0),I(i,"aria-invalid",r=t[7]||void 0),i.disabled=s=t[4]||void 0,i.required=o=t[15]||void 0,I(i,"id",t[5]),I(i,"name",t[6]),S(i,"bx--select-input",!0),S(i,"bx--select-input--sm",t[1]==="sm"),S(i,"bx--select-input--xl",t[1]==="xl"),I(n,"data-invalid",c=t[7]||void 0),S(n,"bx--select-input__wrapper",!0),S(e,"bx--select-input--inline__wrapper",!0)},m(R,N){O(R,e,N),w(e,n),w(n,i),M&&M.m(i,null),t[35](i),w(n,a),z(u,n,null),w(n,f),A&&A.m(n,null),w(e,d),C&&C.m(e,null),O(R,h,N),D&&D.m(R,N),O(R,g,N),_=!0,k||(y=[J(i,"change",t[21]),J(i,"change",t[31]),J(i,"input",t[32]),J(i,"focus",t[33]),J(i,"blur",t[34])],k=!0)},p(R,N){M&&M.p&&(!_||N[0]&33554432)&&Fe(M,T,R,R[25],_?Ue(T,R[25],N,null):Ge(R[25]),null),(!_||N[0]&65664&&l!==(l=R[7]?R[16]:void 0))&&I(i,"aria-describedby",l),(!_||N[0]&128&&r!==(r=R[7]||void 0))&&I(i,"aria-invalid",r),(!_||N[0]&16&&s!==(s=R[4]||void 0))&&(i.disabled=s),(!_||N[0]&32768&&o!==(o=R[15]||void 0))&&(i.required=o),(!_||N[0]&32)&&I(i,"id",R[5]),(!_||N[0]&64)&&I(i,"name",R[6]),(!_||N[0]&2)&&S(i,"bx--select-input--sm",R[1]==="sm"),(!_||N[0]&2)&&S(i,"bx--select-input--xl",R[1]==="xl"),R[7]?A?N[0]&128&&p(A,1):(A=Z2(),A.c(),p(A,1),A.m(n,null)):A&&(ue(),v(A,1,1,()=>{A=null}),fe()),(!_||N[0]&128&&c!==(c=R[7]||void 0))&&I(n,"data-invalid",c),R[7]?C?C.p(R,N):(C=X2(R),C.c(),C.m(e,null)):C&&(C.d(1),C=null),!R[7]&&!R[9]&&R[11]?D?D.p(R,N):(D=K2(R),D.c(),D.m(g.parentNode,g)):D&&(D.d(1),D=null)},i(R){_||(p(M,R),p(u.$$.fragment,R),p(A),_=!0)},o(R){v(M,R),v(u.$$.fragment,R),v(A),_=!1},d(R){R&&(E(e),E(h),E(g)),M&&M.d(R),t[35](null),H(u),A&&A.d(),C&&C.d(),D&&D.d(R),k=!1,ut(y)}}}function Z2(t){let e,n;return e=new Ds({props:{class:"bx--select__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function X2(t){let e,n;return{c(){e=P("div"),n=$(t[8]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&256&&Y(n,i[8]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function K2(t){let e,n;return{c(){e=P("div"),n=$(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[4])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&16&&S(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&E(e)}}}function J2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T;const M=t[26].default,A=He(M,t,t[25],null);a=new co({props:{class:"bx--select__arrow"}});let C=t[7]&&Q2(),D=!t[7]&&t[9]&&x2(),R=!t[7]&&t[11]&&ev(t),N=t[7]&&tv(t),G=!t[7]&&t[9]&&nv(t);return{c(){e=P("div"),n=P("select"),A&&A.c(),o=F(),U(a.$$.fragment),u=F(),C&&C.c(),f=F(),D&&D.c(),d=F(),R&&R.c(),h=F(),N&&N.c(),g=F(),G&&G.c(),_=je(),I(n,"id",t[5]),I(n,"name",t[6]),I(n,"aria-describedby",i=t[7]?t[16]:void 0),n.disabled=l=t[4]||void 0,n.required=r=t[15]||void 0,I(n,"aria-invalid",s=t[7]||void 0),S(n,"bx--select-input",!0),S(n,"bx--select-input--sm",t[1]==="sm"),S(n,"bx--select-input--xl",t[1]==="xl"),I(e,"data-invalid",c=t[7]||void 0),S(e,"bx--select-input__wrapper",!0)},m(B,j){O(B,e,j),w(e,n),A&&A.m(n,null),t[36](n),w(e,o),z(a,e,null),w(e,u),C&&C.m(e,null),w(e,f),D&&D.m(e,null),O(B,d,j),R&&R.m(B,j),O(B,h,j),N&&N.m(B,j),O(B,g,j),G&&G.m(B,j),O(B,_,j),k=!0,y||(T=[J(n,"change",t[21]),J(n,"change",t[27]),J(n,"input",t[28]),J(n,"focus",t[29]),J(n,"blur",t[30])],y=!0)},p(B,j){A&&A.p&&(!k||j[0]&33554432)&&Fe(A,M,B,B[25],k?Ue(M,B[25],j,null):Ge(B[25]),null),(!k||j[0]&32)&&I(n,"id",B[5]),(!k||j[0]&64)&&I(n,"name",B[6]),(!k||j[0]&65664&&i!==(i=B[7]?B[16]:void 0))&&I(n,"aria-describedby",i),(!k||j[0]&16&&l!==(l=B[4]||void 0))&&(n.disabled=l),(!k||j[0]&32768&&r!==(r=B[15]||void 0))&&(n.required=r),(!k||j[0]&128&&s!==(s=B[7]||void 0))&&I(n,"aria-invalid",s),(!k||j[0]&2)&&S(n,"bx--select-input--sm",B[1]==="sm"),(!k||j[0]&2)&&S(n,"bx--select-input--xl",B[1]==="xl"),B[7]?C?j[0]&128&&p(C,1):(C=Q2(),C.c(),p(C,1),C.m(e,f)):C&&(ue(),v(C,1,1,()=>{C=null}),fe()),!B[7]&&B[9]?D?j[0]&640&&p(D,1):(D=x2(),D.c(),p(D,1),D.m(e,null)):D&&(ue(),v(D,1,1,()=>{D=null}),fe()),(!k||j[0]&128&&c!==(c=B[7]||void 0))&&I(e,"data-invalid",c),!B[7]&&B[11]?R?R.p(B,j):(R=ev(B),R.c(),R.m(h.parentNode,h)):R&&(R.d(1),R=null),B[7]?N?N.p(B,j):(N=tv(B),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),!B[7]&&B[9]?G?G.p(B,j):(G=nv(B),G.c(),G.m(_.parentNode,_)):G&&(G.d(1),G=null)},i(B){k||(p(A,B),p(a.$$.fragment,B),p(C),p(D),k=!0)},o(B){v(A,B),v(a.$$.fragment,B),v(C),v(D),k=!1},d(B){B&&(E(e),E(d),E(h),E(g),E(_)),A&&A.d(B),t[36](null),H(a),C&&C.d(),D&&D.d(),R&&R.d(B),N&&N.d(B),G&&G.d(B),y=!1,ut(T)}}}function Q2(t){let e,n;return e=new Ds({props:{class:"bx--select__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function x2(t){let e,n;return e=new Vu({props:{class:"bx--select__invalid-icon bx--select__invalid-icon--warning"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ev(t){let e,n;return{c(){e=P("div"),n=$(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[4])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&16&&S(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&E(e)}}}function tv(t){let e,n;return{c(){e=P("div"),n=$(t[8]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&256&&Y(n,i[8]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function nv(t){let e,n;return{c(){e=P("div"),n=$(t[10]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&1024&&Y(n,i[10]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function LU(t){let e,n,i,l,r,s=!t[12]&&q2(t),o=t[2]&&Y2(t),a=!t[2]&&J2(t),u=[t[22]],f={};for(let c=0;c{s=null}),fe()):s?(s.p(c,d),d[0]&4096&&p(s,1)):(s=q2(c),s.c(),p(s,1),s.m(n,i)),c[2]?o?(o.p(c,d),d[0]&4&&p(o,1)):(o=Y2(c),o.c(),p(o,1),o.m(n,l)):o&&(ue(),v(o,1,1,()=>{o=null}),fe()),c[2]?a&&(ue(),v(a,1,1,()=>{a=null}),fe()):a?(a.p(c,d),d[0]&4&&p(a,1)):(a=J2(c),a.c(),p(a,1),a.m(n,null)),(!r||d[0]&4)&&S(n,"bx--select--inline",c[2]),(!r||d[0]&8)&&S(n,"bx--select--light",c[3]),(!r||d[0]&128)&&S(n,"bx--select--invalid",c[7]),(!r||d[0]&16)&&S(n,"bx--select--disabled",c[4]),(!r||d[0]&512)&&S(n,"bx--select--warning",c[9]),we(e,f=Pe(u,[d[0]&4194304&&c[22]])),S(e,"bx--form-item",!0)},i(c){r||(p(s),p(o),p(a),r=!0)},o(c){v(s),v(o),v(a),r=!1},d(c){c&&E(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function DU(t,e,n){let i;const l=["selected","size","inline","light","disabled","id","name","invalid","invalidText","warn","warnText","helperText","noLabel","labelText","hideLabel","ref","required"];let r=de(e,l),s,o,a,u,{$$slots:f={},$$scope:c}=e,{selected:d=void 0}=e,{size:h=void 0}=e,{inline:g=!1}=e,{light:_=!1}=e,{disabled:k=!1}=e,{id:y="ccs-"+Math.random().toString(36)}=e,{name:T=void 0}=e,{invalid:M=!1}=e,{invalidText:A=""}=e,{warn:C=!1}=e,{warnText:D=""}=e,{helperText:R=""}=e,{noLabel:N=!1}=e,{labelText:G=""}=e,{hideLabel:B=!1}=e,{ref:j=null}=e,{required:q=!1}=e;const V=nn(),K=Wt(d);ct(t,K,Ae=>n(38,o=Ae));const x=Wt(null);ct(t,x,Ae=>n(40,u=Ae));const ie=Wt(null);ct(t,ie,Ae=>n(24,s=Ae));const X=Wt({});ct(t,X,Ae=>n(39,a=Ae)),pi("Select",{selectedValue:K,setDefaultValue:(Ae,ve)=>{s===null?(x.set(Ae),ie.set(ve)):u===Ae&&K.set(ve),X.update(me=>({...me,[ve]:typeof ve}))}});const ce=({target:Ae})=>{let ve=Ae.value;a[ve]==="number"&&(ve=Number(ve)),K.set(ve)};let ae;hr(()=>{n(23,d=o),ae!==void 0&&d!==ae&&V("update",o),ae=d});function ee(Ae){te.call(this,t,Ae)}function he(Ae){te.call(this,t,Ae)}function ne(Ae){te.call(this,t,Ae)}function re(Ae){te.call(this,t,Ae)}function oe(Ae){te.call(this,t,Ae)}function Re(Ae){te.call(this,t,Ae)}function qe(Ae){te.call(this,t,Ae)}function Ce(Ae){te.call(this,t,Ae)}function Ze(Ae){xe[Ae?"unshift":"push"](()=>{j=Ae,n(0,j)})}function be(Ae){xe[Ae?"unshift":"push"](()=>{j=Ae,n(0,j)})}return t.$$set=Ae=>{e=Z(Z({},e),Te(Ae)),n(22,r=de(e,l)),"selected"in Ae&&n(23,d=Ae.selected),"size"in Ae&&n(1,h=Ae.size),"inline"in Ae&&n(2,g=Ae.inline),"light"in Ae&&n(3,_=Ae.light),"disabled"in Ae&&n(4,k=Ae.disabled),"id"in Ae&&n(5,y=Ae.id),"name"in Ae&&n(6,T=Ae.name),"invalid"in Ae&&n(7,M=Ae.invalid),"invalidText"in Ae&&n(8,A=Ae.invalidText),"warn"in Ae&&n(9,C=Ae.warn),"warnText"in Ae&&n(10,D=Ae.warnText),"helperText"in Ae&&n(11,R=Ae.helperText),"noLabel"in Ae&&n(12,N=Ae.noLabel),"labelText"in Ae&&n(13,G=Ae.labelText),"hideLabel"in Ae&&n(14,B=Ae.hideLabel),"ref"in Ae&&n(0,j=Ae.ref),"required"in Ae&&n(15,q=Ae.required),"$$scope"in Ae&&n(25,c=Ae.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32&&n(16,i=`error-${y}`),t.$$.dirty[0]&25165824&&K.set(d??s)},[j,h,g,_,k,y,T,M,A,C,D,R,N,G,B,q,i,K,x,ie,X,ce,r,d,s,c,f,ee,he,ne,re,oe,Re,qe,Ce,Ze,be]}class IU extends Oe{constructor(e){super(),Ee(this,e,DU,LU,Se,{selected:23,size:1,inline:2,light:3,disabled:4,id:5,name:6,invalid:7,invalidText:8,warn:9,warnText:10,helperText:11,noLabel:12,labelText:13,hideLabel:14,ref:0,required:15},null,[-1,-1])}}const Wr=IU;function RU(t){let e,n=(t[1]||t[0])+"",i,l,r;return{c(){e=P("option"),i=$(n),e.__value=t[0],Ll(e,e.__value),e.disabled=t[3],e.hidden=t[2],e.selected=t[4],I(e,"class",l=t[5].class),I(e,"style",r=t[5].style),S(e,"bx--select-option",!0)},m(s,o){O(s,e,o),w(e,i)},p(s,[o]){o&3&&n!==(n=(s[1]||s[0])+"")&&Y(i,n),o&1&&(e.__value=s[0],Ll(e,e.__value)),o&8&&(e.disabled=s[3]),o&4&&(e.hidden=s[2]),o&16&&(e.selected=s[4]),o&32&&l!==(l=s[5].class)&&I(e,"class",l),o&32&&r!==(r=s[5].style)&&I(e,"style",r),o&32&&S(e,"bx--select-option",!0)},i:_e,o:_e,d(s){s&&E(e)}}}function PU(t,e,n){const i=["value","text","hidden","disabled"];let l=de(e,i),{value:r=""}=e,{text:s=""}=e,{hidden:o=!1}=e,{disabled:a=!1}=e;const u="ccs-"+Math.random().toString(36),f=jn("Select")||jn("TimePickerSelect");let c=!1;const d=f.selectedValue.subscribe(h=>{n(4,c=h===r)});return on(()=>()=>d()),t.$$set=h=>{e=Z(Z({},e),Te(h)),n(5,l=de(e,i)),"value"in h&&n(0,r=h.value),"text"in h&&n(1,s=h.text),"hidden"in h&&n(2,o=h.hidden),"disabled"in h&&n(3,a=h.disabled)},t.$$.update=()=>{var h;t.$$.dirty&1&&((h=f==null?void 0:f.setDefaultValue)==null||h.call(f,u,r))},[r,s,o,a,c,l]}class NU extends Oe{constructor(e){super(),Ee(this,e,PU,RU,Se,{value:0,text:1,hidden:2,disabled:3})}}const Rn=NU;function BU(t){let e,n,i,l;const r=t[7].default,s=He(r,t,t[6],null);let o=[t[3]],a={};for(let u=0;uA.reduce((C,D)=>({...C,[D.id]:D}),{}));ct(t,g,A=>n(12,r=A));const _=Wt(c);pi("ProgressIndicator",{steps:h,stepsById:g,preventChangeOnClick:{subscribe:_.subscribe},add:A=>{h.update(C=>A.id in r?C.map(D=>D.id===A.id?{...D,...A}:D):[...C,{...A,index:C.length,current:C.length===a,complete:A.complete}])},change:A=>{c||(n(4,a=A),d("change",A))}});function k(A){te.call(this,t,A)}function y(A){te.call(this,t,A)}function T(A){te.call(this,t,A)}function M(A){te.call(this,t,A)}return t.$$set=A=>{e=Z(Z({},e),Te(A)),n(3,l=de(e,i)),"currentIndex"in A&&n(4,a=A.currentIndex),"vertical"in A&&n(0,u=A.vertical),"spaceEqually"in A&&n(1,f=A.spaceEqually),"preventChangeOnClick"in A&&n(5,c=A.preventChangeOnClick),"$$scope"in A&&n(6,o=A.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&h.update(A=>A.map((C,D)=>({...C,current:D===a}))),t.$$.dirty&32&&_.set(c)},[u,f,g,l,a,c,o,s,k,y,T,M]}class HU extends Oe{constructor(e){super(),Ee(this,e,zU,BU,Se,{currentIndex:4,vertical:0,spaceEqually:1,preventChangeOnClick:5})}}const UU=HU;function iv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function FU(t){let e,n,i,l=t[1]&&iv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class VU extends Oe{constructor(e){super(),Ee(this,e,GU,FU,Se,{size:0,title:1})}}const WU=VU;function lv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function jU(t){let e,n,i,l=t[1]&&lv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class qU extends Oe{constructor(e){super(),Ee(this,e,$U,jU,Se,{size:0,title:1})}}const YU=qU;function rv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function ZU(t){let e,n,i=t[1]&&rv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class KU extends Oe{constructor(e){super(),Ee(this,e,XU,ZU,Se,{size:0,title:1})}}const JU=KU;function sv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function QU(t){let e,n,i=t[1]&&sv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class eF extends Oe{constructor(e){super(),Ee(this,e,xU,QU,Se,{size:0,title:1})}}const tF=eF,nF=t=>({}),ov=t=>({props:{class:"bx--progress-label"}});function iF(t){let e,n;return e=new JU({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lF(t){let e,n;return e=new WU({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rF(t){let e,n;return e=new tF({props:{title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sF(t){let e,n;return e=new YU({props:{class:"bx--progress__warning",title:t[4]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oF(t){let e,n;return{c(){e=P("p"),n=$(t[5]),S(e,"bx--progress-label",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&32&&Y(n,i[5])},d(i){i&&E(e)}}}function av(t){let e,n;return{c(){e=P("p"),n=$(t[6]),S(e,"bx--progress-optional",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function aF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;const g=[sF,rF,lF,iF],_=[];function k(R,N){return R[3]?0:R[1]?1:R[0]?2:3}i=k(t),l=_[i]=g[i](t);const y=t[14].default,T=He(y,t,t[13],ov),M=T||oF(t);let A=t[6]&&av(t),C=[{id:t[7]},t[12]],D={};for(let R=0;R{_[G]=null}),fe(),l=_[i],l?l.p(R,N):(l=_[i]=g[i](R),l.c()),p(l,1),l.m(n,r)),T?T.p&&(!c||N&8192)&&Fe(T,y,R,R[13],c?Ue(y,R[13],N,nF):Ge(R[13]),ov):M&&M.p&&(!c||N&32)&&M.p(R,c?N:-1),R[6]?A?A.p(R,N):(A=av(R),A.c(),A.m(s,null)):A&&(A.d(1),A=null),(!c||N&4)&&(n.disabled=R[2]),(!c||N&4)&&I(n,"aria-disabled",R[2]),(!c||N&6&&f!==(f=!R[1]&&!R[2]?"0":"-1"))&&I(n,"tabindex",f),(!c||N&514)&&S(n,"bx--progress-step-button--unclickable",R[1]||R[9]),we(e,D=Pe(C,[(!c||N&128)&&{id:R[7]},N&4096&&R[12]])),S(e,"bx--progress-step",!0),S(e,"bx--progress-step--current",R[1]),S(e,"bx--progress-step--complete",R[0]),S(e,"bx--progress-step--incomplete",!R[0]&&!R[1]),S(e,"bx--progress-step--disabled",R[2])},i(R){c||(p(l),p(M,R),c=!0)},o(R){v(l),v(M,R),c=!1},d(R){R&&E(e),_[i].d(),M&&M.d(R),A&&A.d(),d=!1,ut(h)}}}function uF(t,e,n){const i=["complete","current","disabled","invalid","description","label","secondaryLabel","id"];let l=de(e,i),r,{$$slots:s={},$$scope:o}=e,{complete:a=!1}=e,{current:u=!1}=e,{disabled:f=!1}=e,{invalid:c=!1}=e,{description:d=""}=e,{label:h=""}=e,{secondaryLabel:g=""}=e,{id:_="ccs-"+Math.random().toString(36)}=e,k={};const{stepsById:y,add:T,change:M,preventChangeOnClick:A}=jn("ProgressIndicator");ct(t,A,V=>n(9,r=V));const C=y.subscribe(V=>{V[_]&&(n(8,k=V[_]),n(1,u=k.current),n(0,a=k.complete))});on(()=>()=>{C()});function D(V){te.call(this,t,V)}function R(V){te.call(this,t,V)}function N(V){te.call(this,t,V)}function G(V){te.call(this,t,V)}function B(V){te.call(this,t,V)}const j=()=>{k.complete&&M(k.index)},q=V=>{k.complete&&(V.key===" "||V.key==="Enter")&&M(k.index)};return t.$$set=V=>{e=Z(Z({},e),Te(V)),n(12,l=de(e,i)),"complete"in V&&n(0,a=V.complete),"current"in V&&n(1,u=V.current),"disabled"in V&&n(2,f=V.disabled),"invalid"in V&&n(3,c=V.invalid),"description"in V&&n(4,d=V.description),"label"in V&&n(5,h=V.label),"secondaryLabel"in V&&n(6,g=V.secondaryLabel),"id"in V&&n(7,_=V.id),"$$scope"in V&&n(13,o=V.$$scope)},t.$$.update=()=>{t.$$.dirty&133&&T({id:_,complete:a,disabled:f})},[a,u,f,c,d,h,g,_,k,r,M,A,l,o,s,D,R,N,G,B,j,q]}class fF extends Oe{constructor(e){super(),Ee(this,e,uF,aF,Se,{complete:0,current:1,disabled:2,invalid:3,description:4,label:5,secondaryLabel:6,id:7})}}const cF=fF,dF=t=>({}),uv=t=>({});function fv(t){let e,n;const i=t[11].legendText,l=He(i,t,t[10],uv),r=l||hF(t);return{c(){e=P("legend"),r&&r.c(),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[2])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&1024)&&Fe(l,i,s,s[10],n?Ue(i,s[10],o,dF):Ge(s[10]),uv):r&&r.p&&(!n||o&2)&&r.p(s,n?o:-1),(!n||o&4)&&S(e,"bx--visually-hidden",s[2])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function hF(t){let e;return{c(){e=$(t[1])},m(n,i){O(n,e,i)},p(n,i){i&2&&Y(e,n[1])},d(n){n&&E(e)}}}function mF(t){let e,n,i,l,r,s,o=(t[1]||t[8].legendText)&&fv(t);const a=t[11].default,u=He(a,t,t[10],null);let f=[{id:t[5]},t[7]],c={};for(let d=0;d{o=null}),fe()),u&&u.p&&(!l||h&1024)&&Fe(u,a,d,d[10],l?Ue(a,d[10],h,null):Ge(d[10]),null),(!l||h&1)&&(n.disabled=d[0]),(!l||h&16)&&S(n,"bx--radio-button-group--vertical",d[4]==="vertical"),(!l||h&8)&&S(n,"bx--radio-button-group--label-left",d[3]==="left"),(!l||h&8)&&S(n,"bx--radio-button-group--label-right",d[3]==="right"),we(e,c=Pe(f,[(!l||h&32)&&{id:d[5]},h&128&&d[7]])),S(e,"bx--form-item",!0)},i(d){l||(p(o),p(u,d),l=!0)},o(d){v(o),v(u,d),l=!1},d(d){d&&E(e),o&&o.d(),u&&u.d(d),r=!1,ut(s)}}}function gF(t,e,n){const i=["selected","disabled","legendText","hideLegend","labelPosition","orientation","id"];let l=de(e,i),r,{$$slots:s={},$$scope:o}=e;const a=di(s);let{selected:u=void 0}=e,{disabled:f=!1}=e,{legendText:c=""}=e,{hideLegend:d=!1}=e,{labelPosition:h="right"}=e,{orientation:g="horizontal"}=e,{id:_=void 0}=e;const k=nn(),y=Wt(u);ct(t,y,D=>n(16,r=D)),pi("RadioButtonGroup",{selectedValue:y,add:({checked:D,value:R})=>{D&&y.set(R)},update:D=>{n(9,u=D)}}),on(()=>{lo(y,r=u,r)}),aI(()=>{lo(y,r=u,r)}),y.subscribe(D=>{n(9,u=D),k("change",D)});function T(D){te.call(this,t,D)}function M(D){te.call(this,t,D)}function A(D){te.call(this,t,D)}function C(D){te.call(this,t,D)}return t.$$set=D=>{e=Z(Z({},e),Te(D)),n(7,l=de(e,i)),"selected"in D&&n(9,u=D.selected),"disabled"in D&&n(0,f=D.disabled),"legendText"in D&&n(1,c=D.legendText),"hideLegend"in D&&n(2,d=D.hideLegend),"labelPosition"in D&&n(3,h=D.labelPosition),"orientation"in D&&n(4,g=D.orientation),"id"in D&&n(5,_=D.id),"$$scope"in D&&n(10,o=D.$$scope)},[f,c,d,h,g,_,y,l,a,u,o,s,T,M,A,C]}class _F extends Oe{constructor(e){super(),Ee(this,e,gF,mF,Se,{selected:9,disabled:0,legendText:1,hideLegend:2,labelPosition:3,orientation:4,id:5})}}const n5=_F;function pF(t){let e,n,i,l;const r=t[8].default,s=He(r,t,t[7],null);let o=[{role:"table"},t[4]],a={};for(let u=0;un(6,r=T)),pi("StructuredListWrapper",{selectedValue:h,update:T=>{h.set(T)}});function g(T){te.call(this,t,T)}function _(T){te.call(this,t,T)}function k(T){te.call(this,t,T)}function y(T){te.call(this,t,T)}return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(4,l=de(e,i)),"selected"in T&&n(5,a=T.selected),"condensed"in T&&n(0,u=T.condensed),"flush"in T&&n(1,f=T.flush),"selection"in T&&n(2,c=T.selection),"$$scope"in T&&n(7,o=T.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(5,a=r),t.$$.dirty&64&&d("change",r)},[u,f,c,h,l,a,r,o,s,g,_,k,y]}class vF extends Oe{constructor(e){super(),Ee(this,e,bF,pF,Se,{selected:5,condensed:0,flush:1,selection:2})}}const $u=vF;function kF(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class yF extends Oe{constructor(e){super(),Ee(this,e,wF,kF,Se,{})}}const qu=yF;function TF(t){let e,n,i,l;const r=t[2].default,s=He(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Z(Z({},e),Te(c)),n(0,l=de(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class EF extends Oe{constructor(e){super(),Ee(this,e,SF,TF,Se,{})}}const i5=EF;function OF(t){let e,n,i,l,r;const s=t[4].default,o=He(s,t,t[3],null);let a=[{role:n=t[0]?"columnheader":"cell"},t[2]],u={};for(let f=0;f{e=Z(Z({},e),Te(h)),n(2,l=de(e,i)),"head"in h&&n(0,o=h.head),"noWrap"in h&&n(1,a=h.noWrap),"$$scope"in h&&n(3,s=h.$$scope)},[o,a,l,s,r,u,f,c,d]}class CF extends Oe{constructor(e){super(),Ee(this,e,MF,OF,Se,{head:0,noWrap:1})}}const qt=CF;function AF(t){let e,n,i,l;const r=t[5].default,s=He(r,t,t[4],null);let o=[{role:"row"},t[3]],a={};for(let u=0;u{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function IF(t,e,n){const i=["head","label","tabindex"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{head:o=!1}=e,{label:a=!1}=e,{tabindex:u="0"}=e;function f(M){te.call(this,t,M)}function c(M){te.call(this,t,M)}function d(M){te.call(this,t,M)}function h(M){te.call(this,t,M)}function g(M){te.call(this,t,M)}function _(M){te.call(this,t,M)}function k(M){te.call(this,t,M)}function y(M){te.call(this,t,M)}function T(M){te.call(this,t,M)}return t.$$set=M=>{e=Z(Z({},e),Te(M)),n(3,l=de(e,i)),"head"in M&&n(0,o=M.head),"label"in M&&n(1,a=M.label),"tabindex"in M&&n(2,u=M.tabindex),"$$scope"in M&&n(4,s=M.$$scope)},[o,a,u,l,s,r,f,c,d,h,g,_,k,y,T]}class RF extends Oe{constructor(e){super(),Ee(this,e,IF,DF,Se,{head:0,label:1,tabindex:2})}}const si=RF,PF=t=>({}),cv=t=>({});function dv(t){let e=t[3].label+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&8&&e!==(e=i[3].label+"")&&Y(n,e)},d(i){i&&E(n)}}}function NF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h=t[3]&&dv(t);r=new co({props:{"aria-hidden":"true",title:t[1]}});const g=t[20].default,_=He(g,t,t[19],null);let k=[{role:"navigation"},t[10]],y={};for(let A=0;An(18,u=ee));const A=ur(M,ee=>ee.reduce((he,ne)=>({...he,[ne.id]:ne}),{}));ct(t,A,ee=>n(28,f=ee));const C=Wt(_),D=Wt(void 0);ct(t,D,ee=>n(16,o=ee));const R=Wt([]);ct(t,R,ee=>n(17,a=ee));const N=ur(R,ee=>ee.reduce((he,ne)=>({...he,[ne.id]:ne}),{})),G=Wt(void 0);let B=null;pi("Tabs",{tabs:M,contentById:N,selectedTab:D,selectedContent:G,useAutoWidth:C,add:ee=>{M.update(he=>[...he,{...ee,index:he.length}])},addContent:ee=>{R.update(he=>[...he,{...ee,index:he.length}])},update:ee=>{n(14,q=f[ee].index)},change:async ee=>{let he=q+ee;he<0?he=u.length-1:he>=u.length&&(he=0);let ne=u[he].disabled;for(;ne;)he=he+ee,he<0?he=u.length-1:he>=u.length&&(he=0),ne=u[he].disabled;n(14,q=he),await Ou();const re=B==null?void 0:B.querySelectorAll("[role='tab']")[q];re==null||re.focus()}}),hr(()=>{n(12,h=q),V>-1&&V!==q&&T("change",q),V=q});let j=!0,q=h,V=-1;function K(ee){te.call(this,t,ee)}function x(ee){te.call(this,t,ee)}const ie=()=>{n(5,j=!j)},X=()=>{n(5,j=!j)},ce=()=>{n(5,j=!j)};function ae(ee){xe[ee?"unshift":"push"](()=>{B=ee,n(4,B)})}return t.$$set=ee=>{n(11,e=Z(Z({},e),Te(ee))),n(10,s=de(e,r)),"selected"in ee&&n(12,h=ee.selected),"type"in ee&&n(0,g=ee.type),"autoWidth"in ee&&n(13,_=ee.autoWidth),"iconDescription"in ee&&n(1,k=ee.iconDescription),"triggerHref"in ee&&n(2,y=ee.triggerHref),"$$scope"in ee&&n(19,d=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&4096&&n(14,q=h),t.$$.dirty[0]&278528&&n(3,i=u[q]||void 0),t.$$.dirty[0]&147456&&n(15,l=a[q]||void 0),t.$$.dirty[0]&32776&&(i&&D.set(i.id),l&&G.set(l.id)),t.$$.dirty[0]&65536&&o&&n(5,j=!0),t.$$.dirty[0]&8192&&C.set(_)},e=Te(e),[g,k,y,i,B,j,M,A,D,R,s,e,h,_,q,l,o,a,u,d,c,K,x,ie,X,ce,ae]}class zF extends Oe{constructor(e){super(),Ee(this,e,BF,NF,Se,{selected:12,type:0,autoWidth:13,iconDescription:1,triggerHref:2},null,[-1,-1])}}const mg=zF;function HF(t){let e;return{c(){e=$(t[1])},m(n,i){O(n,e,i)},p(n,i){i&2&&Y(e,n[1])},d(n){n&&E(e)}}}function UF(t){let e,n,i,l,r,s;const o=t[15].default,a=He(o,t,t[14],null),u=a||HF(t);let f=[{tabindex:"-1"},{role:"presentation"},t[12]],c={};for(let d=0;dn(13,s=q)),ct(t,y,q=>n(7,o=q)),T({id:g,label:f,disabled:d});function C(q){te.call(this,t,q)}function D(q){te.call(this,t,q)}function R(q){te.call(this,t,q)}function N(q){te.call(this,t,q)}function G(q){xe[q?"unshift":"push"](()=>{_=q,n(0,_)})}const B=()=>{d||M(g)},j=({key:q})=>{d||(q==="ArrowRight"?A(1):q==="ArrowLeft"?A(-1):(q===" "||q==="Enter")&&M(g))};return t.$$set=q=>{e=Z(Z({},e),Te(q)),n(12,r=de(e,l)),"label"in q&&n(1,f=q.label),"href"in q&&n(2,c=q.href),"disabled"in q&&n(3,d=q.disabled),"tabindex"in q&&n(4,h=q.tabindex),"id"in q&&n(5,g=q.id),"ref"in q&&n(0,_=q.ref),"$$scope"in q&&n(14,u=q.$$scope)},t.$$.update=()=>{t.$$.dirty&8224&&n(6,i=s===g)},[_,f,c,d,h,g,i,o,k,y,M,A,r,s,u,a,C,D,R,N,G,B,j]}class GF extends Oe{constructor(e){super(),Ee(this,e,FF,UF,Se,{label:1,href:2,disabled:3,tabindex:4,id:5,ref:0})}}const ql=GF;function VF(t){let e,n,i,l;const r=t[12].default,s=He(r,t,t[11],null);let o=[{role:"tabpanel"},{"aria-labelledby":t[1]},{"aria-hidden":n=!t[2]},{hidden:i=t[2]?void 0:""},{id:t[0]},t[6]],a={};for(let u=0;un(10,f=T)),ct(t,k,T=>n(8,a=T)),ct(t,y,T=>n(9,u=T)),_({id:h}),t.$$set=T=>{e=Z(Z({},e),Te(T)),n(6,o=de(e,s)),"id"in T&&n(0,h=T.id),"$$scope"in T&&n(11,d=T.$$scope)},t.$$.update=()=>{t.$$.dirty&1025&&n(2,i=f===h),t.$$.dirty&513&&n(7,l=u[h].index),t.$$.dirty&384&&n(1,r=a[l].id)},[h,r,i,g,k,y,o,l,a,u,f,d,c]}class jF extends Oe{constructor(e){super(),Ee(this,e,WF,VF,Se,{id:0})}}const Yl=jF;function $F(t){let e,n,i,l=[t[1]],r={};for(let s=0;s{e=Z(Z({},e),Te(f)),n(1,l=de(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class YF extends Oe{constructor(e){super(),Ee(this,e,qF,$F,Se,{size:0})}}const ZF=YF,XF=t=>({}),hv=t=>({}),KF=t=>({}),mv=t=>({}),JF=t=>({}),gv=t=>({props:{class:"bx--tag__label"}});function QF(t){let e,n,i,l,r,s,o=(t[11].icon||t[7])&&_v(t);const a=t[13].default,u=He(a,t,t[12],null);let f=[{id:t[8]},t[10]],c={};for(let d=0;d{o=null}),fe()),u&&u.p&&(!l||h&4096)&&Fe(u,a,d,d[12],l?Ue(a,d[12],h,null):Ge(d[12]),null),we(e,c=Pe(f,[(!l||h&256)&&{id:d[8]},h&1024&&d[10]])),S(e,"bx--tag",!0),S(e,"bx--tag--disabled",d[3]),S(e,"bx--tag--sm",d[1]==="sm"),S(e,"bx--tag--red",d[0]==="red"),S(e,"bx--tag--magenta",d[0]==="magenta"),S(e,"bx--tag--purple",d[0]==="purple"),S(e,"bx--tag--blue",d[0]==="blue"),S(e,"bx--tag--cyan",d[0]==="cyan"),S(e,"bx--tag--teal",d[0]==="teal"),S(e,"bx--tag--green",d[0]==="green"),S(e,"bx--tag--gray",d[0]==="gray"),S(e,"bx--tag--cool-gray",d[0]==="cool-gray"),S(e,"bx--tag--warm-gray",d[0]==="warm-gray"),S(e,"bx--tag--high-contrast",d[0]==="high-contrast"),S(e,"bx--tag--outline",d[0]==="outline")},i(d){l||(p(o),p(u,d),l=!0)},o(d){v(o),v(u,d),l=!1},d(d){d&&E(e),o&&o.d(),u&&u.d(d),r=!1,ut(s)}}}function xF(t){let e,n,i,l,r,s,o,a=(t[11].icon||t[7])&&pv(t);const u=t[13].default,f=He(u,t,t[12],null);let c=[{type:"button"},{id:t[8]},{disabled:t[3]},{"aria-disabled":t[3]},{tabindex:l=t[3]?"-1":void 0},t[10]],d={};for(let h=0;h{a=null}),fe()),f&&f.p&&(!r||g&4096)&&Fe(f,u,h,h[12],r?Ue(u,h[12],g,null):Ge(h[12]),null),we(e,d=Pe(c,[{type:"button"},(!r||g&256)&&{id:h[8]},(!r||g&8)&&{disabled:h[3]},(!r||g&8)&&{"aria-disabled":h[3]},(!r||g&8&&l!==(l=h[3]?"-1":void 0))&&{tabindex:l},g&1024&&h[10]])),S(e,"bx--tag",!0),S(e,"bx--tag--interactive",!0),S(e,"bx--tag--disabled",h[3]),S(e,"bx--tag--sm",h[1]==="sm"),S(e,"bx--tag--red",h[0]==="red"),S(e,"bx--tag--magenta",h[0]==="magenta"),S(e,"bx--tag--purple",h[0]==="purple"),S(e,"bx--tag--blue",h[0]==="blue"),S(e,"bx--tag--cyan",h[0]==="cyan"),S(e,"bx--tag--teal",h[0]==="teal"),S(e,"bx--tag--green",h[0]==="green"),S(e,"bx--tag--gray",h[0]==="gray"),S(e,"bx--tag--cool-gray",h[0]==="cool-gray"),S(e,"bx--tag--warm-gray",h[0]==="warm-gray"),S(e,"bx--tag--high-contrast",h[0]==="high-contrast"),S(e,"bx--tag--outline",h[0]==="outline")},i(h){r||(p(a),p(f,h),r=!0)},o(h){v(a),v(f,h),r=!1},d(h){h&&E(e),a&&a.d(),f&&f.d(h),s=!1,ut(o)}}}function eG(t){let e,n,i,l,r,s,o;const a=t[13].default,u=He(a,t,t[12],gv),f=u||lG(t);l=new Dl({});let c=[{"aria-label":t[6]},{id:t[8]},t[10]],d={};for(let h=0;h{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function pv(t){let e,n;const i=t[13].icon,l=He(i,t,t[12],mv),r=l||iG(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--tag__custom-icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&4096)&&Fe(l,i,s,s[12],n?Ue(i,s[12],o,KF):Ge(s[12]),mv):r&&r.p&&(!n||o&128)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function iG(t){let e,n,i;var l=t[7];function r(s,o){return{}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&128&&l!==(l=s[7])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function lG(t){let e,n;return{c(){e=P("span"),n=$(t[0]),S(e,"bx--tag__label",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1&&Y(n,i[0])},d(i){i&&E(e)}}}function rG(t){let e,n,i,l;const r=[tG,eG,xF,QF],s=[];function o(a,u){return a[5]?0:a[2]?1:a[4]?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function sG(t,e,n){const i=["type","size","filter","disabled","interactive","skeleton","title","icon","id"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{type:a=void 0}=e,{size:u="default"}=e,{filter:f=!1}=e,{disabled:c=!1}=e,{interactive:d=!1}=e,{skeleton:h=!1}=e,{title:g="Clear filter"}=e,{icon:_=void 0}=e,{id:k="ccs-"+Math.random().toString(36)}=e;const y=nn();function T(ae){te.call(this,t,ae)}function M(ae){te.call(this,t,ae)}function A(ae){te.call(this,t,ae)}function C(ae){te.call(this,t,ae)}function D(ae){te.call(this,t,ae)}function R(ae){te.call(this,t,ae)}function N(ae){te.call(this,t,ae)}function G(ae){te.call(this,t,ae)}function B(ae){te.call(this,t,ae)}function j(ae){te.call(this,t,ae)}function q(ae){te.call(this,t,ae)}function V(ae){te.call(this,t,ae)}function K(ae){te.call(this,t,ae)}function x(ae){te.call(this,t,ae)}function ie(ae){te.call(this,t,ae)}function X(ae){te.call(this,t,ae)}const ce=()=>{y("close")};return t.$$set=ae=>{e=Z(Z({},e),Te(ae)),n(10,l=de(e,i)),"type"in ae&&n(0,a=ae.type),"size"in ae&&n(1,u=ae.size),"filter"in ae&&n(2,f=ae.filter),"disabled"in ae&&n(3,c=ae.disabled),"interactive"in ae&&n(4,d=ae.interactive),"skeleton"in ae&&n(5,h=ae.skeleton),"title"in ae&&n(6,g=ae.title),"icon"in ae&&n(7,_=ae.icon),"id"in ae&&n(8,k=ae.id),"$$scope"in ae&&n(12,s=ae.$$scope)},[a,u,f,c,d,h,g,_,k,y,l,o,s,r,T,M,A,C,D,R,N,G,B,j,q,V,K,x,ie,X,ce]}class oG extends Oe{constructor(e){super(),Ee(this,e,sG,rG,Se,{type:0,size:1,filter:2,disabled:3,interactive:4,skeleton:5,title:6,icon:7,id:8})}}const Rt=oG,aG=t=>({}),bv=t=>({});function vv(t){let e,n,i,l;const r=t[20].labelText,s=He(r,t,t[19],bv),o=s||uG(t);let a=t[5]&&kv(t);return{c(){e=P("div"),n=P("label"),o&&o.c(),i=F(),a&&a.c(),I(n,"for",t[14]),S(n,"bx--label",!0),S(n,"bx--visually-hidden",t[11]),S(n,"bx--label--disabled",t[7]),S(e,"bx--text-area__label-wrapper",!0)},m(u,f){O(u,e,f),w(e,n),o&&o.m(n,null),w(e,i),a&&a.m(e,null),l=!0},p(u,f){s?s.p&&(!l||f[0]&524288)&&Fe(s,r,u,u[19],l?Ue(r,u[19],f,aG):Ge(u[19]),bv):o&&o.p&&(!l||f[0]&1024)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&16384)&&I(n,"for",u[14]),(!l||f[0]&2048)&&S(n,"bx--visually-hidden",u[11]),(!l||f[0]&128)&&S(n,"bx--label--disabled",u[7]),u[5]?a?a.p(u,f):(a=kv(u),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){l||(p(o,u),l=!0)},o(u){v(o,u),l=!1},d(u){u&&E(e),o&&o.d(u),a&&a.d()}}}function uG(t){let e;return{c(){e=$(t[10])},m(n,i){O(n,e,i)},p(n,i){i[0]&1024&&Y(e,n[10])},d(n){n&&E(e)}}}function kv(t){let e,n=t[0].length+"",i,l,r;return{c(){e=P("div"),i=$(n),l=$("/"),r=$(t[5]),S(e,"bx--label",!0),S(e,"bx--label--disabled",t[7])},m(s,o){O(s,e,o),w(e,i),w(e,l),w(e,r)},p(s,o){o[0]&1&&n!==(n=s[0].length+"")&&Y(i,n),o[0]&32&&Y(r,s[5]),o[0]&128&&S(e,"bx--label--disabled",s[7])},d(s){s&&E(e)}}}function wv(t){let e,n;return e=new Ds({props:{class:"bx--text-area__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function yv(t){let e,n;return{c(){e=P("div"),n=$(t[9]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[7])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&512&&Y(n,i[9]),l[0]&128&&S(e,"bx--form__helper-text--disabled",i[7])},d(i){i&&E(e)}}}function Tv(t){let e,n;return{c(){e=P("div"),n=$(t[13]),I(e,"id",t[16]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&8192&&Y(n,i[13]),l[0]&65536&&I(e,"id",i[16])},d(i){i&&E(e)}}}function fG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=(t[10]||t[17].labelText)&&!t[11]&&vv(t),k=t[12]&&wv(),y=[{"aria-invalid":s=t[12]||void 0},{"aria-describedby":o=t[12]?t[16]:void 0},{disabled:t[7]},{id:t[14]},{name:t[15]},{cols:t[3]},{rows:t[4]},{placeholder:t[2]},{readOnly:t[8]},{maxlength:a=t[5]??void 0},t[18]],T={};for(let C=0;C{_=null}),fe()),C[12]?k?D[0]&4096&&p(k,1):(k=wv(),k.c(),p(k,1),k.m(i,l)):k&&(ue(),v(k,1,1,()=>{k=null}),fe()),we(r,T=Pe(y,[(!d||D[0]&4096&&s!==(s=C[12]||void 0))&&{"aria-invalid":s},(!d||D[0]&69632&&o!==(o=C[12]?C[16]:void 0))&&{"aria-describedby":o},(!d||D[0]&128)&&{disabled:C[7]},(!d||D[0]&16384)&&{id:C[14]},(!d||D[0]&32768)&&{name:C[15]},(!d||D[0]&8)&&{cols:C[3]},(!d||D[0]&16)&&{rows:C[4]},(!d||D[0]&4)&&{placeholder:C[2]},(!d||D[0]&256)&&{readOnly:C[8]},(!d||D[0]&32&&a!==(a=C[5]??void 0))&&{maxlength:a},D[0]&262144&&C[18]])),D[0]&1&&Ll(r,C[0]),S(r,"bx--text-area",!0),S(r,"bx--text-area--light",C[6]),S(r,"bx--text-area--invalid",C[12]),(!d||D[0]&4096&&u!==(u=C[12]||void 0))&&I(i,"data-invalid",u),!C[12]&&C[9]?M?M.p(C,D):(M=yv(C),M.c(),M.m(e,c)):M&&(M.d(1),M=null),C[12]?A?A.p(C,D):(A=Tv(C),A.c(),A.m(e,null)):A&&(A.d(1),A=null)},i(C){d||(p(_),p(k),d=!0)},o(C){v(_),v(k),d=!1},d(C){C&&E(e),_&&_.d(),k&&k.d(),t[32](null),M&&M.d(),A&&A.d(),h=!1,ut(g)}}}function cG(t,e,n){let i;const l=["value","placeholder","cols","rows","maxCount","light","disabled","readonly","helperText","labelText","hideLabel","invalid","invalidText","id","name","ref"];let r=de(e,l),{$$slots:s={},$$scope:o}=e;const a=di(s);let{value:u=""}=e,{placeholder:f=""}=e,{cols:c=50}=e,{rows:d=4}=e,{maxCount:h=void 0}=e,{light:g=!1}=e,{disabled:_=!1}=e,{readonly:k=!1}=e,{helperText:y=""}=e,{labelText:T=""}=e,{hideLabel:M=!1}=e,{invalid:A=!1}=e,{invalidText:C=""}=e,{id:D="ccs-"+Math.random().toString(36)}=e,{name:R=void 0}=e,{ref:N=null}=e;function G(ne){te.call(this,t,ne)}function B(ne){te.call(this,t,ne)}function j(ne){te.call(this,t,ne)}function q(ne){te.call(this,t,ne)}function V(ne){te.call(this,t,ne)}function K(ne){te.call(this,t,ne)}function x(ne){te.call(this,t,ne)}function ie(ne){te.call(this,t,ne)}function X(ne){te.call(this,t,ne)}function ce(ne){te.call(this,t,ne)}function ae(ne){te.call(this,t,ne)}function ee(ne){xe[ne?"unshift":"push"](()=>{N=ne,n(1,N)})}function he(){u=this.value,n(0,u)}return t.$$set=ne=>{e=Z(Z({},e),Te(ne)),n(18,r=de(e,l)),"value"in ne&&n(0,u=ne.value),"placeholder"in ne&&n(2,f=ne.placeholder),"cols"in ne&&n(3,c=ne.cols),"rows"in ne&&n(4,d=ne.rows),"maxCount"in ne&&n(5,h=ne.maxCount),"light"in ne&&n(6,g=ne.light),"disabled"in ne&&n(7,_=ne.disabled),"readonly"in ne&&n(8,k=ne.readonly),"helperText"in ne&&n(9,y=ne.helperText),"labelText"in ne&&n(10,T=ne.labelText),"hideLabel"in ne&&n(11,M=ne.hideLabel),"invalid"in ne&&n(12,A=ne.invalid),"invalidText"in ne&&n(13,C=ne.invalidText),"id"in ne&&n(14,D=ne.id),"name"in ne&&n(15,R=ne.name),"ref"in ne&&n(1,N=ne.ref),"$$scope"in ne&&n(19,o=ne.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&n(16,i=`error-${D}`)},[u,N,f,c,d,h,g,_,k,y,T,M,A,C,D,R,i,a,r,o,s,G,B,j,q,V,K,x,ie,X,ce,ae,ee,he]}class dG extends Oe{constructor(e){super(),Ee(this,e,cG,fG,Se,{value:0,placeholder:2,cols:3,rows:4,maxCount:5,light:6,disabled:7,readonly:8,helperText:9,labelText:10,hideLabel:11,invalid:12,invalidText:13,id:14,name:15,ref:1},null,[-1,-1])}}const l5=dG,hG=t=>({}),Sv=t=>({}),mG=t=>({}),Ev=t=>({});function Ov(t){let e,n,i,l=t[9]&&Mv(t),r=!t[22]&&t[6]&&Cv(t);return{c(){e=P("div"),l&&l.c(),n=F(),r&&r.c(),S(e,"bx--text-input__label-helper-wrapper",!0)},m(s,o){O(s,e,o),l&&l.m(e,null),w(e,n),r&&r.m(e,null),i=!0},p(s,o){s[9]?l?(l.p(s,o),o[0]&512&&p(l,1)):(l=Mv(s),l.c(),p(l,1),l.m(e,n)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),!s[22]&&s[6]?r?r.p(s,o):(r=Cv(s),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(s){i||(p(l),i=!0)},o(s){v(l),i=!1},d(s){s&&E(e),l&&l.d(),r&&r.d()}}}function Mv(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Ev),r=l||gG(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[7]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[10]),S(e,"bx--label--disabled",t[5]),S(e,"bx--label--inline",t[16]),S(e,"bx--label--inline--sm",t[2]==="sm"),S(e,"bx--label--inline--xl",t[2]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,mG):Ge(s[27]),Ev):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&I(e,"for",s[7]),(!n||o[0]&1024)&&S(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&S(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&S(e,"bx--label--inline",s[16]),(!n||o[0]&4)&&S(e,"bx--label--inline--sm",s[2]==="sm"),(!n||o[0]&4)&&S(e,"bx--label--inline--xl",s[2]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function gG(t){let e;return{c(){e=$(t[9])},m(n,i){O(n,e,i)},p(n,i){i[0]&512&&Y(e,n[9])},d(n){n&&E(e)}}}function Cv(t){let e,n;return{c(){e=P("div"),n=$(t[6]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[5]),S(e,"bx--form__helper-text--inline",t[16])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&64&&Y(n,i[6]),l[0]&32&&S(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&S(e,"bx--form__helper-text--inline",i[16])},d(i){i&&E(e)}}}function Av(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Sv),r=l||_G(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[7]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[10]),S(e,"bx--label--disabled",t[5]),S(e,"bx--label--inline",t[16]),S(e,"bx--label--inline-sm",t[16]&&t[2]==="sm"),S(e,"bx--label--inline-xl",t[16]&&t[2]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,hG):Ge(s[27]),Sv):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&I(e,"for",s[7]),(!n||o[0]&1024)&&S(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&S(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&S(e,"bx--label--inline",s[16]),(!n||o[0]&65540)&&S(e,"bx--label--inline-sm",s[16]&&s[2]==="sm"),(!n||o[0]&65540)&&S(e,"bx--label--inline-xl",s[16]&&s[2]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function _G(t){let e;return{c(){e=$(t[9])},m(n,i){O(n,e,i)},p(n,i){i[0]&512&&Y(e,n[9])},d(n){n&&E(e)}}}function pG(t){let e,n,i,l=t[11]&&Lv(),r=!t[11]&&t[13]&&Dv();return{c(){l&&l.c(),e=F(),r&&r.c(),n=je()},m(s,o){l&&l.m(s,o),O(s,e,o),r&&r.m(s,o),O(s,n,o),i=!0},p(s,o){s[11]?l?o[0]&2048&&p(l,1):(l=Lv(),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),!s[11]&&s[13]?r?o[0]&10240&&p(r,1):(r=Dv(),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function bG(t){let e,n;return e=new MU({props:{class:"bx--text-input__readonly-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Lv(t){let e,n;return e=new Ds({props:{class:"bx--text-input__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Dv(t){let e,n;return e=new Vu({props:{class:`bx--text-input__invalid-icon + bx--text-input__invalid-icon--warning`}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Iv(t){let e;return{c(){e=P("hr"),S(e,"bx--text-input__divider",!0)},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Rv(t){let e,n;return{c(){e=P("div"),n=$(t[12]),I(e,"id",t[19]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&4096&&Y(n,i[12]),l[0]&524288&&I(e,"id",i[19])},d(i){i&&E(e)}}}function Pv(t){let e,n;return{c(){e=P("div"),n=$(t[14]),I(e,"id",t[18]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&16384&&Y(n,i[14]),l[0]&262144&&I(e,"id",i[18])},d(i){i&&E(e)}}}function Nv(t){let e,n;return{c(){e=P("div"),n=$(t[6]),I(e,"id",t[20]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[5]),S(e,"bx--form__helper-text--inline",t[16])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&64&&Y(n,i[6]),l[0]&1048576&&I(e,"id",i[20]),l[0]&32&&S(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&S(e,"bx--form__helper-text--inline",i[16])},d(i){i&&E(e)}}}function Bv(t){let e,n;return{c(){e=P("div"),n=$(t[12]),I(e,"id",t[19]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&4096&&Y(n,i[12]),l[0]&524288&&I(e,"id",i[19])},d(i){i&&E(e)}}}function zv(t){let e,n;return{c(){e=P("div"),n=$(t[14]),I(e,"id",t[18]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&16384&&Y(n,i[14]),l[0]&262144&&I(e,"id",i[18])},d(i){i&&E(e)}}}function vG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G=t[16]&&Ov(t),B=!t[16]&&(t[9]||t[26].labelText)&&Av(t);const j=[bG,pG],q=[];function V(ne,re){return ne[17]?0:1}s=V(t),o=q[s]=j[s](t);let K=[{"data-invalid":f=t[21]||void 0},{"aria-invalid":c=t[21]||void 0},{"data-warn":d=t[13]||void 0},{"aria-describedby":h=t[21]?t[19]:t[13]?t[18]:t[6]?t[20]:void 0},{disabled:t[5]},{id:t[7]},{name:t[8]},{placeholder:t[3]},{required:t[15]},{readOnly:t[17]},t[25]],x={};for(let ne=0;ne{G=null}),fe()),!ne[16]&&(ne[9]||ne[26].labelText)?B?(B.p(ne,re),re[0]&67174912&&p(B,1)):(B=Av(ne),B.c(),p(B,1),B.m(e,i)):B&&(ue(),v(B,1,1,()=>{B=null}),fe());let oe=s;s=V(ne),s===oe?q[s].p(ne,re):(ue(),v(q[oe],1,1,()=>{q[oe]=null}),fe(),o=q[s],o?o.p(ne,re):(o=q[s]=j[s](ne),o.c()),p(o,1),o.m(r,a)),we(u,x=Pe(K,[(!D||re[0]&2097152&&f!==(f=ne[21]||void 0))&&{"data-invalid":f},(!D||re[0]&2097152&&c!==(c=ne[21]||void 0))&&{"aria-invalid":c},(!D||re[0]&8192&&d!==(d=ne[13]||void 0))&&{"data-warn":d},(!D||re[0]&3940416&&h!==(h=ne[21]?ne[19]:ne[13]?ne[18]:ne[6]?ne[20]:void 0))&&{"aria-describedby":h},(!D||re[0]&32)&&{disabled:ne[5]},(!D||re[0]&128)&&{id:ne[7]},(!D||re[0]&256)&&{name:ne[8]},(!D||re[0]&8)&&{placeholder:ne[3]},(!D||re[0]&32768)&&{required:ne[15]},(!D||re[0]&131072)&&{readOnly:ne[17]},re[0]&33554432&&ne[25]])),re[0]&1&&u.value!==ne[0]&&Ll(u,ne[0]),S(u,"bx--text-input",!0),S(u,"bx--text-input--light",ne[4]),S(u,"bx--text-input--invalid",ne[21]),S(u,"bx--text-input--warning",ne[13]),S(u,"bx--text-input--sm",ne[2]==="sm"),S(u,"bx--text-input--xl",ne[2]==="xl"),ne[22]?ie||(ie=Iv(),ie.c(),ie.m(r,_)):ie&&(ie.d(1),ie=null),ne[22]&&!ne[16]&&ne[11]?X?X.p(ne,re):(X=Rv(ne),X.c(),X.m(r,k)):X&&(X.d(1),X=null),ne[22]&&!ne[16]&&ne[13]?ce?ce.p(ne,re):(ce=Pv(ne),ce.c(),ce.m(r,null)):ce&&(ce.d(1),ce=null),(!D||re[0]&2097152&&y!==(y=ne[21]||void 0))&&I(r,"data-invalid",y),(!D||re[0]&8192&&T!==(T=ne[13]||void 0))&&I(r,"data-warn",T),(!D||re[0]&10240)&&S(r,"bx--text-input__field-wrapper--warning",!ne[11]&&ne[13]),!ne[11]&&!ne[13]&&!ne[22]&&!ne[16]&&ne[6]?ae?ae.p(ne,re):(ae=Nv(ne),ae.c(),ae.m(l,A)):ae&&(ae.d(1),ae=null),!ne[22]&&ne[11]?ee?ee.p(ne,re):(ee=Bv(ne),ee.c(),ee.m(l,C)):ee&&(ee.d(1),ee=null),!ne[22]&&!ne[11]&&ne[13]?he?he.p(ne,re):(he=zv(ne),he.c(),he.m(l,null)):he&&(he.d(1),he=null),(!D||re[0]&65536)&&S(l,"bx--text-input__field-outer-wrapper--inline",ne[16]),(!D||re[0]&65536)&&S(e,"bx--text-input-wrapper--inline",ne[16]),(!D||re[0]&16)&&S(e,"bx--text-input-wrapper--light",ne[4]),(!D||re[0]&131072)&&S(e,"bx--text-input-wrapper--readonly",ne[17])},i(ne){D||(p(G),p(B),p(o),D=!0)},o(ne){v(G),v(B),v(o),D=!1},d(ne){ne&&E(e),G&&G.d(),B&&B.d(),q[s].d(),t[38](null),ie&&ie.d(),X&&X.d(),ce&&ce.d(),ae&&ae.d(),ee&&ee.d(),he&&he.d(),R=!1,ut(N)}}}function kG(t,e,n){let i,l,r,s,o;const a=["size","value","placeholder","light","disabled","helperText","id","name","labelText","hideLabel","invalid","invalidText","warn","warnText","ref","required","inline","readonly"];let u=de(e,a),{$$slots:f={},$$scope:c}=e;const d=di(f);let{size:h=void 0}=e,{value:g=""}=e,{placeholder:_=""}=e,{light:k=!1}=e,{disabled:y=!1}=e,{helperText:T=""}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{labelText:C=""}=e,{hideLabel:D=!1}=e,{invalid:R=!1}=e,{invalidText:N=""}=e,{warn:G=!1}=e,{warnText:B=""}=e,{ref:j=null}=e,{required:q=!1}=e,{inline:V=!1}=e,{readonly:K=!1}=e;const x=jn("Form"),ie=nn();function X(ve){return u.type!=="number"?ve:ve!=""?Number(ve):null}const ce=ve=>{n(0,g=X(ve.target.value)),ie("input",g)},ae=ve=>{ie("change",X(ve.target.value))};function ee(ve){te.call(this,t,ve)}function he(ve){te.call(this,t,ve)}function ne(ve){te.call(this,t,ve)}function re(ve){te.call(this,t,ve)}function oe(ve){te.call(this,t,ve)}function Re(ve){te.call(this,t,ve)}function qe(ve){te.call(this,t,ve)}function Ce(ve){te.call(this,t,ve)}function Ze(ve){te.call(this,t,ve)}function be(ve){xe[ve?"unshift":"push"](()=>{j=ve,n(1,j)})}function Ae(){g=this.value,n(0,g)}return t.$$set=ve=>{e=Z(Z({},e),Te(ve)),n(25,u=de(e,a)),"size"in ve&&n(2,h=ve.size),"value"in ve&&n(0,g=ve.value),"placeholder"in ve&&n(3,_=ve.placeholder),"light"in ve&&n(4,k=ve.light),"disabled"in ve&&n(5,y=ve.disabled),"helperText"in ve&&n(6,T=ve.helperText),"id"in ve&&n(7,M=ve.id),"name"in ve&&n(8,A=ve.name),"labelText"in ve&&n(9,C=ve.labelText),"hideLabel"in ve&&n(10,D=ve.hideLabel),"invalid"in ve&&n(11,R=ve.invalid),"invalidText"in ve&&n(12,N=ve.invalidText),"warn"in ve&&n(13,G=ve.warn),"warnText"in ve&&n(14,B=ve.warnText),"ref"in ve&&n(1,j=ve.ref),"required"in ve&&n(15,q=ve.required),"inline"in ve&&n(16,V=ve.inline),"readonly"in ve&&n(17,K=ve.readonly),"$$scope"in ve&&n(27,c=ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&133120&&n(21,l=R&&!K),t.$$.dirty[0]&128&&n(20,r=`helper-${M}`),t.$$.dirty[0]&128&&n(19,s=`error-${M}`),t.$$.dirty[0]&128&&n(18,o=`warn-${M}`)},n(22,i=!!x&&x.isFluid),[g,j,h,_,k,y,T,M,A,C,D,R,N,G,B,q,V,K,o,s,r,l,i,ce,ae,u,d,c,f,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae]}class wG extends Oe{constructor(e){super(),Ee(this,e,kG,vG,Se,{size:2,value:0,placeholder:3,light:4,disabled:5,helperText:6,id:7,name:8,labelText:9,hideLabel:10,invalid:11,invalidText:12,warn:13,warnText:14,ref:1,required:15,inline:16,readonly:17},null,[-1,-1])}}const ei=wG;function Hv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function yG(t){let e,n,i,l=t[1]&&Hv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class SG extends Oe{constructor(e){super(),Ee(this,e,TG,yG,Se,{size:0,title:1})}}const EG=SG;function Uv(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function OG(t){let e,n,i,l=t[1]&&Uv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class CG extends Oe{constructor(e){super(),Ee(this,e,MG,OG,Se,{size:0,title:1})}}const AG=CG,LG=t=>({}),Fv=t=>({}),DG=t=>({}),Gv=t=>({});function Vv(t){let e,n,i,l;const r=t[28].labelText,s=He(r,t,t[27],Gv),o=s||IG(t);let a=!t[24]&&t[11]&&Wv(t);return{c(){e=P("label"),o&&o.c(),n=F(),a&&a.c(),i=je(),I(e,"for",t[19]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[13]),S(e,"bx--label--disabled",t[10]),S(e,"bx--label--inline",t[18]),S(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),S(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(u,f){O(u,e,f),o&&o.m(e,null),O(u,n,f),a&&a.m(u,f),O(u,i,f),l=!0},p(u,f){s?s.p&&(!l||f[0]&134217728)&&Fe(s,r,u,u[27],l?Ue(r,u[27],f,DG):Ge(u[27]),Gv):o&&o.p&&(!l||f[0]&4096)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&524288)&&I(e,"for",u[19]),(!l||f[0]&8192)&&S(e,"bx--visually-hidden",u[13]),(!l||f[0]&1024)&&S(e,"bx--label--disabled",u[10]),(!l||f[0]&262144)&&S(e,"bx--label--inline",u[18]),(!l||f[0]&262152)&&S(e,"bx--label--inline--sm",u[18]&&u[3]==="sm"),(!l||f[0]&262152)&&S(e,"bx--label--inline--xl",u[18]&&u[3]==="xl"),!u[24]&&u[11]?a?a.p(u,f):(a=Wv(u),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},i(u){l||(p(o,u),l=!0)},o(u){v(o,u),l=!1},d(u){u&&(E(e),E(n),E(i)),o&&o.d(u),a&&a.d(u)}}}function IG(t){let e;return{c(){e=$(t[12])},m(n,i){O(n,e,i)},p(n,i){i[0]&4096&&Y(e,n[12])},d(n){n&&E(e)}}}function Wv(t){let e,n;return{c(){e=P("div"),n=$(t[11]),I(e,"id",t[23]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[10]),S(e,"bx--form__helper-text--inline",t[18])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&8388608&&I(e,"id",i[23]),l[0]&1024&&S(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&S(e,"bx--form__helper-text--inline",i[18])},d(i){i&&E(e)}}}function jv(t){let e,n;const i=t[28].labelText,l=He(i,t,t[27],Fv),r=l||RG(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[19]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[13]),S(e,"bx--label--disabled",t[10]),S(e,"bx--label--inline",t[18]),S(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),S(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Fe(l,i,s,s[27],n?Ue(i,s[27],o,LG):Ge(s[27]),Fv):r&&r.p&&(!n||o[0]&4096)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&524288)&&I(e,"for",s[19]),(!n||o[0]&8192)&&S(e,"bx--visually-hidden",s[13]),(!n||o[0]&1024)&&S(e,"bx--label--disabled",s[10]),(!n||o[0]&262144)&&S(e,"bx--label--inline",s[18]),(!n||o[0]&262152)&&S(e,"bx--label--inline--sm",s[18]&&s[3]==="sm"),(!n||o[0]&262152)&&S(e,"bx--label--inline--xl",s[18]&&s[3]==="xl")},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function RG(t){let e;return{c(){e=$(t[12])},m(n,i){O(n,e,i)},p(n,i){i[0]&4096&&Y(e,n[12])},d(n){n&&E(e)}}}function $v(t){let e,n;return e=new Ds({props:{class:"bx--text-input__invalid-icon"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qv(t){let e,n;return e=new Vu({props:{class:`bx--text-input__invalid-icon + bx--text-input__invalid-icon--warning`}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Yv(t){let e,n,i,l;return{c(){e=P("hr"),n=F(),i=P("div"),l=$(t[15]),I(e,"class","bx--text-input__divider"),I(i,"class","bx--form-requirement"),I(i,"id",t[22])},m(r,s){O(r,e,s),O(r,n,s),O(r,i,s),w(i,l)},p(r,s){s[0]&32768&&Y(l,r[15]),s[0]&4194304&&I(i,"id",r[22])},d(r){r&&(E(e),E(n),E(i))}}}function Zv(t){let e,n,i,l,r,s,o,a=!t[10]&&Xv(t);const u=[zG,BG],f=[];function c(d,h){return d[1]==="text"?0:1}return i=c(t),l=f[i]=u[i](t),{c(){e=P("button"),a&&a.c(),n=F(),l.c(),I(e,"type","button"),e.disabled=t[10],S(e,"bx--text-input--password__visibility__toggle",!0),S(e,"bx--btn",!0),S(e,"bx--btn--icon-only",!0),S(e,"bx--btn--disabled",t[10]),S(e,"bx--tooltip__trigger",!0),S(e,"bx--tooltip--a11y",!0),S(e,"bx--tooltip--top",t[8]==="top"),S(e,"bx--tooltip--right",t[8]==="right"),S(e,"bx--tooltip--bottom",t[8]==="bottom"),S(e,"bx--tooltip--left",t[8]==="left"),S(e,"bx--tooltip--align-start",t[7]==="start"),S(e,"bx--tooltip--align-center",t[7]==="center"),S(e,"bx--tooltip--align-end",t[7]==="end")},m(d,h){O(d,e,h),a&&a.m(e,null),w(e,n),f[i].m(e,null),r=!0,s||(o=J(e,"click",t[42]),s=!0)},p(d,h){d[10]?a&&(a.d(1),a=null):a?a.p(d,h):(a=Xv(d),a.c(),a.m(e,n));let g=i;i=c(d),i!==g&&(ue(),v(f[g],1,1,()=>{f[g]=null}),fe(),l=f[i],l||(l=f[i]=u[i](d),l.c()),p(l,1),l.m(e,null)),(!r||h[0]&1024)&&(e.disabled=d[10]),(!r||h[0]&1024)&&S(e,"bx--btn--disabled",d[10]),(!r||h[0]&256)&&S(e,"bx--tooltip--top",d[8]==="top"),(!r||h[0]&256)&&S(e,"bx--tooltip--right",d[8]==="right"),(!r||h[0]&256)&&S(e,"bx--tooltip--bottom",d[8]==="bottom"),(!r||h[0]&256)&&S(e,"bx--tooltip--left",d[8]==="left"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-start",d[7]==="start"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-center",d[7]==="center"),(!r||h[0]&128)&&S(e,"bx--tooltip--align-end",d[7]==="end")},i(d){r||(p(l),r=!0)},o(d){v(l),r=!1},d(d){d&&E(e),a&&a.d(),f[i].d(),s=!1,o()}}}function Xv(t){let e;function n(r,s){return r[1]==="text"?NG:PG}let i=n(t),l=i(t);return{c(){e=P("span"),l.c(),S(e,"bx--assistive-text",!0)},m(r,s){O(r,e,s),l.m(e,null)},p(r,s){i===(i=n(r))&&l?l.p(r,s):(l.d(1),l=i(r),l&&(l.c(),l.m(e,null)))},d(r){r&&E(e),l.d()}}}function PG(t){let e;return{c(){e=$(t[6])},m(n,i){O(n,e,i)},p(n,i){i[0]&64&&Y(e,n[6])},d(n){n&&E(e)}}}function NG(t){let e;return{c(){e=$(t[5])},m(n,i){O(n,e,i)},p(n,i){i[0]&32&&Y(e,n[5])},d(n){n&&E(e)}}}function BG(t){let e,n;return e=new EG({props:{class:"bx--icon-visibility-on"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function zG(t){let e,n;return e=new AG({props:{class:"bx--icon-visibility-off"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Kv(t){let e,n;return{c(){e=P("div"),n=$(t[15]),I(e,"id",t[22]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&32768&&Y(n,i[15]),l[0]&4194304&&I(e,"id",i[22])},d(i){i&&E(e)}}}function Jv(t){let e,n;return{c(){e=P("div"),n=$(t[11]),S(e,"bx--form__helper-text",!0),S(e,"bx--form__helper-text--disabled",t[10]),S(e,"bx--form__helper-text--inline",t[18])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&2048&&Y(n,i[11]),l[0]&1024&&S(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&S(e,"bx--form__helper-text--inline",i[18])},d(i){i&&E(e)}}}function Qv(t){let e,n;return{c(){e=P("div"),n=$(t[17]),I(e,"id",t[21]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l[0]&131072&&Y(n,i[17]),l[0]&2097152&&I(e,"id",i[21])},d(i){i&&E(e)}}}function HG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D=t[18]&&Vv(t),R=!t[18]&&(t[12]||t[25].labelText)&&jv(t),N=t[14]&&$v(),G=!t[14]&&t[16]&&qv(),B=[{"data-invalid":u=t[14]||void 0},{"aria-invalid":f=t[14]||void 0},{"aria-describedby":c=t[14]?t[22]:t[16]?t[21]:t[11]?t[23]:void 0},{id:t[19]},{name:t[20]},{placeholder:t[4]},{type:t[1]},{value:d=t[0]??""},{disabled:t[10]},t[26]],j={};for(let X=0;X{D=null}),fe()),!X[18]&&(X[12]||X[25].labelText)?R?(R.p(X,ce),ce[0]&33820672&&p(R,1)):(R=jv(X),R.c(),p(R,1),R.m(e,i)):R&&(ue(),v(R,1,1,()=>{R=null}),fe()),X[14]?N?ce[0]&16384&&p(N,1):(N=$v(),N.c(),p(N,1),N.m(r,s)):N&&(ue(),v(N,1,1,()=>{N=null}),fe()),!X[14]&&X[16]?G?ce[0]&81920&&p(G,1):(G=qv(),G.c(),p(G,1),G.m(r,o)):G&&(ue(),v(G,1,1,()=>{G=null}),fe()),we(a,j=Pe(B,[(!M||ce[0]&16384&&u!==(u=X[14]||void 0))&&{"data-invalid":u},(!M||ce[0]&16384&&f!==(f=X[14]||void 0))&&{"aria-invalid":f},(!M||ce[0]&14764032&&c!==(c=X[14]?X[22]:X[16]?X[21]:X[11]?X[23]:void 0))&&{"aria-describedby":c},(!M||ce[0]&524288)&&{id:X[19]},(!M||ce[0]&1048576)&&{name:X[20]},(!M||ce[0]&16)&&{placeholder:X[4]},(!M||ce[0]&2)&&{type:X[1]},(!M||ce[0]&1&&d!==(d=X[0]??"")&&a.value!==d)&&{value:d},(!M||ce[0]&1024)&&{disabled:X[10]},ce[0]&67108864&&X[26]])),"value"in j&&(a.value=j.value),S(a,"bx--text-input",!0),S(a,"bx--password-input",!0),S(a,"bx--text-input--light",X[9]),S(a,"bx--text-input--invalid",X[14]),S(a,"bx--text-input--warning",X[16]),S(a,"bx--text-input--sm",X[3]==="sm"),S(a,"bx--text-input--xl",X[3]==="xl"),X[24]&&X[14]?q?q.p(X,ce):(q=Yv(X),q.c(),q.m(r,g)):q&&(q.d(1),q=null),X[24]&&X[14]?V&&(ue(),v(V,1,1,()=>{V=null}),fe()):V?(V.p(X,ce),ce[0]&16793600&&p(V,1)):(V=Zv(X),V.c(),p(V,1),V.m(r,null)),(!M||ce[0]&16384&&_!==(_=X[14]||void 0))&&I(r,"data-invalid",_),(!M||ce[0]&65536)&&S(r,"bx--text-input__field-wrapper--warning",X[16]),!X[24]&&X[14]?K?K.p(X,ce):(K=Kv(X),K.c(),K.m(l,y)):K&&(K.d(1),K=null),!X[14]&&!X[16]&&!X[24]&&!X[18]&&X[11]?x?x.p(X,ce):(x=Jv(X),x.c(),x.m(l,T)):x&&(x.d(1),x=null),!X[24]&&!X[14]&&X[16]?ie?ie.p(X,ce):(ie=Qv(X),ie.c(),ie.m(l,null)):ie&&(ie.d(1),ie=null),(!M||ce[0]&262144)&&S(l,"bx--text-input__field-outer-wrapper--inline",X[18]),(!M||ce[0]&16777216)&&S(e,"bx--password-input-wrapper",!X[24]),(!M||ce[0]&512)&&S(e,"bx--text-input-wrapper--light",X[9]),(!M||ce[0]&262144)&&S(e,"bx--text-input-wrapper--inline",X[18])},i(X){M||(p(D),p(R),p(N),p(G),p(V),M=!0)},o(X){v(D),v(R),v(N),v(G),v(V),M=!1},d(X){X&&E(e),D&&D.d(),R&&R.d(),N&&N.d(),G&&G.d(),t[40](null),q&&q.d(),V&&V.d(),K&&K.d(),x&&x.d(),ie&&ie.d(),A=!1,ut(C)}}}function UG(t,e,n){let i,l,r,s;const o=["size","value","type","placeholder","hidePasswordLabel","showPasswordLabel","tooltipAlignment","tooltipPosition","light","disabled","helperText","labelText","hideLabel","invalid","invalidText","warn","warnText","inline","id","name","ref"];let a=de(e,o),{$$slots:u={},$$scope:f}=e;const c=di(u);let{size:d=void 0}=e,{value:h=""}=e,{type:g="password"}=e,{placeholder:_=""}=e,{hidePasswordLabel:k="Hide password"}=e,{showPasswordLabel:y="Show password"}=e,{tooltipAlignment:T="center"}=e,{tooltipPosition:M="bottom"}=e,{light:A=!1}=e,{disabled:C=!1}=e,{helperText:D=""}=e,{labelText:R=""}=e,{hideLabel:N=!1}=e,{invalid:G=!1}=e,{invalidText:B=""}=e,{warn:j=!1}=e,{warnText:q=""}=e,{inline:V=!1}=e,{id:K="ccs-"+Math.random().toString(36)}=e,{name:x=void 0}=e,{ref:ie=null}=e;const X=jn("Form");function ce(me){te.call(this,t,me)}function ae(me){te.call(this,t,me)}function ee(me){te.call(this,t,me)}function he(me){te.call(this,t,me)}function ne(me){te.call(this,t,me)}function re(me){te.call(this,t,me)}function oe(me){te.call(this,t,me)}function Re(me){te.call(this,t,me)}function qe(me){te.call(this,t,me)}function Ce(me){te.call(this,t,me)}function Ze(me){te.call(this,t,me)}function be(me){xe[me?"unshift":"push"](()=>{ie=me,n(2,ie)})}const Ae=({target:me})=>{n(0,h=me.value)},ve=()=>{n(1,g=g==="password"?"text":"password")};return t.$$set=me=>{e=Z(Z({},e),Te(me)),n(26,a=de(e,o)),"size"in me&&n(3,d=me.size),"value"in me&&n(0,h=me.value),"type"in me&&n(1,g=me.type),"placeholder"in me&&n(4,_=me.placeholder),"hidePasswordLabel"in me&&n(5,k=me.hidePasswordLabel),"showPasswordLabel"in me&&n(6,y=me.showPasswordLabel),"tooltipAlignment"in me&&n(7,T=me.tooltipAlignment),"tooltipPosition"in me&&n(8,M=me.tooltipPosition),"light"in me&&n(9,A=me.light),"disabled"in me&&n(10,C=me.disabled),"helperText"in me&&n(11,D=me.helperText),"labelText"in me&&n(12,R=me.labelText),"hideLabel"in me&&n(13,N=me.hideLabel),"invalid"in me&&n(14,G=me.invalid),"invalidText"in me&&n(15,B=me.invalidText),"warn"in me&&n(16,j=me.warn),"warnText"in me&&n(17,q=me.warnText),"inline"in me&&n(18,V=me.inline),"id"in me&&n(19,K=me.id),"name"in me&&n(20,x=me.name),"ref"in me&&n(2,ie=me.ref),"$$scope"in me&&n(27,f=me.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&524288&&n(23,l=`helper-${K}`),t.$$.dirty[0]&524288&&n(22,r=`error-${K}`),t.$$.dirty[0]&524288&&n(21,s=`warn-${K}`)},n(24,i=!!X&&X.isFluid),[h,g,ie,d,_,k,y,T,M,A,C,D,R,N,G,B,j,q,V,K,x,s,r,l,i,c,a,f,u,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae,ve]}class FG extends Oe{constructor(e){super(),Ee(this,e,UG,HG,Se,{size:3,value:0,type:1,placeholder:4,hidePasswordLabel:5,showPasswordLabel:6,tooltipAlignment:7,tooltipPosition:8,light:9,disabled:10,helperText:11,labelText:12,hideLabel:13,invalid:14,invalidText:15,warn:16,warnText:17,inline:18,id:19,name:20,ref:2},null,[-1,-1])}}const x1=FG,GG=t=>({}),xv=t=>({}),VG=t=>({}),ek=t=>({}),WG=t=>({}),tk=t=>({});function jG(t){let e;return{c(){e=$(t[5])},m(n,i){O(n,e,i)},p(n,i){i&32&&Y(e,n[5])},d(n){n&&E(e)}}}function $G(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function qG(t){let e;return{c(){e=$(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function YG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;const _=t[12].labelText,k=He(_,t,t[11],tk),y=k||jG(t),T=t[12].labelA,M=He(T,t,t[11],ek),A=M||$G(t),C=t[12].labelB,D=He(C,t,t[11],xv),R=D||qG(t);let N=[t[9]],G={};for(let B=0;B{n(0,a=!a)},B=j=>{(j.key===" "||j.key==="Enter")&&(j.preventDefault(),n(0,a=!a))};return t.$$set=j=>{n(10,e=Z(Z({},e),Te(j))),n(9,l=de(e,i)),"size"in j&&n(1,o=j.size),"toggled"in j&&n(0,a=j.toggled),"disabled"in j&&n(2,u=j.disabled),"labelA"in j&&n(3,f=j.labelA),"labelB"in j&&n(4,c=j.labelB),"labelText"in j&&n(5,d=j.labelText),"hideLabel"in j&&n(6,h=j.hideLabel),"id"in j&&n(7,g=j.id),"name"in j&&n(8,_=j.name),"$$scope"in j&&n(11,s=j.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&k("toggle",{toggled:a})},e=Te(e),[a,o,u,f,c,d,h,g,_,l,e,s,r,y,T,M,A,C,D,R,N,G,B]}class XG extends Oe{constructor(e){super(),Ee(this,e,ZG,YG,Se,{size:1,toggled:0,disabled:2,labelA:3,labelB:4,labelText:5,hideLabel:6,id:7,name:8})}}const Ad=XG;function KG(t){let e,n,i,l;const r=t[3].default,s=He(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{e=Z(Z({},e),Te(d)),n(1,l=de(e,i)),"light"in d&&n(0,o=d.light),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class QG extends Oe{constructor(e){super(),Ee(this,e,JG,KG,Se,{light:0})}}const ya=QG,xG=t=>({}),nk=t=>({});function ik(t){let e,n;const i=t[17].labelText,l=He(i,t,t[16],nk),r=l||eV(t);return{c(){e=P("label"),r&&r.c(),I(e,"for",t[12]),S(e,"bx--label",!0),S(e,"bx--visually-hidden",t[9]),S(e,"bx--label--disabled",t[7])},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Fe(l,i,s,s[16],n?Ue(i,s[16],o,xG):Ge(s[16]),nk):r&&r.p&&(!n||o&256)&&r.p(s,n?o:-1),(!n||o&4096)&&I(e,"for",s[12]),(!n||o&512)&&S(e,"bx--visually-hidden",s[9]),(!n||o&128)&&S(e,"bx--label--disabled",s[7])},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function eV(t){let e;return{c(){e=$(t[8])},m(n,i){O(n,e,i)},p(n,i){i&256&&Y(e,n[8])},d(n){n&&E(e)}}}function lk(t){let e,n;return{c(){e=P("div"),n=$(t[11]),S(e,"bx--form-requirement",!0)},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2048&&Y(n,i[11])},d(i){i&&E(e)}}}function tV(t){let e,n,i,l,r,s,o,a,u,f,c,d=(t[8]||t[14].labelText)&&ik(t),h=[{type:"text"},{"data-invalid":s=t[10]||void 0},{pattern:t[4]},{placeholder:t[3]},{maxlength:t[5]},{id:t[12]},{name:t[13]},{disabled:t[7]},t[15]],g={};for(let T=0;T{d=null}),fe()),we(r,g=Pe(h,[{type:"text"},(!u||M&1024&&s!==(s=T[10]||void 0))&&{"data-invalid":s},(!u||M&16)&&{pattern:T[4]},(!u||M&8)&&{placeholder:T[3]},(!u||M&32)&&{maxlength:T[5]},(!u||M&4096)&&{id:T[12]},(!u||M&8192)&&{name:T[13]},(!u||M&128)&&{disabled:T[7]},M&32768&&T[15]])),M&1&&r.value!==T[0]&&Ll(r,T[0]),S(r,"bx--time-picker__input-field",!0),S(r,"bx--text-input",!0),S(r,"bx--text-input--light",T[6]),S(r,"bx--text-input--invalid",T[10]),k&&k.p&&(!u||M&65536)&&Fe(k,_,T,T[16],u?Ue(_,T[16],M,null):Ge(T[16]),null),(!u||M&64)&&S(n,"bx--time-picker--light",T[6]),(!u||M&1024)&&S(n,"bx--time-picker--invalid",T[10]),(!u||M&4)&&S(n,"bx--time-picker--sm",T[2]==="sm"),(!u||M&4)&&S(n,"bx--time-picker--xl",T[2]==="xl"),(!u||M&64)&&S(n,"bx--select--light",T[6]),T[10]?y?y.p(T,M):(y=lk(T),y.c(),y.m(e,null)):y&&(y.d(1),y=null)},i(T){u||(p(d),p(k,T),u=!0)},o(T){v(d),v(k,T),u=!1},d(T){T&&E(e),d&&d.d(),t[29](null),k&&k.d(T),y&&y.d(),f=!1,ut(c)}}}function nV(t,e,n){const i=["size","value","placeholder","pattern","maxlength","light","disabled","labelText","hideLabel","invalid","invalidText","id","name","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{size:a=void 0}=e,{value:u=""}=e,{placeholder:f="hh:mm"}=e,{pattern:c="(1[012]|[1-9]):[0-5][0-9](\\s)?"}=e,{maxlength:d=5}=e,{light:h=!1}=e,{disabled:g=!1}=e,{labelText:_=""}=e,{hideLabel:k=!1}=e,{invalid:y=!1}=e,{invalidText:T=""}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{ref:C=null}=e;function D(ae){te.call(this,t,ae)}function R(ae){te.call(this,t,ae)}function N(ae){te.call(this,t,ae)}function G(ae){te.call(this,t,ae)}function B(ae){te.call(this,t,ae)}function j(ae){te.call(this,t,ae)}function q(ae){te.call(this,t,ae)}function V(ae){te.call(this,t,ae)}function K(ae){te.call(this,t,ae)}function x(ae){te.call(this,t,ae)}function ie(ae){te.call(this,t,ae)}function X(ae){xe[ae?"unshift":"push"](()=>{C=ae,n(1,C)})}function ce(){u=this.value,n(0,u)}return t.$$set=ae=>{e=Z(Z({},e),Te(ae)),n(15,l=de(e,i)),"size"in ae&&n(2,a=ae.size),"value"in ae&&n(0,u=ae.value),"placeholder"in ae&&n(3,f=ae.placeholder),"pattern"in ae&&n(4,c=ae.pattern),"maxlength"in ae&&n(5,d=ae.maxlength),"light"in ae&&n(6,h=ae.light),"disabled"in ae&&n(7,g=ae.disabled),"labelText"in ae&&n(8,_=ae.labelText),"hideLabel"in ae&&n(9,k=ae.hideLabel),"invalid"in ae&&n(10,y=ae.invalid),"invalidText"in ae&&n(11,T=ae.invalidText),"id"in ae&&n(12,M=ae.id),"name"in ae&&n(13,A=ae.name),"ref"in ae&&n(1,C=ae.ref),"$$scope"in ae&&n(16,s=ae.$$scope)},[u,C,a,f,c,d,h,g,_,k,y,T,M,A,o,l,s,r,D,R,N,G,B,j,q,V,K,x,ie,X,ce]}class iV extends Oe{constructor(e){super(),Ee(this,e,nV,tV,Se,{size:2,value:0,placeholder:3,pattern:4,maxlength:5,light:6,disabled:7,labelText:8,hideLabel:9,invalid:10,invalidText:11,id:12,name:13,ref:1})}}const Lc=iV;function rk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function lV(t){let e,n,i=t[1]&&rk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class sV extends Oe{constructor(e){super(),Ee(this,e,rV,lV,Se,{size:0,title:1})}}const r5=sV,em=Wt(!1),tm=Wt(!1),nm=Wt(!1);function oV(t){let e,n,i,l,r;var s=t[0]?t[4]:t[3];function o(f,c){return{props:{size:20}}}s&&(n=sn(s,o()));let a=[{type:"button"},{title:t[2]},{"aria-label":t[2]},t[5]],u={};for(let f=0;f{H(d,1)}),fe()}s?(n=sn(s,o()),U(n.$$.fragment),p(n.$$.fragment,1),z(n,e,null)):n=null}we(e,u=Pe(a,[{type:"button"},(!i||c&4)&&{title:f[2]},(!i||c&4)&&{"aria-label":f[2]},c&32&&f[5]])),S(e,"bx--header__action",!0),S(e,"bx--header__menu-trigger",!0),S(e,"bx--header__menu-toggle",!0)},i(f){i||(n&&p(n.$$.fragment,f),i=!0)},o(f){n&&v(n.$$.fragment,f),i=!1},d(f){f&&E(e),n&&H(n),t[7](null),l=!1,ut(r)}}}function aV(t,e,n){const i=["ariaLabel","isOpen","iconMenu","iconClose","ref"];let l=de(e,i),{ariaLabel:r=void 0}=e,{isOpen:s=!1}=e,{iconMenu:o=r5}=e,{iconClose:a=Dl}=e,{ref:u=null}=e;function f(h){te.call(this,t,h)}function c(h){xe[h?"unshift":"push"](()=>{u=h,n(1,u)})}const d=()=>n(0,s=!s);return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(5,l=de(e,i)),"ariaLabel"in h&&n(2,r=h.ariaLabel),"isOpen"in h&&n(0,s=h.isOpen),"iconMenu"in h&&n(3,o=h.iconMenu),"iconClose"in h&&n(4,a=h.iconClose),"ref"in h&&n(1,u=h.ref)},[s,u,r,o,a,l,f,c,d]}class uV extends Oe{constructor(e){super(),Ee(this,e,aV,oV,Se,{ariaLabel:2,isOpen:0,iconMenu:3,iconClose:4,ref:1})}}const fV=uV,cV=t=>({}),sk=t=>({}),dV=t=>({}),ok=t=>({}),hV=t=>({}),ak=t=>({});function uk(t){let e,n,i;function l(s){t[20](s)}let r={iconClose:t[8],iconMenu:t[7]};return t[0]!==void 0&&(r.isOpen=t[0]),e=new fV({props:r}),xe.push(()=>At(e,"isOpen",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&256&&(a.iconClose=s[8]),o&128&&(a.iconMenu=s[7]),!n&&o&1&&(n=!0,a.isOpen=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function fk(t){let e,n;const i=t[17].company,l=He(i,t,t[16],ok),r=l||mV(t);return{c(){e=P("span"),r&&r.c(),S(e,"bx--header__name--prefix",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Fe(l,i,s,s[16],n?Ue(i,s[16],o,dV):Ge(s[16]),ok):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function mV(t){let e,n;return{c(){e=$(t[3]),n=$(" ")},m(i,l){O(i,e,l),O(i,n,l)},p(i,l){l&8&&Y(e,i[3])},d(i){i&&(E(e),E(n))}}}function gV(t){let e;return{c(){e=$(t[4])},m(n,i){O(n,e,i)},p(n,i){i&16&&Y(e,n[4])},d(n){n&&E(e)}}}function _V(t){let e,n,i,l,r,s,o,a,u;Es(t[19]);const f=t[17]["skip-to-content"],c=He(f,t,t[16],ak);let d=(t[11]&&t[9]{d=null}),fe()),C[3]||C[13].company?h?(h.p(C,D),D&8200&&p(h,1)):(h=fk(C),h.c(),p(h,1),h.m(l,r)):h&&(ue(),v(h,1,1,()=>{h=null}),fe()),_?_.p&&(!o||D&65536)&&Fe(_,g,C,C[16],o?Ue(g,C[16],D,cV):Ge(C[16]),sk):k&&k.p&&(!o||D&16)&&k.p(C,o?D:-1),we(l,T=Pe(y,[(!o||D&4)&&{href:C[2]},D&4096&&C[12]])),S(l,"bx--header__name",!0),A&&A.p&&(!o||D&65536)&&Fe(A,M,C,C[16],o?Ue(M,C[16],D,null):Ge(C[16]),null),(!o||D&1024)&&I(e,"aria-label",C[10])},i(C){o||(p(c,C),p(d),p(h),p(k,C),p(A,C),o=!0)},o(C){v(c,C),v(d),v(h),v(k,C),v(A,C),o=!1},d(C){C&&E(e),c&&c.d(C),d&&d.d(),h&&h.d(),k&&k.d(C),t[21](null),A&&A.d(C),a=!1,ut(u)}}}function pV(t,e,n){let i;const l=["expandedByDefault","isSideNavOpen","uiShellAriaLabel","href","company","platformName","persistentHamburgerMenu","expansionBreakpoint","ref","iconMenu","iconClose"];let r=de(e,l),s;ct(t,em,B=>n(11,s=B));let{$$slots:o={},$$scope:a}=e;const u=di(o);let{expandedByDefault:f=!0}=e,{isSideNavOpen:c=!1}=e,{uiShellAriaLabel:d=void 0}=e,{href:h=void 0}=e,{company:g=void 0}=e,{platformName:_=""}=e,{persistentHamburgerMenu:k=!1}=e,{expansionBreakpoint:y=1056}=e,{ref:T=null}=e,{iconMenu:M=r5}=e,{iconClose:A=Dl}=e,C;function D(B){te.call(this,t,B)}function R(){n(9,C=window.innerWidth)}function N(B){c=B,n(0,c),n(14,f),n(9,C),n(6,y),n(5,k)}function G(B){xe[B?"unshift":"push"](()=>{T=B,n(1,T)})}return t.$$set=B=>{n(22,e=Z(Z({},e),Te(B))),n(12,r=de(e,l)),"expandedByDefault"in B&&n(14,f=B.expandedByDefault),"isSideNavOpen"in B&&n(0,c=B.isSideNavOpen),"uiShellAriaLabel"in B&&n(15,d=B.uiShellAriaLabel),"href"in B&&n(2,h=B.href),"company"in B&&n(3,g=B.company),"platformName"in B&&n(4,_=B.platformName),"persistentHamburgerMenu"in B&&n(5,k=B.persistentHamburgerMenu),"expansionBreakpoint"in B&&n(6,y=B.expansionBreakpoint),"ref"in B&&n(1,T=B.ref),"iconMenu"in B&&n(7,M=B.iconMenu),"iconClose"in B&&n(8,A=B.iconClose),"$$scope"in B&&n(16,a=B.$$scope)},t.$$.update=()=>{t.$$.dirty&16992&&n(0,c=f&&C>=y&&!k),n(10,i=g?`${g} `:""+(d||e["aria-label"]||_))},e=Te(e),[c,T,h,g,_,k,y,M,A,C,i,s,r,u,f,d,a,o,D,R,N,G]}class bV extends Oe{constructor(e){super(),Ee(this,e,pV,_V,Se,{expandedByDefault:14,isSideNavOpen:0,uiShellAriaLabel:15,href:2,company:3,platformName:4,persistentHamburgerMenu:5,expansionBreakpoint:6,ref:1,iconMenu:7,iconClose:8})}}const vV=bV;function ck(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function kV(t){let e,n,i=t[1]&&ck(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class yV extends Oe{constructor(e){super(),Ee(this,e,wV,kV,Se,{size:0,title:1})}}const TV=yV,SV=t=>({}),dk=t=>({}),EV=t=>({}),hk=t=>({}),OV=t=>({}),mk=t=>({});function MV(t){let e;const n=t[11].icon,i=He(n,t,t[10],hk),l=i||AV(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Fe(i,n,r,r[10],e?Ue(n,r[10],s,EV):Ge(r[10]),hk):l&&l.p&&(!e||s&4)&&l.p(r,e?s:-1)},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function CV(t){let e;const n=t[11].closeIcon,i=He(n,t,t[10],mk),l=i||LV(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Fe(i,n,r,r[10],e?Ue(n,r[10],s,OV):Ge(r[10]),mk):l&&l.p&&(!e||s&8)&&l.p(r,e?s:-1)},i(r){e||(p(l,r),e=!0)},o(r){v(l,r),e=!1},d(r){l&&l.d(r)}}}function AV(t){let e,n,i;var l=t[2];function r(s,o){return{props:{size:20}}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&4&&l!==(l=s[2])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function LV(t){let e,n,i;var l=t[3];function r(s,o){return{props:{size:20}}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function gk(t){let e,n;return{c(){e=P("span"),n=$(t[4]),I(e,"class","svelte-187bdaq")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&16&&Y(n,i[4])},d(i){i&&E(e)}}}function DV(t){let e,n=t[4]&&gk(t);return{c(){n&&n.c(),e=je()},m(i,l){n&&n.m(i,l),O(i,e,l)},p(i,l){i[4]?n?n.p(i,l):(n=gk(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&E(e),n&&n.d(i)}}}function _k(t){let e,n,i;const l=t[11].default,r=He(l,t,t[10],null);return{c(){e=P("div"),r&&r.c(),S(e,"bx--header-panel",!0),S(e,"bx--header-panel--expanded",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),t[16](e),i=!0},p(s,o){t=s,r&&r.p&&(!i||o&1024)&&Fe(r,l,t,t[10],i?Ue(l,t[10],o,null):Ge(t[10]),null)},i(s){i||(p(r,s),s&&Es(()=>{i&&(n||(n=Dp(e,s2,{...t[5],duration:t[5]===!1?0:t[5].duration},!0)),n.run(1))}),i=!0)},o(s){v(r,s),s&&(n||(n=Dp(e,s2,{...t[5],duration:t[5]===!1?0:t[5].duration},!1)),n.run(0)),i=!1},d(s){s&&E(e),r&&r.d(s),t[16](null),s&&n&&n.end()}}}function IV(t){let e,n,i,l,r,s,o,a,u;const f=[CV,MV],c=[];function d(M,A){return M[0]?0:1}n=d(t),i=c[n]=f[n](t);const h=t[11].text,g=He(h,t,t[10],dk),_=g||DV(t);let k=[{type:"button"},t[9]],y={};for(let M=0;M{c[C]=null}),fe(),i=c[n],i?i.p(M,A):(i=c[n]=f[n](M),i.c()),p(i,1),i.m(e,l)),g?g.p&&(!o||A&1024)&&Fe(g,h,M,M[10],o?Ue(h,M[10],A,SV):Ge(M[10]),dk):_&&_.p&&(!o||A&16)&&_.p(M,o?A:-1),we(e,y=Pe(k,[{type:"button"},A&512&&M[9]])),S(e,"bx--header__action",!0),S(e,"bx--header__action--active",M[0]),S(e,"action-text",M[4]),S(e,"svelte-187bdaq",!0),M[0]?T?(T.p(M,A),A&1&&p(T,1)):(T=_k(M),T.c(),p(T,1),T.m(s.parentNode,s)):T&&(ue(),v(T,1,1,()=>{T=null}),fe())},i(M){o||(p(i),p(_,M),p(T),o=!0)},o(M){v(i),v(_,M),v(T),o=!1},d(M){M&&(E(e),E(r),E(s)),c[n].d(),_&&_.d(M),t[14](null),T&&T.d(M),a=!1,ut(u)}}}function RV(t,e,n){const i=["isOpen","icon","closeIcon","text","ref","transition","preventCloseOnClickOutside"];let l=de(e,i),{$$slots:r={},$$scope:s}=e,{isOpen:o=!1}=e,{icon:a=TV}=e,{closeIcon:u=Dl}=e,{text:f=void 0}=e,{ref:c=null}=e,{transition:d={duration:200}}=e,{preventCloseOnClickOutside:h=!1}=e;const g=nn();let _=null;function k(C){te.call(this,t,C)}const y=({target:C})=>{o&&!c.contains(C)&&!_.contains(C)&&!h&&(n(0,o=!1),g("close"))};function T(C){xe[C?"unshift":"push"](()=>{c=C,n(1,c)})}const M=()=>{n(0,o=!o),g(o?"open":"close")};function A(C){xe[C?"unshift":"push"](()=>{_=C,n(7,_)})}return t.$$set=C=>{e=Z(Z({},e),Te(C)),n(9,l=de(e,i)),"isOpen"in C&&n(0,o=C.isOpen),"icon"in C&&n(2,a=C.icon),"closeIcon"in C&&n(3,u=C.closeIcon),"text"in C&&n(4,f=C.text),"ref"in C&&n(1,c=C.ref),"transition"in C&&n(5,d=C.transition),"preventCloseOnClickOutside"in C&&n(6,h=C.preventCloseOnClickOutside),"$$scope"in C&&n(10,s=C.$$scope)},[o,c,a,u,f,d,h,_,g,l,s,r,k,y,T,M,A]}class PV extends Oe{constructor(e){super(),Ee(this,e,RV,IV,Se,{isOpen:0,icon:2,closeIcon:3,text:4,ref:1,transition:5,preventCloseOnClickOutside:6})}}const NV=PV;function BV(t){let e,n,i;const l=t[3].default,r=He(l,t,t[2],null);let s=[t[0],{role:"menubar"}],o={};for(let f=0;f{n(4,e=Z(Z({},e),Te(a))),n(1,r=de(e,l)),"$$scope"in a&&n(2,o=a.$$scope)},t.$$.update=()=>{n(0,i={"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"]})},e=Te(e),[i,r,o,s]}class HV extends Oe{constructor(e){super(),Ee(this,e,zV,BV,Se,{})}}const UV=HV;function FV(t){let e;return{c(){e=$(t[2])},m(n,i){O(n,e,i)},p(n,i){i&4&&Y(e,n[2])},d(n){n&&E(e)}}}function GV(t){let e,n,i,l,r,s,o,a;const u=t[9].default,f=He(u,t,t[8],null),c=f||FV(t);let d=[{role:"menuitem"},{tabindex:"0"},{href:t[1]},{rel:l=t[7].target==="_blank"?"noopener noreferrer":void 0},{"aria-current":r=t[3]?"page":void 0},t[7]],h={};for(let g=0;g{n(4,h=Object.keys(G))});on(()=>()=>{g&&g()});function _(G){te.call(this,t,G)}function k(G){te.call(this,t,G)}function y(G){te.call(this,t,G)}function T(G){te.call(this,t,G)}function M(G){te.call(this,t,G)}function A(G){te.call(this,t,G)}function C(G){te.call(this,t,G)}function D(G){te.call(this,t,G)}function R(G){xe[G?"unshift":"push"](()=>{f=G,n(0,f)})}const N=()=>{h.indexOf(c)===h.length-1&&(d==null||d.closeMenu())};return t.$$set=G=>{e=Z(Z({},e),Te(G)),n(7,l=de(e,i)),"href"in G&&n(1,o=G.href),"text"in G&&n(2,a=G.text),"isSelected"in G&&n(3,u=G.isSelected),"ref"in G&&n(0,f=G.ref),"$$scope"in G&&n(8,s=G.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&(d==null||d.updateSelectedItems({id:c,isSelected:u}))},[f,o,a,u,h,c,d,l,s,r,_,k,y,T,M,A,C,D,R,N]}class WV extends Oe{constructor(e){super(),Ee(this,e,VV,GV,Se,{href:1,text:2,isSelected:3,ref:0})}}const s5=WV;function jV(t){let e,n,i,l,r,s,o,a,u,f;r=new co({props:{class:"bx--header__menu-arrow"}});let c=[{role:"menuitem"},{tabindex:"0"},{"aria-haspopup":"menu"},{"aria-expanded":t[0]},{"aria-label":t[3]},{href:t[2]},t[7]],d={};for(let _=0;_n(8,s=V));let g=null;pi("HeaderNavMenu",{selectedItems:h,updateSelectedItems(V){h.update(K=>({...K,[V.id]:V.isSelected}))},closeMenu(){n(0,u=!1)}});function _(V){te.call(this,t,V)}function k(V){te.call(this,t,V)}function y(V){te.call(this,t,V)}function T(V){te.call(this,t,V)}function M(V){te.call(this,t,V)}function A(V){te.call(this,t,V)}function C(V){te.call(this,t,V)}function D(V){te.call(this,t,V)}const R=({target:V})=>{d.contains(V)||n(0,u=!1)};function N(V){xe[V?"unshift":"push"](()=>{d=V,n(1,d)})}const G=V=>{V.key===" "&&V.preventDefault(),(V.key==="Enter"||V.key===" ")&&n(0,u=!u)};function B(V){xe[V?"unshift":"push"](()=>{g=V,n(4,g)})}const j=V=>{g.contains(V.target)||V.preventDefault(),n(0,u=!u)},q=V=>{V.key==="Enter"&&(V.stopPropagation(),n(0,u=!u))};return t.$$set=V=>{e=Z(Z({},e),Te(V)),n(7,r=de(e,l)),"expanded"in V&&n(0,u=V.expanded),"href"in V&&n(2,f=V.href),"text"in V&&n(3,c=V.text),"ref"in V&&n(1,d=V.ref),"$$scope"in V&&n(9,a=V.$$scope)},t.$$.update=()=>{t.$$.dirty&256&&n(5,i=Object.values(s).filter(Boolean).length>0)},[u,d,f,c,g,i,h,r,s,a,o,_,k,y,T,M,A,C,D,R,N,G,B,j,q]}class qV extends Oe{constructor(e){super(),Ee(this,e,$V,jV,Se,{expanded:0,href:2,text:3,ref:1})}}const YV=qV;function pk(t){let e,n,i;const l=t[2].default,r=He(l,t,t[1],null);return{c(){e=P("li"),n=P("span"),r&&r.c(),I(n,"class","svelte-1tbdbmc"),I(e,"class","svelte-1tbdbmc")},m(s,o){O(s,e,o),w(e,n),r&&r.m(n,null),i=!0},p(s,o){r&&r.p&&(!i||o&2)&&Fe(r,l,s,s[1],i?Ue(l,s[1],o,null):Ge(s[1]),null)},i(s){i||(p(r,s),i=!0)},o(s){v(r,s),i=!1},d(s){s&&E(e),r&&r.d(s)}}}function ZV(t){let e,n,i,l=t[0].default&&pk(t);return{c(){l&&l.c(),e=F(),n=P("hr"),S(n,"bx--switcher__item--divider",!0)},m(r,s){l&&l.m(r,s),O(r,e,s),O(r,n,s),i=!0},p(r,[s]){r[0].default?l?(l.p(r,s),s&1&&p(l,1)):(l=pk(r),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe())},i(r){i||(p(l),i=!0)},o(r){v(l),i=!1},d(r){r&&(E(e),E(n)),l&&l.d(r)}}}function XV(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);return t.$$set=s=>{"$$scope"in s&&n(1,l=s.$$scope)},[r,l,i]}class KV extends Oe{constructor(e){super(),Ee(this,e,XV,ZV,Se,{})}}const JV=KV;function QV(t){let e,n,i,l,r,s;const o=t[4].default,a=He(o,t,t[3],null);let u=[{href:t[1]},{rel:i=t[2].target==="_blank"?"noopener noreferrer":void 0},t[2]],f={};for(let c=0;c{a=c,n(0,a)})}return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,l=de(e,i)),"href"in c&&n(1,o=c.href),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class eW extends Oe{constructor(e){super(),Ee(this,e,xV,QV,Se,{href:1,ref:0})}}const bk=eW;function tW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("ul"),l&&l.c(),S(e,"bx--switcher__item",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function nW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class iW extends Oe{constructor(e){super(),Ee(this,e,nW,tW,Se,{})}}const lW=iW;function rW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("div"),l&&l.c(),S(e,"bx--header__global",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function sW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class oW extends Oe{constructor(e){super(),Ee(this,e,sW,rW,Se,{})}}const aW=oW;function vk(t){let e,n,i;return{c(){e=P("div"),S(e,"bx--side-nav__overlay",!0),S(e,"bx--side-nav__overlay-active",t[0]),An(e,"z-index",t[0]?6e3:void 0)},m(l,r){O(l,e,r),n||(i=J(e,"click",t[11]),n=!0)},p(l,r){r&1&&S(e,"bx--side-nav__overlay-active",l[0]),r&1&&An(e,"z-index",l[0]?6e3:void 0)},d(l){l&&E(e),n=!1,i()}}}function uW(t){let e,n,i,l,r,s;Es(t[10]);let o=!t[1]&&vk(t);const a=t[9].default,u=He(a,t,t[8],null);let f=[{"aria-hidden":i=!t[0]},{"aria-label":t[3]},t[7]],c={};for(let d=0;d=t[4]?!1:t[0]),S(n,"bx--side-nav--collapsed",!t[0]&&!t[2]),S(n,"bx--side-nav--rail",t[2])},m(d,h){o&&o.m(d,h),O(d,e,h),O(d,n,h),u&&u.m(n,null),l=!0,r||(s=J(window,"resize",t[10]),r=!0)},p(d,[h]){d[1]?o&&(o.d(1),o=null):o?o.p(d,h):(o=vk(d),o.c(),o.m(e.parentNode,e)),u&&u.p&&(!l||h&256)&&Fe(u,a,d,d[8],l?Ue(a,d[8],h,null):Ge(d[8]),null),we(n,c=Pe(f,[(!l||h&1&&i!==(i=!d[0]))&&{"aria-hidden":i},(!l||h&8)&&{"aria-label":d[3]},h&128&&d[7]])),S(n,"bx--side-nav__navigation",!0),S(n,"bx--side-nav",!0),S(n,"bx--side-nav--ux",!0),S(n,"bx--side-nav--expanded",d[2]&&d[5]>=d[4]?!1:d[0]),S(n,"bx--side-nav--collapsed",!d[0]&&!d[2]),S(n,"bx--side-nav--rail",d[2])},i(d){l||(p(u,d),l=!0)},o(d){v(u,d),l=!1},d(d){d&&(E(e),E(n)),o&&o.d(d),u&&u.d(d),r=!1,s()}}}function fW(t,e,n){const i=["fixed","rail","ariaLabel","isOpen","expansionBreakpoint"];let l=de(e,i),r,s;ct(t,nm,T=>n(12,r=T)),ct(t,tm,T=>n(13,s=T));let{$$slots:o={},$$scope:a}=e,{fixed:u=!1}=e,{rail:f=!1}=e,{ariaLabel:c=void 0}=e,{isOpen:d=!1}=e,{expansionBreakpoint:h=1056}=e;const g=nn();let _;on(()=>(em.set(!0),()=>em.set(!1)));function k(){n(5,_=window.innerWidth)}const y=()=>{g("click:overlay"),n(0,d=!1)};return t.$$set=T=>{e=Z(Z({},e),Te(T)),n(7,l=de(e,i)),"fixed"in T&&n(1,u=T.fixed),"rail"in T&&n(2,f=T.rail),"ariaLabel"in T&&n(3,c=T.ariaLabel),"isOpen"in T&&n(0,d=T.isOpen),"expansionBreakpoint"in T&&n(4,h=T.expansionBreakpoint),"$$scope"in T&&n(8,a=T.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&g(d?"open":"close"),t.$$.dirty&1&&lo(tm,s=!d,s),t.$$.dirty&4&&lo(nm,r=f,r)},[d,u,f,c,h,_,g,l,a,o,k,y]}class cW extends Oe{constructor(e){super(),Ee(this,e,fW,uW,Se,{fixed:1,rail:2,ariaLabel:3,isOpen:0,expansionBreakpoint:4})}}const dW=cW;function hW(t){let e,n;const i=t[1].default,l=He(i,t,t[0],null);return{c(){e=P("ul"),l&&l.c(),S(e,"bx--side-nav__items",!0)},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Fe(l,i,r,r[0],n?Ue(i,r[0],s,null):Ge(r[0]),null)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function mW(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class gW extends Oe{constructor(e){super(),Ee(this,e,mW,hW,Se,{})}}const _W=gW,pW=t=>({}),kk=t=>({});function wk(t){let e,n;const i=t[8].icon,l=He(i,t,t[7],kk),r=l||bW(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--side-nav__icon",!0),S(e,"bx--side-nav__icon--small",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&128)&&Fe(l,i,s,s[7],n?Ue(i,s[7],o,pW):Ge(s[7]),kk):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function bW(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function vW(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function kW(t){let e,n,i,l,r,s,o,a,u,f=(t[6].icon||t[4])&&wk(t);const c=t[8].default,d=He(c,t,t[7],null),h=d||vW(t);let g=[{"aria-current":r=t[1]?"page":void 0},{href:t[2]},{rel:s=t[5].target==="_blank"?"noopener noreferrer":void 0},t[5]],_={};for(let k=0;k{f=null}),fe()),d?d.p&&(!o||y&128)&&Fe(d,c,k,k[7],o?Ue(c,k[7],y,null):Ge(k[7]),null):h&&h.p&&(!o||y&8)&&h.p(k,o?y:-1),we(n,_=Pe(g,[(!o||y&2&&r!==(r=k[1]?"page":void 0))&&{"aria-current":r},(!o||y&4)&&{href:k[2]},(!o||y&32&&s!==(s=k[5].target==="_blank"?"noopener noreferrer":void 0))&&{rel:s},y&32&&k[5]])),S(n,"bx--side-nav__link",!0),S(n,"bx--side-nav__link--current",k[1])},i(k){o||(p(f),p(h,k),o=!0)},o(k){v(f),v(h,k),o=!1},d(k){k&&E(e),f&&f.d(),h&&h.d(k),t[10](null),a=!1,u()}}}function wW(t,e,n){const i=["isSelected","href","text","icon","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{isSelected:a=!1}=e,{href:u=void 0}=e,{text:f=void 0}=e,{icon:c=void 0}=e,{ref:d=null}=e;function h(_){te.call(this,t,_)}function g(_){xe[_?"unshift":"push"](()=>{d=_,n(0,d)})}return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(5,l=de(e,i)),"isSelected"in _&&n(1,a=_.isSelected),"href"in _&&n(2,u=_.href),"text"in _&&n(3,f=_.text),"icon"in _&&n(4,c=_.icon),"ref"in _&&n(0,d=_.ref),"$$scope"in _&&n(7,s=_.$$scope)},[d,a,u,f,c,l,o,s,r,h,g]}class yW extends Oe{constructor(e){super(),Ee(this,e,wW,kW,Se,{isSelected:1,href:2,text:3,icon:4,ref:0})}}const TW=yW,SW=t=>({}),yk=t=>({});function Tk(t){let e,n;const i=t[7].icon,l=He(i,t,t[6],yk),r=l||EW(t);return{c(){e=P("div"),r&&r.c(),S(e,"bx--side-nav__icon",!0)},m(s,o){O(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&64)&&Fe(l,i,s,s[6],n?Ue(i,s[6],o,SW):Ge(s[6]),yk):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(p(r,s),n=!0)},o(s){v(r,s),n=!1},d(s){s&&E(e),r&&r.d(s)}}}function EW(t){let e,n,i;var l=t[3];function r(s,o){return{}}return l&&(e=sn(l,r())),{c(){e&&U(e.$$.fragment),n=je()},m(s,o){e&&z(e,s,o),O(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){ue();const a=e;v(a.$$.fragment,1,0,()=>{H(a,1)}),fe()}l?(e=sn(l,r()),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}},i(s){i||(e&&p(e.$$.fragment,s),i=!0)},o(s){e&&v(e.$$.fragment,s),i=!1},d(s){s&&E(n),e&&H(e,s)}}}function OW(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g=(t[5].icon||t[3])&&Tk(t);a=new co({});let _=[{type:"button"},{"aria-expanded":t[0]},t[4]],k={};for(let M=0;M<_.length;M+=1)k=Z(k,_[M]);const y=t[7].default,T=He(y,t,t[6],null);return{c(){e=P("li"),n=P("button"),g&&g.c(),i=F(),l=P("span"),r=$(t[2]),s=F(),o=P("div"),U(a.$$.fragment),u=F(),f=P("ul"),T&&T.c(),S(l,"bx--side-nav__submenu-title",!0),S(o,"bx--side-nav__icon",!0),S(o,"bx--side-nav__icon--small",!0),S(o,"bx--side-nav__submenu-chevron",!0),we(n,k),S(n,"bx--side-nav__submenu",!0),I(f,"role","menu"),S(f,"bx--side-nav__menu",!0),An(f,"max-height",t[0]?"none":void 0),S(e,"bx--side-nav__item",!0),S(e,"bx--side-nav__item--icon",t[3])},m(M,A){O(M,e,A),w(e,n),g&&g.m(n,null),w(n,i),w(n,l),w(l,r),w(n,s),w(n,o),z(a,o,null),n.autofocus&&n.focus(),t[9](n),w(e,u),w(e,f),T&&T.m(f,null),c=!0,d||(h=[J(n,"click",t[8]),J(n,"click",t[10])],d=!0)},p(M,[A]){M[5].icon||M[3]?g?(g.p(M,A),A&40&&p(g,1)):(g=Tk(M),g.c(),p(g,1),g.m(n,i)):g&&(ue(),v(g,1,1,()=>{g=null}),fe()),(!c||A&4)&&Y(r,M[2]),we(n,k=Pe(_,[{type:"button"},(!c||A&1)&&{"aria-expanded":M[0]},A&16&&M[4]])),S(n,"bx--side-nav__submenu",!0),T&&T.p&&(!c||A&64)&&Fe(T,y,M,M[6],c?Ue(y,M[6],A,null):Ge(M[6]),null),A&1&&An(f,"max-height",M[0]?"none":void 0),(!c||A&8)&&S(e,"bx--side-nav__item--icon",M[3])},i(M){c||(p(g),p(a.$$.fragment,M),p(T,M),c=!0)},o(M){v(g),v(a.$$.fragment,M),v(T,M),c=!1},d(M){M&&E(e),g&&g.d(),H(a),t[9](null),T&&T.d(M),d=!1,ut(h)}}}function MW(t,e,n){const i=["expanded","text","icon","ref"];let l=de(e,i),{$$slots:r={},$$scope:s}=e;const o=di(r);let{expanded:a=!1}=e,{text:u=void 0}=e,{icon:f=void 0}=e,{ref:c=null}=e;function d(_){te.call(this,t,_)}function h(_){xe[_?"unshift":"push"](()=>{c=_,n(1,c)})}const g=()=>{n(0,a=!a)};return t.$$set=_=>{e=Z(Z({},e),Te(_)),n(4,l=de(e,i)),"expanded"in _&&n(0,a=_.expanded),"text"in _&&n(2,u=_.text),"icon"in _&&n(3,f=_.icon),"ref"in _&&n(1,c=_.ref),"$$scope"in _&&n(6,s=_.$$scope)},[a,c,u,f,l,o,s,r,d,h,g]}class CW extends Oe{constructor(e){super(),Ee(this,e,MW,OW,Se,{expanded:0,text:2,icon:3,ref:1})}}const AW=CW;function LW(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function DW(t){let e,n,i,l,r,s,o;const a=t[6].default,u=He(a,t,t[5],null),f=u||LW(t);let c=[{"aria-current":l=t[1]?"page":void 0},{href:t[2]},t[4]],d={};for(let h=0;h{f=h,n(0,f)})}return t.$$set=h=>{e=Z(Z({},e),Te(h)),n(4,l=de(e,i)),"isSelected"in h&&n(1,o=h.isSelected),"href"in h&&n(2,a=h.href),"text"in h&&n(3,u=h.text),"ref"in h&&n(0,f=h.ref),"$$scope"in h&&n(5,s=h.$$scope)},[f,o,a,u,l,s,r,c,d]}class RW extends Oe{constructor(e){super(),Ee(this,e,IW,DW,Se,{isSelected:1,href:2,text:3,ref:0})}}const PW=RW;function NW(t){let e,n;const i=t[6].default,l=He(i,t,t[5],null);let r=[{id:t[0]},t[2]],s={};for(let o=0;on(3,s=c)),ct(t,tm,c=>n(4,o=c));let{$$slots:a={},$$scope:u}=e,{id:f="main-content"}=e;return t.$$set=c=>{e=Z(Z({},e),Te(c)),n(2,r=de(e,l)),"id"in c&&n(0,f=c.id),"$$scope"in c&&n(5,u=c.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&n(1,i=o&&!s)},[f,i,r,s,o,u,a]}class zW extends Oe{constructor(e){super(),Ee(this,e,BW,NW,Se,{id:0})}}const HW=zW;function UW(t){let e;return{c(){e=$("Skip to main content")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function FW(t){let e,n,i,l;const r=t[4].default,s=He(r,t,t[3],null),o=s||UW();let a=[{href:t[0]},{tabindex:t[1]},t[2]],u={};for(let f=0;f{e=Z(Z({},e),Te(f)),n(2,l=de(e,i)),"href"in f&&n(0,o=f.href),"tabindex"in f&&n(1,a=f.tabindex),"$$scope"in f&&n(3,s=f.$$scope)},[o,a,l,s,r,u]}class VW extends Oe{constructor(e){super(),Ee(this,e,GW,FW,Se,{href:0,tabindex:1})}}const WW=VW;function jW(t){let e,n=[{role:"separator"},t[0]],i={};for(let l=0;l{e=Z(Z({},e),Te(r)),n(0,l=de(e,i))},[l]}class qW extends Oe{constructor(e){super(),Ee(this,e,$W,jW,Se,{})}}const YW=qW,im={},lm={},ZW={},o5=()=>jn(im),a5=/^:(.+)/,Sk=4,XW=3,KW=2,JW=1,QW=1,rm=t=>t.replace(/(^\/+|\/+$)/g,"").split("/"),h1=t=>t.replace(/(^\/+|\/+$)/g,""),xW=(t,e)=>{const n=t.default?0:rm(t.path).reduce((i,l)=>(i+=Sk,l===""?i+=QW:a5.test(l)?i+=KW:l[0]==="*"?i-=Sk+JW:i+=XW,i),0);return{route:t,score:n,index:e}},ej=t=>t.map(xW).sort((e,n)=>e.scoren.score?-1:e.index-n.index),Ek=(t,e)=>{let n,i;const[l]=e.split("?"),r=rm(l),s=r[0]==="",o=ej(t);for(let a=0,u=o.length;a"u"){c=!0;break}const T=a5.exec(k);if(T&&!s){const M=decodeURIComponent(y);h[T[1]]=M}else if(k!==y){c=!0;break}}if(!c){n={route:f,params:h,uri:"/"+r.slice(0,_).join("/")};break}}return n||i||null},Ok=(t,e)=>`${h1(e==="/"?t:`${h1(t)}/${h1(e)}`)}/`,u5=()=>typeof window<"u"&&"document"in window&&"location"in window,tj=t=>({params:t&4}),Mk=t=>({params:t[2]});function Ck(t){let e,n,i,l;const r=[ij,nj],s=[];function o(a,u){return a[0]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function nj(t){let e;const n=t[8].default,i=He(n,t,t[7],Mk);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&132)&&Fe(i,n,l,l[7],e?Ue(n,l[7],r,tj):Ge(l[7]),Mk)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function ij(t){let e,n,i,l={ctx:t,current:null,token:null,hasCatch:!1,pending:sj,then:rj,catch:lj,value:12,blocks:[,,,]};return Ip(n=t[0],l),{c(){e=je(),l.block.c()},m(r,s){O(r,e,s),l.block.m(r,l.anchor=s),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(r,s){t=r,l.ctx=t,s&1&&n!==(n=t[0])&&Ip(n,l)||hI(l,t,s)},i(r){i||(p(l.block),i=!0)},o(r){for(let s=0;s<3;s+=1){const o=l.blocks[s];v(o)}i=!1},d(r){r&&E(e),l.block.d(r),l.token=null,l=null}}}function lj(t){return{c:_e,m:_e,p:_e,i:_e,o:_e,d:_e}}function rj(t){var o;let e,n,i;const l=[t[2],t[3]];var r=((o=t[12])==null?void 0:o.default)||t[12];function s(a,u){let f={};if(u!==void 0&&u&12)f=Pe(l,[u&4&&Gi(a[2]),u&8&&Gi(a[3])]);else for(let c=0;c{H(c,1)}),fe()}r?(e=sn(r,s(a,u)),U(e.$$.fragment),p(e.$$.fragment,1),z(e,n.parentNode,n)):e=null}else if(r){const c=u&12?Pe(l,[u&4&&Gi(a[2]),u&8&&Gi(a[3])]):{};e.$set(c)}},i(a){i||(e&&p(e.$$.fragment,a),i=!0)},o(a){e&&v(e.$$.fragment,a),i=!1},d(a){a&&E(n),e&&H(e,a)}}}function sj(t){return{c:_e,m:_e,p:_e,i:_e,o:_e,d:_e}}function oj(t){let e,n,i=t[1]&&t[1].route===t[5]&&Ck(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[1]&&l[1].route===l[5]?i?(i.p(l,r),r&2&&p(i,1)):(i=Ck(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function aj(t,e,n){let i,{$$slots:l={},$$scope:r}=e,{path:s=""}=e,{component:o=null}=e,a={},u={};const{registerRoute:f,unregisterRoute:c,activeRoute:d}=jn(lm);ct(t,d,g=>n(1,i=g));const h={path:s,default:s===""};return f(h),Ls(()=>{c(h)}),t.$$set=g=>{n(11,e=Z(Z({},e),Te(g))),"path"in g&&n(6,s=g.path),"component"in g&&n(0,o=g.component),"$$scope"in g&&n(7,r=g.$$scope)},t.$$.update=()=>{if(i&&i.route===h){n(2,a=i.params);const{component:g,path:_,...k}=e;n(3,u=k),g&&(g.toString().startsWith("class ")?n(0,o=g):n(0,o=g())),u5()&&(window==null||window.scrollTo(0,0))}},e=Te(e),[o,i,a,u,d,h,s,r,l]}class yi extends Oe{constructor(e){super(),Ee(this,e,aj,oj,Se,{path:6,component:0})}}const m1=t=>({...t.location,state:t.history.state,key:t.history.state&&t.history.state.key||"initial"}),uj=t=>{const e=[];let n=m1(t);return{get location(){return n},listen(i){e.push(i);const l=()=>{n=m1(t),i({location:n,action:"POP"})};return t.addEventListener("popstate",l),()=>{t.removeEventListener("popstate",l);const r=e.indexOf(i);e.splice(r,1)}},navigate(i,{state:l,replace:r=!1}={}){l={...l,key:Date.now()+""};try{r?t.history.replaceState(l,"",i):t.history.pushState(l,"",i)}catch{t.location[r?"replace":"assign"](i)}n=m1(t),e.forEach(s=>s({location:n,action:"PUSH"})),document.activeElement.blur()}}},fj=(t="/")=>{let e=0;const n=[{pathname:t,search:""}],i=[];return{get location(){return n[e]},addEventListener(l,r){},removeEventListener(l,r){},history:{get entries(){return n},get index(){return e},get state(){return i[e]},pushState(l,r,s){const[o,a=""]=s.split("?");e++,n.push({pathname:o,search:a}),i.push(l)},replaceState(l,r,s){const[o,a=""]=s.split("?");n[e]={pathname:o,search:a},i[e]=l}}}},f5=uj(u5()?window:fj()),{navigate:cj}=f5,dj=t=>({route:t&2,location:t&1}),Ak=t=>({route:t[1]&&t[1].uri,location:t[0]});function hj(t){let e;const n=t[12].default,i=He(n,t,t[11],Ak);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,[r]){i&&i.p&&(!e||r&2051)&&Fe(i,n,l,l[11],e?Ue(n,l[11],r,dj):Ge(l[11]),Ak)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function mj(t,e,n){let i,l,r,s,{$$slots:o={},$$scope:a}=e,{basepath:u="/"}=e,{url:f=null}=e,{history:c=f5}=e;pi(ZW,c);const d=jn(im),h=jn(lm),g=Wt([]);ct(t,g,D=>n(9,l=D));const _=Wt(null);ct(t,_,D=>n(1,s=D));let k=!1;const y=d||Wt(f?{pathname:f}:c.location);ct(t,y,D=>n(0,i=D));const T=h?h.routerBase:Wt({path:u,uri:u});ct(t,T,D=>n(10,r=D));const M=ur([T,_],([D,R])=>{if(!R)return D;const{path:N}=D,{route:G,uri:B}=R;return{path:G.default?N:G.path.replace(/\*.*$/,""),uri:B}}),A=D=>{const{path:R}=r;let{path:N}=D;if(D._path=N,D.path=Ok(R,N),typeof window>"u"){if(k)return;const G=Ek([D],i.pathname);G&&(_.set(G),k=!0)}else g.update(G=>[...G,D])},C=D=>{g.update(R=>R.filter(N=>N!==D))};return d||(on(()=>c.listen(R=>{y.set(R.location)})),pi(im,y)),pi(lm,{activeRoute:_,base:T,routerBase:M,registerRoute:A,unregisterRoute:C}),t.$$set=D=>{"basepath"in D&&n(6,u=D.basepath),"url"in D&&n(7,f=D.url),"history"in D&&n(8,c=D.history),"$$scope"in D&&n(11,a=D.$$scope)},t.$$.update=()=>{if(t.$$.dirty&1024){const{path:D}=r;g.update(R=>R.map(N=>Object.assign(N,{path:Ok(D,N._path)})))}if(t.$$.dirty&513){const D=Ek(l,i.pathname);_.set(D)}},[i,s,g,_,y,T,u,f,c,l,r,a,o]}class gj extends Oe{constructor(e){super(),Ee(this,e,mj,hj,Se,{basepath:6,url:7,history:8})}}var xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function c5(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _j(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,l.get?l:{enumerable:!0,get:function(){return t[i]}})}),n}var pj=function(e){return bj(e)&&!vj(e)};function bj(t){return!!t&&typeof t=="object"}function vj(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||yj(t)}var kj=typeof Symbol=="function"&&Symbol.for,wj=kj?Symbol.for("react.element"):60103;function yj(t){return t.$$typeof===wj}function Tj(t){return Array.isArray(t)?[]:{}}function Mu(t,e){return e.clone!==!1&&e.isMergeableObject(t)?ra(Tj(t),t,e):t}function Sj(t,e,n){return t.concat(e).map(function(i){return Mu(i,n)})}function Ej(t,e){if(!e.customMerge)return ra;var n=e.customMerge(t);return typeof n=="function"?n:ra}function Oj(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Lk(t){return Object.keys(t).concat(Oj(t))}function d5(t,e){try{return e in t}catch{return!1}}function Mj(t,e){return d5(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function Cj(t,e,n){var i={};return n.isMergeableObject(t)&&Lk(t).forEach(function(l){i[l]=Mu(t[l],n)}),Lk(e).forEach(function(l){Mj(t,l)||(d5(t,l)&&n.isMergeableObject(e[l])?i[l]=Ej(l,n)(t[l],e[l],n):i[l]=Mu(e[l],n))}),i}function ra(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||Sj,n.isMergeableObject=n.isMergeableObject||pj,n.cloneUnlessOtherwiseSpecified=Mu;var i=Array.isArray(e),l=Array.isArray(t),r=i===l;return r?i?n.arrayMerge(t,e,n):Cj(t,e,n):Mu(e,n)}ra.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,l){return ra(i,l,n)},{})};var Aj=ra,Lj=Aj;const Dj=c5(Lj);var sm=function(t,e){return sm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(n[l]=i[l])},sm(t,e)};function Ld(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");sm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var pn=function(){return pn=Object.assign||function(e){for(var n,i=1,l=arguments.length;i0}),n=[],i=0,l=e;i1)throw new RangeError("integer-width stems only accept a single optional option");l.options[0].replace(Uj,function(a,u,f,c,d,h){if(u)e.minimumIntegerDigits=f.length;else{if(c&&d)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if(y5.test(l.stem)){e.minimumIntegerDigits=l.stem.length;continue}if(Ik.test(l.stem)){if(l.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");l.stem.replace(Ik,function(a,u,f,c,d,h){return f==="*"?e.minimumFractionDigits=u.length:c&&c[0]==="#"?e.maximumFractionDigits=c.length:d&&h?(e.minimumFractionDigits=d.length,e.maximumFractionDigits=d.length+h.length):(e.minimumFractionDigits=u.length,e.maximumFractionDigits=u.length),""});var r=l.options[0];r==="w"?e=pn(pn({},e),{trailingZeroDisplay:"stripIfInteger"}):r&&(e=pn(pn({},e),Rk(r)));continue}if(w5.test(l.stem)){e=pn(pn({},e),Rk(l.stem));continue}var s=T5(l.stem);s&&(e=pn(pn({},e),s));var o=Fj(l.stem);o&&(e=pn(pn({},e),o))}return e}var xf={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Vj(t,e){for(var n="",i=0;i>1),a="a",u=Wj(e);for((u=="H"||u=="k")&&(o=0);o-- >0;)n+=a;for(;s-- >0;)n=u+n}else l==="J"?n+="H":n+=l}return n}function Wj(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=t.language,i;n!=="root"&&(i=t.maximize().region);var l=xf[i||""]||xf[n||""]||xf["".concat(n,"-001")]||xf["001"];return l[0]}var _1,jj=new RegExp("^".concat(k5.source,"*")),$j=new RegExp("".concat(k5.source,"*$"));function rn(t,e){return{start:t,end:e}}var qj=!!String.prototype.startsWith,Yj=!!String.fromCodePoint,Zj=!!Object.fromEntries,Xj=!!String.prototype.codePointAt,Kj=!!String.prototype.trimStart,Jj=!!String.prototype.trimEnd,Qj=!!Number.isSafeInteger,xj=Qj?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},am=!0;try{var e$=E5("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");am=((_1=e$.exec("a"))===null||_1===void 0?void 0:_1[0])==="a"}catch{am=!1}var Nk=qj?function(e,n,i){return e.startsWith(n,i)}:function(e,n,i){return e.slice(i,i+n.length)===n},um=Yj?String.fromCodePoint:function(){for(var e=[],n=0;nr;){if(s=e[r++],s>1114111)throw RangeError(s+" is not a valid code point");i+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return i},Bk=Zj?Object.fromEntries:function(e){for(var n={},i=0,l=e;i=i)){var l=e.charCodeAt(n),r;return l<55296||l>56319||n+1===i||(r=e.charCodeAt(n+1))<56320||r>57343?l:(l-55296<<10)+(r-56320)+65536}},t$=Kj?function(e){return e.trimStart()}:function(e){return e.replace(jj,"")},n$=Jj?function(e){return e.trimEnd()}:function(e){return e.replace($j,"")};function E5(t,e){return new RegExp(t,e)}var fm;if(am){var zk=E5("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");fm=function(e,n){var i;zk.lastIndex=n;var l=zk.exec(e);return(i=l[1])!==null&&i!==void 0?i:""}}else fm=function(e,n){for(var i=[];;){var l=S5(e,n);if(l===void 0||O5(l)||s$(l))break;i.push(l),n+=l>=65536?2:1}return um.apply(void 0,i)};var i$=function(){function t(e,n){n===void 0&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,n,i){for(var l=[];!this.isEOF();){var r=this.char();if(r===123){var s=this.parseArgument(e,i);if(s.err)return s;l.push(s.val)}else{if(r===125&&e>0)break;if(r===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),l.push({type:Hn.pound,location:rn(o,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(tn.UNMATCHED_CLOSING_TAG,rn(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&cm(this.peek()||0)){var s=this.parseTag(e,n);if(s.err)return s;l.push(s.val)}else{var s=this.parseLiteral(e,n);if(s.err)return s;l.push(s.val)}}}return{val:l,err:null}},t.prototype.parseTag=function(e,n){var i=this.clonePosition();this.bump();var l=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Hn.literal,value:"<".concat(l,"/>"),location:rn(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,n,!0);if(r.err)return r;var s=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:Hn.tag,value:l,children:s,location:rn(i,this.clonePosition())},err:null}:this.error(tn.INVALID_TAG,rn(o,this.clonePosition())))}else return this.error(tn.UNCLOSED_TAG,rn(i,this.clonePosition()))}else return this.error(tn.INVALID_TAG,rn(i,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&r$(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,n){for(var i=this.clonePosition(),l="";;){var r=this.tryParseQuote(n);if(r){l+=r;continue}var s=this.tryParseUnquoted(e,n);if(s){l+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){l+=o;continue}break}var a=rn(i,this.clonePosition());return{val:{type:Hn.literal,value:l,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!l$(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return um.apply(void 0,n)},t.prototype.tryParseUnquoted=function(e,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&e>0?null:(this.bump(),um(i))},t.prototype.parseArgument=function(e,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,rn(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(tn.EMPTY_ARGUMENT,rn(i,this.clonePosition()));var l=this.parseIdentifierIfPossible().value;if(!l)return this.error(tn.MALFORMED_ARGUMENT,rn(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,rn(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Hn.argument,value:l,location:rn(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,rn(i,this.clonePosition())):this.parseArgumentOptions(e,n,l,i);default:return this.error(tn.MALFORMED_ARGUMENT,rn(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),n=this.offset(),i=fm(this.message,n),l=n+i.length;this.bumpTo(l);var r=this.clonePosition(),s=rn(e,r);return{value:i,location:s}},t.prototype.parseArgumentOptions=function(e,n,i,l){var r,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(tn.EXPECT_ARGUMENT_TYPE,rn(s,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var d=n$(c.val);if(d.length===0)return this.error(tn.EXPECT_ARGUMENT_STYLE,rn(this.clonePosition(),this.clonePosition()));var h=rn(f,this.clonePosition());u={style:d,styleLocation:h}}var g=this.tryParseArgumentClose(l);if(g.err)return g;var _=rn(l,this.clonePosition());if(u&&Nk(u==null?void 0:u.style,"::",0)){var k=t$(u.style.slice(2));if(o==="number"){var c=this.parseNumberSkeletonFromString(k,u.styleLocation);return c.err?c:{val:{type:Hn.number,value:i,location:_,style:c.val},err:null}}else{if(k.length===0)return this.error(tn.EXPECT_DATE_TIME_SKELETON,_);var y=k;this.locale&&(y=Vj(k,this.locale));var d={type:sa.dateTime,pattern:y,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?Nj(y):{}},T=o==="date"?Hn.date:Hn.time;return{val:{type:T,value:i,location:_,style:d},err:null}}}return{val:{type:o==="number"?Hn.number:o==="date"?Hn.date:Hn.time,value:i,location:_,style:(r=u==null?void 0:u.style)!==null&&r!==void 0?r:null},err:null}}case"plural":case"selectordinal":case"select":{var M=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(tn.EXPECT_SELECT_ARGUMENT_OPTIONS,rn(M,pn({},M)));this.bumpSpace();var A=this.parseIdentifierIfPossible(),C=0;if(o!=="select"&&A.value==="offset"){if(!this.bumpIf(":"))return this.error(tn.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,rn(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(tn.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,tn.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),A=this.parseIdentifierIfPossible(),C=c.val}var D=this.tryParsePluralOrSelectOptions(e,o,n,A);if(D.err)return D;var g=this.tryParseArgumentClose(l);if(g.err)return g;var R=rn(l,this.clonePosition());return o==="select"?{val:{type:Hn.select,value:i,options:Bk(D.val),location:R},err:null}:{val:{type:Hn.plural,value:i,options:Bk(D.val),offset:C,pluralType:o==="plural"?"cardinal":"ordinal",location:R},err:null}}default:return this.error(tn.INVALID_ARGUMENT_TYPE,rn(s,a))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(tn.EXPECT_ARGUMENT_CLOSING_BRACE,rn(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var l=this.clonePosition();if(!this.bumpUntil("'"))return this.error(tn.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,rn(l,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,n){var i=[];try{i=zj(e)}catch{return this.error(tn.INVALID_NUMBER_SKELETON,n)}return{val:{type:sa.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Gj(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,n,i,l){for(var r,s=!1,o=[],a=new Set,u=l.value,f=l.location;;){if(u.length===0){var c=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var d=this.tryParseDecimalInteger(tn.EXPECT_PLURAL_ARGUMENT_SELECTOR,tn.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;f=rn(c,this.clonePosition()),u=this.message.slice(c.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?tn.DUPLICATE_SELECT_ARGUMENT_SELECTOR:tn.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?tn.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:tn.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,rn(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,n,i);if(g.err)return g;var _=this.tryParseArgumentClose(h);if(_.err)return _;o.push([u,{value:g.val,location:rn(h,this.clonePosition())}]),a.add(u),this.bumpSpace(),r=this.parseIdentifierIfPossible(),u=r.value,f=r.location}return o.length===0?this.error(n==="select"?tn.EXPECT_SELECT_ARGUMENT_SELECTOR:tn.EXPECT_PLURAL_ARGUMENT_SELECTOR,rn(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(tn.MISSING_OTHER_CLAUSE,rn(this.clonePosition(),this.clonePosition())):{val:o,err:null}},t.prototype.tryParseDecimalInteger=function(e,n){var i=1,l=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var r=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)r=!0,s=s*10+(o-48),this.bump();else break}var a=rn(l,this.clonePosition());return r?(s*=i,xj(s)?{val:s,err:null}:this.error(n,a)):this.error(e,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var n=S5(this.message,e);if(n===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return n},t.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(Nk(this.message,e,this.offset())){for(var n=0;n=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&O5(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(e>=65536?2:1));return i??null},t}();function cm(t){return t>=97&&t<=122||t>=65&&t<=90}function l$(t){return cm(t)||t===47}function r$(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function O5(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function s$(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function dm(t){t.forEach(function(e){if(delete e.location,_5(e)||p5(e))for(var n in e.options)delete e.options[n].location,dm(e.options[n].value);else h5(e)&&v5(e.style)||(m5(e)||g5(e))&&om(e.style)?delete e.style.location:b5(e)&&dm(e.children)})}function o$(t,e){e===void 0&&(e={}),e=pn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new i$(t,e).parse();if(n.err){var i=SyntaxError(tn[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return e!=null&&e.captureLocation||dm(n.val),n.val}function p1(t,e){var n=e&&e.cache?e.cache:h$,i=e&&e.serializer?e.serializer:d$,l=e&&e.strategy?e.strategy:u$;return l(t,{cache:n,serializer:i})}function a$(t){return t==null||typeof t=="number"||typeof t=="boolean"}function M5(t,e,n,i){var l=a$(i)?i:n(i),r=e.get(l);return typeof r>"u"&&(r=t.call(this,i),e.set(l,r)),r}function C5(t,e,n){var i=Array.prototype.slice.call(arguments,3),l=n(i),r=e.get(l);return typeof r>"u"&&(r=t.apply(this,i),e.set(l,r)),r}function gg(t,e,n,i,l){return n.bind(e,t,i,l)}function u$(t,e){var n=t.length===1?M5:C5;return gg(t,this,n,e.cache.create(),e.serializer)}function f$(t,e){return gg(t,this,C5,e.cache.create(),e.serializer)}function c$(t,e){return gg(t,this,M5,e.cache.create(),e.serializer)}var d$=function(){return JSON.stringify(arguments)};function _g(){this.cache=Object.create(null)}_g.prototype.get=function(t){return this.cache[t]};_g.prototype.set=function(t,e){this.cache[t]=e};var h$={create:function(){return new _g}},b1={variadic:f$,monadic:c$},oa;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(oa||(oa={}));var Dd=function(t){Ld(e,t);function e(n,i,l){var r=t.call(this,n)||this;return r.code=i,r.originalMessage=l,r}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Hk=function(t){Ld(e,t);function e(n,i,l,r){return t.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(l).join('", "'),'"'),oa.INVALID_VALUE,r)||this}return e}(Dd),m$=function(t){Ld(e,t);function e(n,i,l){return t.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),oa.INVALID_VALUE,l)||this}return e}(Dd),g$=function(t){Ld(e,t);function e(n,i){return t.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),oa.MISSING_VALUE,i)||this}return e}(Dd),Fi;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(Fi||(Fi={}));function _$(t){return t.length<2?t:t.reduce(function(e,n){var i=e[e.length-1];return!i||i.type!==Fi.literal||n.type!==Fi.literal?e.push(n):i.value+=n.value,e},[])}function p$(t){return typeof t=="function"}function hc(t,e,n,i,l,r,s){if(t.length===1&&Dk(t[0]))return[{type:Fi.literal,value:t[0].value}];for(var o=[],a=0,u=t;a0?new Intl.Locale(n[0]):new Intl.Locale(typeof e=="string"?e:e[0])},t.__parse=o$,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();function w$(t,e){if(e==null)return;if(e in t)return t[e];const n=e.split(".");let i=t;for(let l=0;l0){const r=n.slice(l,n.length).join(".");if(r in i){i=i[r];break}}i=i[n[l]]}else i=void 0;return i}const ws={},y$=(t,e,n)=>n&&(e in ws||(ws[e]={}),t in ws[e]||(ws[e][t]=n),n),L5=(t,e)=>{if(e==null)return;if(e in ws&&t in ws[e])return ws[e][t];const n=Yu(e);for(let i=0;i(n[t]=Dj.all([n[t]||{},...e]),n))}ur([Ta],([t])=>Object.keys(t));Ta.subscribe(t=>pg=t);const bu={};function M$(t){bu[t]=new Set}function C$(t,e){bu[t].delete(e),bu[t].size===0&&delete bu[t]}function vu(t){return bu[t]}function A$(t){return Yu(t).map(e=>{const n=vu(e);return[e,n?[...n]:[]]}).filter(([,e])=>e.length>0)}function Dc(t){return t==null?!1:Yu(t).some(e=>{var n;return(n=vu(e))==null?void 0:n.size})}function L$(t,e){return Promise.all(e.map(i=>(C$(t,i),i().then(l=>l.default||l)))).then(i=>O$(t,...i))}const eu={};function D5(t){if(!Dc(t))return t in eu?eu[t]:Promise.resolve();const e=A$(t);return eu[t]=Promise.all(e.map(([n,i])=>L$(n,i))).then(()=>{if(Dc(t))return D5(t);delete eu[t]}),eu[t]}function D$(t,e){vu(t)||M$(t);const n=vu(t);vu(t).has(e)||(bg(t)||Ta.update(i=>(i[t]={},i)),n.add(e))}var Uk=Object.getOwnPropertySymbols,I$=Object.prototype.hasOwnProperty,R$=Object.prototype.propertyIsEnumerable,P$=(t,e)=>{var n={};for(var i in t)I$.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&Uk)for(var i of Uk(t))e.indexOf(i)<0&&R$.call(t,i)&&(n[i]=t[i]);return n};const N$={number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}};function B$({locale:t,id:e}){console.warn(`[svelte-i18n] The message "${e}" was not found in "${Yu(t).join('", "')}".${Dc(Is())?` -Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const z$={fallbackLocale:null,loadingDelay:200,formats:N$,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},du=z$;function aa(){return du}function H$(t){const e=t,{formats:n}=e,i=P$(e,["formats"]);let l=t.fallbackLocale;if(t.initialLocale)try{A5.resolveLocale(t.initialLocale)&&(l=t.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${t.initialLocale}" is not a valid locale.`)}return i.warnOnMissingMessages&&(delete i.warnOnMissingMessages,i.handleMissingMessage==null?i.handleMissingMessage=B$:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(du,i,{initialLocale:l}),n&&("number"in n&&Object.assign(du.formats.number,n.number),"date"in n&&Object.assign(du.formats.date,n.date),"time"in n&&Object.assign(du.formats.time,n.time)),Sa.set(l)}const k1=Wt(!1);var U$=Object.defineProperty,F$=Object.defineProperties,G$=Object.getOwnPropertyDescriptors,Fk=Object.getOwnPropertySymbols,V$=Object.prototype.hasOwnProperty,W$=Object.prototype.propertyIsEnumerable,Gk=(t,e,n)=>e in t?U$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j$=(t,e)=>{for(var n in e||(e={}))V$.call(e,n)&&Gk(t,n,e[n]);if(Fk)for(var n of Fk(e))W$.call(e,n)&&Gk(t,n,e[n]);return t},$$=(t,e)=>F$(t,G$(e));let hm;const Ic=Wt(null);function Vk(t){return t.split("-").map((e,n,i)=>i.slice(0,n+1).join("-")).reverse()}function Yu(t,e=aa().fallbackLocale){const n=Vk(t);return e?[...new Set([...n,...Vk(e)])]:n}function Is(){return hm??void 0}Ic.subscribe(t=>{hm=t??void 0,typeof window<"u"&&t!=null&&document.documentElement.setAttribute("lang",t)});const q$=t=>{if(t&&E$(t)&&Dc(t)){const{loadingDelay:e}=aa();let n;return typeof window<"u"&&Is()!=null&&e?n=window.setTimeout(()=>k1.set(!0),e):k1.set(!0),D5(t).then(()=>{Ic.set(t)}).finally(()=>{clearTimeout(n),k1.set(!1)})}return Ic.set(t)},Sa=$$(j$({},Ic),{set:q$}),Id=t=>{const e=Object.create(null);return i=>{const l=JSON.stringify(i);return l in e?e[l]:e[l]=t(i)}};var Y$=Object.defineProperty,Rc=Object.getOwnPropertySymbols,I5=Object.prototype.hasOwnProperty,R5=Object.prototype.propertyIsEnumerable,Wk=(t,e,n)=>e in t?Y$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vg=(t,e)=>{for(var n in e||(e={}))I5.call(e,n)&&Wk(t,n,e[n]);if(Rc)for(var n of Rc(e))R5.call(e,n)&&Wk(t,n,e[n]);return t},Ea=(t,e)=>{var n={};for(var i in t)I5.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&Rc)for(var i of Rc(t))e.indexOf(i)<0&&R5.call(t,i)&&(n[i]=t[i]);return n};const Cu=(t,e)=>{const{formats:n}=aa();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},Z$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return i&&(l=Cu("number",i)),new Intl.NumberFormat(n,l)}),X$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return i?l=Cu("date",i):Object.keys(l).length===0&&(l=Cu("date","short")),new Intl.DateTimeFormat(n,l)}),K$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return i?l=Cu("time",i):Object.keys(l).length===0&&(l=Cu("time","short")),new Intl.DateTimeFormat(n,l)}),J$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return Z$(vg({locale:n},i))},Q$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return X$(vg({locale:n},i))},x$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return K$(vg({locale:n},i))},eq=Id((t,e=Is())=>new A5(t,e,aa().formats,{ignoreTag:aa().ignoreTag})),tq=(t,e={})=>{var n,i,l,r;let s=e;typeof t=="object"&&(s=t,t=s.id);const{values:o,locale:a=Is(),default:u}=s;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=L5(t,a);if(!f)f=(r=(l=(i=(n=aa()).handleMissingMessage)==null?void 0:i.call(n,{locale:a,id:t,defaultValue:u}))!=null?l:u)!=null?r:t;else if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f;if(!o)return f;let c=f;try{c=eq(f,a).format(o)}catch(d){d instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,d.message)}return c},nq=(t,e)=>x$(e).format(t),iq=(t,e)=>Q$(e).format(t),lq=(t,e)=>J$(e).format(t),rq=(t,e=Is())=>L5(t,e),ti=ur([Sa,Ta],()=>tq);ur([Sa],()=>nq);ur([Sa],()=>iq);ur([Sa],()=>lq);ur([Sa,Ta],()=>rq);function sq(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}class oq{constructor(){Ki(this,"baseURL");Ki(this,"headers");Ki(this,"onUnauthorizedcallMe");Ki(this,"loggedIn");Ki(this,"jwtToken");Ki(this,"username");const e=localStorage.getItem("jwt"),n=sq();this.baseURL=n+"/api",this.username="",this.headers={Authorization:`Bearer ${e}`},this.onUnauthorizedcallMe=()=>{}}verifyToken(){return this.doCallRaw("/auth/verify").then(async e=>{if(e.status===200){const n=await e.json();return this.jwtToken=localStorage.getItem("jwt")||"",this.setLoggedIn(this.jwtToken,n.Username||""),!0}else return this.setLoggedOut(),!1})}setLoggedIn(e,n){this.jwtToken=e,this.username=n,this.loggedIn=!0}setLoggedOut(){localStorage.removeItem("jwt"),this.username="",this.loggedIn=!1}onUnauthorized(e){this.onUnauthorizedcallMe=e}setHeaders(e){this.headers=e}getHeaders(){const e=localStorage.getItem("jwt");return this.headers.Authorization=`Bearer ${e}`,this.headers}getSetting(e){return new Promise(async(n,i)=>{const l="/settings/"+e;this.doCall(l).then(function(r){n(r)}).catch(function(r){i(r)})})}deleteUser(e){return new Promise(async(n,i)=>{const l="/users/"+e;this.doCall(l,"delete").then(function(r){n(r)}).catch(function(r){i(r)})})}getUsers(){return new Promise(async(e,n)=>{const i="/users";this.doCall(i).then(function(l){e(l)}).catch(function(l){n(l)})})}createUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"post",e).then(function(r){n(r)}).catch(function(r){i(r)})})}updateUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"put",e).then(function(r){n(r)}).catch(function(r){i(r)})})}setSetting(e,n,i){return new Promise(async(l,r)=>{const s="/settings/"+e;var o=i?i(n):{key:e,value:n};this.doCall(s,"post",o).then(function(a){if(a===void 0)throw new Error("Setting update failed");l(!0)}).catch(function(a){r(a)})})}doCallRaw(e="/",n="get",i={}){const l=this,r={method:n,headers:this.getHeaders()};return n==="post"&&(r.body=JSON.stringify(i)),new Promise((o,a)=>{fetch(l.baseURL+e,r).then(u=>{o(u)}).catch(u=>{a(u)})})}async doCall(e="/",n="get",i={},l={}){const r=this,s={method:n,headers:this.getHeaders(),...l};(n==="post"||n==="put")&&(s.body=JSON.stringify(i));try{const o=await fetch(r.baseURL+e,s);if(o.status===401)throw r.onUnauthorizedcallMe(),new Error("Authentication required");if(!o.ok)throw new Error("GateSentry request failed with status "+o.status);return await o.json()}catch(o){throw console.error("Gatesentry API error : [Path "+e+"] [Method "+n+"]",o),o}}}const P5=new oq,{subscribe:aq,update:w1}=Wt({api:P5}),Ln={subscribe:aq,loginSuccesful:(t,e)=>w1(n=>(n.api.setLoggedIn(t,e),n)),logout:()=>w1(t=>(t.api.setLoggedOut(),t)),refresh:()=>w1(t=>t)};P5.onUnauthorized(()=>{Ln.logout()});function Un(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}function Vi(t,e){const n=Un();cj(n+t,e)}function jk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function uq(t){let e,n,i,l=t[1]&&jk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Rs extends Oe{constructor(e){super(),Ee(this,e,fq,uq,Se,{size:0,title:1})}}function $k(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function cq(t){let e,n,i=t[1]&&$k(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class hq extends Oe{constructor(e){super(),Ee(this,e,dq,cq,Se,{size:0,title:1})}}function qk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function mq(t){let e,n,i,l=t[1]&&qk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class _q extends Oe{constructor(e){super(),Ee(this,e,gq,mq,Se,{size:0,title:1})}}function Yk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function pq(t){let e,n,i=t[1]&&Yk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class vq extends Oe{constructor(e){super(),Ee(this,e,bq,pq,Se,{size:0,title:1})}}function Zk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function kq(t){let e,n,i=t[1]&&Zk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class yq extends Oe{constructor(e){super(),Ee(this,e,wq,kq,Se,{size:0,title:1})}}function Xk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Tq(t){let e,n,i=t[1]&&Xk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Eq extends Oe{constructor(e){super(),Ee(this,e,Sq,Tq,Se,{size:0,title:1})}}function Kk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Oq(t){let e,n,i=t[1]&&Kk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Cq extends Oe{constructor(e){super(),Ee(this,e,Mq,Oq,Se,{size:0,title:1})}}function Jk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Aq(t){let e,n,i,l=t[1]&&Jk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let Dq=class extends Oe{constructor(e){super(),Ee(this,e,Lq,Aq,Se,{size:0,title:1})}};function Qk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Iq(t){let e,n,i=t[1]&&Qk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Pq extends Oe{constructor(e){super(),Ee(this,e,Rq,Iq,Se,{size:0,title:1})}}function xk(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Nq(t){let e,n,i=t[1]&&xk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let ec=class extends Oe{constructor(e){super(),Ee(this,e,Bq,Nq,Se,{size:0,title:1})}};function e3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function zq(t){let e,n,i=t[1]&&e3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Uq extends Oe{constructor(e){super(),Ee(this,e,Hq,zq,Se,{size:0,title:1})}}function t3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Fq(t){let e,n,i=t[1]&&t3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let Vq=class extends Oe{constructor(e){super(),Ee(this,e,Gq,Fq,Se,{size:0,title:1})}};function n3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Wq(t){let e,n,i=t[1]&&n3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class $q extends Oe{constructor(e){super(),Ee(this,e,jq,Wq,Se,{size:0,title:1})}}function i3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function qq(t){let e,n,i,l,r,s=t[1]&&i3(t),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],a={};for(let u=0;u{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Zq extends Oe{constructor(e){super(),Ee(this,e,Yq,qq,Se,{size:0,title:1})}}function l3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Xq(t){let e,n,i=t[1]&&l3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Rd extends Oe{constructor(e){super(),Ee(this,e,Kq,Xq,Se,{size:0,title:1})}}function r3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Jq(t){let e,n,i=t[1]&&r3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class xq extends Oe{constructor(e){super(),Ee(this,e,Qq,Jq,Se,{size:0,title:1})}}function s3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function eY(t){let e,n,i,l=t[1]&&s3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class nY extends Oe{constructor(e){super(),Ee(this,e,tY,eY,Se,{size:0,title:1})}}function o3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function iY(t){let e,n,i,l=t[1]&&o3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class rY extends Oe{constructor(e){super(),Ee(this,e,lY,iY,Se,{size:0,title:1})}}function a3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function sY(t){let e,n,i,l=t[1]&&a3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let aY=class extends Oe{constructor(e){super(),Ee(this,e,oY,sY,Se,{size:0,title:1})}};function u3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function uY(t){let e,n,i=t[1]&&u3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class cY extends Oe{constructor(e){super(),Ee(this,e,fY,uY,Se,{size:0,title:1})}}function f3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function dY(t){let e,n,i=t[1]&&f3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class mY extends Oe{constructor(e){super(),Ee(this,e,hY,dY,Se,{size:0,title:1})}}function c3(t){let e,n;return{c(){e=Ie("title"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function gY(t){let e,n,i,l=t[1]&&c3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class d3 extends Oe{constructor(e){super(),Ee(this,e,_Y,gY,Se,{size:0,title:1})}}const Pc=[{type:"link",text:"Home",href:"/",icon:Vq},{type:"link",text:"Logs",href:"/logs",icon:_q},{type:"link",text:"Settings",href:"/settings",icon:aY},{type:"link",text:"DNS",href:"/dns",icon:rY},{type:"link",text:"Devices",href:"/devices",icon:Dq},{type:"link",text:"Policies",href:"/rules",icon:nY},{type:"link",text:"Services",href:"/services",icon:cY},{type:"menu",text:"HTTPS inspection",icon:$q,children:[{type:"link",text:"Blocked keywords",href:"/blockedkeywords",icon:ec},{type:"link",text:"Blocked content types",href:"/blockedfiletypes",icon:ec},{type:"link",text:"Sites not inspected",href:"/excludehosts",icon:ec},{type:"link",text:"URLs not inspected",href:"/excludeurls",icon:ec}]},{type:"link",text:"Stats",href:"/stats",icon:Uq},{type:"link",text:"AI",href:"/ai",icon:Zq},{type:"link",text:"Users",href:"/users",icon:mY}];function Oa(t){return Un()+t}function Pd(t=window.location.pathname){const e=Un();return e&&(t===e||t.startsWith(e+"/"))&&(t=t.slice(e.length)||"/"),t||"/"}function fr(t,e=Pd()){return t==="/"?e==="/":e===t||e.startsWith(t+"/")}function Nc(t,e=Pd()){return t.type==="link"?fr(t.href,e):t.children.some(n=>fr(n.href,e))}function h3(t,e,n){const i=t.slice();return i[8]=e[n],i}function m3(t,e,n){const i=t.slice();return i[11]=e[n],i}function pY(t){let e,n;return e=new YV({props:{text:t[8].text,href:Oa(t[8].children[0].href),expanded:Nc(t[8],t[0]),$$slots:{default:[vY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.expanded=Nc(i[8],i[0])),l&16385&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bY(t){let e,n;function i(...l){return t[6](t[8],...l)}return e=new s5({props:{text:t[8].text,href:Oa(t[8].href),isSelected:fr(t[8].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[8].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function g3(t){let e,n;function i(...l){return t[7](t[11],...l)}return e=new s5({props:{text:t[11].text,href:Oa(t[11].href),isSelected:fr(t[11].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[11].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function vY(t){let e,n,i=it(t[8].children),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sn(5,l=c));const o=(c,d)=>{c.preventDefault(),Vi(d)},a=c=>c.type==="link"?c.href:"/",u=(c,d)=>o(d,a(c)),f=(c,d)=>o(d,c.href);return t.$$set=c=>{"pathname"in c&&n(4,r=c.pathname)},t.$$.update=()=>{t.$$.dirty&48&&n(0,i=l!=null&&l.pathname?Pd(l.pathname):r)},[i,s,o,a,r,l,u,f]}class TY extends Oe{constructor(e){super(),Ee(this,e,yY,wY,Se,{pathname:4})}}const N5=(t,e)=>({kind:t.kind??"error",title:t.title??e("Error"),subtitle:t.subtitle??e("Unable to perform action"),timeout:t.timeout??3e4}),Ma=(t,e)=>N5({...t,kind:"success",timeout:2e3,title:e("Success")},e),Ss=(t,e)=>N5({...t,kind:"error",timeout:3e4},e),p3=t=>{const e=["Bytes","KB","MB","GB","TB"];if(t===0)return"0 B";const n=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,n))+" "+e[n]},{subscribe:SY,update:y1}=Wt([]),Ei={subscribe:SY,add:({title:t,subtitle:e,kind:n,timeout:i=1e3})=>y1(l=>[...l,{id:l.length+1,title:t,subtitle:e,kind:n,timeout:i}]),remove:t=>y1(e=>e.filter(n=>n.id!==t.id)),refresh:()=>y1(t=>t)};function EY(t){let e,n;return e=new Wi({props:{description:t[9]("Saving setting…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.description=i[9]("Saving setting…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OY(t){let e,n;return e=new Wi({props:{description:t[9]("Loading setting…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.description=i[9]("Loading setting…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MY(t){let e,n,i,l,r,s,o;n=new ei({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5]||t[7]||t[8],value:(t[6]&&t[6][t[0]])??""}}),n.$on("blur",t[10]);const a=[OY,EY],u=[];function f(c,d){return c[7]?0:c[8]?1:-1}return~(l=f(t))&&(r=u[l]=a[l](t)),{c(){e=P("div"),U(n.$$.fragment),i=F(),r&&r.c(),I(e,"class","connected-setting svelte-jacaop"),I(e,"aria-busy",s=t[7]||t[8])},m(c,d){O(c,e,d),z(n,e,null),w(e,i),~l&&u[l].m(e,null),o=!0},p(c,[d]){const h={};d&4&&(h.title=c[2]),d&2&&(h.labelText=c[1]),d&8&&(h.helperText=c[3]),d&16&&(h.type=c[4]),d&416&&(h.disabled=c[5]||c[7]||c[8]),d&65&&(h.value=(c[6]&&c[6][c[0]])??""),n.$set(h);let g=l;l=f(c),l===g?~l&&u[l].p(c,d):(r&&(ue(),v(u[g],1,1,()=>{u[g]=null}),fe()),~l?(r=u[l],r?r.p(c,d):(r=u[l]=a[l](c),r.c()),p(r,1),r.m(e,null)):r=null),(!o||d&384&&s!==(s=c[7]||c[8]))&&I(e,"aria-busy",s)},i(c){o||(p(n.$$.fragment,c),p(r),o=!0)},o(c){v(n.$$.fragment,c),v(r),o=!1},d(c){c&&E(e),H(n),~l&&u[l].d()}}}const b3="general_settings";function CY(t,e,n){let i,l;ct(t,ti,C=>n(9,i=C)),ct(t,Ln,C=>n(14,l=C));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a=""}=e,{type:u="text"}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null,g=!0,_=!1;const k=async()=>{h&&await M(h)},y=()=>{Ei.add(Ss({subtitle:i("Unable to load settings")},i))},T=async()=>{n(7,g=!0);try{const C=await l.api.getSetting(b3);n(6,d=JSON.parse(C.Value))}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)"),y()}finally{n(7,g=!1)}},M=async C=>{n(8,_=!0);try{if(await l.api.setSetting(b3,JSON.stringify(C))===!1){Ei.add(Ss({subtitle:i("Unable to save setting")},i));return}if(Ei.add(Ma({subtitle:i("Setting updated")},i)),h=null,r==="admin_password"||r==="admin_username"){Ln.logout(),Vi("/login");return}await T()}catch{Ei.add(Ss({subtitle:i("Unable to save setting")},i))}finally{n(8,_=!1)}},A=async C=>{if(!d)return;const D=C.currentTarget.value;D!==d[r]&&(h={...d,[r]:D},c||await M(h))};return sn(T),t.$$set=C=>{"keyName"in C&&n(0,r=C.keyName),"labelText"in C&&n(1,s=C.labelText),"title"in C&&n(2,o=C.title),"helperText"in C&&n(3,a=C.helperText),"type"in C&&n(4,u=C.type),"disabled"in C&&n(5,f=C.disabled),"disableOnblur"in C&&n(11,c=C.disableOnblur)},[r,s,o,a,u,f,d,g,_,i,A,c,k]}class B5 extends Oe{constructor(e){super(),Ee(this,e,CY,MY,Se,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:11,updateDataOnBackend:12})}get updateDataOnBackend(){return this.$$.ctx[12]}}function AY(t){let e=t[4].api.username?`Logged in as ${t[4].api.username}`:"Logged in",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4].api.username?`Logged in as ${i[4].api.username}`:"Logged in")&&Y(n,e)},d(i){i&&E(n)}}}function LY(t){let e=t[3]("Change password")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&8&&e!==(e=i[3]("Change password")+"")&&Y(n,e)},d(i){i&&E(n)}}}function DY(t){let e=t[3]("Log out")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&8&&e!==(e=i[3]("Log out")+"")&&Y(n,e)},d(i){i&&E(n)}}}function IY(t){let e,n,i,l,r,s;return e=new JV({props:{$$slots:{default:[AY]},$$scope:{ctx:t}}}),i=new bk({props:{$$slots:{default:[LY]},$$scope:{ctx:t}}}),i.$on("click",t[7]),r=new bk({props:{$$slots:{default:[DY]},$$scope:{ctx:t}}}),r.$on("click",t[5]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&4112&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&4104&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&4104&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function RY(t){let e,n;return e=new lW({props:{$$slots:{default:[IY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4124&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function PY(t){let e,n,i;function l(s){t[9](s)}let r={keyName:"admin_password",helperText:t[3]("Leave blank to keep the current password"),type:"password",title:t[3]("Password"),labelText:t[3]("Password"),disableOnblur:!0};return t[1]!==void 0&&(r.updateDataOnBackend=t[1]),e=new B5({props:r}),xe.push(()=>At(e,"updateDataOnBackend",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&8&&(a.helperText=s[3]("Leave blank to keep the current password")),o&8&&(a.title=s[3]("Password")),o&8&&(a.labelText=s[3]("Password")),!n&&o&2&&(n=!0,a.updateDataOnBackend=s[1],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function NY(t){let e,n,i,l,r,s;return e=new Od({props:{title:t[3]("Update password")}}),i=new Md({props:{hasForm:!0,$$slots:{default:[PY]},$$scope:{ctx:t}}}),r=new Cd({props:{secondaryButtonText:t[3]("Cancel"),primaryButtonText:t[3]("Update password")}}),r.$on("click:button--secondary",t[10]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&8&&(u.title=o[3]("Update password")),e.$set(u);const f={};a&4106&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&8&&(c.secondaryButtonText=o[3]("Cancel")),a&8&&(c.primaryButtonText=o[3]("Update password")),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function BY(t){let e,n,i,l,r,s;function o(c){t[8](c)}let a={icon:d3,closeIcon:d3,text:t[3]("Account"),$$slots:{default:[RY]},$$scope:{ctx:t}};t[0]!==void 0&&(a.isOpen=t[0]),e=new NV({props:a}),xe.push(()=>At(e,"isOpen",o));function u(c){t[11](c)}let f={$$slots:{default:[NY]},$$scope:{ctx:t}};return t[2]!==void 0&&(f.open=t[2]),l=new Ed({props:f}),xe.push(()=>At(l,"open",u)),l.$on("submit",t[6]),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment)},m(c,d){z(e,c,d),O(c,i,d),z(l,c,d),s=!0},p(c,d){const h={};d&8&&(h.text=c[3]("Account")),d&4124&&(h.$$scope={dirty:d,ctx:c}),!n&&d&1&&(n=!0,h.isOpen=c[0],Ct(()=>n=!1)),e.$set(h);const g={};d&4110&&(g.$$scope={dirty:d,ctx:c}),!r&&d&4&&(r=!0,g.open=c[2],Ct(()=>r=!1)),l.$set(g)},i(c){s||(p(e.$$.fragment,c),p(l.$$.fragment,c),s=!0)},o(c){v(e.$$.fragment,c),v(l.$$.fragment,c),s=!1},d(c){c&&E(i),H(e,c),H(l,c)}}}function zY(t){let e,n;return e=new aW({props:{$$slots:{default:[BY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&4127&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function HY(t,e,n){let i,l;ct(t,ti,_=>n(3,i=_)),ct(t,Ln,_=>n(4,l=_));let{userProfilePanelOpen:r=!1}=e,s,o=!1;const a=()=>{Ln.logout(),n(0,r=!1),n(2,o=!1),Vi("/login",{replace:!0})},u=()=>{n(2,o=!1),s==null||s()},f=()=>n(2,o=!0);function c(_){r=_,n(0,r)}function d(_){s=_,n(1,s)}const h=()=>n(2,o=!1);function g(_){o=_,n(2,o)}return t.$$set=_=>{"userProfilePanelOpen"in _&&n(0,r=_.userProfilePanelOpen)},[r,s,o,i,l,a,u,f,c,d,h,g]}class UY extends Oe{constructor(e){super(),Ee(this,e,HY,zY,Se,{userProfilePanelOpen:0})}}function FY(t){let e,n,i,l,r;e=new TY({props:{pathname:t[2]}});function s(a){t[4](a)}let o={};return t[1]!==void 0&&(o.userProfilePanelOpen=t[1]),i=new UY({props:o}),xe.push(()=>At(i,"userProfilePanelOpen",s)),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(a,u){z(e,a,u),O(a,n,u),z(i,a,u),r=!0},p(a,u){const f={};u&4&&(f.pathname=a[2]),e.$set(f);const c={};!l&&u&2&&(l=!0,c.userProfilePanelOpen=a[1],Ct(()=>l=!1)),i.$set(c)},i(a){r||(p(e.$$.fragment,a),p(i.$$.fragment,a),r=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),r=!1},d(a){a&&E(n),H(e,a),H(i,a)}}}function GY(t){let e,n;return e=new WW({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function VY(t){let e,n,i;function l(s){t[5](s)}let r={company:"GateSentry",platformName:t[3],href:Oa("/"),persistentHamburgerMenu:!0,$$slots:{"skip-to-content":[GY],default:[FY]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.isSideNavOpen=t[0]),e=new vV({props:r}),xe.push(()=>At(e,"isSideNavOpen",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,[o]){const a={};o&8&&(a.platformName=s[3]),o&134&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.isSideNavOpen=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function WY(t,e,n){let i;ct(t,Ln,f=>n(6,i=f));let{isSideNavOpen:l=!1}=e,{userProfilePanelOpen:r=!1}=e,{pathname:s="/"}=e,o="";sn(async()=>{try{const f=await i.api.doCall("/about");n(3,o=(f==null?void 0:f.version)||"")}catch{n(3,o="")}});function a(f){r=f,n(1,r)}function u(f){l=f,n(0,l)}return t.$$set=f=>{"isSideNavOpen"in f&&n(0,l=f.isSideNavOpen),"userProfilePanelOpen"in f&&n(1,r=f.userProfilePanelOpen),"pathname"in f&&n(2,s=f.pathname)},[l,r,s,o,a,u]}class jY extends Oe{constructor(e){super(),Ee(this,e,WY,VY,Se,{isSideNavOpen:0,userProfilePanelOpen:1,pathname:2})}}function v3(t,e,n){const i=t.slice();return i[9]=e[n],i}function k3(t,e,n){const i=t.slice();return i[12]=e[n],i}function $Y(t){let e,n;return e=new AW({props:{icon:t[9].icon,text:t[9].text,expanded:Nc(t[9],t[0]),$$slots:{default:[YY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.expanded=Nc(i[9],i[0])),l&32769&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qY(t){let e,n;function i(...l){return t[7](t[9],...l)}return e=new TW({props:{icon:t[9].icon,text:t[9].text,href:Oa(t[9].href),isSelected:fr(t[9].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[9].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function w3(t){let e,n;function i(...l){return t[8](t[12],...l)}return e=new PW({props:{text:t[12].text,href:Oa(t[12].href),isSelected:fr(t[12].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[12].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function YY(t){let e,n,i=it(t[9].children),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sv(r[o],1,1,()=>{r[o]=null});return n=new YW({}),{c(){for(let o=0;o{}}=e;const o=o5();ct(t,o,d=>n(6,l=d));const a=(d,h)=>{d.preventDefault(),Vi(h),s()},u=d=>d.type==="link"?d.href:"/",f=(d,h)=>a(h,u(d)),c=(d,h)=>a(h,d.href);return t.$$set=d=>{"pathname"in d&&n(4,r=d.pathname),"onNavigate"in d&&n(5,s=d.onNavigate)},t.$$.update=()=>{t.$$.dirty&80&&n(0,i=l!=null&&l.pathname?Pd(l.pathname):r)},[i,o,a,u,r,s,l,f,c]}class JY extends Oe{constructor(e){super(),Ee(this,e,KY,XY,Se,{pathname:4,onNavigate:5})}}function T3(t,e,n){const i=t.slice();return i[2]=e[n],i}function S3(t,e){let n,i,l;function r(){return e[1](e[2])}return i=new gU({props:{kind:e[2].kind,title:e[2].title,subtitle:e[2].subtitle,timeout:e[2].timeout}}),i.$on("close",r),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(s,o){O(s,n,o),z(i,s,o),l=!0},p(s,o){e=s;const a={};o&1&&(a.kind=e[2].kind),o&1&&(a.title=e[2].title),o&1&&(a.subtitle=e[2].subtitle),o&1&&(a.timeout=e[2].timeout),i.$set(a)},i(s){l||(p(i.$$.fragment,s),l=!0)},o(s){v(i.$$.fragment,s),l=!1},d(s){s&&E(n),H(i,s)}}}function QY(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[2].id;for(let o=0;on(0,i=r)),[i,r=>Ei.remove(r)]}class eZ extends Oe{constructor(e){super(),Ee(this,e,xY,QY,Se,{})}}const tZ=t=>({}),E3=t=>({});function O3(t){let e,n;return{c(){e=P("p"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function M3(t){let e,n;const i=t[4].footer,l=He(i,t,t[3],E3);return{c(){e=P("footer"),l&&l.c(),I(e,"class","auth-shell__footer")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&8)&&Fe(l,i,r,r[3],n?Ue(i,r[3],s,tZ):Ge(r[3]),E3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function nZ(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[1]&&O3(t);const h=t[4].default,g=He(h,t,t[3],null);let _=t[2].footer&&M3(t);return{c(){e=P("main"),n=P("section"),i=P("div"),i.textContent="GateSentry",l=F(),r=P("header"),s=P("h1"),o=j(t[0]),a=F(),d&&d.c(),u=F(),g&&g.c(),f=F(),_&&_.c(),I(i,"class","auth-shell__brand"),I(s,"id","auth-shell-title"),I(r,"class","auth-shell__header"),I(n,"class","auth-shell__card"),I(n,"aria-labelledby","auth-shell-title"),I(e,"class","auth-shell")},m(k,y){O(k,e,y),w(e,n),w(n,i),w(n,l),w(n,r),w(r,s),w(s,o),w(r,a),d&&d.m(r,null),w(n,u),g&&g.m(n,null),w(e,f),_&&_.m(e,null),c=!0},p(k,[y]){(!c||y&1)&&Y(o,k[0]),k[1]?d?d.p(k,y):(d=O3(k),d.c(),d.m(r,null)):d&&(d.d(1),d=null),g&&g.p&&(!c||y&8)&&Fe(g,h,k,k[3],c?Ue(h,k[3],y,null):Ge(k[3]),null),k[2].footer?_?(_.p(k,y),y&4&&p(_,1)):(_=M3(k),_.c(),p(_,1),_.m(e,null)):_&&(ue(),v(_,1,1,()=>{_=null}),fe())},i(k){c||(p(g,k),p(_),c=!0)},o(k){v(g,k),v(_),c=!1},d(k){k&&E(e),d&&d.d(),g&&g.d(k),_&&_.d()}}}function iZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e;return t.$$set=a=>{"title"in a&&n(0,s=a.title),"description"in a&&n(1,o=a.description),"$$scope"in a&&n(3,l=a.$$scope)},[s,o,r,l,i]}class Nd extends Oe{constructor(e){super(),Ee(this,e,iZ,nZ,Se,{title:0,description:1})}}function lZ(t){let e,n=(t[1]||"Nothing here yet")+"",i,l,r,s,o=t[2]&&C3(t);const a=t[5].default,u=He(a,t,t[6],null);return{c(){e=P("h2"),i=j(n),l=F(),o&&o.c(),r=F(),u&&u.c()},m(f,c){O(f,e,c),w(e,i),O(f,l,c),o&&o.m(f,c),O(f,r,c),u&&u.m(f,c),s=!0},p(f,c){(!s||c&2)&&n!==(n=(f[1]||"Nothing here yet")+"")&&Y(i,n),f[2]?o?o.p(f,c):(o=C3(f),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null),u&&u.p&&(!s||c&64)&&Fe(u,a,f,f[6],s?Ue(a,f[6],c,null):Ge(f[6]),null)},i(f){s||(p(u,f),s=!0)},o(f){v(u,f),s=!1},d(f){f&&(E(e),E(l),E(r)),o&&o.d(f),u&&u.d(f)}}}function rZ(t){let e,n,i,l;e=new nn({props:{kind:"error",hideCloseButton:!0,title:t[1]||"Unable to load",subtitle:t[2]}});let r=t[4]&&A3(t);return{c(){U(e.$$.fragment),n=F(),r&&r.c(),i=je()},m(s,o){z(e,s,o),O(s,n,o),r&&r.m(s,o),O(s,i,o),l=!0},p(s,o){const a={};o&2&&(a.title=s[1]||"Unable to load"),o&4&&(a.subtitle=s[2]),e.$set(a),s[4]?r?(r.p(s,o),o&16&&p(r,1)):(r=A3(s),r.c(),p(r,1),r.m(i.parentNode,i)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){l||(p(e.$$.fragment,s),p(r),l=!0)},o(s){v(e.$$.fragment,s),v(r),l=!1},d(s){s&&(E(n),E(i)),H(e,s),r&&r.d(s)}}}function sZ(t){let e,n;return e=new Wi({props:{description:t[2]||t[1]||"Loading"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&6&&(r.description=i[2]||i[1]||"Loading"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function C3(t){let e,n;return{c(){e=P("p"),n=j(t[2])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&4&&Y(n,i[2])},d(i){i&&E(e)}}}function A3(t){let e,n;return e=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[oZ]},$$scope:{ctx:t}}}),e.$on("click",function(){lo(t[4])&&t[4].apply(this,arguments)}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){t=i;const r={};l&72&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oZ(t){let e;return{c(){e=j(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function aZ(t){let e,n,i,l;const r=[sZ,rZ,lZ],s=[];function o(a,u){return a[0]==="loading"?0:a[0]==="error"?1:2}return n=o(t),i=s[n]=r[n](t),{c(){e=P("div"),i.c(),I(e,"class","resource-state"),S(e,"resource-state--error",t[0]==="error")},m(a,u){O(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),p(i,1),i.m(e,null)),(!l||u&1)&&S(e,"resource-state--error",a[0]==="error")},i(a){l||(p(i),l=!0)},o(a){v(i),l=!1},d(a){a&&E(e),s[n].d()}}}function uZ(t,e,n){let{$$slots:i={},$$scope:l}=e,{state:r="loading"}=e,{title:s=""}=e,{message:o=""}=e,{retryLabel:a="Retry"}=e,{onRetry:u=null}=e;return t.$$set=f=>{"state"in f&&n(0,r=f.state),"title"in f&&n(1,s=f.title),"message"in f&&n(2,o=f.message),"retryLabel"in f&&n(3,a=f.retryLabel),"onRetry"in f&&n(4,u=f.onRetry),"$$scope"in f&&n(6,l=f.$$scope)},[r,s,o,a,u,i,l]}class hi extends Oe{constructor(e){super(),Ee(this,e,uZ,aZ,Se,{state:0,title:1,message:2,retryLabel:3,onRetry:4})}}function fZ(t){let e=t[0]("Download certificate")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&1&&e!==(e=i[0]("Download certificate")+"")&&Y(n,e)},d(i){i&&E(n)}}}function cZ(t){let e,n;return e=new bt({props:{href:t[1],icon:Pq,kind:"tertiary",size:"small",download:!0,$$slots:{default:[fZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&5&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function dZ(t,e,n){let i;ct(t,ti,r=>n(0,i=r));const l=Un()+"/api/files/certificate";return[i,l]}class z5 extends Oe{constructor(e){super(),Ee(this,e,dZ,cZ,Se,{})}}function hZ(t){let e=t[5]("Clear")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Clear")+"")&&Y(n,e)},d(i){i&&E(n)}}}function mZ(t){let e=(t[4]?t[5]("Signing in…"):t[5]("Sign in"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&48&&e!==(e=(i[4]?i[5]("Signing in…"):i[5]("Sign in"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function gZ(t){let e,n,i,l;return e=new bt({props:{size:"lg",kind:"secondary",icon:Cq,type:"button",disabled:t[4]||!t[0]&&!t[1],$$slots:{default:[hZ]},$$scope:{ctx:t}}}),e.$on("click",t[7]),i=new bt({props:{size:"lg",type:"submit",icon:yq,disabled:t[4]||!t[0]||!t[1],$$slots:{default:[mZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&19&&(o.disabled=r[4]||!r[0]&&!r[1]),s&4128&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&19&&(a.disabled=r[4]||!r[0]||!r[1]),s&4144&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function _Z(t){let e,n,i,l,r,s,o,a;function u(h){t[8](h)}let f={invalid:t[3],autocomplete:"username",labelText:t[5]("User name"),placeholder:t[5]("Enter user name"),required:!0,invalidText:t[2]};t[0]!==void 0&&(f.value=t[0]),e=new ei({props:f}),xe.push(()=>At(e,"value",u));function c(h){t[9](h)}let d={invalid:t[3],autocomplete:"current-password",required:!0,labelText:t[5]("Password"),placeholder:t[5]("Enter password"),invalidText:t[2]};return t[1]!==void 0&&(d.value=t[1]),l=new x1({props:d}),xe.push(()=>At(l,"value",c)),o=new MR({props:{stacked:!0,$$slots:{default:[gZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment),s=F(),U(o.$$.fragment)},m(h,g){z(e,h,g),O(h,i,g),z(l,h,g),O(h,s,g),z(o,h,g),a=!0},p(h,g){const _={};g&8&&(_.invalid=h[3]),g&32&&(_.labelText=h[5]("User name")),g&32&&(_.placeholder=h[5]("Enter user name")),g&4&&(_.invalidText=h[2]),!n&&g&1&&(n=!0,_.value=h[0],Ct(()=>n=!1)),e.$set(_);const k={};g&8&&(k.invalid=h[3]),g&32&&(k.labelText=h[5]("Password")),g&32&&(k.placeholder=h[5]("Enter password")),g&4&&(k.invalidText=h[2]),!r&&g&2&&(r=!0,k.value=h[1],Ct(()=>r=!1)),l.$set(k);const y={};g&4147&&(y.$$scope={dirty:g,ctx:h}),o.$set(y)},i(h){a||(p(e.$$.fragment,h),p(l.$$.fragment,h),p(o.$$.fragment,h),a=!0)},o(h){v(e.$$.fragment,h),v(l.$$.fragment,h),v(o.$$.fragment,h),a=!1},d(h){h&&(E(i),E(s)),H(e,h),H(l,h),H(o,h)}}}function pZ(t){let e,n;return e=new JT({props:{$$slots:{default:[_Z]},$$scope:{ctx:t}}}),e.$on("submit",t[6]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bZ(t){let e,n;return e=new z5({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function vZ(t){let e,n;return e=new Nd({props:{title:t[5]("Sign in"),description:t[5]("Manage protection, policies, and connected devices."),$$slots:{footer:[bZ],default:[pZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&32&&(r.title=i[5]("Sign in")),l&32&&(r.description=i[5]("Manage protection, policies, and connected devices.")),l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function kZ(t,e,n){let i,l;ct(t,ti,_=>n(5,i=_)),ct(t,Ln,_=>n(10,l=_));let r="",s="",o="",a=!1,u=!1;const f=on();localStorage.removeItem("password"),localStorage.removeItem("rememberMe");const c=async _=>{_.preventDefault(),n(3,a=!1),n(2,o=""),n(4,u=!0);try{const k=await l.api.doCall("/auth/token","post",{username:r,pass:s});if((k==null?void 0:k.Validated)===!0||(k==null?void 0:k.Validated)==="true"){localStorage.removeItem("jwt"),localStorage.setItem("jwt",k.Jwtoken),n(1,s=""),Ln.loginSuccesful(k.Jwtoken,k.Username||""),f("authenticated"),Vi("/",{replace:!0});return}n(2,o=i("Invalid username or password")),n(3,a=!0)}catch{Ei.add(Ss({subtitle:i("Unable to contact GateSentry. Try again.")},i))}finally{n(4,u=!1)}},d=()=>{n(0,r=""),n(1,s=""),n(3,a=!1),n(2,o="")};function h(_){r=_,n(0,r)}function g(_){s=_,n(1,s)}return[r,s,o,a,u,i,c,d,h,g]}class wZ extends Oe{constructor(e){super(),Ee(this,e,kZ,vZ,Se,{})}}const Bc=12,zc=72;function H5(t){return new TextEncoder().encode(t).length}function yZ(t){const e=H5(t);return e>=Bc&&e<=zc}function L3(t){let e,n;return{c(){e=P("p"),n=j(t[6]),I(e,"class","form-message form-message--error svelte-1u8dzph"),I(e,"role","alert")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function D3(t){let e,n;return e=new bt({props:{type:"button",kind:"secondary",$$slots:{default:[TZ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function TZ(t){let e;return{c(){e=j("Retry status check")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function I3(t){let e,n;return{c(){e=P("p"),n=j(t[10]),I(e,"class","hint svelte-1u8dzph"),I(e,"aria-live","polite")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1024&&Y(n,i[10])},d(i){i&&E(e)}}}function SZ(t){let e=t[7]?"Completing setup…":"Complete setup",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&128&&e!==(e=i[7]?"Completing setup…":"Complete setup")&&Y(n,e)},d(i){i&&E(n)}}}function EZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=t[6]&&L3(t),k=t[9]&&D3(t);function y(N){t[17](N)}let T={required:!0,autocomplete:"username",labelText:"Administrator username"};t[0]!==void 0&&(T.value=t[0]),i=new ei({props:T}),xe.push(()=>At(i,"value",y));function M(N){t[18](N)}let A={required:!0,autocomplete:"new-password",labelText:"Password",helperText:`Use ${Bc} to ${zc} UTF-8 bytes.`,invalid:t[5],invalidText:t[4]};t[1]!==void 0&&(A.value=t[1]),s=new x1({props:A}),xe.push(()=>At(s,"value",M));function C(N){t[19](N)}let D={required:!0,autocomplete:"new-password",labelText:"Confirm password",invalid:t[3],invalidText:"Passwords do not match."};t[2]!==void 0&&(D.value=t[2]),u=new x1({props:D}),xe.push(()=>At(u,"value",C));let R=t[8]&&t[10]&&I3(t);return h=new bt({props:{type:"submit",disabled:!t[8]||t[7]||t[11]!=="",$$slots:{default:[SZ]},$$scope:{ctx:t}}}),{c(){_&&_.c(),e=F(),k&&k.c(),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),c=F(),R&&R.c(),d=F(),U(h.$$.fragment)},m(N,G){_&&_.m(N,G),O(N,e,G),k&&k.m(N,G),O(N,n,G),z(i,N,G),O(N,r,G),z(s,N,G),O(N,a,G),z(u,N,G),O(N,c,G),R&&R.m(N,G),O(N,d,G),z(h,N,G),g=!0},p(N,G){N[6]?_?_.p(N,G):(_=L3(N),_.c(),_.m(e.parentNode,e)):_&&(_.d(1),_=null),N[9]?k?(k.p(N,G),G&512&&p(k,1)):(k=D3(N),k.c(),p(k,1),k.m(n.parentNode,n)):k&&(ue(),v(k,1,1,()=>{k=null}),fe());const B={};!l&&G&1&&(l=!0,B.value=N[0],Ct(()=>l=!1)),i.$set(B);const $={};G&32&&($.invalid=N[5]),G&16&&($.invalidText=N[4]),!o&&G&2&&(o=!0,$.value=N[1],Ct(()=>o=!1)),s.$set($);const q={};G&8&&(q.invalid=N[3]),!f&&G&4&&(f=!0,q.value=N[2],Ct(()=>f=!1)),u.$set(q),N[8]&&N[10]?R?R.p(N,G):(R=I3(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null);const V={};G&2432&&(V.disabled=!N[8]||N[7]||N[11]!==""),G&1048704&&(V.$$scope={dirty:G,ctx:N}),h.$set(V)},i(N){g||(p(k),p(i.$$.fragment,N),p(s.$$.fragment,N),p(u.$$.fragment,N),p(h.$$.fragment,N),g=!0)},o(N){v(k),v(i.$$.fragment,N),v(s.$$.fragment,N),v(u.$$.fragment,N),v(h.$$.fragment,N),g=!1},d(N){N&&(E(e),E(n),E(r),E(a),E(c),E(d)),_&&_.d(N),k&&k.d(N),H(i,N),H(s,N),H(u,N),R&&R.d(N),H(h,N)}}}function OZ(t){let e,n;return e=new JT({props:{$$slots:{default:[EZ]},$$scope:{ctx:t}}}),e.$on("submit",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MZ(t){let e,n;return e=new Nd({props:{title:"Set up GateSentry",description:"Create the administrator account for this installation.",$$slots:{default:[OZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function CZ(t,e,n){let i,l,r,s,o,a,u,f,c="",d="",h="",g="",_=!1,k=!1,y=!1;async function T(){n(9,y=!1),n(6,g="");try{const R=await fetch(Un()+"/api/setup/status");if(!R.ok)throw new Error("setup status failed");if((await R.json()).complete){Vi("/login");return}n(8,k=!0)}catch{n(9,y=!0),n(6,g="Unable to read setup status.")}}T();async function M(R){if(R.preventDefault(),n(6,g=""),!l){n(6,g=`Password must contain between ${Bc} and ${zc} UTF-8 bytes.`);return}if(d!==h){n(6,g="Passwords do not match.");return}n(7,_=!0);try{const N=await fetch(Un()+"/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c,password:d})});if(!N.ok){n(6,g=N.status===409?"Setup was already completed. Sign in instead.":"Setup could not be completed.");return}n(1,d=""),n(2,h=""),window.location.assign(Un()+"/login")}catch{n(6,g="Unable to contact GateSentry.")}finally{n(7,_=!1)}}function A(R){c=R,n(0,c)}function C(R){d=R,n(1,d)}function D(R){h=R,n(2,h)}return t.$$.update=()=>{t.$$.dirty&2&&n(16,i=H5(d)),t.$$.dirty&2&&n(14,l=yZ(d)),t.$$.dirty&16386&&n(5,r=d.length>0&&!l),t.$$.dirty&65536&&n(4,s=`Password must contain between ${Bc} and ${zc} UTF-8 bytes (currently ${i}).`),t.$$.dirty&6&&n(3,o=h.length>0&&d!==h),t.$$.dirty&63&&n(15,a=c?d.length===0?{message:"Enter a password.",field:""}:r?{message:s,field:"password"}:h.length===0?{message:"Re-enter the password to confirm it.",field:""}:o?{message:"Passwords do not match.",field:"confirmation"}:{message:"",field:""}:{message:"Enter an administrator username.",field:""}),t.$$.dirty&32768&&n(11,u=a.message),t.$$.dirty&32768&&n(10,f=a.field===""?a.message:"")},[c,d,h,o,s,r,g,_,k,y,f,u,T,M,l,a,i,A,C,D]}class AZ extends Oe{constructor(e){super(),Ee(this,e,CZ,MZ,Se,{})}}var LZ=["second","minute","hour","day","week","month","year"];function DZ(t,e){if(e===0)return["just now","right now"];var n=LZ[Math.floor(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]}var IZ=["秒","分钟","小时","天","周","个月","年"];function RZ(t,e){if(e===0)return["刚刚","片刻后"];var n=IZ[~~(e/2)];return[t+" "+n+"前",t+" "+n+"后"]}var mm={},U5=function(t,e){mm[t]=e},PZ=function(t){return mm[t]||mm.en_US},T1=[60,60,24,7,365/7/12,12];function R3(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}function NZ(t,e){var n=t<0?1:0;t=Math.abs(t);for(var i=t,l=0;t>=T1[l]&&l(l===0?9:1)&&(l+=1),e(t,l,i)[n].replace("%s",t.toString())}function BZ(t,e){var n=e?R3(e):new Date;return(+n-+R3(t))/1e3}var zZ=function(t,e,n){var i=BZ(t,n&&n.relativeDate);return NZ(i,PZ(e))};U5("en_US",DZ);U5("zh_CN",RZ);function HZ(t){var i;const e=new Map,n=new Map;for(const l of t||[])for(const r of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.set(r,(n.get(r)||0)+1);for(const l of t||[]){const r=(i=l.manual_name)==null?void 0:i.trim();if(r)for(const s of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.get(s)===1&&e.set(s,r)}return e}function UZ(t,e){const n=t.get(e);return n?`${n} (${e})`:e}var Hc={exports:{}};/** +Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const z$={fallbackLocale:null,loadingDelay:200,formats:N$,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},du=z$;function aa(){return du}function H$(t){const e=t,{formats:n}=e,i=P$(e,["formats"]);let l=t.fallbackLocale;if(t.initialLocale)try{A5.resolveLocale(t.initialLocale)&&(l=t.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${t.initialLocale}" is not a valid locale.`)}return i.warnOnMissingMessages&&(delete i.warnOnMissingMessages,i.handleMissingMessage==null?i.handleMissingMessage=B$:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(du,i,{initialLocale:l}),n&&("number"in n&&Object.assign(du.formats.number,n.number),"date"in n&&Object.assign(du.formats.date,n.date),"time"in n&&Object.assign(du.formats.time,n.time)),Sa.set(l)}const k1=Wt(!1);var U$=Object.defineProperty,F$=Object.defineProperties,G$=Object.getOwnPropertyDescriptors,Fk=Object.getOwnPropertySymbols,V$=Object.prototype.hasOwnProperty,W$=Object.prototype.propertyIsEnumerable,Gk=(t,e,n)=>e in t?U$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j$=(t,e)=>{for(var n in e||(e={}))V$.call(e,n)&&Gk(t,n,e[n]);if(Fk)for(var n of Fk(e))W$.call(e,n)&&Gk(t,n,e[n]);return t},$$=(t,e)=>F$(t,G$(e));let hm;const Ic=Wt(null);function Vk(t){return t.split("-").map((e,n,i)=>i.slice(0,n+1).join("-")).reverse()}function Yu(t,e=aa().fallbackLocale){const n=Vk(t);return e?[...new Set([...n,...Vk(e)])]:n}function Is(){return hm??void 0}Ic.subscribe(t=>{hm=t??void 0,typeof window<"u"&&t!=null&&document.documentElement.setAttribute("lang",t)});const q$=t=>{if(t&&E$(t)&&Dc(t)){const{loadingDelay:e}=aa();let n;return typeof window<"u"&&Is()!=null&&e?n=window.setTimeout(()=>k1.set(!0),e):k1.set(!0),D5(t).then(()=>{Ic.set(t)}).finally(()=>{clearTimeout(n),k1.set(!1)})}return Ic.set(t)},Sa=$$(j$({},Ic),{set:q$}),Id=t=>{const e=Object.create(null);return i=>{const l=JSON.stringify(i);return l in e?e[l]:e[l]=t(i)}};var Y$=Object.defineProperty,Rc=Object.getOwnPropertySymbols,I5=Object.prototype.hasOwnProperty,R5=Object.prototype.propertyIsEnumerable,Wk=(t,e,n)=>e in t?Y$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,vg=(t,e)=>{for(var n in e||(e={}))I5.call(e,n)&&Wk(t,n,e[n]);if(Rc)for(var n of Rc(e))R5.call(e,n)&&Wk(t,n,e[n]);return t},Ea=(t,e)=>{var n={};for(var i in t)I5.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&Rc)for(var i of Rc(t))e.indexOf(i)<0&&R5.call(t,i)&&(n[i]=t[i]);return n};const Cu=(t,e)=>{const{formats:n}=aa();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},Z$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return i&&(l=Cu("number",i)),new Intl.NumberFormat(n,l)}),X$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return i?l=Cu("date",i):Object.keys(l).length===0&&(l=Cu("date","short")),new Intl.DateTimeFormat(n,l)}),K$=Id(t=>{var e=t,{locale:n,format:i}=e,l=Ea(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return i?l=Cu("time",i):Object.keys(l).length===0&&(l=Cu("time","short")),new Intl.DateTimeFormat(n,l)}),J$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return Z$(vg({locale:n},i))},Q$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return X$(vg({locale:n},i))},x$=(t={})=>{var e=t,{locale:n=Is()}=e,i=Ea(e,["locale"]);return K$(vg({locale:n},i))},eq=Id((t,e=Is())=>new A5(t,e,aa().formats,{ignoreTag:aa().ignoreTag})),tq=(t,e={})=>{var n,i,l,r;let s=e;typeof t=="object"&&(s=t,t=s.id);const{values:o,locale:a=Is(),default:u}=s;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=L5(t,a);if(!f)f=(r=(l=(i=(n=aa()).handleMissingMessage)==null?void 0:i.call(n,{locale:a,id:t,defaultValue:u}))!=null?l:u)!=null?r:t;else if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f;if(!o)return f;let c=f;try{c=eq(f,a).format(o)}catch(d){d instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,d.message)}return c},nq=(t,e)=>x$(e).format(t),iq=(t,e)=>Q$(e).format(t),lq=(t,e)=>J$(e).format(t),rq=(t,e=Is())=>L5(t,e),ti=ur([Sa,Ta],()=>tq);ur([Sa],()=>nq);ur([Sa],()=>iq);ur([Sa],()=>lq);ur([Sa,Ta],()=>rq);function sq(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}class oq{constructor(){Ki(this,"baseURL");Ki(this,"headers");Ki(this,"onUnauthorizedcallMe");Ki(this,"loggedIn");Ki(this,"jwtToken");Ki(this,"username");const e=localStorage.getItem("jwt"),n=sq();this.baseURL=n+"/api",this.username="",this.headers={Authorization:`Bearer ${e}`},this.onUnauthorizedcallMe=()=>{}}verifyToken(){return this.doCallRaw("/auth/verify").then(async e=>{if(e.status===200){const n=await e.json();return this.jwtToken=localStorage.getItem("jwt")||"",this.setLoggedIn(this.jwtToken,n.Username||""),!0}else return this.setLoggedOut(),!1})}setLoggedIn(e,n){this.jwtToken=e,this.username=n,this.loggedIn=!0}setLoggedOut(){localStorage.removeItem("jwt"),this.username="",this.loggedIn=!1}onUnauthorized(e){this.onUnauthorizedcallMe=e}setHeaders(e){this.headers=e}getHeaders(){const e=localStorage.getItem("jwt");return this.headers.Authorization=`Bearer ${e}`,this.headers}getSetting(e){return new Promise(async(n,i)=>{const l="/settings/"+e;this.doCall(l).then(function(r){n(r)}).catch(function(r){i(r)})})}deleteUser(e){return new Promise(async(n,i)=>{const l="/users/"+e;this.doCall(l,"delete").then(function(r){n(r)}).catch(function(r){i(r)})})}getUsers(){return new Promise(async(e,n)=>{const i="/users";this.doCall(i).then(function(l){e(l)}).catch(function(l){n(l)})})}createUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"post",e).then(function(r){n(r)}).catch(function(r){i(r)})})}updateUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"put",e).then(function(r){n(r)}).catch(function(r){i(r)})})}setSetting(e,n,i){return new Promise(async(l,r)=>{const s="/settings/"+e;var o=i?i(n):{key:e,value:n};this.doCall(s,"post",o).then(function(a){if(a===void 0)throw new Error("Setting update failed");l(!0)}).catch(function(a){r(a)})})}doCallRaw(e="/",n="get",i={}){const l=this,r={method:n,headers:this.getHeaders()};return n==="post"&&(r.body=JSON.stringify(i)),new Promise((o,a)=>{fetch(l.baseURL+e,r).then(u=>{o(u)}).catch(u=>{a(u)})})}async doCall(e="/",n="get",i={},l={}){const r=this,s={method:n,headers:this.getHeaders(),...l};(n==="post"||n==="put")&&(s.body=JSON.stringify(i));try{const o=await fetch(r.baseURL+e,s);if(o.status===401)throw r.onUnauthorizedcallMe(),new Error("Authentication required");if(!o.ok)throw new Error("GateSentry request failed with status "+o.status);return await o.json()}catch(o){throw console.error("Gatesentry API error : [Path "+e+"] [Method "+n+"]",o),o}}}const P5=new oq,{subscribe:aq,update:w1}=Wt({api:P5}),Ln={subscribe:aq,loginSuccesful:(t,e)=>w1(n=>(n.api.setLoggedIn(t,e),n)),logout:()=>w1(t=>(t.api.setLoggedOut(),t)),refresh:()=>w1(t=>t)};P5.onUnauthorized(()=>{Ln.logout()});function Un(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}function Vi(t,e){const n=Un();cj(n+t,e)}function jk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function uq(t){let e,n,i,l=t[1]&&jk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class ho extends Oe{constructor(e){super(),Ee(this,e,fq,uq,Se,{size:0,title:1})}}function $k(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function cq(t){let e,n,i=t[1]&&$k(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class hq extends Oe{constructor(e){super(),Ee(this,e,dq,cq,Se,{size:0,title:1})}}function qk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function mq(t){let e,n,i,l=t[1]&&qk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class _q extends Oe{constructor(e){super(),Ee(this,e,gq,mq,Se,{size:0,title:1})}}function Yk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function pq(t){let e,n,i=t[1]&&Yk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class vq extends Oe{constructor(e){super(),Ee(this,e,bq,pq,Se,{size:0,title:1})}}function Zk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function kq(t){let e,n,i=t[1]&&Zk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class yq extends Oe{constructor(e){super(),Ee(this,e,wq,kq,Se,{size:0,title:1})}}function Xk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Tq(t){let e,n,i=t[1]&&Xk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Eq extends Oe{constructor(e){super(),Ee(this,e,Sq,Tq,Se,{size:0,title:1})}}function Kk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Oq(t){let e,n,i=t[1]&&Kk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Cq extends Oe{constructor(e){super(),Ee(this,e,Mq,Oq,Se,{size:0,title:1})}}function Jk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Aq(t){let e,n,i,l=t[1]&&Jk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let Dq=class extends Oe{constructor(e){super(),Ee(this,e,Lq,Aq,Se,{size:0,title:1})}};function Qk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Iq(t){let e,n,i=t[1]&&Qk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Pq extends Oe{constructor(e){super(),Ee(this,e,Rq,Iq,Se,{size:0,title:1})}}function xk(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Nq(t){let e,n,i=t[1]&&xk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let ec=class extends Oe{constructor(e){super(),Ee(this,e,Bq,Nq,Se,{size:0,title:1})}};function e3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function zq(t){let e,n,i=t[1]&&e3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Uq extends Oe{constructor(e){super(),Ee(this,e,Hq,zq,Se,{size:0,title:1})}}function t3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Fq(t){let e,n,i=t[1]&&t3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let Vq=class extends Oe{constructor(e){super(),Ee(this,e,Gq,Fq,Se,{size:0,title:1})}};function n3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Wq(t){let e,n,i=t[1]&&n3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class $q extends Oe{constructor(e){super(),Ee(this,e,jq,Wq,Se,{size:0,title:1})}}function i3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function qq(t){let e,n,i,l,r,s=t[1]&&i3(t),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],a={};for(let u=0;u{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Zq extends Oe{constructor(e){super(),Ee(this,e,Yq,qq,Se,{size:0,title:1})}}function l3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Xq(t){let e,n,i=t[1]&&l3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class Rd extends Oe{constructor(e){super(),Ee(this,e,Kq,Xq,Se,{size:0,title:1})}}function r3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function Jq(t){let e,n,i=t[1]&&r3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class xq extends Oe{constructor(e){super(),Ee(this,e,Qq,Jq,Se,{size:0,title:1})}}function s3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function eY(t){let e,n,i,l=t[1]&&s3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class nY extends Oe{constructor(e){super(),Ee(this,e,tY,eY,Se,{size:0,title:1})}}function o3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function iY(t){let e,n,i,l=t[1]&&o3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class rY extends Oe{constructor(e){super(),Ee(this,e,lY,iY,Se,{size:0,title:1})}}function a3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function sY(t){let e,n,i,l=t[1]&&a3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}let aY=class extends Oe{constructor(e){super(),Ee(this,e,oY,sY,Se,{size:0,title:1})}};function u3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function uY(t){let e,n,i=t[1]&&u3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class cY extends Oe{constructor(e){super(),Ee(this,e,fY,uY,Se,{size:0,title:1})}}function f3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function dY(t){let e,n,i=t[1]&&f3(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class mY extends Oe{constructor(e){super(),Ee(this,e,hY,dY,Se,{size:0,title:1})}}function c3(t){let e,n;return{c(){e=Ie("title"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function gY(t){let e,n,i,l=t[1]&&c3(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Z(Z({},e),Te(u))),n(3,s=de(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Te(e),[o,a,l,s,i]}class d3 extends Oe{constructor(e){super(),Ee(this,e,_Y,gY,Se,{size:0,title:1})}}const Pc=[{type:"link",text:"Home",href:"/",icon:Vq},{type:"link",text:"Logs",href:"/logs",icon:_q},{type:"link",text:"Settings",href:"/settings",icon:aY},{type:"link",text:"DNS",href:"/dns",icon:rY},{type:"link",text:"Devices",href:"/devices",icon:Dq},{type:"link",text:"Policies",href:"/rules",icon:nY},{type:"link",text:"Services",href:"/services",icon:cY},{type:"menu",text:"HTTPS inspection",icon:$q,children:[{type:"link",text:"Blocked keywords",href:"/blockedkeywords",icon:ec},{type:"link",text:"Blocked content types",href:"/blockedfiletypes",icon:ec},{type:"link",text:"Sites not inspected",href:"/excludehosts",icon:ec},{type:"link",text:"URLs not inspected",href:"/excludeurls",icon:ec}]},{type:"link",text:"Stats",href:"/stats",icon:Uq},{type:"link",text:"AI",href:"/ai",icon:Zq},{type:"link",text:"Users",href:"/users",icon:mY}];function Oa(t){return Un()+t}function Pd(t=window.location.pathname){const e=Un();return e&&(t===e||t.startsWith(e+"/"))&&(t=t.slice(e.length)||"/"),t||"/"}function fr(t,e=Pd()){return t==="/"?e==="/":e===t||e.startsWith(t+"/")}function Nc(t,e=Pd()){return t.type==="link"?fr(t.href,e):t.children.some(n=>fr(n.href,e))}function h3(t,e,n){const i=t.slice();return i[8]=e[n],i}function m3(t,e,n){const i=t.slice();return i[11]=e[n],i}function pY(t){let e,n;return e=new YV({props:{text:t[8].text,href:Oa(t[8].children[0].href),expanded:Nc(t[8],t[0]),$$slots:{default:[vY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.expanded=Nc(i[8],i[0])),l&16385&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bY(t){let e,n;function i(...l){return t[6](t[8],...l)}return e=new s5({props:{text:t[8].text,href:Oa(t[8].href),isSelected:fr(t[8].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[8].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function g3(t){let e,n;function i(...l){return t[7](t[11],...l)}return e=new s5({props:{text:t[11].text,href:Oa(t[11].href),isSelected:fr(t[11].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[11].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function vY(t){let e,n,i=it(t[8].children),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sn(5,l=c));const o=(c,d)=>{c.preventDefault(),Vi(d)},a=c=>c.type==="link"?c.href:"/",u=(c,d)=>o(d,a(c)),f=(c,d)=>o(d,c.href);return t.$$set=c=>{"pathname"in c&&n(4,r=c.pathname)},t.$$.update=()=>{t.$$.dirty&48&&n(0,i=l!=null&&l.pathname?Pd(l.pathname):r)},[i,s,o,a,r,l,u,f]}class TY extends Oe{constructor(e){super(),Ee(this,e,yY,wY,Se,{pathname:4})}}const N5=(t,e)=>({kind:t.kind??"error",title:t.title??e("Error"),subtitle:t.subtitle??e("Unable to perform action"),timeout:t.timeout??3e4}),Ma=(t,e)=>N5({...t,kind:"success",timeout:2e3,title:e("Success")},e),Ss=(t,e)=>N5({...t,kind:"error",timeout:3e4},e),p3=t=>{const e=["Bytes","KB","MB","GB","TB"];if(t===0)return"0 B";const n=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,n))+" "+e[n]},{subscribe:SY,update:y1}=Wt([]),Ei={subscribe:SY,add:({title:t,subtitle:e,kind:n,timeout:i=1e3})=>y1(l=>[...l,{id:l.length+1,title:t,subtitle:e,kind:n,timeout:i}]),remove:t=>y1(e=>e.filter(n=>n.id!==t.id)),refresh:()=>y1(t=>t)};function EY(t){let e,n;return e=new Wi({props:{description:t[9]("Saving setting…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.description=i[9]("Saving setting…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OY(t){let e,n;return e=new Wi({props:{description:t[9]("Loading setting…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.description=i[9]("Loading setting…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MY(t){let e,n,i,l,r,s,o;n=new ei({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5]||t[7]||t[8],value:(t[6]&&t[6][t[0]])??""}}),n.$on("blur",t[10]);const a=[OY,EY],u=[];function f(c,d){return c[7]?0:c[8]?1:-1}return~(l=f(t))&&(r=u[l]=a[l](t)),{c(){e=P("div"),U(n.$$.fragment),i=F(),r&&r.c(),I(e,"class","connected-setting svelte-jacaop"),I(e,"aria-busy",s=t[7]||t[8])},m(c,d){O(c,e,d),z(n,e,null),w(e,i),~l&&u[l].m(e,null),o=!0},p(c,[d]){const h={};d&4&&(h.title=c[2]),d&2&&(h.labelText=c[1]),d&8&&(h.helperText=c[3]),d&16&&(h.type=c[4]),d&416&&(h.disabled=c[5]||c[7]||c[8]),d&65&&(h.value=(c[6]&&c[6][c[0]])??""),n.$set(h);let g=l;l=f(c),l===g?~l&&u[l].p(c,d):(r&&(ue(),v(u[g],1,1,()=>{u[g]=null}),fe()),~l?(r=u[l],r?r.p(c,d):(r=u[l]=a[l](c),r.c()),p(r,1),r.m(e,null)):r=null),(!o||d&384&&s!==(s=c[7]||c[8]))&&I(e,"aria-busy",s)},i(c){o||(p(n.$$.fragment,c),p(r),o=!0)},o(c){v(n.$$.fragment,c),v(r),o=!1},d(c){c&&E(e),H(n),~l&&u[l].d()}}}const b3="general_settings";function CY(t,e,n){let i,l;ct(t,ti,C=>n(9,i=C)),ct(t,Ln,C=>n(14,l=C));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a=""}=e,{type:u="text"}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null,g=!0,_=!1;const k=async()=>{h&&await M(h)},y=()=>{Ei.add(Ss({subtitle:i("Unable to load settings")},i))},T=async()=>{n(7,g=!0);try{const C=await l.api.getSetting(b3);n(6,d=JSON.parse(C.Value))}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)"),y()}finally{n(7,g=!1)}},M=async C=>{n(8,_=!0);try{if(await l.api.setSetting(b3,JSON.stringify(C))===!1){Ei.add(Ss({subtitle:i("Unable to save setting")},i));return}if(Ei.add(Ma({subtitle:i("Setting updated")},i)),h=null,r==="admin_password"||r==="admin_username"){Ln.logout(),Vi("/login");return}await T()}catch{Ei.add(Ss({subtitle:i("Unable to save setting")},i))}finally{n(8,_=!1)}},A=async C=>{if(!d)return;const D=C.currentTarget.value;D!==d[r]&&(h={...d,[r]:D},c||await M(h))};return on(T),t.$$set=C=>{"keyName"in C&&n(0,r=C.keyName),"labelText"in C&&n(1,s=C.labelText),"title"in C&&n(2,o=C.title),"helperText"in C&&n(3,a=C.helperText),"type"in C&&n(4,u=C.type),"disabled"in C&&n(5,f=C.disabled),"disableOnblur"in C&&n(11,c=C.disableOnblur)},[r,s,o,a,u,f,d,g,_,i,A,c,k]}class B5 extends Oe{constructor(e){super(),Ee(this,e,CY,MY,Se,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:11,updateDataOnBackend:12})}get updateDataOnBackend(){return this.$$.ctx[12]}}function AY(t){let e=t[4].api.username?`Logged in as ${t[4].api.username}`:"Logged in",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4].api.username?`Logged in as ${i[4].api.username}`:"Logged in")&&Y(n,e)},d(i){i&&E(n)}}}function LY(t){let e=t[3]("Change password")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&8&&e!==(e=i[3]("Change password")+"")&&Y(n,e)},d(i){i&&E(n)}}}function DY(t){let e=t[3]("Log out")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&8&&e!==(e=i[3]("Log out")+"")&&Y(n,e)},d(i){i&&E(n)}}}function IY(t){let e,n,i,l,r,s;return e=new JV({props:{$$slots:{default:[AY]},$$scope:{ctx:t}}}),i=new bk({props:{$$slots:{default:[LY]},$$scope:{ctx:t}}}),i.$on("click",t[7]),r=new bk({props:{$$slots:{default:[DY]},$$scope:{ctx:t}}}),r.$on("click",t[5]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&8208&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&8200&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&8200&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function RY(t){let e,n;return e=new lW({props:{$$slots:{default:[IY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&8220&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function PY(t){let e,n,i;function l(s){t[9](s)}let r={keyName:"admin_password",helperText:t[3]("Leave blank to keep the current password"),type:"password",title:t[3]("Password"),labelText:t[3]("Password"),disableOnblur:!0};return t[1]!==void 0&&(r.updateDataOnBackend=t[1]),e=new B5({props:r}),xe.push(()=>At(e,"updateDataOnBackend",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&8&&(a.helperText=s[3]("Leave blank to keep the current password")),o&8&&(a.title=s[3]("Password")),o&8&&(a.labelText=s[3]("Password")),!n&&o&2&&(n=!0,a.updateDataOnBackend=s[1],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function NY(t){let e,n,i,l,r,s;return e=new Od({props:{title:t[3]("Update password")}}),i=new Md({props:{hasForm:!0,$$slots:{default:[PY]},$$scope:{ctx:t}}}),r=new Cd({props:{secondaryButtonText:t[3]("Cancel"),primaryButtonText:t[3]("Update password")}}),r.$on("click:button--secondary",t[10]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&8&&(u.title=o[3]("Update password")),e.$set(u);const f={};a&8202&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&8&&(c.secondaryButtonText=o[3]("Cancel")),a&8&&(c.primaryButtonText=o[3]("Update password")),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function BY(t){let e,n,i,l,r,s;function o(c){t[8](c)}let a={icon:d3,closeIcon:d3,text:t[3]("Account"),$$slots:{default:[RY]},$$scope:{ctx:t}};t[0]!==void 0&&(a.isOpen=t[0]),e=new NV({props:a}),xe.push(()=>At(e,"isOpen",o));function u(c){t[11](c)}let f={$$slots:{default:[NY]},$$scope:{ctx:t}};return t[2]!==void 0&&(f.open=t[2]),l=new Ed({props:f}),xe.push(()=>At(l,"open",u)),l.$on("submit",t[6]),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment)},m(c,d){z(e,c,d),O(c,i,d),z(l,c,d),s=!0},p(c,d){const h={};d&8&&(h.text=c[3]("Account")),d&8220&&(h.$$scope={dirty:d,ctx:c}),!n&&d&1&&(n=!0,h.isOpen=c[0],Ct(()=>n=!1)),e.$set(h);const g={};d&8206&&(g.$$scope={dirty:d,ctx:c}),!r&&d&4&&(r=!0,g.open=c[2],Ct(()=>r=!1)),l.$set(g)},i(c){s||(p(e.$$.fragment,c),p(l.$$.fragment,c),s=!0)},o(c){v(e.$$.fragment,c),v(l.$$.fragment,c),s=!1},d(c){c&&E(i),H(e,c),H(l,c)}}}function zY(t){let e,n;return e=new aW({props:{$$slots:{default:[BY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&8223&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function HY(t,e,n){let i,l;ct(t,ti,k=>n(3,i=k)),ct(t,Ln,k=>n(4,l=k));let{userProfilePanelOpen:r=!1}=e;const s=nn();let o,a=!1;const u=()=>{Ln.logout(),n(0,r=!1),n(2,a=!1),Vi("/login",{replace:!0}),s("loggedout")},f=()=>{n(2,a=!1),o==null||o()},c=()=>n(2,a=!0);function d(k){r=k,n(0,r)}function h(k){o=k,n(1,o)}const g=()=>n(2,a=!1);function _(k){a=k,n(2,a)}return t.$$set=k=>{"userProfilePanelOpen"in k&&n(0,r=k.userProfilePanelOpen)},[r,o,a,i,l,u,f,c,d,h,g,_]}class UY extends Oe{constructor(e){super(),Ee(this,e,HY,zY,Se,{userProfilePanelOpen:0})}}function FY(t){let e,n,i,l,r;e=new TY({props:{pathname:t[2]}});function s(a){t[5](a)}let o={};return t[1]!==void 0&&(o.userProfilePanelOpen=t[1]),i=new UY({props:o}),xe.push(()=>At(i,"userProfilePanelOpen",s)),i.$on("loggedout",t[6]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(a,u){z(e,a,u),O(a,n,u),z(i,a,u),r=!0},p(a,u){const f={};u&4&&(f.pathname=a[2]),e.$set(f);const c={};!l&&u&2&&(l=!0,c.userProfilePanelOpen=a[1],Ct(()=>l=!1)),i.$set(c)},i(a){r||(p(e.$$.fragment,a),p(i.$$.fragment,a),r=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),r=!1},d(a){a&&E(n),H(e,a),H(i,a)}}}function GY(t){let e,n;return e=new WW({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function VY(t){let e,n,i;function l(s){t[7](s)}let r={company:"GateSentry",platformName:t[3],href:Oa("/"),persistentHamburgerMenu:!0,$$slots:{"skip-to-content":[GY],default:[FY]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.isSideNavOpen=t[0]),e=new vV({props:r}),xe.push(()=>At(e,"isSideNavOpen",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,[o]){const a={};o&8&&(a.platformName=s[3]),o&518&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.isSideNavOpen=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function WY(t,e,n){let i;ct(t,Ln,d=>n(8,i=d));let{isSideNavOpen:l=!1}=e,{userProfilePanelOpen:r=!1}=e,{pathname:s="/"}=e,o="";const a=nn();on(async()=>{try{const d=await i.api.doCall("/about");n(3,o=(d==null?void 0:d.version)||"")}catch{n(3,o="")}});function u(d){r=d,n(1,r)}const f=()=>a("loggedout");function c(d){l=d,n(0,l)}return t.$$set=d=>{"isSideNavOpen"in d&&n(0,l=d.isSideNavOpen),"userProfilePanelOpen"in d&&n(1,r=d.userProfilePanelOpen),"pathname"in d&&n(2,s=d.pathname)},[l,r,s,o,a,u,f,c]}class jY extends Oe{constructor(e){super(),Ee(this,e,WY,VY,Se,{isSideNavOpen:0,userProfilePanelOpen:1,pathname:2})}}function v3(t,e,n){const i=t.slice();return i[9]=e[n],i}function k3(t,e,n){const i=t.slice();return i[12]=e[n],i}function $Y(t){let e,n;return e=new AW({props:{icon:t[9].icon,text:t[9].text,expanded:Nc(t[9],t[0]),$$slots:{default:[YY]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.expanded=Nc(i[9],i[0])),l&32769&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qY(t){let e,n;function i(...l){return t[7](t[9],...l)}return e=new TW({props:{icon:t[9].icon,text:t[9].text,href:Oa(t[9].href),isSelected:fr(t[9].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[9].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function w3(t){let e,n;function i(...l){return t[8](t[12],...l)}return e=new PW({props:{text:t[12].text,href:Oa(t[12].href),isSelected:fr(t[12].href,t[0])}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.isSelected=fr(t[12].href,t[0])),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function YY(t){let e,n,i=it(t[9].children),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sv(r[o],1,1,()=>{r[o]=null});return n=new YW({}),{c(){for(let o=0;o{}}=e;const o=o5();ct(t,o,d=>n(6,l=d));const a=(d,h)=>{d.preventDefault(),Vi(h),s()},u=d=>d.type==="link"?d.href:"/",f=(d,h)=>a(h,u(d)),c=(d,h)=>a(h,d.href);return t.$$set=d=>{"pathname"in d&&n(4,r=d.pathname),"onNavigate"in d&&n(5,s=d.onNavigate)},t.$$.update=()=>{t.$$.dirty&80&&n(0,i=l!=null&&l.pathname?Pd(l.pathname):r)},[i,o,a,u,r,s,l,f,c]}class JY extends Oe{constructor(e){super(),Ee(this,e,KY,XY,Se,{pathname:4,onNavigate:5})}}function T3(t,e,n){const i=t.slice();return i[2]=e[n],i}function S3(t,e){let n,i,l;function r(){return e[1](e[2])}return i=new gU({props:{kind:e[2].kind,title:e[2].title,subtitle:e[2].subtitle,timeout:e[2].timeout}}),i.$on("close",r),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(s,o){O(s,n,o),z(i,s,o),l=!0},p(s,o){e=s;const a={};o&1&&(a.kind=e[2].kind),o&1&&(a.title=e[2].title),o&1&&(a.subtitle=e[2].subtitle),o&1&&(a.timeout=e[2].timeout),i.$set(a)},i(s){l||(p(i.$$.fragment,s),l=!0)},o(s){v(i.$$.fragment,s),l=!1},d(s){s&&E(n),H(i,s)}}}function QY(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[2].id;for(let o=0;on(0,i=r)),[i,r=>Ei.remove(r)]}class eZ extends Oe{constructor(e){super(),Ee(this,e,xY,QY,Se,{})}}const tZ=t=>({}),E3=t=>({});function O3(t){let e,n;return{c(){e=P("p"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function M3(t){let e,n;const i=t[4].footer,l=He(i,t,t[3],E3);return{c(){e=P("footer"),l&&l.c(),I(e,"class","auth-shell__footer")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&8)&&Fe(l,i,r,r[3],n?Ue(i,r[3],s,tZ):Ge(r[3]),E3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function nZ(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[1]&&O3(t);const h=t[4].default,g=He(h,t,t[3],null);let _=t[2].footer&&M3(t);return{c(){e=P("main"),n=P("section"),i=P("div"),i.textContent="GateSentry",l=F(),r=P("header"),s=P("h1"),o=$(t[0]),a=F(),d&&d.c(),u=F(),g&&g.c(),f=F(),_&&_.c(),I(i,"class","auth-shell__brand"),I(s,"id","auth-shell-title"),I(r,"class","auth-shell__header"),I(n,"class","auth-shell__card"),I(n,"aria-labelledby","auth-shell-title"),I(e,"class","auth-shell")},m(k,y){O(k,e,y),w(e,n),w(n,i),w(n,l),w(n,r),w(r,s),w(s,o),w(r,a),d&&d.m(r,null),w(n,u),g&&g.m(n,null),w(e,f),_&&_.m(e,null),c=!0},p(k,[y]){(!c||y&1)&&Y(o,k[0]),k[1]?d?d.p(k,y):(d=O3(k),d.c(),d.m(r,null)):d&&(d.d(1),d=null),g&&g.p&&(!c||y&8)&&Fe(g,h,k,k[3],c?Ue(h,k[3],y,null):Ge(k[3]),null),k[2].footer?_?(_.p(k,y),y&4&&p(_,1)):(_=M3(k),_.c(),p(_,1),_.m(e,null)):_&&(ue(),v(_,1,1,()=>{_=null}),fe())},i(k){c||(p(g,k),p(_),c=!0)},o(k){v(g,k),v(_),c=!1},d(k){k&&E(e),d&&d.d(),g&&g.d(k),_&&_.d()}}}function iZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e;return t.$$set=a=>{"title"in a&&n(0,s=a.title),"description"in a&&n(1,o=a.description),"$$scope"in a&&n(3,l=a.$$scope)},[s,o,r,l,i]}class Nd extends Oe{constructor(e){super(),Ee(this,e,iZ,nZ,Se,{title:0,description:1})}}function lZ(t){let e,n=(t[1]||"Nothing here yet")+"",i,l,r,s,o=t[2]&&C3(t);const a=t[5].default,u=He(a,t,t[6],null);return{c(){e=P("h2"),i=$(n),l=F(),o&&o.c(),r=F(),u&&u.c()},m(f,c){O(f,e,c),w(e,i),O(f,l,c),o&&o.m(f,c),O(f,r,c),u&&u.m(f,c),s=!0},p(f,c){(!s||c&2)&&n!==(n=(f[1]||"Nothing here yet")+"")&&Y(i,n),f[2]?o?o.p(f,c):(o=C3(f),o.c(),o.m(r.parentNode,r)):o&&(o.d(1),o=null),u&&u.p&&(!s||c&64)&&Fe(u,a,f,f[6],s?Ue(a,f[6],c,null):Ge(f[6]),null)},i(f){s||(p(u,f),s=!0)},o(f){v(u,f),s=!1},d(f){f&&(E(e),E(l),E(r)),o&&o.d(f),u&&u.d(f)}}}function rZ(t){let e,n,i,l;e=new ln({props:{kind:"error",hideCloseButton:!0,title:t[1]||"Unable to load",subtitle:t[2]}});let r=t[4]&&A3(t);return{c(){U(e.$$.fragment),n=F(),r&&r.c(),i=je()},m(s,o){z(e,s,o),O(s,n,o),r&&r.m(s,o),O(s,i,o),l=!0},p(s,o){const a={};o&2&&(a.title=s[1]||"Unable to load"),o&4&&(a.subtitle=s[2]),e.$set(a),s[4]?r?(r.p(s,o),o&16&&p(r,1)):(r=A3(s),r.c(),p(r,1),r.m(i.parentNode,i)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){l||(p(e.$$.fragment,s),p(r),l=!0)},o(s){v(e.$$.fragment,s),v(r),l=!1},d(s){s&&(E(n),E(i)),H(e,s),r&&r.d(s)}}}function sZ(t){let e,n;return e=new Wi({props:{description:t[2]||t[1]||"Loading"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&6&&(r.description=i[2]||i[1]||"Loading"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function C3(t){let e,n;return{c(){e=P("p"),n=$(t[2])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&4&&Y(n,i[2])},d(i){i&&E(e)}}}function A3(t){let e,n;return e=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[oZ]},$$scope:{ctx:t}}}),e.$on("click",function(){io(t[4])&&t[4].apply(this,arguments)}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){t=i;const r={};l&72&&(r.$$scope={dirty:l,ctx:t}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oZ(t){let e;return{c(){e=$(t[3])},m(n,i){O(n,e,i)},p(n,i){i&8&&Y(e,n[3])},d(n){n&&E(e)}}}function aZ(t){let e,n,i,l;const r=[sZ,rZ,lZ],s=[];function o(a,u){return a[0]==="loading"?0:a[0]==="error"?1:2}return n=o(t),i=s[n]=r[n](t),{c(){e=P("div"),i.c(),I(e,"class","resource-state"),S(e,"resource-state--error",t[0]==="error")},m(a,u){O(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),p(i,1),i.m(e,null)),(!l||u&1)&&S(e,"resource-state--error",a[0]==="error")},i(a){l||(p(i),l=!0)},o(a){v(i),l=!1},d(a){a&&E(e),s[n].d()}}}function uZ(t,e,n){let{$$slots:i={},$$scope:l}=e,{state:r="loading"}=e,{title:s=""}=e,{message:o=""}=e,{retryLabel:a="Retry"}=e,{onRetry:u=null}=e;return t.$$set=f=>{"state"in f&&n(0,r=f.state),"title"in f&&n(1,s=f.title),"message"in f&&n(2,o=f.message),"retryLabel"in f&&n(3,a=f.retryLabel),"onRetry"in f&&n(4,u=f.onRetry),"$$scope"in f&&n(6,l=f.$$scope)},[r,s,o,a,u,i,l]}class hi extends Oe{constructor(e){super(),Ee(this,e,uZ,aZ,Se,{state:0,title:1,message:2,retryLabel:3,onRetry:4})}}function fZ(t){let e=t[0]("Download certificate")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&1&&e!==(e=i[0]("Download certificate")+"")&&Y(n,e)},d(i){i&&E(n)}}}function cZ(t){let e,n;return e=new bt({props:{href:t[1],icon:Pq,kind:"tertiary",size:"small",download:!0,$$slots:{default:[fZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&5&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function dZ(t,e,n){let i;ct(t,ti,r=>n(0,i=r));const l=Un()+"/api/files/certificate";return[i,l]}class z5 extends Oe{constructor(e){super(),Ee(this,e,dZ,cZ,Se,{})}}function hZ(t){let e=t[5]("Clear")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Clear")+"")&&Y(n,e)},d(i){i&&E(n)}}}function mZ(t){let e=(t[4]?t[5]("Signing in…"):t[5]("Sign in"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&48&&e!==(e=(i[4]?i[5]("Signing in…"):i[5]("Sign in"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function gZ(t){let e,n,i,l;return e=new bt({props:{size:"lg",kind:"secondary",icon:Cq,type:"button",disabled:t[4]||!t[0]&&!t[1],$$slots:{default:[hZ]},$$scope:{ctx:t}}}),e.$on("click",t[7]),i=new bt({props:{size:"lg",type:"submit",icon:yq,disabled:t[4]||!t[0]||!t[1],$$slots:{default:[mZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&19&&(o.disabled=r[4]||!r[0]&&!r[1]),s&4128&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&19&&(a.disabled=r[4]||!r[0]||!r[1]),s&4144&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function _Z(t){let e,n,i,l,r,s,o,a;function u(h){t[8](h)}let f={invalid:t[3],autocomplete:"username",labelText:t[5]("User name"),placeholder:t[5]("Enter user name"),required:!0,invalidText:t[2]};t[0]!==void 0&&(f.value=t[0]),e=new ei({props:f}),xe.push(()=>At(e,"value",u));function c(h){t[9](h)}let d={invalid:t[3],autocomplete:"current-password",required:!0,labelText:t[5]("Password"),placeholder:t[5]("Enter password"),invalidText:t[2]};return t[1]!==void 0&&(d.value=t[1]),l=new x1({props:d}),xe.push(()=>At(l,"value",c)),o=new MR({props:{$$slots:{default:[gZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment),s=F(),U(o.$$.fragment)},m(h,g){z(e,h,g),O(h,i,g),z(l,h,g),O(h,s,g),z(o,h,g),a=!0},p(h,g){const _={};g&8&&(_.invalid=h[3]),g&32&&(_.labelText=h[5]("User name")),g&32&&(_.placeholder=h[5]("Enter user name")),g&4&&(_.invalidText=h[2]),!n&&g&1&&(n=!0,_.value=h[0],Ct(()=>n=!1)),e.$set(_);const k={};g&8&&(k.invalid=h[3]),g&32&&(k.labelText=h[5]("Password")),g&32&&(k.placeholder=h[5]("Enter password")),g&4&&(k.invalidText=h[2]),!r&&g&2&&(r=!0,k.value=h[1],Ct(()=>r=!1)),l.$set(k);const y={};g&4147&&(y.$$scope={dirty:g,ctx:h}),o.$set(y)},i(h){a||(p(e.$$.fragment,h),p(l.$$.fragment,h),p(o.$$.fragment,h),a=!0)},o(h){v(e.$$.fragment,h),v(l.$$.fragment,h),v(o.$$.fragment,h),a=!1},d(h){h&&(E(i),E(s)),H(e,h),H(l,h),H(o,h)}}}function pZ(t){let e,n;return e=new JT({props:{$$slots:{default:[_Z]},$$scope:{ctx:t}}}),e.$on("submit",t[6]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bZ(t){let e,n;return e=new z5({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function vZ(t){let e,n;return e=new Nd({props:{title:t[5]("Sign in"),description:t[5]("Manage protection, policies, and connected devices."),$$slots:{footer:[bZ],default:[pZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&32&&(r.title=i[5]("Sign in")),l&32&&(r.description=i[5]("Manage protection, policies, and connected devices.")),l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function kZ(t,e,n){let i,l;ct(t,ti,_=>n(5,i=_)),ct(t,Ln,_=>n(10,l=_));let r="",s="",o="",a=!1,u=!1;const f=nn();localStorage.removeItem("password"),localStorage.removeItem("rememberMe");const c=async _=>{_.preventDefault(),n(3,a=!1),n(2,o=""),n(4,u=!0);try{const k=await l.api.doCall("/auth/token","post",{username:r,pass:s});if((k==null?void 0:k.Validated)===!0||(k==null?void 0:k.Validated)==="true"){localStorage.removeItem("jwt"),localStorage.setItem("jwt",k.Jwtoken),n(1,s=""),Ln.loginSuccesful(k.Jwtoken,k.Username||""),f("authenticated"),Vi("/",{replace:!0});return}n(2,o=i("Invalid username or password")),n(3,a=!0)}catch{Ei.add(Ss({subtitle:i("Unable to contact GateSentry. Try again.")},i))}finally{n(4,u=!1)}},d=()=>{n(0,r=""),n(1,s=""),n(3,a=!1),n(2,o="")};function h(_){r=_,n(0,r)}function g(_){s=_,n(1,s)}return[r,s,o,a,u,i,c,d,h,g]}class wZ extends Oe{constructor(e){super(),Ee(this,e,kZ,vZ,Se,{})}}const Bc=12,zc=72;function H5(t){return new TextEncoder().encode(t).length}function yZ(t){const e=H5(t);return e>=Bc&&e<=zc}function L3(t){let e,n;return{c(){e=P("p"),n=$(t[6]),I(e,"class","form-message form-message--error svelte-1u8dzph"),I(e,"role","alert")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&64&&Y(n,i[6])},d(i){i&&E(e)}}}function D3(t){let e,n;return e=new bt({props:{type:"button",kind:"secondary",$$slots:{default:[TZ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function TZ(t){let e;return{c(){e=$("Retry status check")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function I3(t){let e,n;return{c(){e=P("p"),n=$(t[10]),I(e,"class","hint svelte-1u8dzph"),I(e,"aria-live","polite")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1024&&Y(n,i[10])},d(i){i&&E(e)}}}function SZ(t){let e=t[7]?"Completing setup…":"Complete setup",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&128&&e!==(e=i[7]?"Completing setup…":"Complete setup")&&Y(n,e)},d(i){i&&E(n)}}}function EZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=t[6]&&L3(t),k=t[9]&&D3(t);function y(N){t[17](N)}let T={required:!0,autocomplete:"username",labelText:"Administrator username"};t[0]!==void 0&&(T.value=t[0]),i=new ei({props:T}),xe.push(()=>At(i,"value",y));function M(N){t[18](N)}let A={required:!0,autocomplete:"new-password",labelText:"Password",helperText:`Use ${Bc} to ${zc} UTF-8 bytes.`,invalid:t[5],invalidText:t[4]};t[1]!==void 0&&(A.value=t[1]),s=new x1({props:A}),xe.push(()=>At(s,"value",M));function C(N){t[19](N)}let D={required:!0,autocomplete:"new-password",labelText:"Confirm password",invalid:t[3],invalidText:"Passwords do not match."};t[2]!==void 0&&(D.value=t[2]),u=new x1({props:D}),xe.push(()=>At(u,"value",C));let R=t[8]&&t[10]&&I3(t);return h=new bt({props:{type:"submit",disabled:!t[8]||t[7]||t[11]!=="",$$slots:{default:[SZ]},$$scope:{ctx:t}}}),{c(){_&&_.c(),e=F(),k&&k.c(),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),c=F(),R&&R.c(),d=F(),U(h.$$.fragment)},m(N,G){_&&_.m(N,G),O(N,e,G),k&&k.m(N,G),O(N,n,G),z(i,N,G),O(N,r,G),z(s,N,G),O(N,a,G),z(u,N,G),O(N,c,G),R&&R.m(N,G),O(N,d,G),z(h,N,G),g=!0},p(N,G){N[6]?_?_.p(N,G):(_=L3(N),_.c(),_.m(e.parentNode,e)):_&&(_.d(1),_=null),N[9]?k?(k.p(N,G),G&512&&p(k,1)):(k=D3(N),k.c(),p(k,1),k.m(n.parentNode,n)):k&&(ue(),v(k,1,1,()=>{k=null}),fe());const B={};!l&&G&1&&(l=!0,B.value=N[0],Ct(()=>l=!1)),i.$set(B);const j={};G&32&&(j.invalid=N[5]),G&16&&(j.invalidText=N[4]),!o&&G&2&&(o=!0,j.value=N[1],Ct(()=>o=!1)),s.$set(j);const q={};G&8&&(q.invalid=N[3]),!f&&G&4&&(f=!0,q.value=N[2],Ct(()=>f=!1)),u.$set(q),N[8]&&N[10]?R?R.p(N,G):(R=I3(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null);const V={};G&2432&&(V.disabled=!N[8]||N[7]||N[11]!==""),G&1048704&&(V.$$scope={dirty:G,ctx:N}),h.$set(V)},i(N){g||(p(k),p(i.$$.fragment,N),p(s.$$.fragment,N),p(u.$$.fragment,N),p(h.$$.fragment,N),g=!0)},o(N){v(k),v(i.$$.fragment,N),v(s.$$.fragment,N),v(u.$$.fragment,N),v(h.$$.fragment,N),g=!1},d(N){N&&(E(e),E(n),E(r),E(a),E(c),E(d)),_&&_.d(N),k&&k.d(N),H(i,N),H(s,N),H(u,N),R&&R.d(N),H(h,N)}}}function OZ(t){let e,n;return e=new JT({props:{$$slots:{default:[EZ]},$$scope:{ctx:t}}}),e.$on("submit",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MZ(t){let e,n;return e=new Nd({props:{title:"Set up GateSentry",description:"Create the administrator account for this installation.",$$slots:{default:[OZ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function CZ(t,e,n){let i,l,r,s,o,a,u,f,c="",d="",h="",g="",_=!1,k=!1,y=!1;async function T(){n(9,y=!1),n(6,g="");try{const R=await fetch(Un()+"/api/setup/status");if(!R.ok)throw new Error("setup status failed");if((await R.json()).complete){Vi("/login");return}n(8,k=!0)}catch{n(9,y=!0),n(6,g="Unable to read setup status.")}}T();async function M(R){if(R.preventDefault(),n(6,g=""),!l){n(6,g=`Password must contain between ${Bc} and ${zc} UTF-8 bytes.`);return}if(d!==h){n(6,g="Passwords do not match.");return}n(7,_=!0);try{const N=await fetch(Un()+"/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c,password:d})});if(!N.ok){n(6,g=N.status===409?"Setup was already completed. Sign in instead.":"Setup could not be completed.");return}n(1,d=""),n(2,h=""),window.location.assign(Un()+"/login")}catch{n(6,g="Unable to contact GateSentry.")}finally{n(7,_=!1)}}function A(R){c=R,n(0,c)}function C(R){d=R,n(1,d)}function D(R){h=R,n(2,h)}return t.$$.update=()=>{t.$$.dirty&2&&n(16,i=H5(d)),t.$$.dirty&2&&n(14,l=yZ(d)),t.$$.dirty&16386&&n(5,r=d.length>0&&!l),t.$$.dirty&65536&&n(4,s=`Password must contain between ${Bc} and ${zc} UTF-8 bytes (currently ${i}).`),t.$$.dirty&6&&n(3,o=h.length>0&&d!==h),t.$$.dirty&63&&n(15,a=c?d.length===0?{message:"Enter a password.",field:""}:r?{message:s,field:"password"}:h.length===0?{message:"Re-enter the password to confirm it.",field:""}:o?{message:"Passwords do not match.",field:"confirmation"}:{message:"",field:""}:{message:"Enter an administrator username.",field:""}),t.$$.dirty&32768&&n(11,u=a.message),t.$$.dirty&32768&&n(10,f=a.field===""?a.message:"")},[c,d,h,o,s,r,g,_,k,y,f,u,T,M,l,a,i,A,C,D]}class AZ extends Oe{constructor(e){super(),Ee(this,e,CZ,MZ,Se,{})}}var LZ=["second","minute","hour","day","week","month","year"];function DZ(t,e){if(e===0)return["just now","right now"];var n=LZ[Math.floor(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]}var IZ=["秒","分钟","小时","天","周","个月","年"];function RZ(t,e){if(e===0)return["刚刚","片刻后"];var n=IZ[~~(e/2)];return[t+" "+n+"前",t+" "+n+"后"]}var mm={},U5=function(t,e){mm[t]=e},PZ=function(t){return mm[t]||mm.en_US},T1=[60,60,24,7,365/7/12,12];function R3(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}function NZ(t,e){var n=t<0?1:0;t=Math.abs(t);for(var i=t,l=0;t>=T1[l]&&l(l===0?9:1)&&(l+=1),e(t,l,i)[n].replace("%s",t.toString())}function BZ(t,e){var n=e?R3(e):new Date;return(+n-+R3(t))/1e3}var zZ=function(t,e,n){var i=BZ(t,n&&n.relativeDate);return NZ(i,PZ(e))};U5("en_US",DZ);U5("zh_CN",RZ);function HZ(t){var i;const e=new Map,n=new Map;for(const l of t||[])for(const r of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.set(r,(n.get(r)||0)+1);for(const l of t||[]){const r=(i=l.manual_name)==null?void 0:i.trim();if(r)for(const s of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.get(s)===1&&e.set(s,r)}return e}function UZ(t,e){const n=t.get(e);return n?`${n} (${e})`:e}var Hc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Hc.exports;(function(t,e){(function(){var n,i="4.17.21",l=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,d=2,h=4,g=1,_=2,k=1,y=2,T=4,M=8,A=16,C=32,D=64,R=128,N=256,G=512,B=30,$="...",q=800,V=16,K=1,x=2,ie=3,X=1/0,ce=9007199254740991,ae=17976931348623157e292,ee=0/0,he=4294967295,ne=he-1,re=he>>>1,oe=[["ary",R],["bind",k],["bindKey",y],["curry",M],["curryRight",A],["flip",G],["partial",C],["partialRight",D],["rearg",N]],Re="[object Arguments]",qe="[object Array]",Ce="[object AsyncFunction]",Ze="[object Boolean]",be="[object Date]",Ae="[object DOMException]",ve="[object Error]",me="[object Function]",lt="[object GeneratorFunction]",De="[object Map]",vt="[object Number]",dt="[object Null]",ot="[object Object]",ht="[object Promise]",Bt="[object Proxy]",Ot="[object RegExp]",Zt="[object Set]",Ve="[object String]",Nt="[object Symbol]",Tt="[object Undefined]",Gt="[object WeakMap]",fn="[object WeakSet]",an="[object ArrayBuffer]",Qt="[object DataView]",Ne="[object Float32Array]",pe="[object Float64Array]",et="[object Int8Array]",gt="[object Int16Array]",Kt="[object Int32Array]",ze="[object Uint8Array]",kt="[object Uint8ClampedArray]",Pt="[object Uint16Array]",cn="[object Uint32Array]",qn=/\b__p \+= '';/g,nl=/\b(__p \+=) '' \+/g,Bl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Et=/[&<>"']/g,kn=RegExp(Be.source),Xe=RegExp(Et.source),wt=/<%-([\s\S]+?)%>/g,Mt=/<%([\s\S]+?)%>/g,Zn=/<%=([\s\S]+?)%>/g,Bn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wn=/^\w*$/,_r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_l=/[\\^$.*+?()[\]{}|]/g,Jr=RegExp(_l.source),ji=/^\s+/,gn=/\s/,Qr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,il=/\{\n\/\* \[wrapped with (.+)\] \*/,Xn=/,? & /,xt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xr=/[()=,{}\[\]\/\s]/,$i=/\\(\\)?/g,Mn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yn=/\w*$/,es=/^[-+]0x[0-9a-f]+$/i,pr=/^0b[01]+$/i,ts=/^\[object .+?Constructor\]$/,Ps=/^0o[0-7]+$/i,Ns=/^(?:0|[1-9]\d*)$/,ns=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pl=/($^)/,br=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",Ut="\\u0300-\\u036f",vi="\\ufe20-\\ufe2f",Bs="\\u20d0-\\u20ff",is=Ut+vi+Bs,ni="\\u2700-\\u27bf",tr="a-z\\xdf-\\xf6\\xf8-\\xff",vr="\\xac\\xb1\\xd7\\xf7",ls="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zs="\\u2000-\\u206f",kr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Hs="A-Z\\xc0-\\xd6\\xd8-\\xde",ko="\\ufe0e\\ufe0f",Aa=vr+ls+zs+kr,zl="['’]",sf="["+_t+"]",Us="["+Aa+"]",wr="["+is+"]",wo="\\d+",of="["+ni+"]",yr="["+tr+"]",La="[^"+_t+Aa+wo+ni+tr+Hs+"]",bl="\\ud83c[\\udffb-\\udfff]",nr="(?:"+wr+"|"+bl+")",Da="[^"+_t+"]",vl="(?:\\ud83c[\\udde6-\\uddff]){2}",yo="[\\ud800-\\udbff][\\udc00-\\udfff]",Bi="["+Hs+"]",dn="\\u200d",rs="(?:"+yr+"|"+La+")",af="(?:"+Bi+"|"+La+")",Ia="(?:"+zl+"(?:d|ll|m|re|s|t|ve))?",Hl="(?:"+zl+"(?:D|LL|M|RE|S|T|VE))?",Ra=nr+"?",Kn="["+ko+"]?",ii="(?:"+dn+"(?:"+[Da,vl,yo].join("|")+")"+Kn+Ra+")*",li="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pa=Kn+Ra+ii,tt="(?:"+[of,vl,yo].join("|")+")"+Pa,at="(?:"+[Da+wr+"?",wr,vl,yo,sf].join("|")+")",Mi=RegExp(zl,"g"),ss=RegExp(wr,"g"),To=RegExp(bl+"(?="+bl+")|"+at+Pa,"g"),Na=RegExp([Bi+"?"+yr+"+"+Ia+"(?="+[Us,Bi,"$"].join("|")+")",af+"+"+Hl+"(?="+[Us,Bi+rs,"$"].join("|")+")",Bi+"?"+rs+"+"+Ia,Bi+"+"+Hl,uf,li,wo,tt].join("|"),"g"),Ba=RegExp("["+dn+_t+is+ko+"]"),ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],df=-1,On={};On[Ne]=On[pe]=On[et]=On[gt]=On[Kt]=On[ze]=On[kt]=On[Pt]=On[cn]=!0,On[Re]=On[qe]=On[an]=On[Ze]=On[Qt]=On[be]=On[ve]=On[me]=On[De]=On[vt]=On[ot]=On[Ot]=On[Zt]=On[Ve]=On[Gt]=!1;var Tn={};Tn[Re]=Tn[qe]=Tn[an]=Tn[Qt]=Tn[Ze]=Tn[be]=Tn[Ne]=Tn[pe]=Tn[et]=Tn[gt]=Tn[Kt]=Tn[De]=Tn[vt]=Tn[ot]=Tn[Ot]=Tn[Zt]=Tn[Ve]=Tn[Nt]=Tn[ze]=Tn[kt]=Tn[Pt]=Tn[cn]=!0,Tn[ve]=Tn[me]=Tn[Gt]=!1;var hf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tM={"&":"&","<":"<",">":">",'"':""","'":"'"},nM={"&":"&","<":"<",">":">",""":'"',"'":"'"},iM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lM=parseFloat,rM=parseInt,w_=typeof xa=="object"&&xa&&xa.Object===Object&&xa,sM=typeof self=="object"&&self&&self.Object===Object&&self,ki=w_||sM||Function("return this")(),sh=e&&!e.nodeType&&e,Fs=sh&&!0&&t&&!t.nodeType&&t,y_=Fs&&Fs.exports===sh,oh=y_&&w_.process,kl=function(){try{var Me=Fs&&Fs.require&&Fs.require("util").types;return Me||oh&&oh.binding&&oh.binding("util")}catch{}}(),T_=kl&&kl.isArrayBuffer,S_=kl&&kl.isDate,E_=kl&&kl.isMap,O_=kl&&kl.isRegExp,M_=kl&&kl.isSet,C_=kl&&kl.isTypedArray;function ll(Me,Ye,We){switch(We.length){case 0:return Me.call(Ye);case 1:return Me.call(Ye,We[0]);case 2:return Me.call(Ye,We[0],We[1]);case 3:return Me.call(Ye,We[0],We[1],We[2])}return Me.apply(Ye,We)}function oM(Me,Ye,We,pt){for(var zt=-1,hn=Me==null?0:Me.length;++zt-1}function ah(Me,Ye,We){for(var pt=-1,zt=Me==null?0:Me.length;++pt-1;);return We}function B_(Me,Ye){for(var We=Me.length;We--&&So(Ye,Me[We],0)>-1;);return We}function _M(Me,Ye){for(var We=Me.length,pt=0;We--;)Me[We]===Ye&&++pt;return pt}var pM=dh(hf),bM=dh(tM);function vM(Me){return"\\"+iM[Me]}function kM(Me,Ye){return Me==null?n:Me[Ye]}function Eo(Me){return Ba.test(Me)}function wM(Me){return ff.test(Me)}function yM(Me){for(var Ye,We=[];!(Ye=Me.next()).done;)We.push(Ye.value);return We}function _h(Me){var Ye=-1,We=Array(Me.size);return Me.forEach(function(pt,zt){We[++Ye]=[zt,pt]}),We}function z_(Me,Ye){return function(We){return Me(Ye(We))}}function us(Me,Ye){for(var We=-1,pt=Me.length,zt=0,hn=[];++We-1}function uC(m,b){var L=this.__data__,W=Df(L,m);return W<0?(++this.size,L.push([m,b])):L[W][1]=b,this}Tr.prototype.clear=rC,Tr.prototype.delete=sC,Tr.prototype.get=oC,Tr.prototype.has=aC,Tr.prototype.set=uC;function Sr(m){var b=-1,L=m==null?0:m.length;for(this.clear();++b=b?m:b)),m}function Sl(m,b,L,W,Q,se){var ge,ke=b&c,Le=b&d,Ke=b&h;if(L&&(ge=Q?L(m,W,Q,se):L(m)),ge!==n)return ge;if(!Gn(m))return m;var Je=Ht(m);if(Je){if(ge=hA(m),!ke)return qi(m,ge)}else{var nt=Ai(m),mt=nt==me||nt==lt;if(gs(m))return v0(m,ke);if(nt==ot||nt==Re||mt&&!Q){if(ge=Le||mt?{}:H0(m),!ke)return Le?nA(m,EC(ge,m)):tA(m,X_(ge,m))}else{if(!Tn[nt])return Q?m:{};ge=mA(m,nt,ke)}}se||(se=new Fl);var yt=se.get(m);if(yt)return yt;se.set(m,ge),hp(m)?m.forEach(function(It){ge.add(Sl(It,b,L,It,m,se))}):cp(m)&&m.forEach(function(It,Xt){ge.set(Xt,Sl(It,b,L,Xt,m,se))});var Dt=Ke?Le?Vh:Gh:Le?Zi:gi,$t=Je?n:Dt(m);return wl($t||m,function(It,Xt){$t&&(Xt=It,It=m[Xt]),Wa(ge,Xt,Sl(It,b,L,Xt,m,se))}),ge}function OC(m){var b=gi(m);return function(L){return K_(L,m,b)}}function K_(m,b,L){var W=L.length;if(m==null)return!W;for(m=Cn(m);W--;){var Q=L[W],se=b[Q],ge=m[Q];if(ge===n&&!(Q in m)||!se(ge))return!1}return!0}function J_(m,b,L){if(typeof m!="function")throw new yl(s);return Ka(function(){m.apply(n,L)},b)}function ja(m,b,L,W){var Q=-1,se=mf,ge=!0,ke=m.length,Le=[],Ke=b.length;if(!ke)return Le;L&&(b=zn(b,rl(L))),W?(se=ah,ge=!1):b.length>=l&&(se=za,ge=!1,b=new Ws(b));e:for(;++QQ?0:Q+L),W=W===n||W>Q?Q:Vt(W),W<0&&(W+=Q),W=L>W?0:gp(W);L0&&L(ke)?b>1?wi(ke,b-1,L,W,Q):as(Q,ke):W||(Q[Q.length]=ke)}return Q}var Th=E0(),e0=E0(!0);function ir(m,b){return m&&Th(m,b,gi)}function Sh(m,b){return m&&e0(m,b,gi)}function Rf(m,b){return os(b,function(L){return Ar(m[L])})}function $s(m,b){b=hs(b,m);for(var L=0,W=b.length;m!=null&&Lb}function AC(m,b){return m!=null&&Sn.call(m,b)}function LC(m,b){return m!=null&&b in Cn(m)}function DC(m,b,L){return m>=Ci(b,L)&&m=120&&Je.length>=120)?new Ws(ge&&Je):n}Je=m[0];var nt=-1,mt=ke[0];e:for(;++nt-1;)ke!==m&&Sf.call(ke,Le,1),Sf.call(m,Le,1);return m}function c0(m,b){for(var L=m?b.length:0,W=L-1;L--;){var Q=b[L];if(L==W||Q!==se){var se=Q;Cr(Q)?Sf.call(m,Q,1):Ph(m,Q)}}return m}function Dh(m,b){return m+Mf($_()*(b-m+1))}function jC(m,b,L,W){for(var Q=-1,se=ui(Of((b-m)/(L||1)),0),ge=We(se);se--;)ge[W?se:++Q]=m,m+=L;return ge}function Ih(m,b){var L="";if(!m||b<1||b>ce)return L;do b%2&&(L+=m),b=Mf(b/2),b&&(m+=m);while(b);return L}function Yt(m,b){return Xh(G0(m,b,Xi),m+"")}function $C(m){return Z_(Bo(m))}function qC(m,b){var L=Bo(m);return jf(L,js(b,0,L.length))}function Ya(m,b,L,W){if(!Gn(m))return m;b=hs(b,m);for(var Q=-1,se=b.length,ge=se-1,ke=m;ke!=null&&++QQ?0:Q+b),L=L>Q?Q:L,L<0&&(L+=Q),Q=b>L?0:L-b>>>0,b>>>=0;for(var se=We(Q);++W>>1,ge=m[se];ge!==null&&!ol(ge)&&(L?ge<=b:ge=l){var Ke=b?null:sA(m);if(Ke)return _f(Ke);ge=!1,Q=za,Le=new Ws}else Le=b?[]:ke;e:for(;++W=W?m:El(m,b,L)}var b0=zM||function(m){return ki.clearTimeout(m)};function v0(m,b){if(b)return m.slice();var L=m.length,W=F_?F_(L):new m.constructor(L);return m.copy(W),W}function Hh(m){var b=new m.constructor(m.byteLength);return new yf(b).set(new yf(m)),b}function JC(m,b){var L=b?Hh(m.buffer):m.buffer;return new m.constructor(L,m.byteOffset,m.byteLength)}function QC(m){var b=new m.constructor(m.source,yn.exec(m));return b.lastIndex=m.lastIndex,b}function xC(m){return Va?Cn(Va.call(m)):{}}function k0(m,b){var L=b?Hh(m.buffer):m.buffer;return new m.constructor(L,m.byteOffset,m.length)}function w0(m,b){if(m!==b){var L=m!==n,W=m===null,Q=m===m,se=ol(m),ge=b!==n,ke=b===null,Le=b===b,Ke=ol(b);if(!ke&&!Ke&&!se&&m>b||se&&ge&&Le&&!ke&&!Ke||W&&ge&&Le||!L&&Le||!Q)return 1;if(!W&&!se&&!Ke&&m=ke)return Le;var Ke=L[W];return Le*(Ke=="desc"?-1:1)}}return m.index-b.index}function y0(m,b,L,W){for(var Q=-1,se=m.length,ge=L.length,ke=-1,Le=b.length,Ke=ui(se-ge,0),Je=We(Le+Ke),nt=!W;++ke1?L[Q-1]:n,ge=Q>2?L[2]:n;for(se=m.length>3&&typeof se=="function"?(Q--,se):n,ge&&Hi(L[0],L[1],ge)&&(se=Q<3?n:se,Q=1),b=Cn(b);++W-1?Q[se?b[ge]:ge]:n}}function C0(m){return Mr(function(b){var L=b.length,W=L,Q=Tl.prototype.thru;for(m&&b.reverse();W--;){var se=b[W];if(typeof se!="function")throw new yl(s);if(Q&&!ge&&Vf(se)=="wrapper")var ge=new Tl([],!0)}for(W=ge?W:L;++W1&&en.reverse(),Je&&Leke))return!1;var Ke=se.get(m),Je=se.get(b);if(Ke&&Je)return Ke==b&&Je==m;var nt=-1,mt=!0,yt=L&_?new Ws:n;for(se.set(m,b),se.set(b,m);++nt1?"& ":"")+b[W],b=b.join(L>2?", ":" "),m.replace(Qr,`{ + */Hc.exports;(function(t,e){(function(){var n,i="4.17.21",l=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,d=2,h=4,g=1,_=2,k=1,y=2,T=4,M=8,A=16,C=32,D=64,R=128,N=256,G=512,B=30,j="...",q=800,V=16,K=1,x=2,ie=3,X=1/0,ce=9007199254740991,ae=17976931348623157e292,ee=0/0,he=4294967295,ne=he-1,re=he>>>1,oe=[["ary",R],["bind",k],["bindKey",y],["curry",M],["curryRight",A],["flip",G],["partial",C],["partialRight",D],["rearg",N]],Re="[object Arguments]",qe="[object Array]",Ce="[object AsyncFunction]",Ze="[object Boolean]",be="[object Date]",Ae="[object DOMException]",ve="[object Error]",me="[object Function]",lt="[object GeneratorFunction]",De="[object Map]",vt="[object Number]",dt="[object Null]",ot="[object Object]",ht="[object Promise]",Bt="[object Proxy]",Ot="[object RegExp]",Zt="[object Set]",Ve="[object String]",Nt="[object Symbol]",Tt="[object Undefined]",Gt="[object WeakMap]",fn="[object WeakSet]",an="[object ArrayBuffer]",Qt="[object DataView]",Ne="[object Float32Array]",pe="[object Float64Array]",et="[object Int8Array]",gt="[object Int16Array]",Kt="[object Int32Array]",ze="[object Uint8Array]",kt="[object Uint8ClampedArray]",Pt="[object Uint16Array]",cn="[object Uint32Array]",qn=/\b__p \+= '';/g,nl=/\b(__p \+=) '' \+/g,Bl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,Et=/[&<>"']/g,kn=RegExp(Be.source),Xe=RegExp(Et.source),wt=/<%-([\s\S]+?)%>/g,Mt=/<%([\s\S]+?)%>/g,Zn=/<%=([\s\S]+?)%>/g,Bn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wn=/^\w*$/,_r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_l=/[\\^$.*+?()[\]{}|]/g,Jr=RegExp(_l.source),ji=/^\s+/,gn=/\s/,Qr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,il=/\{\n\/\* \[wrapped with (.+)\] \*/,Xn=/,? & /,xt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xr=/[()=,{}\[\]\/\s]/,$i=/\\(\\)?/g,Mn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yn=/\w*$/,es=/^[-+]0x[0-9a-f]+$/i,pr=/^0b[01]+$/i,ts=/^\[object .+?Constructor\]$/,Rs=/^0o[0-7]+$/i,Ps=/^(?:0|[1-9]\d*)$/,ns=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pl=/($^)/,br=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",Ut="\\u0300-\\u036f",vi="\\ufe20-\\ufe2f",Ns="\\u20d0-\\u20ff",is=Ut+vi+Ns,ni="\\u2700-\\u27bf",tr="a-z\\xdf-\\xf6\\xf8-\\xff",vr="\\xac\\xb1\\xd7\\xf7",ls="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bs="\\u2000-\\u206f",kr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zs="A-Z\\xc0-\\xd6\\xd8-\\xde",ko="\\ufe0e\\ufe0f",Aa=vr+ls+Bs+kr,zl="['’]",sf="["+_t+"]",Hs="["+Aa+"]",wr="["+is+"]",wo="\\d+",of="["+ni+"]",yr="["+tr+"]",La="[^"+_t+Aa+wo+ni+tr+zs+"]",bl="\\ud83c[\\udffb-\\udfff]",nr="(?:"+wr+"|"+bl+")",Da="[^"+_t+"]",vl="(?:\\ud83c[\\udde6-\\uddff]){2}",yo="[\\ud800-\\udbff][\\udc00-\\udfff]",Bi="["+zs+"]",dn="\\u200d",rs="(?:"+yr+"|"+La+")",af="(?:"+Bi+"|"+La+")",Ia="(?:"+zl+"(?:d|ll|m|re|s|t|ve))?",Hl="(?:"+zl+"(?:D|LL|M|RE|S|T|VE))?",Ra=nr+"?",Kn="["+ko+"]?",ii="(?:"+dn+"(?:"+[Da,vl,yo].join("|")+")"+Kn+Ra+")*",li="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",uf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Pa=Kn+Ra+ii,tt="(?:"+[of,vl,yo].join("|")+")"+Pa,at="(?:"+[Da+wr+"?",wr,vl,yo,sf].join("|")+")",Mi=RegExp(zl,"g"),ss=RegExp(wr,"g"),To=RegExp(bl+"(?="+bl+")|"+at+Pa,"g"),Na=RegExp([Bi+"?"+yr+"+"+Ia+"(?="+[Hs,Bi,"$"].join("|")+")",af+"+"+Hl+"(?="+[Hs,Bi+rs,"$"].join("|")+")",Bi+"?"+rs+"+"+Ia,Bi+"+"+Hl,uf,li,wo,tt].join("|"),"g"),Ba=RegExp("["+dn+_t+is+ko+"]"),ff=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],df=-1,On={};On[Ne]=On[pe]=On[et]=On[gt]=On[Kt]=On[ze]=On[kt]=On[Pt]=On[cn]=!0,On[Re]=On[qe]=On[an]=On[Ze]=On[Qt]=On[be]=On[ve]=On[me]=On[De]=On[vt]=On[ot]=On[Ot]=On[Zt]=On[Ve]=On[Gt]=!1;var Tn={};Tn[Re]=Tn[qe]=Tn[an]=Tn[Qt]=Tn[Ze]=Tn[be]=Tn[Ne]=Tn[pe]=Tn[et]=Tn[gt]=Tn[Kt]=Tn[De]=Tn[vt]=Tn[ot]=Tn[Ot]=Tn[Zt]=Tn[Ve]=Tn[Nt]=Tn[ze]=Tn[kt]=Tn[Pt]=Tn[cn]=!0,Tn[ve]=Tn[me]=Tn[Gt]=!1;var hf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tM={"&":"&","<":"<",">":">",'"':""","'":"'"},nM={"&":"&","<":"<",">":">",""":'"',"'":"'"},iM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lM=parseFloat,rM=parseInt,w_=typeof xa=="object"&&xa&&xa.Object===Object&&xa,sM=typeof self=="object"&&self&&self.Object===Object&&self,ki=w_||sM||Function("return this")(),sh=e&&!e.nodeType&&e,Us=sh&&!0&&t&&!t.nodeType&&t,y_=Us&&Us.exports===sh,oh=y_&&w_.process,kl=function(){try{var Me=Us&&Us.require&&Us.require("util").types;return Me||oh&&oh.binding&&oh.binding("util")}catch{}}(),T_=kl&&kl.isArrayBuffer,S_=kl&&kl.isDate,E_=kl&&kl.isMap,O_=kl&&kl.isRegExp,M_=kl&&kl.isSet,C_=kl&&kl.isTypedArray;function ll(Me,Ye,We){switch(We.length){case 0:return Me.call(Ye);case 1:return Me.call(Ye,We[0]);case 2:return Me.call(Ye,We[0],We[1]);case 3:return Me.call(Ye,We[0],We[1],We[2])}return Me.apply(Ye,We)}function oM(Me,Ye,We,pt){for(var zt=-1,hn=Me==null?0:Me.length;++zt-1}function ah(Me,Ye,We){for(var pt=-1,zt=Me==null?0:Me.length;++pt-1;);return We}function B_(Me,Ye){for(var We=Me.length;We--&&So(Ye,Me[We],0)>-1;);return We}function _M(Me,Ye){for(var We=Me.length,pt=0;We--;)Me[We]===Ye&&++pt;return pt}var pM=dh(hf),bM=dh(tM);function vM(Me){return"\\"+iM[Me]}function kM(Me,Ye){return Me==null?n:Me[Ye]}function Eo(Me){return Ba.test(Me)}function wM(Me){return ff.test(Me)}function yM(Me){for(var Ye,We=[];!(Ye=Me.next()).done;)We.push(Ye.value);return We}function _h(Me){var Ye=-1,We=Array(Me.size);return Me.forEach(function(pt,zt){We[++Ye]=[zt,pt]}),We}function z_(Me,Ye){return function(We){return Me(Ye(We))}}function us(Me,Ye){for(var We=-1,pt=Me.length,zt=0,hn=[];++We-1}function uC(m,b){var L=this.__data__,W=Df(L,m);return W<0?(++this.size,L.push([m,b])):L[W][1]=b,this}Tr.prototype.clear=rC,Tr.prototype.delete=sC,Tr.prototype.get=oC,Tr.prototype.has=aC,Tr.prototype.set=uC;function Sr(m){var b=-1,L=m==null?0:m.length;for(this.clear();++b=b?m:b)),m}function Sl(m,b,L,W,Q,se){var ge,ke=b&c,Le=b&d,Ke=b&h;if(L&&(ge=Q?L(m,W,Q,se):L(m)),ge!==n)return ge;if(!Gn(m))return m;var Je=Ht(m);if(Je){if(ge=hA(m),!ke)return qi(m,ge)}else{var nt=Ai(m),mt=nt==me||nt==lt;if(gs(m))return v0(m,ke);if(nt==ot||nt==Re||mt&&!Q){if(ge=Le||mt?{}:H0(m),!ke)return Le?nA(m,EC(ge,m)):tA(m,X_(ge,m))}else{if(!Tn[nt])return Q?m:{};ge=mA(m,nt,ke)}}se||(se=new Fl);var yt=se.get(m);if(yt)return yt;se.set(m,ge),hp(m)?m.forEach(function(It){ge.add(Sl(It,b,L,It,m,se))}):cp(m)&&m.forEach(function(It,Xt){ge.set(Xt,Sl(It,b,L,Xt,m,se))});var Dt=Ke?Le?Vh:Gh:Le?Zi:gi,$t=Je?n:Dt(m);return wl($t||m,function(It,Xt){$t&&(Xt=It,It=m[Xt]),Wa(ge,Xt,Sl(It,b,L,Xt,m,se))}),ge}function OC(m){var b=gi(m);return function(L){return K_(L,m,b)}}function K_(m,b,L){var W=L.length;if(m==null)return!W;for(m=Cn(m);W--;){var Q=L[W],se=b[Q],ge=m[Q];if(ge===n&&!(Q in m)||!se(ge))return!1}return!0}function J_(m,b,L){if(typeof m!="function")throw new yl(s);return Ka(function(){m.apply(n,L)},b)}function ja(m,b,L,W){var Q=-1,se=mf,ge=!0,ke=m.length,Le=[],Ke=b.length;if(!ke)return Le;L&&(b=zn(b,rl(L))),W?(se=ah,ge=!1):b.length>=l&&(se=za,ge=!1,b=new Vs(b));e:for(;++QQ?0:Q+L),W=W===n||W>Q?Q:Vt(W),W<0&&(W+=Q),W=L>W?0:gp(W);L0&&L(ke)?b>1?wi(ke,b-1,L,W,Q):as(Q,ke):W||(Q[Q.length]=ke)}return Q}var Th=E0(),e0=E0(!0);function ir(m,b){return m&&Th(m,b,gi)}function Sh(m,b){return m&&e0(m,b,gi)}function Rf(m,b){return os(b,function(L){return Ar(m[L])})}function js(m,b){b=hs(b,m);for(var L=0,W=b.length;m!=null&&Lb}function AC(m,b){return m!=null&&Sn.call(m,b)}function LC(m,b){return m!=null&&b in Cn(m)}function DC(m,b,L){return m>=Ci(b,L)&&m=120&&Je.length>=120)?new Vs(ge&&Je):n}Je=m[0];var nt=-1,mt=ke[0];e:for(;++nt-1;)ke!==m&&Sf.call(ke,Le,1),Sf.call(m,Le,1);return m}function c0(m,b){for(var L=m?b.length:0,W=L-1;L--;){var Q=b[L];if(L==W||Q!==se){var se=Q;Cr(Q)?Sf.call(m,Q,1):Ph(m,Q)}}return m}function Dh(m,b){return m+Mf($_()*(b-m+1))}function jC(m,b,L,W){for(var Q=-1,se=ui(Of((b-m)/(L||1)),0),ge=We(se);se--;)ge[W?se:++Q]=m,m+=L;return ge}function Ih(m,b){var L="";if(!m||b<1||b>ce)return L;do b%2&&(L+=m),b=Mf(b/2),b&&(m+=m);while(b);return L}function Yt(m,b){return Xh(G0(m,b,Xi),m+"")}function $C(m){return Z_(Bo(m))}function qC(m,b){var L=Bo(m);return jf(L,Ws(b,0,L.length))}function Ya(m,b,L,W){if(!Gn(m))return m;b=hs(b,m);for(var Q=-1,se=b.length,ge=se-1,ke=m;ke!=null&&++QQ?0:Q+b),L=L>Q?Q:L,L<0&&(L+=Q),Q=b>L?0:L-b>>>0,b>>>=0;for(var se=We(Q);++W>>1,ge=m[se];ge!==null&&!ol(ge)&&(L?ge<=b:ge=l){var Ke=b?null:sA(m);if(Ke)return _f(Ke);ge=!1,Q=za,Le=new Vs}else Le=b?[]:ke;e:for(;++W=W?m:El(m,b,L)}var b0=zM||function(m){return ki.clearTimeout(m)};function v0(m,b){if(b)return m.slice();var L=m.length,W=F_?F_(L):new m.constructor(L);return m.copy(W),W}function Hh(m){var b=new m.constructor(m.byteLength);return new yf(b).set(new yf(m)),b}function JC(m,b){var L=b?Hh(m.buffer):m.buffer;return new m.constructor(L,m.byteOffset,m.byteLength)}function QC(m){var b=new m.constructor(m.source,yn.exec(m));return b.lastIndex=m.lastIndex,b}function xC(m){return Va?Cn(Va.call(m)):{}}function k0(m,b){var L=b?Hh(m.buffer):m.buffer;return new m.constructor(L,m.byteOffset,m.length)}function w0(m,b){if(m!==b){var L=m!==n,W=m===null,Q=m===m,se=ol(m),ge=b!==n,ke=b===null,Le=b===b,Ke=ol(b);if(!ke&&!Ke&&!se&&m>b||se&&ge&&Le&&!ke&&!Ke||W&&ge&&Le||!L&&Le||!Q)return 1;if(!W&&!se&&!Ke&&m=ke)return Le;var Ke=L[W];return Le*(Ke=="desc"?-1:1)}}return m.index-b.index}function y0(m,b,L,W){for(var Q=-1,se=m.length,ge=L.length,ke=-1,Le=b.length,Ke=ui(se-ge,0),Je=We(Le+Ke),nt=!W;++ke1?L[Q-1]:n,ge=Q>2?L[2]:n;for(se=m.length>3&&typeof se=="function"?(Q--,se):n,ge&&Hi(L[0],L[1],ge)&&(se=Q<3?n:se,Q=1),b=Cn(b);++W-1?Q[se?b[ge]:ge]:n}}function C0(m){return Mr(function(b){var L=b.length,W=L,Q=Tl.prototype.thru;for(m&&b.reverse();W--;){var se=b[W];if(typeof se!="function")throw new yl(s);if(Q&&!ge&&Vf(se)=="wrapper")var ge=new Tl([],!0)}for(W=ge?W:L;++W1&&en.reverse(),Je&&Leke))return!1;var Ke=se.get(m),Je=se.get(b);if(Ke&&Je)return Ke==b&&Je==m;var nt=-1,mt=!0,yt=L&_?new Vs:n;for(se.set(m,b),se.set(b,m);++nt1?"& ":"")+b[W],b=b.join(L>2?", ":" "),m.replace(Qr,`{ /* [wrapped with `+b+`] */ -`)}function _A(m){return Ht(m)||Zs(m)||!!(W_&&m&&m[W_])}function Cr(m,b){var L=typeof m;return b=b??ce,!!b&&(L=="number"||L!="symbol"&&Ns.test(m))&&m>-1&&m%1==0&&m0){if(++b>=q)return arguments[0]}else b=0;return m.apply(n,arguments)}}function jf(m,b){var L=-1,W=m.length,Q=W-1;for(b=b===n?W:b;++L1?m[b-1]:n;return L=typeof L=="function"?(m.pop(),L):n,x0(m,L)});function ep(m){var b=le(m);return b.__chain__=!0,b}function M7(m,b){return b(m),m}function $f(m,b){return b(m)}var C7=Mr(function(m){var b=m.length,L=b?m[0]:0,W=this.__wrapped__,Q=function(se){return yh(se,m)};return b>1||this.__actions__.length||!(W instanceof Jt)||!Cr(L)?this.thru(Q):(W=W.slice(L,+L+(b?1:0)),W.__actions__.push({func:$f,args:[Q],thisArg:n}),new Tl(W,this.__chain__).thru(function(se){return b&&!se.length&&se.push(n),se}))});function A7(){return ep(this)}function L7(){return new Tl(this.value(),this.__chain__)}function D7(){this.__values__===n&&(this.__values__=mp(this.value()));var m=this.__index__>=this.__values__.length,b=m?n:this.__values__[this.__index__++];return{done:m,value:b}}function I7(){return this}function R7(m){for(var b,L=this;L instanceof Lf;){var W=Y0(L);W.__index__=0,W.__values__=n,b?Q.__wrapped__=W:b=W;var Q=W;L=L.__wrapped__}return Q.__wrapped__=m,b}function P7(){var m=this.__wrapped__;if(m instanceof Jt){var b=m;return this.__actions__.length&&(b=new Jt(this)),b=b.reverse(),b.__actions__.push({func:$f,args:[Kh],thisArg:n}),new Tl(b,this.__chain__)}return this.thru(Kh)}function N7(){return _0(this.__wrapped__,this.__actions__)}var B7=zf(function(m,b,L){Sn.call(m,L)?++m[L]:Er(m,L,1)});function z7(m,b,L){var W=Ht(m)?A_:MC;return L&&Hi(m,b,L)&&(b=n),W(m,Lt(b,3))}function H7(m,b){var L=Ht(m)?os:x_;return L(m,Lt(b,3))}var U7=M0(Z0),F7=M0(X0);function G7(m,b){return wi(qf(m,b),1)}function V7(m,b){return wi(qf(m,b),X)}function W7(m,b,L){return L=L===n?1:Vt(L),wi(qf(m,b),L)}function tp(m,b){var L=Ht(m)?wl:cs;return L(m,Lt(b,3))}function np(m,b){var L=Ht(m)?aM:Q_;return L(m,Lt(b,3))}var j7=zf(function(m,b,L){Sn.call(m,L)?m[L].push(b):Er(m,L,[b])});function $7(m,b,L,W){m=Yi(m)?m:Bo(m),L=L&&!W?Vt(L):0;var Q=m.length;return L<0&&(L=ui(Q+L,0)),Jf(m)?L<=Q&&m.indexOf(b,L)>-1:!!Q&&So(m,b,L)>-1}var q7=Yt(function(m,b,L){var W=-1,Q=typeof b=="function",se=Yi(m)?We(m.length):[];return cs(m,function(ge){se[++W]=Q?ll(b,ge,L):$a(ge,b,L)}),se}),Y7=zf(function(m,b,L){Er(m,L,b)});function qf(m,b){var L=Ht(m)?zn:r0;return L(m,Lt(b,3))}function Z7(m,b,L,W){return m==null?[]:(Ht(b)||(b=b==null?[]:[b]),L=W?n:L,Ht(L)||(L=L==null?[]:[L]),u0(m,b,L))}var X7=zf(function(m,b,L){m[L?0:1].push(b)},function(){return[[],[]]});function K7(m,b,L){var W=Ht(m)?uh:R_,Q=arguments.length<3;return W(m,Lt(b,4),L,Q,cs)}function J7(m,b,L){var W=Ht(m)?uM:R_,Q=arguments.length<3;return W(m,Lt(b,4),L,Q,Q_)}function Q7(m,b){var L=Ht(m)?os:x_;return L(m,Xf(Lt(b,3)))}function x7(m){var b=Ht(m)?Z_:$C;return b(m)}function e9(m,b,L){(L?Hi(m,b,L):b===n)?b=1:b=Vt(b);var W=Ht(m)?yC:qC;return W(m,b)}function t9(m){var b=Ht(m)?TC:ZC;return b(m)}function n9(m){if(m==null)return 0;if(Yi(m))return Jf(m)?Oo(m):m.length;var b=Ai(m);return b==De||b==Zt?m.size:Ch(m).length}function i9(m,b,L){var W=Ht(m)?fh:XC;return L&&Hi(m,b,L)&&(b=n),W(m,Lt(b,3))}var l9=Yt(function(m,b){if(m==null)return[];var L=b.length;return L>1&&Hi(m,b[0],b[1])?b=[]:L>2&&Hi(b[0],b[1],b[2])&&(b=[b[0]]),u0(m,wi(b,1),[])}),Yf=HM||function(){return ki.Date.now()};function r9(m,b){if(typeof b!="function")throw new yl(s);return m=Vt(m),function(){if(--m<1)return b.apply(this,arguments)}}function ip(m,b,L){return b=L?n:b,b=m&&b==null?m.length:b,Or(m,R,n,n,n,n,b)}function lp(m,b){var L;if(typeof b!="function")throw new yl(s);return m=Vt(m),function(){return--m>0&&(L=b.apply(this,arguments)),m<=1&&(b=n),L}}var Qh=Yt(function(m,b,L){var W=k;if(L.length){var Q=us(L,Po(Qh));W|=C}return Or(m,W,b,L,Q)}),rp=Yt(function(m,b,L){var W=k|y;if(L.length){var Q=us(L,Po(rp));W|=C}return Or(b,W,m,L,Q)});function sp(m,b,L){b=L?n:b;var W=Or(m,M,n,n,n,n,n,b);return W.placeholder=sp.placeholder,W}function op(m,b,L){b=L?n:b;var W=Or(m,A,n,n,n,n,n,b);return W.placeholder=op.placeholder,W}function ap(m,b,L){var W,Q,se,ge,ke,Le,Ke=0,Je=!1,nt=!1,mt=!0;if(typeof m!="function")throw new yl(s);b=Ml(b)||0,Gn(L)&&(Je=!!L.leading,nt="maxWait"in L,se=nt?ui(Ml(L.maxWait)||0,b):se,mt="trailing"in L?!!L.trailing:mt);function yt(Qn){var Vl=W,Dr=Q;return W=Q=n,Ke=Qn,ge=m.apply(Dr,Vl),ge}function Dt(Qn){return Ke=Qn,ke=Ka(Xt,b),Je?yt(Qn):ge}function $t(Qn){var Vl=Qn-Le,Dr=Qn-Ke,Mp=b-Vl;return nt?Ci(Mp,se-Dr):Mp}function It(Qn){var Vl=Qn-Le,Dr=Qn-Ke;return Le===n||Vl>=b||Vl<0||nt&&Dr>=se}function Xt(){var Qn=Yf();if(It(Qn))return en(Qn);ke=Ka(Xt,$t(Qn))}function en(Qn){return ke=n,mt&&W?yt(Qn):(W=Q=n,ge)}function al(){ke!==n&&b0(ke),Ke=0,W=Le=Q=ke=n}function Ui(){return ke===n?ge:en(Yf())}function ul(){var Qn=Yf(),Vl=It(Qn);if(W=arguments,Q=this,Le=Qn,Vl){if(ke===n)return Dt(Le);if(nt)return b0(ke),ke=Ka(Xt,b),yt(Le)}return ke===n&&(ke=Ka(Xt,b)),ge}return ul.cancel=al,ul.flush=Ui,ul}var s9=Yt(function(m,b){return J_(m,1,b)}),o9=Yt(function(m,b,L){return J_(m,Ml(b)||0,L)});function a9(m){return Or(m,G)}function Zf(m,b){if(typeof m!="function"||b!=null&&typeof b!="function")throw new yl(s);var L=function(){var W=arguments,Q=b?b.apply(this,W):W[0],se=L.cache;if(se.has(Q))return se.get(Q);var ge=m.apply(this,W);return L.cache=se.set(Q,ge)||se,ge};return L.cache=new(Zf.Cache||Sr),L}Zf.Cache=Sr;function Xf(m){if(typeof m!="function")throw new yl(s);return function(){var b=arguments;switch(b.length){case 0:return!m.call(this);case 1:return!m.call(this,b[0]);case 2:return!m.call(this,b[0],b[1]);case 3:return!m.call(this,b[0],b[1],b[2])}return!m.apply(this,b)}}function u9(m){return lp(2,m)}var f9=KC(function(m,b){b=b.length==1&&Ht(b[0])?zn(b[0],rl(Lt())):zn(wi(b,1),rl(Lt()));var L=b.length;return Yt(function(W){for(var Q=-1,se=Ci(W.length,L);++Q=b}),Zs=n0(function(){return arguments}())?n0:function(m){return Yn(m)&&Sn.call(m,"callee")&&!V_.call(m,"callee")},Ht=We.isArray,E9=T_?rl(T_):RC;function Yi(m){return m!=null&&Kf(m.length)&&!Ar(m)}function Jn(m){return Yn(m)&&Yi(m)}function O9(m){return m===!0||m===!1||Yn(m)&&zi(m)==Ze}var gs=FM||f1,M9=S_?rl(S_):PC;function C9(m){return Yn(m)&&m.nodeType===1&&!Ja(m)}function A9(m){if(m==null)return!0;if(Yi(m)&&(Ht(m)||typeof m=="string"||typeof m.splice=="function"||gs(m)||No(m)||Zs(m)))return!m.length;var b=Ai(m);if(b==De||b==Zt)return!m.size;if(Xa(m))return!Ch(m).length;for(var L in m)if(Sn.call(m,L))return!1;return!0}function L9(m,b){return qa(m,b)}function D9(m,b,L){L=typeof L=="function"?L:n;var W=L?L(m,b):n;return W===n?qa(m,b,n,L):!!W}function e1(m){if(!Yn(m))return!1;var b=zi(m);return b==ve||b==Ae||typeof m.message=="string"&&typeof m.name=="string"&&!Ja(m)}function I9(m){return typeof m=="number"&&j_(m)}function Ar(m){if(!Gn(m))return!1;var b=zi(m);return b==me||b==lt||b==Ce||b==Bt}function fp(m){return typeof m=="number"&&m==Vt(m)}function Kf(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=ce}function Gn(m){var b=typeof m;return m!=null&&(b=="object"||b=="function")}function Yn(m){return m!=null&&typeof m=="object"}var cp=E_?rl(E_):BC;function R9(m,b){return m===b||Mh(m,b,jh(b))}function P9(m,b,L){return L=typeof L=="function"?L:n,Mh(m,b,jh(b),L)}function N9(m){return dp(m)&&m!=+m}function B9(m){if(vA(m))throw new zt(r);return i0(m)}function z9(m){return m===null}function H9(m){return m==null}function dp(m){return typeof m=="number"||Yn(m)&&zi(m)==vt}function Ja(m){if(!Yn(m)||zi(m)!=ot)return!1;var b=Tf(m);if(b===null)return!0;var L=Sn.call(b,"constructor")&&b.constructor;return typeof L=="function"&&L instanceof L&&vf.call(L)==PM}var t1=O_?rl(O_):zC;function U9(m){return fp(m)&&m>=-ce&&m<=ce}var hp=M_?rl(M_):HC;function Jf(m){return typeof m=="string"||!Ht(m)&&Yn(m)&&zi(m)==Ve}function ol(m){return typeof m=="symbol"||Yn(m)&&zi(m)==Nt}var No=C_?rl(C_):UC;function F9(m){return m===n}function G9(m){return Yn(m)&&Ai(m)==Gt}function V9(m){return Yn(m)&&zi(m)==fn}var W9=Gf(Ah),j9=Gf(function(m,b){return m<=b});function mp(m){if(!m)return[];if(Yi(m))return Jf(m)?Ul(m):qi(m);if(Ha&&m[Ha])return yM(m[Ha]());var b=Ai(m),L=b==De?_h:b==Zt?_f:Bo;return L(m)}function Lr(m){if(!m)return m===0?m:0;if(m=Ml(m),m===X||m===-X){var b=m<0?-1:1;return b*ae}return m===m?m:0}function Vt(m){var b=Lr(m),L=b%1;return b===b?L?b-L:b:0}function gp(m){return m?js(Vt(m),0,he):0}function Ml(m){if(typeof m=="number")return m;if(ol(m))return ee;if(Gn(m)){var b=typeof m.valueOf=="function"?m.valueOf():m;m=Gn(b)?b+"":b}if(typeof m!="string")return m===0?m:+m;m=P_(m);var L=pr.test(m);return L||Ps.test(m)?rM(m.slice(2),L?2:8):es.test(m)?ee:+m}function _p(m){return lr(m,Zi(m))}function $9(m){return m?js(Vt(m),-ce,ce):m===0?m:0}function _n(m){return m==null?"":sl(m)}var q9=Io(function(m,b){if(Xa(b)||Yi(b)){lr(b,gi(b),m);return}for(var L in b)Sn.call(b,L)&&Wa(m,L,b[L])}),pp=Io(function(m,b){lr(b,Zi(b),m)}),Qf=Io(function(m,b,L,W){lr(b,Zi(b),m,W)}),Y9=Io(function(m,b,L,W){lr(b,gi(b),m,W)}),Z9=Mr(yh);function X9(m,b){var L=Do(m);return b==null?L:X_(L,b)}var K9=Yt(function(m,b){m=Cn(m);var L=-1,W=b.length,Q=W>2?b[2]:n;for(Q&&Hi(b[0],b[1],Q)&&(W=1);++L1),se}),lr(m,Vh(m),L),W&&(L=Sl(L,c|d|h,oA));for(var Q=b.length;Q--;)Ph(L,b[Q]);return L});function mL(m,b){return vp(m,Xf(Lt(b)))}var gL=Mr(function(m,b){return m==null?{}:VC(m,b)});function vp(m,b){if(m==null)return{};var L=zn(Vh(m),function(W){return[W]});return b=Lt(b),f0(m,L,function(W,Q){return b(W,Q[0])})}function _L(m,b,L){b=hs(b,m);var W=-1,Q=b.length;for(Q||(Q=1,m=n);++Wb){var W=m;m=b,b=W}if(L||m%1||b%1){var Q=$_();return Ci(m+Q*(b-m+lM("1e-"+((Q+"").length-1))),b)}return Dh(m,b)}var ML=Ro(function(m,b,L){return b=b.toLowerCase(),m+(L?yp(b):b)});function yp(m){return l1(_n(m).toLowerCase())}function Tp(m){return m=_n(m),m&&m.replace(ns,pM).replace(ss,"")}function CL(m,b,L){m=_n(m),b=sl(b);var W=m.length;L=L===n?W:js(Vt(L),0,W);var Q=L;return L-=b.length,L>=0&&m.slice(L,Q)==b}function AL(m){return m=_n(m),m&&Xe.test(m)?m.replace(Et,bM):m}function LL(m){return m=_n(m),m&&Jr.test(m)?m.replace(_l,"\\$&"):m}var DL=Ro(function(m,b,L){return m+(L?"-":"")+b.toLowerCase()}),IL=Ro(function(m,b,L){return m+(L?" ":"")+b.toLowerCase()}),RL=O0("toLowerCase");function PL(m,b,L){m=_n(m),b=Vt(b);var W=b?Oo(m):0;if(!b||W>=b)return m;var Q=(b-W)/2;return Ff(Mf(Q),L)+m+Ff(Of(Q),L)}function NL(m,b,L){m=_n(m),b=Vt(b);var W=b?Oo(m):0;return b&&W>>0,L?(m=_n(m),m&&(typeof b=="string"||b!=null&&!t1(b))&&(b=sl(b),!b&&Eo(m))?ms(Ul(m),0,L):m.split(b,L)):[]}var VL=Ro(function(m,b,L){return m+(L?" ":"")+l1(b)});function WL(m,b,L){return m=_n(m),L=L==null?0:js(Vt(L),0,m.length),b=sl(b),m.slice(L,L+b.length)==b}function jL(m,b,L){var W=le.templateSettings;L&&Hi(m,b,L)&&(b=n),m=_n(m),b=Qf({},b,W,R0);var Q=Qf({},b.imports,W.imports,R0),se=gi(Q),ge=gh(Q,se),ke,Le,Ke=0,Je=b.interpolate||pl,nt="__p += '",mt=ph((b.escape||pl).source+"|"+Je.source+"|"+(Je===Zn?Mn:pl).source+"|"+(b.evaluate||pl).source+"|$","g"),yt="//# sourceURL="+(Sn.call(b,"sourceURL")?(b.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++df+"]")+` +`)}function _A(m){return Ht(m)||Ys(m)||!!(W_&&m&&m[W_])}function Cr(m,b){var L=typeof m;return b=b??ce,!!b&&(L=="number"||L!="symbol"&&Ps.test(m))&&m>-1&&m%1==0&&m0){if(++b>=q)return arguments[0]}else b=0;return m.apply(n,arguments)}}function jf(m,b){var L=-1,W=m.length,Q=W-1;for(b=b===n?W:b;++L1?m[b-1]:n;return L=typeof L=="function"?(m.pop(),L):n,x0(m,L)});function ep(m){var b=le(m);return b.__chain__=!0,b}function M7(m,b){return b(m),m}function $f(m,b){return b(m)}var C7=Mr(function(m){var b=m.length,L=b?m[0]:0,W=this.__wrapped__,Q=function(se){return yh(se,m)};return b>1||this.__actions__.length||!(W instanceof Jt)||!Cr(L)?this.thru(Q):(W=W.slice(L,+L+(b?1:0)),W.__actions__.push({func:$f,args:[Q],thisArg:n}),new Tl(W,this.__chain__).thru(function(se){return b&&!se.length&&se.push(n),se}))});function A7(){return ep(this)}function L7(){return new Tl(this.value(),this.__chain__)}function D7(){this.__values__===n&&(this.__values__=mp(this.value()));var m=this.__index__>=this.__values__.length,b=m?n:this.__values__[this.__index__++];return{done:m,value:b}}function I7(){return this}function R7(m){for(var b,L=this;L instanceof Lf;){var W=Y0(L);W.__index__=0,W.__values__=n,b?Q.__wrapped__=W:b=W;var Q=W;L=L.__wrapped__}return Q.__wrapped__=m,b}function P7(){var m=this.__wrapped__;if(m instanceof Jt){var b=m;return this.__actions__.length&&(b=new Jt(this)),b=b.reverse(),b.__actions__.push({func:$f,args:[Kh],thisArg:n}),new Tl(b,this.__chain__)}return this.thru(Kh)}function N7(){return _0(this.__wrapped__,this.__actions__)}var B7=zf(function(m,b,L){Sn.call(m,L)?++m[L]:Er(m,L,1)});function z7(m,b,L){var W=Ht(m)?A_:MC;return L&&Hi(m,b,L)&&(b=n),W(m,Lt(b,3))}function H7(m,b){var L=Ht(m)?os:x_;return L(m,Lt(b,3))}var U7=M0(Z0),F7=M0(X0);function G7(m,b){return wi(qf(m,b),1)}function V7(m,b){return wi(qf(m,b),X)}function W7(m,b,L){return L=L===n?1:Vt(L),wi(qf(m,b),L)}function tp(m,b){var L=Ht(m)?wl:cs;return L(m,Lt(b,3))}function np(m,b){var L=Ht(m)?aM:Q_;return L(m,Lt(b,3))}var j7=zf(function(m,b,L){Sn.call(m,L)?m[L].push(b):Er(m,L,[b])});function $7(m,b,L,W){m=Yi(m)?m:Bo(m),L=L&&!W?Vt(L):0;var Q=m.length;return L<0&&(L=ui(Q+L,0)),Jf(m)?L<=Q&&m.indexOf(b,L)>-1:!!Q&&So(m,b,L)>-1}var q7=Yt(function(m,b,L){var W=-1,Q=typeof b=="function",se=Yi(m)?We(m.length):[];return cs(m,function(ge){se[++W]=Q?ll(b,ge,L):$a(ge,b,L)}),se}),Y7=zf(function(m,b,L){Er(m,L,b)});function qf(m,b){var L=Ht(m)?zn:r0;return L(m,Lt(b,3))}function Z7(m,b,L,W){return m==null?[]:(Ht(b)||(b=b==null?[]:[b]),L=W?n:L,Ht(L)||(L=L==null?[]:[L]),u0(m,b,L))}var X7=zf(function(m,b,L){m[L?0:1].push(b)},function(){return[[],[]]});function K7(m,b,L){var W=Ht(m)?uh:R_,Q=arguments.length<3;return W(m,Lt(b,4),L,Q,cs)}function J7(m,b,L){var W=Ht(m)?uM:R_,Q=arguments.length<3;return W(m,Lt(b,4),L,Q,Q_)}function Q7(m,b){var L=Ht(m)?os:x_;return L(m,Xf(Lt(b,3)))}function x7(m){var b=Ht(m)?Z_:$C;return b(m)}function e9(m,b,L){(L?Hi(m,b,L):b===n)?b=1:b=Vt(b);var W=Ht(m)?yC:qC;return W(m,b)}function t9(m){var b=Ht(m)?TC:ZC;return b(m)}function n9(m){if(m==null)return 0;if(Yi(m))return Jf(m)?Oo(m):m.length;var b=Ai(m);return b==De||b==Zt?m.size:Ch(m).length}function i9(m,b,L){var W=Ht(m)?fh:XC;return L&&Hi(m,b,L)&&(b=n),W(m,Lt(b,3))}var l9=Yt(function(m,b){if(m==null)return[];var L=b.length;return L>1&&Hi(m,b[0],b[1])?b=[]:L>2&&Hi(b[0],b[1],b[2])&&(b=[b[0]]),u0(m,wi(b,1),[])}),Yf=HM||function(){return ki.Date.now()};function r9(m,b){if(typeof b!="function")throw new yl(s);return m=Vt(m),function(){if(--m<1)return b.apply(this,arguments)}}function ip(m,b,L){return b=L?n:b,b=m&&b==null?m.length:b,Or(m,R,n,n,n,n,b)}function lp(m,b){var L;if(typeof b!="function")throw new yl(s);return m=Vt(m),function(){return--m>0&&(L=b.apply(this,arguments)),m<=1&&(b=n),L}}var Qh=Yt(function(m,b,L){var W=k;if(L.length){var Q=us(L,Po(Qh));W|=C}return Or(m,W,b,L,Q)}),rp=Yt(function(m,b,L){var W=k|y;if(L.length){var Q=us(L,Po(rp));W|=C}return Or(b,W,m,L,Q)});function sp(m,b,L){b=L?n:b;var W=Or(m,M,n,n,n,n,n,b);return W.placeholder=sp.placeholder,W}function op(m,b,L){b=L?n:b;var W=Or(m,A,n,n,n,n,n,b);return W.placeholder=op.placeholder,W}function ap(m,b,L){var W,Q,se,ge,ke,Le,Ke=0,Je=!1,nt=!1,mt=!0;if(typeof m!="function")throw new yl(s);b=Ml(b)||0,Gn(L)&&(Je=!!L.leading,nt="maxWait"in L,se=nt?ui(Ml(L.maxWait)||0,b):se,mt="trailing"in L?!!L.trailing:mt);function yt(Qn){var Vl=W,Dr=Q;return W=Q=n,Ke=Qn,ge=m.apply(Dr,Vl),ge}function Dt(Qn){return Ke=Qn,ke=Ka(Xt,b),Je?yt(Qn):ge}function $t(Qn){var Vl=Qn-Le,Dr=Qn-Ke,Mp=b-Vl;return nt?Ci(Mp,se-Dr):Mp}function It(Qn){var Vl=Qn-Le,Dr=Qn-Ke;return Le===n||Vl>=b||Vl<0||nt&&Dr>=se}function Xt(){var Qn=Yf();if(It(Qn))return en(Qn);ke=Ka(Xt,$t(Qn))}function en(Qn){return ke=n,mt&&W?yt(Qn):(W=Q=n,ge)}function al(){ke!==n&&b0(ke),Ke=0,W=Le=Q=ke=n}function Ui(){return ke===n?ge:en(Yf())}function ul(){var Qn=Yf(),Vl=It(Qn);if(W=arguments,Q=this,Le=Qn,Vl){if(ke===n)return Dt(Le);if(nt)return b0(ke),ke=Ka(Xt,b),yt(Le)}return ke===n&&(ke=Ka(Xt,b)),ge}return ul.cancel=al,ul.flush=Ui,ul}var s9=Yt(function(m,b){return J_(m,1,b)}),o9=Yt(function(m,b,L){return J_(m,Ml(b)||0,L)});function a9(m){return Or(m,G)}function Zf(m,b){if(typeof m!="function"||b!=null&&typeof b!="function")throw new yl(s);var L=function(){var W=arguments,Q=b?b.apply(this,W):W[0],se=L.cache;if(se.has(Q))return se.get(Q);var ge=m.apply(this,W);return L.cache=se.set(Q,ge)||se,ge};return L.cache=new(Zf.Cache||Sr),L}Zf.Cache=Sr;function Xf(m){if(typeof m!="function")throw new yl(s);return function(){var b=arguments;switch(b.length){case 0:return!m.call(this);case 1:return!m.call(this,b[0]);case 2:return!m.call(this,b[0],b[1]);case 3:return!m.call(this,b[0],b[1],b[2])}return!m.apply(this,b)}}function u9(m){return lp(2,m)}var f9=KC(function(m,b){b=b.length==1&&Ht(b[0])?zn(b[0],rl(Lt())):zn(wi(b,1),rl(Lt()));var L=b.length;return Yt(function(W){for(var Q=-1,se=Ci(W.length,L);++Q=b}),Ys=n0(function(){return arguments}())?n0:function(m){return Yn(m)&&Sn.call(m,"callee")&&!V_.call(m,"callee")},Ht=We.isArray,E9=T_?rl(T_):RC;function Yi(m){return m!=null&&Kf(m.length)&&!Ar(m)}function Jn(m){return Yn(m)&&Yi(m)}function O9(m){return m===!0||m===!1||Yn(m)&&zi(m)==Ze}var gs=FM||f1,M9=S_?rl(S_):PC;function C9(m){return Yn(m)&&m.nodeType===1&&!Ja(m)}function A9(m){if(m==null)return!0;if(Yi(m)&&(Ht(m)||typeof m=="string"||typeof m.splice=="function"||gs(m)||No(m)||Ys(m)))return!m.length;var b=Ai(m);if(b==De||b==Zt)return!m.size;if(Xa(m))return!Ch(m).length;for(var L in m)if(Sn.call(m,L))return!1;return!0}function L9(m,b){return qa(m,b)}function D9(m,b,L){L=typeof L=="function"?L:n;var W=L?L(m,b):n;return W===n?qa(m,b,n,L):!!W}function e1(m){if(!Yn(m))return!1;var b=zi(m);return b==ve||b==Ae||typeof m.message=="string"&&typeof m.name=="string"&&!Ja(m)}function I9(m){return typeof m=="number"&&j_(m)}function Ar(m){if(!Gn(m))return!1;var b=zi(m);return b==me||b==lt||b==Ce||b==Bt}function fp(m){return typeof m=="number"&&m==Vt(m)}function Kf(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=ce}function Gn(m){var b=typeof m;return m!=null&&(b=="object"||b=="function")}function Yn(m){return m!=null&&typeof m=="object"}var cp=E_?rl(E_):BC;function R9(m,b){return m===b||Mh(m,b,jh(b))}function P9(m,b,L){return L=typeof L=="function"?L:n,Mh(m,b,jh(b),L)}function N9(m){return dp(m)&&m!=+m}function B9(m){if(vA(m))throw new zt(r);return i0(m)}function z9(m){return m===null}function H9(m){return m==null}function dp(m){return typeof m=="number"||Yn(m)&&zi(m)==vt}function Ja(m){if(!Yn(m)||zi(m)!=ot)return!1;var b=Tf(m);if(b===null)return!0;var L=Sn.call(b,"constructor")&&b.constructor;return typeof L=="function"&&L instanceof L&&vf.call(L)==PM}var t1=O_?rl(O_):zC;function U9(m){return fp(m)&&m>=-ce&&m<=ce}var hp=M_?rl(M_):HC;function Jf(m){return typeof m=="string"||!Ht(m)&&Yn(m)&&zi(m)==Ve}function ol(m){return typeof m=="symbol"||Yn(m)&&zi(m)==Nt}var No=C_?rl(C_):UC;function F9(m){return m===n}function G9(m){return Yn(m)&&Ai(m)==Gt}function V9(m){return Yn(m)&&zi(m)==fn}var W9=Gf(Ah),j9=Gf(function(m,b){return m<=b});function mp(m){if(!m)return[];if(Yi(m))return Jf(m)?Ul(m):qi(m);if(Ha&&m[Ha])return yM(m[Ha]());var b=Ai(m),L=b==De?_h:b==Zt?_f:Bo;return L(m)}function Lr(m){if(!m)return m===0?m:0;if(m=Ml(m),m===X||m===-X){var b=m<0?-1:1;return b*ae}return m===m?m:0}function Vt(m){var b=Lr(m),L=b%1;return b===b?L?b-L:b:0}function gp(m){return m?Ws(Vt(m),0,he):0}function Ml(m){if(typeof m=="number")return m;if(ol(m))return ee;if(Gn(m)){var b=typeof m.valueOf=="function"?m.valueOf():m;m=Gn(b)?b+"":b}if(typeof m!="string")return m===0?m:+m;m=P_(m);var L=pr.test(m);return L||Rs.test(m)?rM(m.slice(2),L?2:8):es.test(m)?ee:+m}function _p(m){return lr(m,Zi(m))}function $9(m){return m?Ws(Vt(m),-ce,ce):m===0?m:0}function _n(m){return m==null?"":sl(m)}var q9=Io(function(m,b){if(Xa(b)||Yi(b)){lr(b,gi(b),m);return}for(var L in b)Sn.call(b,L)&&Wa(m,L,b[L])}),pp=Io(function(m,b){lr(b,Zi(b),m)}),Qf=Io(function(m,b,L,W){lr(b,Zi(b),m,W)}),Y9=Io(function(m,b,L,W){lr(b,gi(b),m,W)}),Z9=Mr(yh);function X9(m,b){var L=Do(m);return b==null?L:X_(L,b)}var K9=Yt(function(m,b){m=Cn(m);var L=-1,W=b.length,Q=W>2?b[2]:n;for(Q&&Hi(b[0],b[1],Q)&&(W=1);++L1),se}),lr(m,Vh(m),L),W&&(L=Sl(L,c|d|h,oA));for(var Q=b.length;Q--;)Ph(L,b[Q]);return L});function mL(m,b){return vp(m,Xf(Lt(b)))}var gL=Mr(function(m,b){return m==null?{}:VC(m,b)});function vp(m,b){if(m==null)return{};var L=zn(Vh(m),function(W){return[W]});return b=Lt(b),f0(m,L,function(W,Q){return b(W,Q[0])})}function _L(m,b,L){b=hs(b,m);var W=-1,Q=b.length;for(Q||(Q=1,m=n);++Wb){var W=m;m=b,b=W}if(L||m%1||b%1){var Q=$_();return Ci(m+Q*(b-m+lM("1e-"+((Q+"").length-1))),b)}return Dh(m,b)}var ML=Ro(function(m,b,L){return b=b.toLowerCase(),m+(L?yp(b):b)});function yp(m){return l1(_n(m).toLowerCase())}function Tp(m){return m=_n(m),m&&m.replace(ns,pM).replace(ss,"")}function CL(m,b,L){m=_n(m),b=sl(b);var W=m.length;L=L===n?W:Ws(Vt(L),0,W);var Q=L;return L-=b.length,L>=0&&m.slice(L,Q)==b}function AL(m){return m=_n(m),m&&Xe.test(m)?m.replace(Et,bM):m}function LL(m){return m=_n(m),m&&Jr.test(m)?m.replace(_l,"\\$&"):m}var DL=Ro(function(m,b,L){return m+(L?"-":"")+b.toLowerCase()}),IL=Ro(function(m,b,L){return m+(L?" ":"")+b.toLowerCase()}),RL=O0("toLowerCase");function PL(m,b,L){m=_n(m),b=Vt(b);var W=b?Oo(m):0;if(!b||W>=b)return m;var Q=(b-W)/2;return Ff(Mf(Q),L)+m+Ff(Of(Q),L)}function NL(m,b,L){m=_n(m),b=Vt(b);var W=b?Oo(m):0;return b&&W>>0,L?(m=_n(m),m&&(typeof b=="string"||b!=null&&!t1(b))&&(b=sl(b),!b&&Eo(m))?ms(Ul(m),0,L):m.split(b,L)):[]}var VL=Ro(function(m,b,L){return m+(L?" ":"")+l1(b)});function WL(m,b,L){return m=_n(m),L=L==null?0:Ws(Vt(L),0,m.length),b=sl(b),m.slice(L,L+b.length)==b}function jL(m,b,L){var W=le.templateSettings;L&&Hi(m,b,L)&&(b=n),m=_n(m),b=Qf({},b,W,R0);var Q=Qf({},b.imports,W.imports,R0),se=gi(Q),ge=gh(Q,se),ke,Le,Ke=0,Je=b.interpolate||pl,nt="__p += '",mt=ph((b.escape||pl).source+"|"+Je.source+"|"+(Je===Zn?Mn:pl).source+"|"+(b.evaluate||pl).source+"|$","g"),yt="//# sourceURL="+(Sn.call(b,"sourceURL")?(b.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++df+"]")+` `;m.replace(mt,function(It,Xt,en,al,Ui,ul){return en||(en=al),nt+=m.slice(Ke,ul).replace(br,vM),Xt&&(ke=!0,nt+=`' + __e(`+Xt+`) + '`),Ui&&(Le=!0,nt+=`'; @@ -55,7 +55,7 @@ __p += '`),en&&(nt+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+nt+`return __p -}`;var $t=Ep(function(){return hn(se,yt+"return "+nt).apply(n,ge)});if($t.source=nt,e1($t))throw $t;return $t}function $L(m){return _n(m).toLowerCase()}function qL(m){return _n(m).toUpperCase()}function YL(m,b,L){if(m=_n(m),m&&(L||b===n))return P_(m);if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=Ul(b),se=N_(W,Q),ge=B_(W,Q)+1;return ms(W,se,ge).join("")}function ZL(m,b,L){if(m=_n(m),m&&(L||b===n))return m.slice(0,H_(m)+1);if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=B_(W,Ul(b))+1;return ms(W,0,Q).join("")}function XL(m,b,L){if(m=_n(m),m&&(L||b===n))return m.replace(ji,"");if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=N_(W,Ul(b));return ms(W,Q).join("")}function KL(m,b){var L=B,W=$;if(Gn(b)){var Q="separator"in b?b.separator:Q;L="length"in b?Vt(b.length):L,W="omission"in b?sl(b.omission):W}m=_n(m);var se=m.length;if(Eo(m)){var ge=Ul(m);se=ge.length}if(L>=se)return m;var ke=L-Oo(W);if(ke<1)return W;var Le=ge?ms(ge,0,ke).join(""):m.slice(0,ke);if(Q===n)return Le+W;if(ge&&(ke+=Le.length-ke),t1(Q)){if(m.slice(ke).search(Q)){var Ke,Je=Le;for(Q.global||(Q=ph(Q.source,_n(yn.exec(Q))+"g")),Q.lastIndex=0;Ke=Q.exec(Je);)var nt=Ke.index;Le=Le.slice(0,nt===n?ke:nt)}}else if(m.indexOf(sl(Q),ke)!=ke){var mt=Le.lastIndexOf(Q);mt>-1&&(Le=Le.slice(0,mt))}return Le+W}function JL(m){return m=_n(m),m&&kn.test(m)?m.replace(Be,OM):m}var QL=Ro(function(m,b,L){return m+(L?" ":"")+b.toUpperCase()}),l1=O0("toUpperCase");function Sp(m,b,L){return m=_n(m),b=L?n:b,b===n?wM(m)?AM(m):dM(m):m.match(b)||[]}var Ep=Yt(function(m,b){try{return ll(m,n,b)}catch(L){return e1(L)?L:new zt(L)}}),xL=Mr(function(m,b){return wl(b,function(L){L=rr(L),Er(m,L,Qh(m[L],m))}),m});function eD(m){var b=m==null?0:m.length,L=Lt();return m=b?zn(m,function(W){if(typeof W[1]!="function")throw new yl(s);return[L(W[0]),W[1]]}):[],Yt(function(W){for(var Q=-1;++Qce)return[];var L=he,W=Ci(m,he);b=Lt(b),m-=he;for(var Q=mh(W,b);++L0||b<0)?new Jt(L):(m<0?L=L.takeRight(-m):m&&(L=L.drop(m)),b!==n&&(b=Vt(b),L=b<0?L.dropRight(-b):L.take(b-m)),L)},Jt.prototype.takeRightWhile=function(m){return this.reverse().takeWhile(m).reverse()},Jt.prototype.toArray=function(){return this.take(he)},ir(Jt.prototype,function(m,b){var L=/^(?:filter|find|map|reject)|While$/.test(b),W=/^(?:head|last)$/.test(b),Q=le[W?"take"+(b=="last"?"Right":""):b],se=W||/^find/.test(b);Q&&(le.prototype[b]=function(){var ge=this.__wrapped__,ke=W?[1]:arguments,Le=ge instanceof Jt,Ke=ke[0],Je=Le||Ht(ge),nt=function(Xt){var en=Q.apply(le,as([Xt],ke));return W&&mt?en[0]:en};Je&&L&&typeof Ke=="function"&&Ke.length!=1&&(Le=Je=!1);var mt=this.__chain__,yt=!!this.__actions__.length,Dt=se&&!mt,$t=Le&&!yt;if(!se&&Je){ge=$t?ge:new Jt(this);var It=m.apply(ge,ke);return It.__actions__.push({func:$f,args:[nt],thisArg:n}),new Tl(It,mt)}return Dt&&$t?m.apply(this,ke):(It=this.thru(nt),Dt?W?It.value()[0]:It.value():It)})}),wl(["pop","push","shift","sort","splice","unshift"],function(m){var b=pf[m],L=/^(?:push|sort|unshift)$/.test(m)?"tap":"thru",W=/^(?:pop|shift)$/.test(m);le.prototype[m]=function(){var Q=arguments;if(W&&!this.__chain__){var se=this.value();return b.apply(Ht(se)?se:[],Q)}return this[L](function(ge){return b.apply(Ht(ge)?ge:[],Q)})}}),ir(Jt.prototype,function(m,b){var L=le[b];if(L){var W=L.name+"";Sn.call(Lo,W)||(Lo[W]=[]),Lo[W].push({name:b,func:L})}}),Lo[Hf(n,y).name]=[{name:"wrapper",func:n}],Jt.prototype.clone=JM,Jt.prototype.reverse=QM,Jt.prototype.value=xM,le.prototype.at=C7,le.prototype.chain=A7,le.prototype.commit=L7,le.prototype.next=D7,le.prototype.plant=R7,le.prototype.reverse=P7,le.prototype.toJSON=le.prototype.valueOf=le.prototype.value=N7,le.prototype.first=le.prototype.head,Ha&&(le.prototype[Ha]=I7),le},Mo=LM();Fs?((Fs.exports=Mo)._=Mo,sh._=Mo):ki._=Mo}).call(xa)})(Hc,Hc.exports);var FZ=Hc.exports;const P3=c5(FZ),GZ=t=>({}),N3=t=>({}),VZ=t=>({}),B3=t=>({});function z3(t){let e,n;return{c(){e=P("p"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function H3(t){let e,n;const i=t[5].actions,l=He(i,t,t[4],N3);return{c(){e=P("div"),l&&l.c(),I(e,"class","page-shell__actions")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&16)&&Fe(l,i,r,r[4],n?Ue(i,r[4],s,GZ):Ge(r[4]),N3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function WZ(t){let e,n,i,l,r,s,o,a,u,f,c;const d=t[5].breadcrumb,h=He(d,t,t[4],B3);let g=t[1]&&z3(t),_=t[3].actions&&H3(t);const k=t[5].default,y=He(k,t,t[4],null);return{c(){e=P("div"),n=P("header"),i=P("div"),h&&h.c(),l=F(),r=P("h1"),s=j(t[0]),o=F(),g&&g.c(),a=F(),_&&_.c(),u=F(),f=P("div"),y&&y.c(),I(i,"class","page-shell__heading"),I(n,"class","page-shell__header"),I(f,"class","page-shell__content"),I(e,"class","page-shell"),S(e,"page-shell--narrow",t[2])},m(T,M){O(T,e,M),w(e,n),w(n,i),h&&h.m(i,null),w(i,l),w(i,r),w(r,s),w(i,o),g&&g.m(i,null),w(n,a),_&&_.m(n,null),w(e,u),w(e,f),y&&y.m(f,null),c=!0},p(T,[M]){h&&h.p&&(!c||M&16)&&Fe(h,d,T,T[4],c?Ue(d,T[4],M,VZ):Ge(T[4]),B3),(!c||M&1)&&Y(s,T[0]),T[1]?g?g.p(T,M):(g=z3(T),g.c(),g.m(i,null)):g&&(g.d(1),g=null),T[3].actions?_?(_.p(T,M),M&8&&p(_,1)):(_=H3(T),_.c(),p(_,1),_.m(n,null)):_&&(ue(),v(_,1,1,()=>{_=null}),fe()),y&&y.p&&(!c||M&16)&&Fe(y,k,T,T[4],c?Ue(k,T[4],M,null):Ge(T[4]),null),(!c||M&4)&&S(e,"page-shell--narrow",T[2])},i(T){c||(p(h,T),p(_),p(y,T),c=!0)},o(T){v(h,T),v(_),v(y,T),c=!1},d(T){T&&E(e),h&&h.d(T),g&&g.d(),_&&_.d(),y&&y.d(T)}}}function jZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e,{narrow:a=!1}=e;return t.$$set=u=>{"title"in u&&n(0,s=u.title),"description"in u&&n(1,o=u.description),"narrow"in u&&n(2,a=u.narrow),"$$scope"in u&&n(4,l=u.$$scope)},[s,o,a,r,l,i]}class Nl extends Oe{constructor(e){super(),Ee(this,e,jZ,WZ,Se,{title:0,description:1,narrow:2})}}const $Z=t=>({}),U3=t=>({});function F3(t){let e,n,i,l,r,s=t[0]&&G3(t),o=t[1]&&V3(t),a=t[3].actions&&W3(t);return{c(){e=P("header"),n=P("div"),s&&s.c(),i=F(),o&&o.c(),l=F(),a&&a.c(),I(e,"class","section-panel__header")},m(u,f){O(u,e,f),w(e,n),s&&s.m(n,null),w(n,i),o&&o.m(n,null),w(e,l),a&&a.m(e,null),r=!0},p(u,f){u[0]?s?s.p(u,f):(s=G3(u),s.c(),s.m(n,i)):s&&(s.d(1),s=null),u[1]?o?o.p(u,f):(o=V3(u),o.c(),o.m(n,null)):o&&(o.d(1),o=null),u[3].actions?a?(a.p(u,f),f&8&&p(a,1)):(a=W3(u),a.c(),p(a,1),a.m(e,null)):a&&(ue(),v(a,1,1,()=>{a=null}),fe())},i(u){r||(p(a),r=!0)},o(u){v(a),r=!1},d(u){u&&E(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function G3(t){let e,n;return{c(){e=P("h2"),n=j(t[0])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1&&Y(n,i[0])},d(i){i&&E(e)}}}function V3(t){let e,n;return{c(){e=P("p"),n=j(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function W3(t){let e,n;const i=t[5].actions,l=He(i,t,t[4],U3);return{c(){e=P("div"),l&&l.c(),I(e,"class","section-panel__actions")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&16)&&Fe(l,i,r,r[4],n?Ue(i,r[4],s,$Z):Ge(r[4]),U3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function qZ(t){let e,n,i,l,r,s=(t[0]||t[1]||t[3].actions)&&F3(t);const o=t[5].default,a=He(o,t,t[4],null);return{c(){e=P("section"),s&&s.c(),n=F(),i=P("div"),a&&a.c(),I(i,"class","section-panel__body"),I(e,"class","section-panel"),I(e,"aria-label",l=t[2]||t[0]||void 0)},m(u,f){O(u,e,f),s&&s.m(e,null),w(e,n),w(e,i),a&&a.m(i,null),r=!0},p(u,[f]){u[0]||u[1]||u[3].actions?s?(s.p(u,f),f&11&&p(s,1)):(s=F3(u),s.c(),p(s,1),s.m(e,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a&&a.p&&(!r||f&16)&&Fe(a,o,u,u[4],r?Ue(o,u[4],f,null):Ge(u[4]),null),(!r||f&5&&l!==(l=u[2]||u[0]||void 0))&&I(e,"aria-label",l)},i(u){r||(p(s),p(a,u),r=!0)},o(u){v(s),v(a,u),r=!1},d(u){u&&E(e),s&&s.d(),a&&a.d(u)}}}function YZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e,{ariaLabel:a=""}=e;return t.$$set=u=>{"title"in u&&n(0,s=u.title),"description"in u&&n(1,o=u.description),"ariaLabel"in u&&n(2,a=u.ariaLabel),"$$scope"in u&&n(4,l=u.$$scope)},[s,o,a,r,l,i]}class jr extends Oe{constructor(e){super(),Ee(this,e,YZ,qZ,Se,{title:0,description:1,ariaLabel:2})}}function ZZ(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Rn({props:{value:"",text:"All actions"}}),i=new Rn({props:{value:"block",text:"Block"}}),r=new Rn({props:{value:"allow",text:"Allow"}}),o=new Rn({props:{value:"bypass",text:"Bypass"}}),u=new Rn({props:{value:"inspect",text:"Inspect"}}),c=new Rn({props:{value:"error",text:"Error"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment)},m(h,g){z(e,h,g),O(h,n,g),z(i,h,g),O(h,l,g),z(r,h,g),O(h,s,g),z(o,h,g),O(h,a,g),z(u,h,g),O(h,f,g),z(c,h,g),d=!0},p:_e,i(h){d||(p(e.$$.fragment,h),p(i.$$.fragment,h),p(r.$$.fragment,h),p(o.$$.fragment,h),p(u.$$.fragment,h),p(c.$$.fragment,h),d=!0)},o(h){v(e.$$.fragment,h),v(i.$$.fragment,h),v(r.$$.fragment,h),v(o.$$.fragment,h),v(u.$$.fragment,h),v(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(l),E(s),E(a),E(f)),H(e,h),H(i,h),H(r,h),H(o,h),H(u,h),H(c,h)}}}function XZ(t){let e,n,i,l,r,s,o,a,u,f;return e=new Rn({props:{value:"",text:"All layers"}}),i=new Rn({props:{value:"dns",text:"DNS"}}),r=new Rn({props:{value:"explicit_proxy",text:"Explicit proxy"}}),o=new Rn({props:{value:"transparent_proxy",text:"Transparent proxy"}}),u=new Rn({props:{value:"content",text:"Content"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment)},m(c,d){z(e,c,d),O(c,n,d),z(i,c,d),O(c,l,d),z(r,c,d),O(c,s,d),z(o,c,d),O(c,a,d),z(u,c,d),f=!0},p:_e,i(c){f||(p(e.$$.fragment,c),p(i.$$.fragment,c),p(r.$$.fragment,c),p(o.$$.fragment,c),p(u.$$.fragment,c),f=!0)},o(c){v(e.$$.fragment,c),v(i.$$.fragment,c),v(r.$$.fragment,c),v(o.$$.fragment,c),v(u.$$.fragment,c),f=!1},d(c){c&&(E(n),E(l),E(s),E(a)),H(e,c),H(i,c),H(r,c),H(o,c),H(u,c)}}}function KZ(t){let e,n;return e=new ml({props:{sortable:!0,size:"medium",headers:[{key:"time",value:"Time"},{key:"client",value:"Client"},{key:"url",value:"URL"},{key:"action",value:"Action"},{key:"layer",value:"Layer"},{key:"reason",value:"Reason"}],rows:t[5]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.rows=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function JZ(t){let e,n;return e=new hi({props:{state:"empty",title:"No decisions found",message:"Try clearing the search or choosing a different filter."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function QZ(t){let e,n;return e=new hi({props:{state:"loading",message:"Loading filtering decisions"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xZ(t){let e,n;return e=new hi({props:{state:"error",title:"Decisions unavailable",message:t[4],onRetry:t[6]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.message=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function eX(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_;function k(G){t[12](G)}let y={placeholder:"Search by domain",labelText:"Search decisions"};t[2]!==void 0&&(y.value=t[2]),i=new YT({props:y}),xe.push(()=>At(i,"value",k)),i.$on("clear",t[7]);function T(G){t[13](G)}let M={labelText:"Action",$$slots:{default:[ZZ]},$$scope:{ctx:t}};t[0]!==void 0&&(M.selected=t[0]),s=new Wr({props:M}),xe.push(()=>At(s,"selected",T));function A(G){t[14](G)}let C={labelText:"Layer",$$slots:{default:[XZ]},$$scope:{ctx:t}};t[1]!==void 0&&(C.selected=t[1]),u=new Wr({props:C}),xe.push(()=>At(u,"selected",A));const D=[xZ,QZ,JZ,KZ],R=[];function N(G,B){return G[4]?0:G[3]?G[5].length===0?2:3:1}return d=N(t),h=R[d]=D[d](t),{c(){e=P("div"),n=P("div"),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),c=F(),h.c(),g=je(),I(n,"class","filters__search svelte-1ccvqz1"),I(e,"class","filters svelte-1ccvqz1")},m(G,B){O(G,e,B),w(e,n),z(i,n,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),O(G,c,B),R[d].m(G,B),O(G,g,B),_=!0},p(G,B){const $={};!l&&B&4&&(l=!0,$.value=G[2],Ct(()=>l=!1)),i.$set($);const q={};B&33554432&&(q.$$scope={dirty:B,ctx:G}),!o&&B&1&&(o=!0,q.selected=G[0],Ct(()=>o=!1)),s.$set(q);const V={};B&33554432&&(V.$$scope={dirty:B,ctx:G}),!f&&B&2&&(f=!0,V.selected=G[1],Ct(()=>f=!1)),u.$set(V);let K=d;d=N(G),d===K?R[d].p(G,B):(ue(),v(R[K],1,1,()=>{R[K]=null}),fe(),h=R[d],h?h.p(G,B):(h=R[d]=D[d](G),h.c()),p(h,1),h.m(g.parentNode,g))},i(G){_||(p(i.$$.fragment,G),p(s.$$.fragment,G),p(u.$$.fragment,G),p(h),_=!0)},o(G){v(i.$$.fragment,G),v(s.$$.fragment,G),v(u.$$.fragment,G),v(h),_=!1},d(G){G&&(E(e),E(c),E(g)),H(i),H(s),H(u),R[d].d(G)}}}function tX(t){let e,n;return e=new jr({props:{title:"Filter decisions",description:"Search recent activity or narrow it by outcome and enforcement layer.",$$slots:{default:[eX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&33554495&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function nX(t){let e;return{c(){e=j("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iX(t){let e;return{c(){e=j("Logs")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function lX(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[nX]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[iX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&33554432&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&33554432&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function rX(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[lX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&33554432&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sX(t){let e,n;return e=new Nl({props:{title:"Decision log",description:"Structured filtering decisions from DNS, proxy, and content inspection layers.",$$slots:{breadcrumb:[rX],default:[tX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&33554495&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oX(t,e,n){let i,l;ct(t,Ln,q=>n(21,l=q));let r="",s="",o="",a=[],u=new Map,f=null,c=null,d=!1,h=!1,g=!1,_=!1,k=!1,y="",T=!1,M="";const A=()=>{const q=[];return r.length>0&&q.push("domain="+encodeURIComponent(r)),s&&q.push("action="+s),o&&q.push("layer="+o),q.length>0?"?"+q.join("&"):""},C=async()=>{if(d||k)return;d=!0;const q=A();try{const V=await l.api.doCall("/decisions"+q);!k&&q===A()&&(n(8,a=(V==null?void 0:V.items)||[]),n(4,M=""),n(3,T=!0))}catch{!k&&!T&&n(4,M="Unable to load decisions.")}finally{if(d=!1,k)return;h?(h=!1,C()):f=setTimeout(C,5e3)}},D=async()=>{if(!(g||k)){g=!0;try{const q=await l.api.doCall("/devices");k||n(9,u=HZ(q==null?void 0:q.devices))}catch{}finally{g=!1,k||(c=setTimeout(D,6e4))}}},R=()=>{if(f&&clearTimeout(f),f=null,d){h=!0;return}C()},N=()=>{n(2,r=""),R()};sn(()=>{n(10,_=!0),n(11,y=s+"\0"+o),C(),D()}),Ls(()=>{k=!0,f&&clearTimeout(f),c&&clearTimeout(c)});function G(q){r=q,n(2,r)}function B(q){s=q,n(0,s)}function $(q){o=q,n(1,o)}return t.$$.update=()=>{if(t.$$.dirty&768&&n(5,i=a.map((q,V)=>({id:q.ip+q.time+V+q.url,time:zZ(q.time*1e3),client:UZ(u,q.ip),url:P3.truncate(q.url,{length:50}),action:q.action||"",layer:q.layer||"",reason:P3.truncate(q.reason||q.matched_rule||"",{length:40})}))),t.$$.dirty&3075){const q=s+"\0"+o;_&&q!==y&&(n(11,y=q),R())}},[s,o,r,T,M,i,R,N,a,u,_,y,G,B,$]}class aX extends Oe{constructor(e){super(),Ee(this,e,oX,sX,Se,{})}}function j3(t,e,n){const i=t.slice();return i[26]=e[n],i}function $3(t){let e,n,i,l;const r=[fX,uX],s=[];function o(a,u){return a[4]==="radio"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function uX(t){let e,n;return e=new ei({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5],value:t[8]}}),e.$on("input",t[13]),e.$on("blur",t[14]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.title=i[2]),l&2&&(r.labelText=i[1]),l&8&&(r.helperText=i[3]),l&16&&(r.type=i[4]),l&32&&(r.disabled=i[5]),l&256&&(r.value=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function fX(t){let e,n,i,l,r;function s(u){t[19](u)}let o={legendText:t[1],orientation:t[7],disabled:t[5]||t[10],$$slots:{default:[hX]},$$scope:{ctx:t}};t[8]!==void 0&&(o.selected=t[8]),e=new n5({props:o}),xe.push(()=>At(e,"selected",s)),e.$on("change",t[15]);let a=t[3]&&Y3(t);return{c(){U(e.$$.fragment),i=F(),a&&a.c(),l=je()},m(u,f){z(e,u,f),O(u,i,f),a&&a.m(u,f),O(u,l,f),r=!0},p(u,f){const c={};f&2&&(c.legendText=u[1]),f&128&&(c.orientation=u[7]),f&1056&&(c.disabled=u[5]||u[10]),f&536875073&&(c.$$scope={dirty:f,ctx:u}),!n&&f&256&&(n=!0,c.selected=u[8],Ct(()=>n=!1)),e.$set(c),u[3]?a?a.p(u,f):(a=Y3(u),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){r||(p(e.$$.fragment,u),r=!0)},o(u){v(e.$$.fragment,u),r=!1},d(u){u&&(E(i),E(l)),H(e,u),a&&a.d(u)}}}function cX(t){let e,n,i,l;return e=new la({props:{id:`${t[0]}-true`,value:"true",labelText:t[12]("True")}}),i=new la({props:{id:`${t[0]}-false`,value:"false",labelText:t[12]("False")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.id=`${r[0]}-true`),s&4096&&(o.labelText=r[12]("True")),e.$set(o);const a={};s&1&&(a.id=`${r[0]}-false`),s&4096&&(a.labelText=r[12]("False")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function dX(t){let e=[],n=new Map,i,l,r=it(t[6]);const s=o=>o[26].value;for(let o=0;o0?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function Y3(t){let e,n;return{c(){e=P("p"),n=j(t[3]),I(e,"class","helper-text svelte-p4zmla")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&8&&Y(n,i[3])},d(i){i&&E(e)}}}function Z3(t){let e,n;return e=new Wi({props:{description:t[12]("Saving…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4096&&(r.description=i[12]("Saving…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function X3(t){let e,n;return e=new nn({props:{lowContrast:!0,kind:"error",title:t[12]("Setting not saved"),subtitle:t[11]}}),e.$on("close",t[20]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4096&&(r.title=i[12]("Setting not saved")),l&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mX(t){let e,n,i,l,r=t[9]&&$3(t),s=t[10]&&Z3(t),o=t[11]&&X3(t);return{c(){e=P("div"),r&&r.c(),n=F(),s&&s.c(),i=F(),o&&o.c(),I(e,"class","connected-setting svelte-p4zmla")},m(a,u){O(a,e,u),r&&r.m(e,null),w(e,n),s&&s.m(e,null),w(e,i),o&&o.m(e,null),l=!0},p(a,[u]){a[9]?r?(r.p(a,u),u&512&&p(r,1)):(r=$3(a),r.c(),p(r,1),r.m(e,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[10]?s?(s.p(a,u),u&1024&&p(s,1)):(s=Z3(a),s.c(),p(s,1),s.m(e,i)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[11]?o?(o.p(a,u),u&2048&&p(o,1)):(o=X3(a),o.c(),p(o,1),o.m(e,null)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&E(e),r&&r.d(),s&&s.d(),o&&o.d()}}}function gX(t,e,n){let i,l;ct(t,ti,V=>n(12,i=V)),ct(t,Ln,V=>n(23,l=V));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a=""}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,{radioOptions:d=[]}=e,{orientation:h="horizontal"}=e,{onSaved:g=()=>{}}=e,_="",k="",y="",T=!1,M=!1,A="";const C=async()=>R(y),D=async()=>{try{const V=await l.api.getSetting(r),K=(V==null?void 0:V.Value)??(V==null?void 0:V.value)??"";n(8,_=String(K)),k=_,y=_}catch{n(11,A=i("Unable to load setting")),console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},R=async V=>{if(M||V===k)return!0;n(10,M=!0),n(11,A="");try{if(await l.api.setSetting(r,V)===!1)throw new Error(i("Unable to save setting"));return k=V,n(8,_=V),Ei.add(Ma({subtitle:i("Setting updated")},i)),await g(V),!0}catch(K){return n(8,_=k),y=k,n(11,A=K instanceof Error&&K.message?K.message:i("Unable to save setting")),Ei.add(Ss({subtitle:A},i)),!1}finally{n(10,M=!1)}},N=V=>{y=V.currentTarget.value},G=async V=>{const K=V.currentTarget.value;y=K,!(K===k||c)&&await R(K)},B=async V=>{const K=String(V.detail??_??"");y=K,!(K===k||c)&&await R(K)};sn(async()=>{await D(),n(9,T=!0)}),Ls(()=>{n(8,_=""),k="",y="",n(9,T=!1)});function $(V){_=V,n(8,_)}const q=()=>n(11,A="");return t.$$set=V=>{"keyName"in V&&n(0,r=V.keyName),"labelText"in V&&n(1,s=V.labelText),"title"in V&&n(2,o=V.title),"helperText"in V&&n(3,a=V.helperText),"type"in V&&n(4,u=V.type),"disabled"in V&&n(5,f=V.disabled),"disableOnblur"in V&&n(16,c=V.disableOnblur),"radioOptions"in V&&n(6,d=V.radioOptions),"orientation"in V&&n(7,h=V.orientation),"onSaved"in V&&n(17,g=V.onSaved)},[r,s,o,a,u,f,d,h,_,T,M,A,i,N,G,B,c,g,C,$,q]}class Ql extends Oe{constructor(e){super(),Ee(this,e,gX,mX,Se,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:16,radioOptions:6,orientation:7,onSaved:17,updateDataOnBackend:18})}get updateDataOnBackend(){return this.$$.ctx[18]}}function _X(t){let e;const n=t[8].default,i=He(n,t,t[13],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&8192)&&Fe(i,n,l,l[13],e?Ue(n,l[13],r,null):Ge(l[13]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function pX(t){let e,n,i;function l(s){t[9](s)}let r={danger:t[5],alert:!0,modalHeading:t[1],modalLabel:t[2],primaryButtonText:t[6]?"Working…":t[3],primaryButtonDisabled:t[6],secondaryButtonText:t[4],shouldSubmitOnEnter:!1,preventCloseOnClickOutside:t[6],$$slots:{default:[_X]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.open=t[0]),e=new xT({props:r}),xe.push(()=>At(e,"open",l)),e.$on("click:button--primary",t[10]),e.$on("submit",t[11]),e.$on("click:button--secondary",t[7]),e.$on("close",t[12]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,[o]){const a={};o&32&&(a.danger=s[5]),o&2&&(a.modalHeading=s[1]),o&4&&(a.modalLabel=s[2]),o&72&&(a.primaryButtonText=s[6]?"Working…":s[3]),o&64&&(a.primaryButtonDisabled=s[6]),o&16&&(a.secondaryButtonText=s[4]),o&64&&(a.preventCloseOnClickOutside=s[6]),o&8192&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.open=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function bX(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{title:s="Confirm action"}=e,{label:o="Confirmation"}=e,{confirmText:a="Confirm"}=e,{cancelText:u="Cancel"}=e,{danger:f=!1}=e,{busy:c=!1}=e;const d=()=>{c||n(0,r=!1)};function h(y){r=y,n(0,r)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{"open"in y&&n(0,r=y.open),"title"in y&&n(1,s=y.title),"label"in y&&n(2,o=y.label),"confirmText"in y&&n(3,a=y.confirmText),"cancelText"in y&&n(4,u=y.cancelText),"danger"in y&&n(5,f=y.danger),"busy"in y&&n(6,c=y.busy),"$$scope"in y&&n(13,l=y.$$scope)},[r,s,o,a,u,f,c,d,i,h,g,_,k,l]}class Zu extends Oe{constructor(e){super(),Ee(this,e,bX,pX,Se,{open:0,title:1,label:2,confirmText:3,cancelText:4,danger:5,busy:6})}}function K3(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("Inspection list unavailable"),subtitle:t[4]}}),e.$on("close",t[22]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Inspection list unavailable")),l[0]&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function J3(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("Inspection list not saved"),subtitle:t[5]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Inspection list not saved")),l[0]&32&&(r.subtitle=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function vX(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[10],rows:t[9],$$slots:{cell:[BX,({row:l,cell:r})=>({36:l,37:r}),({row:l,cell:r})=>[0,(l?32:0)|(r?64:0)]],default:[EX]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","filter-table svelte-7kqp5z")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&1024&&(s.headers=l[10]),r[0]&512&&(s.rows=l[9]),r[0]&2507|r[1]&224&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function kX(t){let e,n;return e=new hi({props:{state:"empty",title:t[11]("No list entries"),message:t[11]("Add an entry when this inspection rule should match content or a host."),$$slots:{default:[HX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("No list entries")),l[0]&2048&&(r.message=i[11]("Add an entry when this inspection rule should match content or a host.")),l[0]&2048|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wX(t){let e,n;return e=new hi({props:{state:"loading",message:t[11]("Loading inspection list…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.message=i[11]("Loading inspection list…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function yX(t){let e=t[11]("Add entry")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add entry")+"")&&Y(n,e)},d(i){i&&E(n)}}}function TX(t){let e,n,i,l,r;function s(a){t[28](a)}let o={value:"",shouldFilterRows:!0,placeholder:t[11]("Search entries")};return t[7]!==void 0&&(o.filteredRowIds=t[7]),e=new ZT({props:o}),xe.push(()=>At(e,"filteredRowIds",s)),l=new bt({props:{size:"small",icon:Rs,disabled:t[1]!=null||t[3],$$slots:{default:[yX]},$$scope:{ctx:t}}}),l.$on("click",t[17]),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment)},m(a,u){z(e,a,u),O(a,i,u),z(l,a,u),r=!0},p(a,u){const f={};u[0]&2048&&(f.placeholder=a[11]("Search entries")),!n&&u[0]&128&&(n=!0,f.filteredRowIds=a[7],Ct(()=>n=!1)),e.$set(f);const c={};u[0]&10&&(c.disabled=a[1]!=null||a[3]),u[0]&2048|u[1]&128&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(p(e.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(e.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(i),H(e,a),H(l,a)}}}function SX(t){let e,n;return e=new hg({props:{$$slots:{default:[TX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2186|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function EX(t){let e,n;return e=new dg({props:{size:"sm",$$slots:{default:[SX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2186|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OX(t){let e=t[37].value+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&64&&e!==(e=i[37].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function MX(t){let e,n,i,l;const r=[LX,AX],s=[];function o(a,u){return a[37].key==="score"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function CX(t){let e,n,i,l,r;const s=[IX,DX],o=[];function a(u,f){return f[0]&2|f[1]&32&&(e=null),e==null&&(e=u[1]===Number(u[36].id)),e?0:1}return n=a(t,[-1,-1]),i=o[n]=s[n](t),{c(){i.c(),l=je()},m(u,f){o[n].m(u,f),O(u,l,f),r=!0},p(u,f){let c=n;n=a(u,f),n===c?o[n].p(u,f):(ue(),v(o[c],1,1,()=>{o[c]=null}),fe(),i=o[n],i?i.p(u,f):(i=o[n]=s[n](u),i.c()),p(i,1),i.m(l.parentNode,l))},i(u){r||(p(i),r=!0)},o(u){v(i),r=!1},d(u){u&&E(l),o[n].d(u)}}}function AX(t){let e,n;function i(...l){return t[27](t[36],...l)}return e=new ei({props:{labelText:t[11]("Content"),hideLabel:!0,invalid:!String(t[37].value).trim(),invalidText:t[11]("Content is required."),value:t[37].value}}),e.$on("input",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&2048&&(s.labelText=t[11]("Content")),r[1]&64&&(s.invalid=!String(t[37].value).trim()),r[0]&2048&&(s.invalidText=t[11]("Content is required.")),r[1]&64&&(s.value=t[37].value),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function LX(t){let e,n;function i(...l){return t[26](t[36],...l)}return e=new ei({props:{type:"number",labelText:t[11]("Score"),hideLabel:!0,invalid:!Number.isFinite(Number(t[37].value)),invalidText:t[11]("Score must be a number."),value:t[37].value}}),e.$on("input",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&2048&&(s.labelText=t[11]("Score")),r[1]&64&&(s.invalid=!Number.isFinite(Number(t[37].value))),r[0]&2048&&(s.invalidText=t[11]("Score must be a number.")),r[1]&64&&(s.value=t[37].value),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function DX(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[11]("Entry actions"),$$slots:{default:[RX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.iconDescription=i[11]("Entry actions")),l[0]&2113|l[1]&160&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function IX(t){let e,n,i,l,r;return n=new bt({props:{size:"small",disabled:!t[8]||t[3],$$slots:{default:[PX]},$$scope:{ctx:t}}}),n.$on("click",t[15]),l=new bt({props:{kind:"ghost",size:"small",disabled:t[3],$$slots:{default:[NX]},$$scope:{ctx:t}}}),l.$on("click",t[16]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","edit-actions svelte-7kqp5z")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o[0]&264&&(a.disabled=!s[8]||s[3]),o[0]&2056|o[1]&128&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o[0]&8&&(u.disabled=s[3]),o[0]&2048|o[1]&128&&(u.$$scope={dirty:o,ctx:s}),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function RX(t){let e,n,i,l;function r(){return t[24](t[36])}e=new Al({props:{text:t[11]("Edit")}}),e.$on("click",r);function s(){return t[25](t[36])}return i=new Al({props:{danger:!0,text:t[11]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a[0]&2048&&(u.text=t[11]("Edit")),e.$set(u);const f={};a[0]&2048&&(f.text=t[11]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function PX(t){let e=(t[3]?t[11]("Saving…"):t[11]("Save"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2056&&e!==(e=(i[3]?i[11]("Saving…"):i[11]("Save"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function NX(t){let e=t[11]("Cancel")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Cancel")+"")&&Y(n,e)},d(i){i&&E(n)}}}function BX(t){let e,n,i,l,r;const s=[CX,MX,OX],o=[];function a(u,f){return f[0]&2|f[1]&32&&(e=null),u[37].key==="actions"?0:(e==null&&(e=u[1]===Number(u[36].id)),e?1:2)}return n=a(t,[-1,-1]),i=o[n]=s[n](t),{c(){i.c(),l=je()},m(u,f){o[n].m(u,f),O(u,l,f),r=!0},p(u,f){let c=n;n=a(u,f),n===c?o[n].p(u,f):(ue(),v(o[c],1,1,()=>{o[c]=null}),fe(),i=o[n],i?i.p(u,f):(i=o[n]=s[n](u),i.c()),p(i,1),i.m(l.parentNode,l))},i(u){r||(p(i),r=!0)},o(u){v(i),r=!1},d(u){u&&E(l),o[n].d(u)}}}function zX(t){let e=t[11]("Add entry")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add entry")+"")&&Y(n,e)},d(i){i&&E(n)}}}function HX(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[zX]},$$scope:{ctx:t}}}),e.$on("click",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function UX(t){var c;let e,n=t[11]("Remove")+"",i,l,r,s=(((c=t[6])==null?void 0:c.content)??"")+"",o,a,u=t[11]("from this inspection list?")+"",f;return{c(){e=P("p"),i=j(n),l=F(),r=P("strong"),o=j(s),a=F(),f=j(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h[0]&2048&&n!==(n=d[11]("Remove")+"")&&Y(i,n),h[0]&64&&s!==(s=(((g=d[6])==null?void 0:g.content)??"")+"")&&Y(o,s),h[0]&2048&&u!==(u=d[11]("from this inspection list?")+"")&&Y(f,u)},d(d){d&&E(e)}}}function FX(t){let e,n,i,l,r,s,o,a=t[4]&&K3(t),u=t[5]&&J3(t);const f=[wX,kX,vX],c=[];function d(h,g){return h[2]&&h[0].length===0?0:h[0].length===0&&h[1]==null?1:2}return i=d(t),l=c[i]=f[i](t),s=new Zu({props:{open:t[6]!=null,title:t[11]("Delete inspection-list entry?"),label:t[11]("HTTPS inspection"),confirmText:t[11]("Delete entry"),cancelText:t[11]("Cancel"),danger:!0,busy:t[3],$$slots:{default:[UX]},$$scope:{ctx:t}}}),s.$on("submit",t[18]),s.$on("close",t[29]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),l.c(),r=F(),U(s.$$.fragment)},m(h,g){a&&a.m(h,g),O(h,e,g),u&&u.m(h,g),O(h,n,g),c[i].m(h,g),O(h,r,g),z(s,h,g),o=!0},p(h,g){h[4]?a?(a.p(h,g),g[0]&16&&p(a,1)):(a=K3(h),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),h[5]?u?(u.p(h,g),g[0]&32&&p(u,1)):(u=J3(h),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());let _=i;i=d(h),i===_?c[i].p(h,g):(ue(),v(c[_],1,1,()=>{c[_]=null}),fe(),l=c[i],l?l.p(h,g):(l=c[i]=f[i](h),l.c()),p(l,1),l.m(r.parentNode,r));const k={};g[0]&64&&(k.open=h[6]!=null),g[0]&2048&&(k.title=h[11]("Delete inspection-list entry?")),g[0]&2048&&(k.label=h[11]("HTTPS inspection")),g[0]&2048&&(k.confirmText=h[11]("Delete entry")),g[0]&2048&&(k.cancelText=h[11]("Cancel")),g[0]&8&&(k.busy=h[3]),g[0]&2112|g[1]&128&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){o||(p(a),p(u),p(l),p(s.$$.fragment,h),o=!0)},o(h){v(a),v(u),v(l),v(s.$$.fragment,h),o=!1},d(h){h&&(E(e),E(n),E(r)),a&&a.d(h),u&&u.d(h),c[i].d(h),H(s,h)}}}function GX(t,e,n){let i,l,r,s,o,a;ct(t,ti,re=>n(11,o=re)),ct(t,Ln,re=>n(31,a=re));let{filterId:u}=e,{showColumns:f=["content","score","actions"]}=e;const c=[{key:"content",value:o("Content")},{key:"score",value:o("Score")},{key:"actions",value:o("Actions")}];let d=[],h=!0,g=!1,_="",k="",y=null,T=null,M=[],A=1;const C=async()=>{n(2,h=!0),n(4,_="");try{const re=await a.api.doCall(`/filters/${u}`),oe=Array.isArray(re)?re[0]:null,Re=Array.isArray(oe==null?void 0:oe.Entries)?oe.Entries:[];n(0,d=Re.map((qe,Ce)=>({id:Ce+1,content:String(qe.Content??""),score:Number(qe.Score)||0}))),A=d.length+1,n(1,y=null)}catch(re){n(4,_=re instanceof Error&&re.message?re.message:o("This inspection list could not be loaded."))}finally{n(2,h=!1)}},D=()=>{Ei.add({kind:"success",title:o("Inspection list updated"),subtitle:o("The filter was saved successfully."),timeout:3e3})},R=async re=>{if(g)return!1;n(3,g=!0),n(5,k="");try{const oe=re.map(Ce=>({Content:Ce.content,Score:Ce.score})),Re=await a.api.doCall(`/filters/${u}`,"post",oe);if(!String((Re==null?void 0:Re.response)??(Re==null?void 0:Re.Response)??"").includes("Ok"))throw new Error((Re==null?void 0:Re.error)||o("The filter service did not confirm the save."));return D(),await C(),!0}catch(oe){return n(5,k=oe instanceof Error&&oe.message?oe.message:o("This inspection list could not be saved.")),!1}finally{n(3,g=!1)}},N=(re,oe)=>{const Re=String(oe.detail??"");n(0,d=d.map(qe=>qe.id===re?{...qe,content:Re}:qe))},G=(re,oe)=>{const Re=Number(oe.detail);n(0,d=d.map(qe=>qe.id===re?{...qe,score:Re}:qe))},B=re=>{n(1,y=re),n(5,k="")},$=async()=>{!r||!s||await R(d.map(re=>({...re,draft:!1})))},q=()=>{r!=null&&r.draft&&n(0,d=d.filter(re=>re.id!==r.id)),n(1,y=null),n(5,k="")},V=()=>{if(y!=null)return;const re={id:A++,content:"",score:0,draft:!0};n(0,d=[...d,re]),n(1,y=re.id)},K=async()=>{if(!T||g)return;const re=T;await R(d.filter(oe=>oe.id!==re.id))&&n(6,T=null)};sn(C);const x=()=>n(4,_=""),ie=()=>n(5,k=""),X=re=>B(Number(re.id)),ce=re=>n(6,T=d.find(oe=>oe.id===Number(re.id))??null),ae=(re,oe)=>G(Number(re.id),oe),ee=(re,oe)=>N(Number(re.id),oe);function he(re){M=re,n(7,M)}const ne=()=>n(6,T=null);return t.$$set=re=>{"filterId"in re&&n(19,u=re.filterId),"showColumns"in re&&n(20,f=re.showColumns)},t.$$.update=()=>{t.$$.dirty[0]&1048576&&n(10,i=c.filter(re=>f.includes(re.key))),t.$$.dirty[0]&1&&n(9,l=d.map(({id:re,content:oe,score:Re})=>({id:re,content:oe,score:Re}))),t.$$.dirty[0]&3&&n(21,r=d.find(re=>re.id===y)??null),t.$$.dirty[0]&3145728&&n(8,s=!!(r!=null&&r.content.trim())&&(!f.includes("score")||Number.isFinite(r==null?void 0:r.score)))},[d,y,h,g,_,k,T,M,s,l,i,o,N,G,B,$,q,V,K,u,f,r,x,ie,X,ce,ae,ee,he,ne]}class VX extends Oe{constructor(e){super(),Ee(this,e,GX,FX,Se,{filterId:19,showColumns:20},null,[-1,-1])}}function Q3(t,e,n){const i=t.slice();return i[10]=e[n],i}function WX(t){let e=t[10].label+"",n,i;return{c(){n=j(e),i=F()},m(l,r){O(l,n,r),O(l,i,r)},p:_e,d(l){l&&(E(n),E(i))}}}function x3(t){let e,n;function i(){return t[6](t[10])}return e=new bt({props:{kind:t[10].path===t[3].path?"primary":"ghost",size:"small",$$slots:{default:[WX]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&8&&(s.kind=t[10].path===t[3].path?"primary":"ghost"),r&8192&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function jX(t){let e,n;return e=new nn({props:{kind:"info",lowContrast:!0,title:t[4]("Inspection status unavailable"),subtitle:t[2]}}),e.$on("close",t[7]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Inspection status unavailable")),l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $X(t){let e,n;return e=new nn({props:{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:t[4]("HTTPS inspection is off"),subtitle:t[4]("This list applies to plain HTTP traffic only until HTTPS inspection is enabled in Settings and the GateSentry certificate is installed on each device. Use Policies to block whole domains.")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("HTTPS inspection is off")),l&16&&(r.subtitle=i[4]("This list applies to plain HTTP traffic only until HTTPS inspection is enabled in Settings and the GateSentry certificate is installed on each device. Use Policies to block whole domains.")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qX(t){let e,n;return e=new Wi({props:{description:t[4]("Checking HTTPS inspection…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.description=i[4]("Checking HTTPS inspection…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function e4(t){let e,n;return e=new jr({props:{title:t[4]("Filtering strictness"),description:t[4]("Set the total keyword score at which GateSentry blocks an inspected page. For example, two matches scored 1,000 reach a threshold of 2,000."),$$slots:{default:[YX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Filtering strictness")),l&16&&(r.description=i[4]("Set the total keyword score at which GateSentry blocks an inspected page. For example, two matches scored 1,000 reach a threshold of 2,000.")),l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function YX(t){let e,n,i;return n=new Ql({props:{keyName:"strictness",title:t[4]("Filtering strictness"),labelText:t[4]("Filtering strictness"),type:"number",helperText:t[4]("Lower thresholds block pages after fewer or lower-scored matches.")}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","strictness-control svelte-1aq0r5o")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&16&&(s.title=l[4]("Filtering strictness")),r&16&&(s.labelText=l[4]("Filtering strictness")),r&16&&(s.helperText=l[4]("Lower thresholds block pages after fewer or lower-scored matches.")),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function ZX(t){let e,n;return e=new VX({props:{filterId:t[3].filterId,showColumns:t[3].showColumns??["content","score","actions"]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.filterId=i[3].filterId),l&8&&(r.showColumns=i[3].showColumns??["content","score","actions"]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function XX(t){let e,n,i,l,r,s,o,a,u,f=it(Object.values(t[5])),c=[];for(let y=0;yv(c[y],1,1,()=>{c[y]=null}),h=[qX,$X,jX],g=[];function _(y,T){return y[3].warnsWhenDisabled&&y[1]===null&&!y[2]?0:y[3].warnsWhenDisabled&&y[1]===!1?1:y[2]?2:-1}~(l=_(t))&&(r=g[l]=h[l](t));let k=t[0]==="blockedkeywords"&&e4(t);return a=new jr({props:{title:t[3].sectionTitle,description:t[3].sectionDescription,$$slots:{default:[ZX]},$$scope:{ctx:t}}}),{c(){e=P("nav");for(let y=0;y{g[M]=null}),fe()),~l?(r=g[l],r?r.p(y,T):(r=g[l]=h[l](y),r.c()),p(r,1),r.m(s.parentNode,s)):r=null),y[0]==="blockedkeywords"?k?(k.p(y,T),T&1&&p(k,1)):(k=e4(y),k.c(),p(k,1),k.m(o.parentNode,o)):k&&(ue(),v(k,1,1,()=>{k=null}),fe());const A={};T&8&&(A.title=y[3].sectionTitle),T&8&&(A.description=y[3].sectionDescription),T&8200&&(A.$$scope={dirty:T,ctx:y}),a.$set(A)},i(y){if(!u){for(let T=0;Tn(4,l=h)),ct(t,Ln,h=>n(8,r=h));let{type:s}=e;const o={blockedkeywords:{path:"/blockedkeywords",label:l("Blocked keywords"),title:l("Blocked keywords"),description:l("Score words found in inspected HTTP and HTTPS response content."),sectionTitle:l("Keyword scores"),sectionDescription:l("GateSentry totals matching scores and blocks the response when the filtering strictness threshold is reached."),filterId:"bVxTPTOXiqGRbhF",warnsWhenDisabled:!0},blockedfiletypes:{path:"/blockedfiletypes",label:l("Blocked content types"),title:l("Blocked content types"),description:l("Block inspected proxy responses by their MIME content type."),sectionTitle:l("Content types"),sectionDescription:l("Entries apply to every device using the proxy. Use a policy rule when a content type should apply only to selected devices."),filterId:"JHGJiwjkGOeglsk",showColumns:["content","actions"],warnsWhenDisabled:!0},excludehosts:{path:"/excludehosts",label:l("Sites not inspected"),title:l("Sites not inspected"),description:l("Pass selected HTTPS hosts through without decrypting their traffic."),sectionTitle:l("Host exclusions"),sectionDescription:l("Add apps or sites that fail under inspection, such as certificate-pinning services. Policies can still block these hosts by domain."),filterId:"CeBqssmRbqXzbHR",showColumns:["content","actions"],warnsWhenDisabled:!1},excludeurls:{path:"/excludeurls",label:l("URLs not inspected"),title:l("URLs not inspected"),description:l("Exclude selected request URLs from content filtering after the connection is inspected."),sectionTitle:l("URL exclusions"),sectionDescription:l("Use narrowly scoped URLs for content that should bypass response filtering. Use Sites not inspected when the TLS connection itself must not be decrypted."),filterId:"JHGJiwjkGOeglsd",showColumns:["content","actions"],warnsWhenDisabled:!0}};let a=null,u="";sn(async()=>{n(2,u="");try{const h=await r.api.doCall("/settings/enable_https_filtering");n(1,a=(h==null?void 0:h.Value)==="true")}catch(h){n(1,a=null),n(2,u=h instanceof Error&&h.message?h.message:l("HTTPS inspection status could not be checked."))}});const c=h=>Vi(h.path),d=()=>n(2,u="");return t.$$set=h=>{"type"in h&&n(0,s=h.type)},t.$$.update=()=>{t.$$.dirty&1&&n(3,i=o[s]??o.blockedkeywords)},[s,a,u,i,l,o,c,d]}class Bd extends Oe{constructor(e){super(),Ee(this,e,nK,tK,Se,{type:0})}}function iK(t){let e;return{c(){e=j(t[0])},m(n,i){O(n,e,i)},p(n,i){i&1&&Y(e,n[0])},d(n){n&&E(e)}}}function lK(t){let e,n,i,l,r;return n=new xz({props:{for:t[2],$$slots:{default:[iK]},$$scope:{ctx:t}}}),l=new l5({props:{id:t[2],value:t[1]}}),l.$on("blur",t[3]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","certificate-field svelte-1nft9cf")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,[o]){const a={};o&4&&(a.for=s[2]),o&257&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o&4&&(u.id=s[2]),o&2&&(u.value=s[1]),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function rK(t,e,n){let i,l,r;ct(t,ti,c=>n(5,l=c)),ct(t,Ln,c=>n(6,r=c));let s="",{settingName:o}=e,{label:a}=e;const u=async()=>{if(o===void 0)return;const c=await r.api.getSetting(o);n(1,s=c.Value)};let f=async c=>{const d=c.target.value;await r.api.setSetting(o,d)===!1?Ei.add(Ss({subtitle:l("Unable to save certificate data")},l)):Ei.add(Ma({subtitle:l("Certificate data saved")},l)),u()};return t.$$set=c=>{"settingName"in c&&n(4,o=c.settingName),"label"in c&&n(0,a=c.label)},t.$$.update=()=>{t.$$.dirty&16&&n(2,i=`certificate-${o}`)},u(),[a,s,i,f,o]}class t4 extends Oe{constructor(e){super(),Ee(this,e,rK,lK,Se,{settingName:4,label:0})}}function sK(t){let e=(t[3]?t[4]("Hide advanced settings"):t[4]("Edit certificate"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&24&&e!==(e=(i[3]?i[4]("Hide advanced settings"):i[4]("Edit certificate"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function oK(t){let e,n,i,l=t[4]("Issuer name")+"",r,s,o,a=(t[0].name||t[4]("Unknown"))+"",u,f,c,d,h=t[4]("Expiry")+"",g,_,k,y=(t[0].expiry||t[4]("Unknown"))+"",T;return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=j(l),s=F(),o=P("dd"),u=j(a),f=F(),c=P("div"),d=P("dt"),g=j(h),_=F(),k=P("dd"),T=j(y),I(i,"class","svelte-1877to5"),I(o,"class","svelte-1877to5"),I(n,"class","svelte-1877to5"),I(d,"class","svelte-1877to5"),I(k,"class","svelte-1877to5"),I(c,"class","svelte-1877to5"),I(e,"class","certificate-summary svelte-1877to5")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(n,f),w(e,c),w(c,d),w(d,g),w(c,_),w(c,k),w(k,T)},p(M,A){A&16&&l!==(l=M[4]("Issuer name")+"")&&Y(r,l),A&17&&a!==(a=(M[0].name||M[4]("Unknown"))+"")&&Y(u,a),A&16&&h!==(h=M[4]("Expiry")+"")&&Y(g,h),A&17&&y!==(y=(M[0].expiry||M[4]("Unknown"))+"")&&Y(T,y)},i:_e,o:_e,d(M){M&&E(e)}}}function aK(t){let e,n;return e=new nn({props:{lowContrast:!0,hideCloseButton:!0,kind:"error",title:t[4]("Certificate unavailable"),subtitle:t[2]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Certificate unavailable")),l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function uK(t){let e,n;return e=new Wi({props:{description:t[4]("Loading certificate details…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.description=i[4]("Loading certificate details…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function n4(t){let e,n,i,l,r,s=t[4]("Certificate (PEM)")+"",o,a,u,f=t[4]("Public certificate installed on protected devices. It may be downloaded and shared with those devices.")+"",c,d,h,g,_,k,y=t[4]("Private key (PEM)")+"",T,M,A,C=t[4]("Sensitive signing key stored by GateSentry. Never install or share this value with client devices.")+"",D,R,N,G;return e=new nn({props:{lowContrast:!0,hideCloseButton:!0,kind:"warning",title:t[4]("Advanced certificate settings"),subtitle:t[4]("Replacing certificate material can interrupt HTTPS inspection. Keep the private key secret and update the certificate and key as a matched pair.")}}),h=new t4({props:{settingName:"capem",label:t[4]("HTTPS filtering certificate")}}),N=new t4({props:{settingName:"keypem",label:t[4]("HTTPS filtering private key")}}),{c(){U(e.$$.fragment),n=F(),i=P("div"),l=P("section"),r=P("h4"),o=j(s),a=F(),u=P("p"),c=j(f),d=F(),U(h.$$.fragment),g=F(),_=P("section"),k=P("h4"),T=j(y),M=F(),A=P("p"),D=j(C),R=F(),U(N.$$.fragment),I(r,"id","certificate-pem-heading"),I(r,"class","svelte-1877to5"),I(u,"class","svelte-1877to5"),I(l,"aria-labelledby","certificate-pem-heading"),I(l,"class","svelte-1877to5"),I(k,"id","private-key-heading"),I(k,"class","svelte-1877to5"),I(A,"class","svelte-1877to5"),I(_,"class","private-key svelte-1877to5"),I(_,"aria-labelledby","private-key-heading"),I(i,"class","advanced-grid svelte-1877to5")},m(B,$){z(e,B,$),O(B,n,$),O(B,i,$),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(l,d),z(h,l,null),w(i,g),w(i,_),w(_,k),w(k,T),w(_,M),w(_,A),w(A,D),w(_,R),z(N,_,null),G=!0},p(B,$){const q={};$&16&&(q.title=B[4]("Advanced certificate settings")),$&16&&(q.subtitle=B[4]("Replacing certificate material can interrupt HTTPS inspection. Keep the private key secret and update the certificate and key as a matched pair.")),e.$set(q),(!G||$&16)&&s!==(s=B[4]("Certificate (PEM)")+"")&&Y(o,s),(!G||$&16)&&f!==(f=B[4]("Public certificate installed on protected devices. It may be downloaded and shared with those devices.")+"")&&Y(c,f);const V={};$&16&&(V.label=B[4]("HTTPS filtering certificate")),h.$set(V),(!G||$&16)&&y!==(y=B[4]("Private key (PEM)")+"")&&Y(T,y),(!G||$&16)&&C!==(C=B[4]("Sensitive signing key stored by GateSentry. Never install or share this value with client devices.")+"")&&Y(D,C);const K={};$&16&&(K.label=B[4]("HTTPS filtering private key")),N.$set(K)},i(B){G||(p(e.$$.fragment,B),p(h.$$.fragment,B),p(N.$$.fragment,B),G=!0)},o(B){v(e.$$.fragment,B),v(h.$$.fragment,B),v(N.$$.fragment,B),G=!1},d(B){B&&(E(n),E(i)),H(e,B),H(h),H(N)}}}function fK(t){let e,n,i,l=t[4]("Inspection certificate")+"",r,s,o,a=t[4]("Install this certificate only on devices that you intend GateSentry to inspect.")+"",u,f,c,d,h,g,_,k,y,T,M,A;c=new bt({props:{size:"small",kind:t[3]?"secondary":"tertiary",$$slots:{default:[sK]},$$scope:{ctx:t}}}),c.$on("click",t[5]);const C=[uK,aK,oK],D=[];function R(G,B){return G[1]?0:G[2]?1:G[0]?2:-1}~(h=R(t))&&(g=D[h]=C[h](t)),y=new z5({});let N=t[3]&&n4(t);return{c(){e=P("div"),n=P("div"),i=P("h3"),r=j(l),s=F(),o=P("p"),u=j(a),f=F(),U(c.$$.fragment),d=F(),g&&g.c(),_=F(),k=P("div"),U(y.$$.fragment),T=F(),N&&N.c(),M=je(),I(i,"class","svelte-1877to5"),I(o,"class","svelte-1877to5"),I(e,"class","certificate-heading svelte-1877to5"),I(k,"class","certificate-download svelte-1877to5")},m(G,B){O(G,e,B),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(e,f),z(c,e,null),O(G,d,B),~h&&D[h].m(G,B),O(G,_,B),O(G,k,B),z(y,k,null),O(G,T,B),N&&N.m(G,B),O(G,M,B),A=!0},p(G,[B]){(!A||B&16)&&l!==(l=G[4]("Inspection certificate")+"")&&Y(r,l),(!A||B&16)&&a!==(a=G[4]("Install this certificate only on devices that you intend GateSentry to inspect.")+"")&&Y(u,a);const $={};B&8&&($.kind=G[3]?"secondary":"tertiary"),B&152&&($.$$scope={dirty:B,ctx:G}),c.$set($);let q=h;h=R(G),h===q?~h&&D[h].p(G,B):(g&&(ue(),v(D[q],1,1,()=>{D[q]=null}),fe()),~h?(g=D[h],g?g.p(G,B):(g=D[h]=C[h](G),g.c()),p(g,1),g.m(_.parentNode,_)):g=null),G[3]?N?(N.p(G,B),B&8&&p(N,1)):(N=n4(G),N.c(),p(N,1),N.m(M.parentNode,M)):N&&(ue(),v(N,1,1,()=>{N=null}),fe())},i(G){A||(p(c.$$.fragment,G),p(g),p(y.$$.fragment,G),p(N),A=!0)},o(G){v(c.$$.fragment,G),v(g),v(y.$$.fragment,G),v(N),A=!1},d(G){G&&(E(e),E(d),E(_),E(k),E(T),E(M)),H(c),~h&&D[h].d(G),H(y),N&&N.d(G)}}}function cK(t,e,n){let i,l;ct(t,Ln,f=>n(6,i=f)),ct(t,ti,f=>n(4,l=f));let r=null,s=!0,o="",a=!1;return sn(async()=>{try{n(0,r=await i.api.doCall("/certificate/info"))}catch(f){n(2,o=f instanceof Error?f.message:"Certificate details failed")}finally{n(1,s=!1)}}),[r,s,o,a,l,()=>n(3,a=!a)]}class dK extends Oe{constructor(e){super(),Ee(this,e,cK,fK,Se,{})}}function hK(t){let e,n,i,l=t[0]("Privacy Notice for Enabling MITM Filtering")+"",r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G;return{c(){e=P("div"),n=P("div"),i=P("h3"),r=j(l),s=F(),o=P("h4"),o.textContent="Attention System Administrators:",a=F(),u=P("p"),u.textContent=`Before enabling the Man-In-The-Middle (MITM) filtering on this proxy +}`;var $t=Ep(function(){return hn(se,yt+"return "+nt).apply(n,ge)});if($t.source=nt,e1($t))throw $t;return $t}function $L(m){return _n(m).toLowerCase()}function qL(m){return _n(m).toUpperCase()}function YL(m,b,L){if(m=_n(m),m&&(L||b===n))return P_(m);if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=Ul(b),se=N_(W,Q),ge=B_(W,Q)+1;return ms(W,se,ge).join("")}function ZL(m,b,L){if(m=_n(m),m&&(L||b===n))return m.slice(0,H_(m)+1);if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=B_(W,Ul(b))+1;return ms(W,0,Q).join("")}function XL(m,b,L){if(m=_n(m),m&&(L||b===n))return m.replace(ji,"");if(!m||!(b=sl(b)))return m;var W=Ul(m),Q=N_(W,Ul(b));return ms(W,Q).join("")}function KL(m,b){var L=B,W=j;if(Gn(b)){var Q="separator"in b?b.separator:Q;L="length"in b?Vt(b.length):L,W="omission"in b?sl(b.omission):W}m=_n(m);var se=m.length;if(Eo(m)){var ge=Ul(m);se=ge.length}if(L>=se)return m;var ke=L-Oo(W);if(ke<1)return W;var Le=ge?ms(ge,0,ke).join(""):m.slice(0,ke);if(Q===n)return Le+W;if(ge&&(ke+=Le.length-ke),t1(Q)){if(m.slice(ke).search(Q)){var Ke,Je=Le;for(Q.global||(Q=ph(Q.source,_n(yn.exec(Q))+"g")),Q.lastIndex=0;Ke=Q.exec(Je);)var nt=Ke.index;Le=Le.slice(0,nt===n?ke:nt)}}else if(m.indexOf(sl(Q),ke)!=ke){var mt=Le.lastIndexOf(Q);mt>-1&&(Le=Le.slice(0,mt))}return Le+W}function JL(m){return m=_n(m),m&&kn.test(m)?m.replace(Be,OM):m}var QL=Ro(function(m,b,L){return m+(L?" ":"")+b.toUpperCase()}),l1=O0("toUpperCase");function Sp(m,b,L){return m=_n(m),b=L?n:b,b===n?wM(m)?AM(m):dM(m):m.match(b)||[]}var Ep=Yt(function(m,b){try{return ll(m,n,b)}catch(L){return e1(L)?L:new zt(L)}}),xL=Mr(function(m,b){return wl(b,function(L){L=rr(L),Er(m,L,Qh(m[L],m))}),m});function eD(m){var b=m==null?0:m.length,L=Lt();return m=b?zn(m,function(W){if(typeof W[1]!="function")throw new yl(s);return[L(W[0]),W[1]]}):[],Yt(function(W){for(var Q=-1;++Qce)return[];var L=he,W=Ci(m,he);b=Lt(b),m-=he;for(var Q=mh(W,b);++L0||b<0)?new Jt(L):(m<0?L=L.takeRight(-m):m&&(L=L.drop(m)),b!==n&&(b=Vt(b),L=b<0?L.dropRight(-b):L.take(b-m)),L)},Jt.prototype.takeRightWhile=function(m){return this.reverse().takeWhile(m).reverse()},Jt.prototype.toArray=function(){return this.take(he)},ir(Jt.prototype,function(m,b){var L=/^(?:filter|find|map|reject)|While$/.test(b),W=/^(?:head|last)$/.test(b),Q=le[W?"take"+(b=="last"?"Right":""):b],se=W||/^find/.test(b);Q&&(le.prototype[b]=function(){var ge=this.__wrapped__,ke=W?[1]:arguments,Le=ge instanceof Jt,Ke=ke[0],Je=Le||Ht(ge),nt=function(Xt){var en=Q.apply(le,as([Xt],ke));return W&&mt?en[0]:en};Je&&L&&typeof Ke=="function"&&Ke.length!=1&&(Le=Je=!1);var mt=this.__chain__,yt=!!this.__actions__.length,Dt=se&&!mt,$t=Le&&!yt;if(!se&&Je){ge=$t?ge:new Jt(this);var It=m.apply(ge,ke);return It.__actions__.push({func:$f,args:[nt],thisArg:n}),new Tl(It,mt)}return Dt&&$t?m.apply(this,ke):(It=this.thru(nt),Dt?W?It.value()[0]:It.value():It)})}),wl(["pop","push","shift","sort","splice","unshift"],function(m){var b=pf[m],L=/^(?:push|sort|unshift)$/.test(m)?"tap":"thru",W=/^(?:pop|shift)$/.test(m);le.prototype[m]=function(){var Q=arguments;if(W&&!this.__chain__){var se=this.value();return b.apply(Ht(se)?se:[],Q)}return this[L](function(ge){return b.apply(Ht(ge)?ge:[],Q)})}}),ir(Jt.prototype,function(m,b){var L=le[b];if(L){var W=L.name+"";Sn.call(Lo,W)||(Lo[W]=[]),Lo[W].push({name:b,func:L})}}),Lo[Hf(n,y).name]=[{name:"wrapper",func:n}],Jt.prototype.clone=JM,Jt.prototype.reverse=QM,Jt.prototype.value=xM,le.prototype.at=C7,le.prototype.chain=A7,le.prototype.commit=L7,le.prototype.next=D7,le.prototype.plant=R7,le.prototype.reverse=P7,le.prototype.toJSON=le.prototype.valueOf=le.prototype.value=N7,le.prototype.first=le.prototype.head,Ha&&(le.prototype[Ha]=I7),le},Mo=LM();Us?((Us.exports=Mo)._=Mo,sh._=Mo):ki._=Mo}).call(xa)})(Hc,Hc.exports);var FZ=Hc.exports;const P3=c5(FZ),GZ=t=>({}),N3=t=>({}),VZ=t=>({}),B3=t=>({});function z3(t){let e,n;return{c(){e=P("p"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function H3(t){let e,n;const i=t[5].actions,l=He(i,t,t[4],N3);return{c(){e=P("div"),l&&l.c(),I(e,"class","page-shell__actions")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&16)&&Fe(l,i,r,r[4],n?Ue(i,r[4],s,GZ):Ge(r[4]),N3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function WZ(t){let e,n,i,l,r,s,o,a,u,f,c;const d=t[5].breadcrumb,h=He(d,t,t[4],B3);let g=t[1]&&z3(t),_=t[3].actions&&H3(t);const k=t[5].default,y=He(k,t,t[4],null);return{c(){e=P("div"),n=P("header"),i=P("div"),h&&h.c(),l=F(),r=P("h1"),s=$(t[0]),o=F(),g&&g.c(),a=F(),_&&_.c(),u=F(),f=P("div"),y&&y.c(),I(i,"class","page-shell__heading"),I(n,"class","page-shell__header"),I(f,"class","page-shell__content"),I(e,"class","page-shell"),S(e,"page-shell--narrow",t[2])},m(T,M){O(T,e,M),w(e,n),w(n,i),h&&h.m(i,null),w(i,l),w(i,r),w(r,s),w(i,o),g&&g.m(i,null),w(n,a),_&&_.m(n,null),w(e,u),w(e,f),y&&y.m(f,null),c=!0},p(T,[M]){h&&h.p&&(!c||M&16)&&Fe(h,d,T,T[4],c?Ue(d,T[4],M,VZ):Ge(T[4]),B3),(!c||M&1)&&Y(s,T[0]),T[1]?g?g.p(T,M):(g=z3(T),g.c(),g.m(i,null)):g&&(g.d(1),g=null),T[3].actions?_?(_.p(T,M),M&8&&p(_,1)):(_=H3(T),_.c(),p(_,1),_.m(n,null)):_&&(ue(),v(_,1,1,()=>{_=null}),fe()),y&&y.p&&(!c||M&16)&&Fe(y,k,T,T[4],c?Ue(k,T[4],M,null):Ge(T[4]),null),(!c||M&4)&&S(e,"page-shell--narrow",T[2])},i(T){c||(p(h,T),p(_),p(y,T),c=!0)},o(T){v(h,T),v(_),v(y,T),c=!1},d(T){T&&E(e),h&&h.d(T),g&&g.d(),_&&_.d(),y&&y.d(T)}}}function jZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e,{narrow:a=!1}=e;return t.$$set=u=>{"title"in u&&n(0,s=u.title),"description"in u&&n(1,o=u.description),"narrow"in u&&n(2,a=u.narrow),"$$scope"in u&&n(4,l=u.$$scope)},[s,o,a,r,l,i]}class Nl extends Oe{constructor(e){super(),Ee(this,e,jZ,WZ,Se,{title:0,description:1,narrow:2})}}const $Z=t=>({}),U3=t=>({});function F3(t){let e,n,i,l,r,s=t[0]&&G3(t),o=t[1]&&V3(t),a=t[3].actions&&W3(t);return{c(){e=P("header"),n=P("div"),s&&s.c(),i=F(),o&&o.c(),l=F(),a&&a.c(),I(e,"class","section-panel__header")},m(u,f){O(u,e,f),w(e,n),s&&s.m(n,null),w(n,i),o&&o.m(n,null),w(e,l),a&&a.m(e,null),r=!0},p(u,f){u[0]?s?s.p(u,f):(s=G3(u),s.c(),s.m(n,i)):s&&(s.d(1),s=null),u[1]?o?o.p(u,f):(o=V3(u),o.c(),o.m(n,null)):o&&(o.d(1),o=null),u[3].actions?a?(a.p(u,f),f&8&&p(a,1)):(a=W3(u),a.c(),p(a,1),a.m(e,null)):a&&(ue(),v(a,1,1,()=>{a=null}),fe())},i(u){r||(p(a),r=!0)},o(u){v(a),r=!1},d(u){u&&E(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function G3(t){let e,n;return{c(){e=P("h2"),n=$(t[0])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&1&&Y(n,i[0])},d(i){i&&E(e)}}}function V3(t){let e,n;return{c(){e=P("p"),n=$(t[1])},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&2&&Y(n,i[1])},d(i){i&&E(e)}}}function W3(t){let e,n;const i=t[5].actions,l=He(i,t,t[4],U3);return{c(){e=P("div"),l&&l.c(),I(e,"class","section-panel__actions")},m(r,s){O(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s&16)&&Fe(l,i,r,r[4],n?Ue(i,r[4],s,$Z):Ge(r[4]),U3)},i(r){n||(p(l,r),n=!0)},o(r){v(l,r),n=!1},d(r){r&&E(e),l&&l.d(r)}}}function qZ(t){let e,n,i,l,r,s=(t[0]||t[1]||t[3].actions)&&F3(t);const o=t[5].default,a=He(o,t,t[4],null);return{c(){e=P("section"),s&&s.c(),n=F(),i=P("div"),a&&a.c(),I(i,"class","section-panel__body"),I(e,"class","section-panel"),I(e,"aria-label",l=t[2]||t[0]||void 0)},m(u,f){O(u,e,f),s&&s.m(e,null),w(e,n),w(e,i),a&&a.m(i,null),r=!0},p(u,[f]){u[0]||u[1]||u[3].actions?s?(s.p(u,f),f&11&&p(s,1)):(s=F3(u),s.c(),p(s,1),s.m(e,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a&&a.p&&(!r||f&16)&&Fe(a,o,u,u[4],r?Ue(o,u[4],f,null):Ge(u[4]),null),(!r||f&5&&l!==(l=u[2]||u[0]||void 0))&&I(e,"aria-label",l)},i(u){r||(p(s),p(a,u),r=!0)},o(u){v(s),v(a,u),r=!1},d(u){u&&E(e),s&&s.d(),a&&a.d(u)}}}function YZ(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=di(i);let{title:s=""}=e,{description:o=""}=e,{ariaLabel:a=""}=e;return t.$$set=u=>{"title"in u&&n(0,s=u.title),"description"in u&&n(1,o=u.description),"ariaLabel"in u&&n(2,a=u.ariaLabel),"$$scope"in u&&n(4,l=u.$$scope)},[s,o,a,r,l,i]}class jr extends Oe{constructor(e){super(),Ee(this,e,YZ,qZ,Se,{title:0,description:1,ariaLabel:2})}}function ZZ(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Rn({props:{value:"",text:"All actions"}}),i=new Rn({props:{value:"block",text:"Block"}}),r=new Rn({props:{value:"allow",text:"Allow"}}),o=new Rn({props:{value:"bypass",text:"Bypass"}}),u=new Rn({props:{value:"inspect",text:"Inspect"}}),c=new Rn({props:{value:"error",text:"Error"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment)},m(h,g){z(e,h,g),O(h,n,g),z(i,h,g),O(h,l,g),z(r,h,g),O(h,s,g),z(o,h,g),O(h,a,g),z(u,h,g),O(h,f,g),z(c,h,g),d=!0},p:_e,i(h){d||(p(e.$$.fragment,h),p(i.$$.fragment,h),p(r.$$.fragment,h),p(o.$$.fragment,h),p(u.$$.fragment,h),p(c.$$.fragment,h),d=!0)},o(h){v(e.$$.fragment,h),v(i.$$.fragment,h),v(r.$$.fragment,h),v(o.$$.fragment,h),v(u.$$.fragment,h),v(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(l),E(s),E(a),E(f)),H(e,h),H(i,h),H(r,h),H(o,h),H(u,h),H(c,h)}}}function XZ(t){let e,n,i,l,r,s,o,a,u,f;return e=new Rn({props:{value:"",text:"All layers"}}),i=new Rn({props:{value:"dns",text:"DNS"}}),r=new Rn({props:{value:"explicit_proxy",text:"Explicit proxy"}}),o=new Rn({props:{value:"transparent_proxy",text:"Transparent proxy"}}),u=new Rn({props:{value:"content",text:"Content"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment)},m(c,d){z(e,c,d),O(c,n,d),z(i,c,d),O(c,l,d),z(r,c,d),O(c,s,d),z(o,c,d),O(c,a,d),z(u,c,d),f=!0},p:_e,i(c){f||(p(e.$$.fragment,c),p(i.$$.fragment,c),p(r.$$.fragment,c),p(o.$$.fragment,c),p(u.$$.fragment,c),f=!0)},o(c){v(e.$$.fragment,c),v(i.$$.fragment,c),v(r.$$.fragment,c),v(o.$$.fragment,c),v(u.$$.fragment,c),f=!1},d(c){c&&(E(n),E(l),E(s),E(a)),H(e,c),H(i,c),H(r,c),H(o,c),H(u,c)}}}function KZ(t){let e,n;return e=new ml({props:{sortable:!0,size:"medium",headers:[{key:"time",value:"Time"},{key:"client",value:"Client"},{key:"url",value:"URL"},{key:"action",value:"Action"},{key:"layer",value:"Layer"},{key:"reason",value:"Reason"}],rows:t[5]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.rows=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function JZ(t){let e,n;return e=new hi({props:{state:"empty",title:"No decisions found",message:"Try clearing the search or choosing a different filter."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function QZ(t){let e,n;return e=new hi({props:{state:"loading",message:"Loading filtering decisions"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xZ(t){let e,n;return e=new hi({props:{state:"error",title:"Decisions unavailable",message:t[4],onRetry:t[6]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.message=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function eX(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_;function k(G){t[12](G)}let y={placeholder:"Search by domain",labelText:"Search decisions"};t[2]!==void 0&&(y.value=t[2]),i=new YT({props:y}),xe.push(()=>At(i,"value",k)),i.$on("clear",t[7]);function T(G){t[13](G)}let M={labelText:"Action",$$slots:{default:[ZZ]},$$scope:{ctx:t}};t[0]!==void 0&&(M.selected=t[0]),s=new Wr({props:M}),xe.push(()=>At(s,"selected",T));function A(G){t[14](G)}let C={labelText:"Layer",$$slots:{default:[XZ]},$$scope:{ctx:t}};t[1]!==void 0&&(C.selected=t[1]),u=new Wr({props:C}),xe.push(()=>At(u,"selected",A));const D=[xZ,QZ,JZ,KZ],R=[];function N(G,B){return G[4]?0:G[3]?G[5].length===0?2:3:1}return d=N(t),h=R[d]=D[d](t),{c(){e=P("div"),n=P("div"),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),c=F(),h.c(),g=je(),I(n,"class","filters__search svelte-1ccvqz1"),I(e,"class","filters svelte-1ccvqz1")},m(G,B){O(G,e,B),w(e,n),z(i,n,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),O(G,c,B),R[d].m(G,B),O(G,g,B),_=!0},p(G,B){const j={};!l&&B&4&&(l=!0,j.value=G[2],Ct(()=>l=!1)),i.$set(j);const q={};B&33554432&&(q.$$scope={dirty:B,ctx:G}),!o&&B&1&&(o=!0,q.selected=G[0],Ct(()=>o=!1)),s.$set(q);const V={};B&33554432&&(V.$$scope={dirty:B,ctx:G}),!f&&B&2&&(f=!0,V.selected=G[1],Ct(()=>f=!1)),u.$set(V);let K=d;d=N(G),d===K?R[d].p(G,B):(ue(),v(R[K],1,1,()=>{R[K]=null}),fe(),h=R[d],h?h.p(G,B):(h=R[d]=D[d](G),h.c()),p(h,1),h.m(g.parentNode,g))},i(G){_||(p(i.$$.fragment,G),p(s.$$.fragment,G),p(u.$$.fragment,G),p(h),_=!0)},o(G){v(i.$$.fragment,G),v(s.$$.fragment,G),v(u.$$.fragment,G),v(h),_=!1},d(G){G&&(E(e),E(c),E(g)),H(i),H(s),H(u),R[d].d(G)}}}function tX(t){let e,n;return e=new jr({props:{title:"Filter decisions",description:"Search recent activity or narrow it by outcome and enforcement layer.",$$slots:{default:[eX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&33554495&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function nX(t){let e;return{c(){e=$("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iX(t){let e;return{c(){e=$("Logs")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function lX(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[nX]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[iX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&33554432&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&33554432&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function rX(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[lX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&33554432&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sX(t){let e,n;return e=new Nl({props:{title:"Decision log",description:"Structured filtering decisions from DNS, proxy, and content inspection layers.",$$slots:{breadcrumb:[rX],default:[tX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&33554495&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function oX(t,e,n){let i,l;ct(t,Ln,q=>n(21,l=q));let r="",s="",o="",a=[],u=new Map,f=null,c=null,d=!1,h=!1,g=!1,_=!1,k=!1,y="",T=!1,M="";const A=()=>{const q=[];return r.length>0&&q.push("domain="+encodeURIComponent(r)),s&&q.push("action="+s),o&&q.push("layer="+o),q.length>0?"?"+q.join("&"):""},C=async()=>{if(d||k)return;d=!0;const q=A();try{const V=await l.api.doCall("/decisions"+q);!k&&q===A()&&(n(8,a=(V==null?void 0:V.items)||[]),n(4,M=""),n(3,T=!0))}catch{!k&&!T&&n(4,M="Unable to load decisions.")}finally{if(d=!1,k)return;h?(h=!1,C()):f=setTimeout(C,5e3)}},D=async()=>{if(!(g||k)){g=!0;try{const q=await l.api.doCall("/devices");k||n(9,u=HZ(q==null?void 0:q.devices))}catch{}finally{g=!1,k||(c=setTimeout(D,6e4))}}},R=()=>{if(f&&clearTimeout(f),f=null,d){h=!0;return}C()},N=()=>{n(2,r=""),R()};on(()=>{n(10,_=!0),n(11,y=s+"\0"+o),C(),D()}),Ls(()=>{k=!0,f&&clearTimeout(f),c&&clearTimeout(c)});function G(q){r=q,n(2,r)}function B(q){s=q,n(0,s)}function j(q){o=q,n(1,o)}return t.$$.update=()=>{if(t.$$.dirty&768&&n(5,i=a.map((q,V)=>({id:q.ip+q.time+V+q.url,time:zZ(q.time*1e3),client:UZ(u,q.ip),url:P3.truncate(q.url,{length:50}),action:q.action||"",layer:q.layer||"",reason:P3.truncate(q.reason||q.matched_rule||"",{length:40})}))),t.$$.dirty&3075){const q=s+"\0"+o;_&&q!==y&&(n(11,y=q),R())}},[s,o,r,T,M,i,R,N,a,u,_,y,G,B,j]}class aX extends Oe{constructor(e){super(),Ee(this,e,oX,sX,Se,{})}}function j3(t,e,n){const i=t.slice();return i[26]=e[n],i}function $3(t){let e,n,i,l;const r=[fX,uX],s=[];function o(a,u){return a[4]==="radio"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function uX(t){let e,n;return e=new ei({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5],value:t[8]}}),e.$on("input",t[13]),e.$on("blur",t[14]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.title=i[2]),l&2&&(r.labelText=i[1]),l&8&&(r.helperText=i[3]),l&16&&(r.type=i[4]),l&32&&(r.disabled=i[5]),l&256&&(r.value=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function fX(t){let e,n,i,l,r;function s(u){t[19](u)}let o={legendText:t[1],orientation:t[7],disabled:t[5]||t[10],$$slots:{default:[hX]},$$scope:{ctx:t}};t[8]!==void 0&&(o.selected=t[8]),e=new n5({props:o}),xe.push(()=>At(e,"selected",s)),e.$on("change",t[15]);let a=t[3]&&Y3(t);return{c(){U(e.$$.fragment),i=F(),a&&a.c(),l=je()},m(u,f){z(e,u,f),O(u,i,f),a&&a.m(u,f),O(u,l,f),r=!0},p(u,f){const c={};f&2&&(c.legendText=u[1]),f&128&&(c.orientation=u[7]),f&1056&&(c.disabled=u[5]||u[10]),f&536875073&&(c.$$scope={dirty:f,ctx:u}),!n&&f&256&&(n=!0,c.selected=u[8],Ct(()=>n=!1)),e.$set(c),u[3]?a?a.p(u,f):(a=Y3(u),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(u){r||(p(e.$$.fragment,u),r=!0)},o(u){v(e.$$.fragment,u),r=!1},d(u){u&&(E(i),E(l)),H(e,u),a&&a.d(u)}}}function cX(t){let e,n,i,l;return e=new la({props:{id:`${t[0]}-true`,value:"true",labelText:t[12]("True")}}),i=new la({props:{id:`${t[0]}-false`,value:"false",labelText:t[12]("False")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.id=`${r[0]}-true`),s&4096&&(o.labelText=r[12]("True")),e.$set(o);const a={};s&1&&(a.id=`${r[0]}-false`),s&4096&&(a.labelText=r[12]("False")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function dX(t){let e=[],n=new Map,i,l,r=it(t[6]);const s=o=>o[26].value;for(let o=0;o0?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function Y3(t){let e,n;return{c(){e=P("p"),n=$(t[3]),I(e,"class","helper-text svelte-p4zmla")},m(i,l){O(i,e,l),w(e,n)},p(i,l){l&8&&Y(n,i[3])},d(i){i&&E(e)}}}function Z3(t){let e,n;return e=new Wi({props:{description:t[12]("Saving…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4096&&(r.description=i[12]("Saving…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function X3(t){let e,n;return e=new ln({props:{lowContrast:!0,kind:"error",title:t[12]("Setting not saved"),subtitle:t[11]}}),e.$on("close",t[20]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4096&&(r.title=i[12]("Setting not saved")),l&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mX(t){let e,n,i,l,r=t[9]&&$3(t),s=t[10]&&Z3(t),o=t[11]&&X3(t);return{c(){e=P("div"),r&&r.c(),n=F(),s&&s.c(),i=F(),o&&o.c(),I(e,"class","connected-setting svelte-p4zmla")},m(a,u){O(a,e,u),r&&r.m(e,null),w(e,n),s&&s.m(e,null),w(e,i),o&&o.m(e,null),l=!0},p(a,[u]){a[9]?r?(r.p(a,u),u&512&&p(r,1)):(r=$3(a),r.c(),p(r,1),r.m(e,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[10]?s?(s.p(a,u),u&1024&&p(s,1)):(s=Z3(a),s.c(),p(s,1),s.m(e,i)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[11]?o?(o.p(a,u),u&2048&&p(o,1)):(o=X3(a),o.c(),p(o,1),o.m(e,null)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&E(e),r&&r.d(),s&&s.d(),o&&o.d()}}}function gX(t,e,n){let i,l;ct(t,ti,V=>n(12,i=V)),ct(t,Ln,V=>n(23,l=V));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a=""}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,{radioOptions:d=[]}=e,{orientation:h="horizontal"}=e,{onSaved:g=()=>{}}=e,_="",k="",y="",T=!1,M=!1,A="";const C=async()=>R(y),D=async()=>{try{const V=await l.api.getSetting(r),K=(V==null?void 0:V.Value)??(V==null?void 0:V.value)??"";n(8,_=String(K)),k=_,y=_}catch{n(11,A=i("Unable to load setting")),console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},R=async V=>{if(M||V===k)return!0;n(10,M=!0),n(11,A="");try{if(await l.api.setSetting(r,V)===!1)throw new Error(i("Unable to save setting"));return k=V,n(8,_=V),Ei.add(Ma({subtitle:i("Setting updated")},i)),await g(V),!0}catch(K){return n(8,_=k),y=k,n(11,A=K instanceof Error&&K.message?K.message:i("Unable to save setting")),Ei.add(Ss({subtitle:A},i)),!1}finally{n(10,M=!1)}},N=V=>{y=V.currentTarget.value},G=async V=>{const K=V.currentTarget.value;y=K,!(K===k||c)&&await R(K)},B=async V=>{const K=String(V.detail??_??"");y=K,!(K===k||c)&&await R(K)};on(async()=>{await D(),n(9,T=!0)}),Ls(()=>{n(8,_=""),k="",y="",n(9,T=!1)});function j(V){_=V,n(8,_)}const q=()=>n(11,A="");return t.$$set=V=>{"keyName"in V&&n(0,r=V.keyName),"labelText"in V&&n(1,s=V.labelText),"title"in V&&n(2,o=V.title),"helperText"in V&&n(3,a=V.helperText),"type"in V&&n(4,u=V.type),"disabled"in V&&n(5,f=V.disabled),"disableOnblur"in V&&n(16,c=V.disableOnblur),"radioOptions"in V&&n(6,d=V.radioOptions),"orientation"in V&&n(7,h=V.orientation),"onSaved"in V&&n(17,g=V.onSaved)},[r,s,o,a,u,f,d,h,_,T,M,A,i,N,G,B,c,g,C,j,q]}class Ql extends Oe{constructor(e){super(),Ee(this,e,gX,mX,Se,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:16,radioOptions:6,orientation:7,onSaved:17,updateDataOnBackend:18})}get updateDataOnBackend(){return this.$$.ctx[18]}}function _X(t){let e;const n=t[8].default,i=He(n,t,t[13],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&8192)&&Fe(i,n,l,l[13],e?Ue(n,l[13],r,null):Ge(l[13]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function pX(t){let e,n,i;function l(s){t[9](s)}let r={danger:t[5],alert:!0,modalHeading:t[1],modalLabel:t[2],primaryButtonText:t[6]?"Working…":t[3],primaryButtonDisabled:t[6],secondaryButtonText:t[4],shouldSubmitOnEnter:!1,preventCloseOnClickOutside:t[6],$$slots:{default:[_X]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.open=t[0]),e=new xT({props:r}),xe.push(()=>At(e,"open",l)),e.$on("click:button--primary",t[10]),e.$on("submit",t[11]),e.$on("click:button--secondary",t[7]),e.$on("close",t[12]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,[o]){const a={};o&32&&(a.danger=s[5]),o&2&&(a.modalHeading=s[1]),o&4&&(a.modalLabel=s[2]),o&72&&(a.primaryButtonText=s[6]?"Working…":s[3]),o&64&&(a.primaryButtonDisabled=s[6]),o&16&&(a.secondaryButtonText=s[4]),o&64&&(a.preventCloseOnClickOutside=s[6]),o&8192&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.open=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function bX(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{title:s="Confirm action"}=e,{label:o="Confirmation"}=e,{confirmText:a="Confirm"}=e,{cancelText:u="Cancel"}=e,{danger:f=!1}=e,{busy:c=!1}=e;const d=()=>{c||n(0,r=!1)};function h(y){r=y,n(0,r)}function g(y){te.call(this,t,y)}function _(y){te.call(this,t,y)}function k(y){te.call(this,t,y)}return t.$$set=y=>{"open"in y&&n(0,r=y.open),"title"in y&&n(1,s=y.title),"label"in y&&n(2,o=y.label),"confirmText"in y&&n(3,a=y.confirmText),"cancelText"in y&&n(4,u=y.cancelText),"danger"in y&&n(5,f=y.danger),"busy"in y&&n(6,c=y.busy),"$$scope"in y&&n(13,l=y.$$scope)},[r,s,o,a,u,f,c,d,i,h,g,_,k,l]}class Zu extends Oe{constructor(e){super(),Ee(this,e,bX,pX,Se,{open:0,title:1,label:2,confirmText:3,cancelText:4,danger:5,busy:6})}}function K3(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("Inspection list unavailable"),subtitle:t[4]}}),e.$on("close",t[22]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Inspection list unavailable")),l[0]&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function J3(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("Inspection list not saved"),subtitle:t[5]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Inspection list not saved")),l[0]&32&&(r.subtitle=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function vX(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[10],rows:t[9],$$slots:{cell:[BX,({row:l,cell:r})=>({36:l,37:r}),({row:l,cell:r})=>[0,(l?32:0)|(r?64:0)]],default:[EX]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","filter-table svelte-7kqp5z")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&1024&&(s.headers=l[10]),r[0]&512&&(s.rows=l[9]),r[0]&2507|r[1]&224&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function kX(t){let e,n;return e=new hi({props:{state:"empty",title:t[11]("No list entries"),message:t[11]("Add an entry when this inspection rule should match content or a host."),$$slots:{default:[HX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("No list entries")),l[0]&2048&&(r.message=i[11]("Add an entry when this inspection rule should match content or a host.")),l[0]&2048|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wX(t){let e,n;return e=new hi({props:{state:"loading",message:t[11]("Loading inspection list…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.message=i[11]("Loading inspection list…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function yX(t){let e=t[11]("Add entry")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add entry")+"")&&Y(n,e)},d(i){i&&E(n)}}}function TX(t){let e,n,i,l,r;function s(a){t[28](a)}let o={value:"",shouldFilterRows:!0,placeholder:t[11]("Search entries")};return t[7]!==void 0&&(o.filteredRowIds=t[7]),e=new ZT({props:o}),xe.push(()=>At(e,"filteredRowIds",s)),l=new bt({props:{size:"small",icon:ho,disabled:t[1]!=null||t[3],$$slots:{default:[yX]},$$scope:{ctx:t}}}),l.$on("click",t[17]),{c(){U(e.$$.fragment),i=F(),U(l.$$.fragment)},m(a,u){z(e,a,u),O(a,i,u),z(l,a,u),r=!0},p(a,u){const f={};u[0]&2048&&(f.placeholder=a[11]("Search entries")),!n&&u[0]&128&&(n=!0,f.filteredRowIds=a[7],Ct(()=>n=!1)),e.$set(f);const c={};u[0]&10&&(c.disabled=a[1]!=null||a[3]),u[0]&2048|u[1]&128&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(p(e.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(e.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(i),H(e,a),H(l,a)}}}function SX(t){let e,n;return e=new hg({props:{$$slots:{default:[TX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2186|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function EX(t){let e,n;return e=new dg({props:{size:"sm",$$slots:{default:[SX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2186|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function OX(t){let e=t[37].value+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&64&&e!==(e=i[37].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function MX(t){let e,n,i,l;const r=[LX,AX],s=[];function o(a,u){return a[37].key==="score"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function CX(t){let e,n,i,l,r;const s=[IX,DX],o=[];function a(u,f){return f[0]&2|f[1]&32&&(e=null),e==null&&(e=u[1]===Number(u[36].id)),e?0:1}return n=a(t,[-1,-1]),i=o[n]=s[n](t),{c(){i.c(),l=je()},m(u,f){o[n].m(u,f),O(u,l,f),r=!0},p(u,f){let c=n;n=a(u,f),n===c?o[n].p(u,f):(ue(),v(o[c],1,1,()=>{o[c]=null}),fe(),i=o[n],i?i.p(u,f):(i=o[n]=s[n](u),i.c()),p(i,1),i.m(l.parentNode,l))},i(u){r||(p(i),r=!0)},o(u){v(i),r=!1},d(u){u&&E(l),o[n].d(u)}}}function AX(t){let e,n;function i(...l){return t[27](t[36],...l)}return e=new ei({props:{labelText:t[11]("Content"),hideLabel:!0,invalid:!String(t[37].value).trim(),invalidText:t[11]("Content is required."),value:t[37].value}}),e.$on("input",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&2048&&(s.labelText=t[11]("Content")),r[1]&64&&(s.invalid=!String(t[37].value).trim()),r[0]&2048&&(s.invalidText=t[11]("Content is required.")),r[1]&64&&(s.value=t[37].value),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function LX(t){let e,n;function i(...l){return t[26](t[36],...l)}return e=new ei({props:{type:"number",labelText:t[11]("Score"),hideLabel:!0,invalid:!Number.isFinite(Number(t[37].value)),invalidText:t[11]("Score must be a number."),value:t[37].value}}),e.$on("input",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&2048&&(s.labelText=t[11]("Score")),r[1]&64&&(s.invalid=!Number.isFinite(Number(t[37].value))),r[0]&2048&&(s.invalidText=t[11]("Score must be a number.")),r[1]&64&&(s.value=t[37].value),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function DX(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[11]("Entry actions"),$$slots:{default:[RX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.iconDescription=i[11]("Entry actions")),l[0]&2113|l[1]&160&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function IX(t){let e,n,i,l,r;return n=new bt({props:{size:"small",disabled:!t[8]||t[3],$$slots:{default:[PX]},$$scope:{ctx:t}}}),n.$on("click",t[15]),l=new bt({props:{kind:"ghost",size:"small",disabled:t[3],$$slots:{default:[NX]},$$scope:{ctx:t}}}),l.$on("click",t[16]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","edit-actions svelte-7kqp5z")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o[0]&264&&(a.disabled=!s[8]||s[3]),o[0]&2056|o[1]&128&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o[0]&8&&(u.disabled=s[3]),o[0]&2048|o[1]&128&&(u.$$scope={dirty:o,ctx:s}),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function RX(t){let e,n,i,l;function r(){return t[24](t[36])}e=new Al({props:{text:t[11]("Edit")}}),e.$on("click",r);function s(){return t[25](t[36])}return i=new Al({props:{danger:!0,text:t[11]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a[0]&2048&&(u.text=t[11]("Edit")),e.$set(u);const f={};a[0]&2048&&(f.text=t[11]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function PX(t){let e=(t[3]?t[11]("Saving…"):t[11]("Save"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2056&&e!==(e=(i[3]?i[11]("Saving…"):i[11]("Save"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function NX(t){let e=t[11]("Cancel")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Cancel")+"")&&Y(n,e)},d(i){i&&E(n)}}}function BX(t){let e,n,i,l,r;const s=[CX,MX,OX],o=[];function a(u,f){return f[0]&2|f[1]&32&&(e=null),u[37].key==="actions"?0:(e==null&&(e=u[1]===Number(u[36].id)),e?1:2)}return n=a(t,[-1,-1]),i=o[n]=s[n](t),{c(){i.c(),l=je()},m(u,f){o[n].m(u,f),O(u,l,f),r=!0},p(u,f){let c=n;n=a(u,f),n===c?o[n].p(u,f):(ue(),v(o[c],1,1,()=>{o[c]=null}),fe(),i=o[n],i?i.p(u,f):(i=o[n]=s[n](u),i.c()),p(i,1),i.m(l.parentNode,l))},i(u){r||(p(i),r=!0)},o(u){v(i),r=!1},d(u){u&&E(l),o[n].d(u)}}}function zX(t){let e=t[11]("Add entry")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add entry")+"")&&Y(n,e)},d(i){i&&E(n)}}}function HX(t){let e,n;return e=new bt({props:{size:"small",icon:ho,$$slots:{default:[zX]},$$scope:{ctx:t}}}),e.$on("click",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&128&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function UX(t){var c;let e,n=t[11]("Remove")+"",i,l,r,s=(((c=t[6])==null?void 0:c.content)??"")+"",o,a,u=t[11]("from this inspection list?")+"",f;return{c(){e=P("p"),i=$(n),l=F(),r=P("strong"),o=$(s),a=F(),f=$(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h[0]&2048&&n!==(n=d[11]("Remove")+"")&&Y(i,n),h[0]&64&&s!==(s=(((g=d[6])==null?void 0:g.content)??"")+"")&&Y(o,s),h[0]&2048&&u!==(u=d[11]("from this inspection list?")+"")&&Y(f,u)},d(d){d&&E(e)}}}function FX(t){let e,n,i,l,r,s,o,a=t[4]&&K3(t),u=t[5]&&J3(t);const f=[wX,kX,vX],c=[];function d(h,g){return h[2]&&h[0].length===0?0:h[0].length===0&&h[1]==null?1:2}return i=d(t),l=c[i]=f[i](t),s=new Zu({props:{open:t[6]!=null,title:t[11]("Delete inspection-list entry?"),label:t[11]("HTTPS inspection"),confirmText:t[11]("Delete entry"),cancelText:t[11]("Cancel"),danger:!0,busy:t[3],$$slots:{default:[UX]},$$scope:{ctx:t}}}),s.$on("submit",t[18]),s.$on("close",t[29]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),l.c(),r=F(),U(s.$$.fragment)},m(h,g){a&&a.m(h,g),O(h,e,g),u&&u.m(h,g),O(h,n,g),c[i].m(h,g),O(h,r,g),z(s,h,g),o=!0},p(h,g){h[4]?a?(a.p(h,g),g[0]&16&&p(a,1)):(a=K3(h),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),h[5]?u?(u.p(h,g),g[0]&32&&p(u,1)):(u=J3(h),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());let _=i;i=d(h),i===_?c[i].p(h,g):(ue(),v(c[_],1,1,()=>{c[_]=null}),fe(),l=c[i],l?l.p(h,g):(l=c[i]=f[i](h),l.c()),p(l,1),l.m(r.parentNode,r));const k={};g[0]&64&&(k.open=h[6]!=null),g[0]&2048&&(k.title=h[11]("Delete inspection-list entry?")),g[0]&2048&&(k.label=h[11]("HTTPS inspection")),g[0]&2048&&(k.confirmText=h[11]("Delete entry")),g[0]&2048&&(k.cancelText=h[11]("Cancel")),g[0]&8&&(k.busy=h[3]),g[0]&2112|g[1]&128&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){o||(p(a),p(u),p(l),p(s.$$.fragment,h),o=!0)},o(h){v(a),v(u),v(l),v(s.$$.fragment,h),o=!1},d(h){h&&(E(e),E(n),E(r)),a&&a.d(h),u&&u.d(h),c[i].d(h),H(s,h)}}}function GX(t,e,n){let i,l,r,s,o,a;ct(t,ti,re=>n(11,o=re)),ct(t,Ln,re=>n(31,a=re));let{filterId:u}=e,{showColumns:f=["content","score","actions"]}=e;const c=[{key:"content",value:o("Content")},{key:"score",value:o("Score")},{key:"actions",value:o("Actions")}];let d=[],h=!0,g=!1,_="",k="",y=null,T=null,M=[],A=1;const C=async()=>{n(2,h=!0),n(4,_="");try{const re=await a.api.doCall(`/filters/${u}`),oe=Array.isArray(re)?re[0]:null,Re=Array.isArray(oe==null?void 0:oe.Entries)?oe.Entries:[];n(0,d=Re.map((qe,Ce)=>({id:Ce+1,content:String(qe.Content??""),score:Number(qe.Score)||0}))),A=d.length+1,n(1,y=null)}catch(re){n(4,_=re instanceof Error&&re.message?re.message:o("This inspection list could not be loaded."))}finally{n(2,h=!1)}},D=()=>{Ei.add({kind:"success",title:o("Inspection list updated"),subtitle:o("The filter was saved successfully."),timeout:3e3})},R=async re=>{if(g)return!1;n(3,g=!0),n(5,k="");try{const oe=re.map(Ce=>({Content:Ce.content,Score:Ce.score})),Re=await a.api.doCall(`/filters/${u}`,"post",oe);if(!String((Re==null?void 0:Re.response)??(Re==null?void 0:Re.Response)??"").includes("Ok"))throw new Error((Re==null?void 0:Re.error)||o("The filter service did not confirm the save."));return D(),await C(),!0}catch(oe){return n(5,k=oe instanceof Error&&oe.message?oe.message:o("This inspection list could not be saved.")),!1}finally{n(3,g=!1)}},N=(re,oe)=>{const Re=String(oe.detail??"");n(0,d=d.map(qe=>qe.id===re?{...qe,content:Re}:qe))},G=(re,oe)=>{const Re=Number(oe.detail);n(0,d=d.map(qe=>qe.id===re?{...qe,score:Re}:qe))},B=re=>{n(1,y=re),n(5,k="")},j=async()=>{!r||!s||await R(d.map(re=>({...re,draft:!1})))},q=()=>{r!=null&&r.draft&&n(0,d=d.filter(re=>re.id!==r.id)),n(1,y=null),n(5,k="")},V=()=>{if(y!=null)return;const re={id:A++,content:"",score:0,draft:!0};n(0,d=[...d,re]),n(1,y=re.id)},K=async()=>{if(!T||g)return;const re=T;await R(d.filter(oe=>oe.id!==re.id))&&n(6,T=null)};on(C);const x=()=>n(4,_=""),ie=()=>n(5,k=""),X=re=>B(Number(re.id)),ce=re=>n(6,T=d.find(oe=>oe.id===Number(re.id))??null),ae=(re,oe)=>G(Number(re.id),oe),ee=(re,oe)=>N(Number(re.id),oe);function he(re){M=re,n(7,M)}const ne=()=>n(6,T=null);return t.$$set=re=>{"filterId"in re&&n(19,u=re.filterId),"showColumns"in re&&n(20,f=re.showColumns)},t.$$.update=()=>{t.$$.dirty[0]&1048576&&n(10,i=c.filter(re=>f.includes(re.key))),t.$$.dirty[0]&1&&n(9,l=d.map(({id:re,content:oe,score:Re})=>({id:re,content:oe,score:Re}))),t.$$.dirty[0]&3&&n(21,r=d.find(re=>re.id===y)??null),t.$$.dirty[0]&3145728&&n(8,s=!!(r!=null&&r.content.trim())&&(!f.includes("score")||Number.isFinite(r==null?void 0:r.score)))},[d,y,h,g,_,k,T,M,s,l,i,o,N,G,B,j,q,V,K,u,f,r,x,ie,X,ce,ae,ee,he,ne]}class VX extends Oe{constructor(e){super(),Ee(this,e,GX,FX,Se,{filterId:19,showColumns:20},null,[-1,-1])}}function Q3(t,e,n){const i=t.slice();return i[10]=e[n],i}function WX(t){let e=t[10].label+"",n,i;return{c(){n=$(e),i=F()},m(l,r){O(l,n,r),O(l,i,r)},p:_e,d(l){l&&(E(n),E(i))}}}function x3(t){let e,n;function i(){return t[6](t[10])}return e=new bt({props:{kind:t[10].path===t[3].path?"primary":"ghost",size:"small",$$slots:{default:[WX]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r&8&&(s.kind=t[10].path===t[3].path?"primary":"ghost"),r&8192&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function jX(t){let e,n;return e=new ln({props:{kind:"info",lowContrast:!0,title:t[4]("Inspection status unavailable"),subtitle:t[2]}}),e.$on("close",t[7]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Inspection status unavailable")),l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $X(t){let e,n;return e=new ln({props:{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:t[4]("HTTPS inspection is off"),subtitle:t[4]("This list applies to plain HTTP traffic only until HTTPS inspection is enabled in Settings and the GateSentry certificate is installed on each device. Use Policies to block whole domains.")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("HTTPS inspection is off")),l&16&&(r.subtitle=i[4]("This list applies to plain HTTP traffic only until HTTPS inspection is enabled in Settings and the GateSentry certificate is installed on each device. Use Policies to block whole domains.")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qX(t){let e,n;return e=new Wi({props:{description:t[4]("Checking HTTPS inspection…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.description=i[4]("Checking HTTPS inspection…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function e4(t){let e,n;return e=new jr({props:{title:t[4]("Filtering strictness"),description:t[4]("Set the total keyword score at which GateSentry blocks an inspected page. For example, two matches scored 1,000 reach a threshold of 2,000."),$$slots:{default:[YX]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Filtering strictness")),l&16&&(r.description=i[4]("Set the total keyword score at which GateSentry blocks an inspected page. For example, two matches scored 1,000 reach a threshold of 2,000.")),l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function YX(t){let e,n,i;return n=new Ql({props:{keyName:"strictness",title:t[4]("Filtering strictness"),labelText:t[4]("Filtering strictness"),type:"number",helperText:t[4]("Lower thresholds block pages after fewer or lower-scored matches.")}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","strictness-control svelte-1aq0r5o")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&16&&(s.title=l[4]("Filtering strictness")),r&16&&(s.labelText=l[4]("Filtering strictness")),r&16&&(s.helperText=l[4]("Lower thresholds block pages after fewer or lower-scored matches.")),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function ZX(t){let e,n;return e=new VX({props:{filterId:t[3].filterId,showColumns:t[3].showColumns??["content","score","actions"]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.filterId=i[3].filterId),l&8&&(r.showColumns=i[3].showColumns??["content","score","actions"]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function XX(t){let e,n,i,l,r,s,o,a,u,f=it(Object.values(t[5])),c=[];for(let y=0;yv(c[y],1,1,()=>{c[y]=null}),h=[qX,$X,jX],g=[];function _(y,T){return y[3].warnsWhenDisabled&&y[1]===null&&!y[2]?0:y[3].warnsWhenDisabled&&y[1]===!1?1:y[2]?2:-1}~(l=_(t))&&(r=g[l]=h[l](t));let k=t[0]==="blockedkeywords"&&e4(t);return a=new jr({props:{title:t[3].sectionTitle,description:t[3].sectionDescription,$$slots:{default:[ZX]},$$scope:{ctx:t}}}),{c(){e=P("nav");for(let y=0;y{g[M]=null}),fe()),~l?(r=g[l],r?r.p(y,T):(r=g[l]=h[l](y),r.c()),p(r,1),r.m(s.parentNode,s)):r=null),y[0]==="blockedkeywords"?k?(k.p(y,T),T&1&&p(k,1)):(k=e4(y),k.c(),p(k,1),k.m(o.parentNode,o)):k&&(ue(),v(k,1,1,()=>{k=null}),fe());const A={};T&8&&(A.title=y[3].sectionTitle),T&8&&(A.description=y[3].sectionDescription),T&8200&&(A.$$scope={dirty:T,ctx:y}),a.$set(A)},i(y){if(!u){for(let T=0;Tn(4,l=h)),ct(t,Ln,h=>n(8,r=h));let{type:s}=e;const o={blockedkeywords:{path:"/blockedkeywords",label:l("Blocked keywords"),title:l("Blocked keywords"),description:l("Score words found in inspected HTTP and HTTPS response content."),sectionTitle:l("Keyword scores"),sectionDescription:l("GateSentry totals matching scores and blocks the response when the filtering strictness threshold is reached."),filterId:"bVxTPTOXiqGRbhF",warnsWhenDisabled:!0},blockedfiletypes:{path:"/blockedfiletypes",label:l("Blocked content types"),title:l("Blocked content types"),description:l("Block inspected proxy responses by their MIME content type."),sectionTitle:l("Content types"),sectionDescription:l("Entries apply to every device using the proxy. Use a policy rule when a content type should apply only to selected devices."),filterId:"JHGJiwjkGOeglsk",showColumns:["content","actions"],warnsWhenDisabled:!0},excludehosts:{path:"/excludehosts",label:l("Sites not inspected"),title:l("Sites not inspected"),description:l("Pass selected HTTPS hosts through without decrypting their traffic."),sectionTitle:l("Host exclusions"),sectionDescription:l("Add apps or sites that fail under inspection, such as certificate-pinning services. Policies can still block these hosts by domain."),filterId:"CeBqssmRbqXzbHR",showColumns:["content","actions"],warnsWhenDisabled:!1},excludeurls:{path:"/excludeurls",label:l("URLs not inspected"),title:l("URLs not inspected"),description:l("Exclude selected request URLs from content filtering after the connection is inspected."),sectionTitle:l("URL exclusions"),sectionDescription:l("Use narrowly scoped URLs for content that should bypass response filtering. Use Sites not inspected when the TLS connection itself must not be decrypted."),filterId:"JHGJiwjkGOeglsd",showColumns:["content","actions"],warnsWhenDisabled:!0}};let a=null,u="";on(async()=>{n(2,u="");try{const h=await r.api.doCall("/settings/enable_https_filtering");n(1,a=(h==null?void 0:h.Value)==="true")}catch(h){n(1,a=null),n(2,u=h instanceof Error&&h.message?h.message:l("HTTPS inspection status could not be checked."))}});const c=h=>Vi(h.path),d=()=>n(2,u="");return t.$$set=h=>{"type"in h&&n(0,s=h.type)},t.$$.update=()=>{t.$$.dirty&1&&n(3,i=o[s]??o.blockedkeywords)},[s,a,u,i,l,o,c,d]}class Bd extends Oe{constructor(e){super(),Ee(this,e,nK,tK,Se,{type:0})}}function iK(t){let e;return{c(){e=$(t[0])},m(n,i){O(n,e,i)},p(n,i){i&1&&Y(e,n[0])},d(n){n&&E(e)}}}function lK(t){let e,n,i,l,r;return n=new xz({props:{for:t[2],$$slots:{default:[iK]},$$scope:{ctx:t}}}),l=new l5({props:{id:t[2],value:t[1]}}),l.$on("blur",t[3]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","certificate-field svelte-1nft9cf")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,[o]){const a={};o&4&&(a.for=s[2]),o&257&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o&4&&(u.id=s[2]),o&2&&(u.value=s[1]),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function rK(t,e,n){let i,l,r;ct(t,ti,c=>n(5,l=c)),ct(t,Ln,c=>n(6,r=c));let s="",{settingName:o}=e,{label:a}=e;const u=async()=>{if(o===void 0)return;const c=await r.api.getSetting(o);n(1,s=c.Value)};let f=async c=>{const d=c.target.value;await r.api.setSetting(o,d)===!1?Ei.add(Ss({subtitle:l("Unable to save certificate data")},l)):Ei.add(Ma({subtitle:l("Certificate data saved")},l)),u()};return t.$$set=c=>{"settingName"in c&&n(4,o=c.settingName),"label"in c&&n(0,a=c.label)},t.$$.update=()=>{t.$$.dirty&16&&n(2,i=`certificate-${o}`)},u(),[a,s,i,f,o]}class t4 extends Oe{constructor(e){super(),Ee(this,e,rK,lK,Se,{settingName:4,label:0})}}function sK(t){let e=(t[3]?t[4]("Hide advanced settings"):t[4]("Edit certificate"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&24&&e!==(e=(i[3]?i[4]("Hide advanced settings"):i[4]("Edit certificate"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function oK(t){let e,n,i,l=t[4]("Issuer name")+"",r,s,o,a=(t[0].name||t[4]("Unknown"))+"",u,f,c,d,h=t[4]("Expiry")+"",g,_,k,y=(t[0].expiry||t[4]("Unknown"))+"",T;return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=$(l),s=F(),o=P("dd"),u=$(a),f=F(),c=P("div"),d=P("dt"),g=$(h),_=F(),k=P("dd"),T=$(y),I(i,"class","svelte-1877to5"),I(o,"class","svelte-1877to5"),I(n,"class","svelte-1877to5"),I(d,"class","svelte-1877to5"),I(k,"class","svelte-1877to5"),I(c,"class","svelte-1877to5"),I(e,"class","certificate-summary svelte-1877to5")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(n,f),w(e,c),w(c,d),w(d,g),w(c,_),w(c,k),w(k,T)},p(M,A){A&16&&l!==(l=M[4]("Issuer name")+"")&&Y(r,l),A&17&&a!==(a=(M[0].name||M[4]("Unknown"))+"")&&Y(u,a),A&16&&h!==(h=M[4]("Expiry")+"")&&Y(g,h),A&17&&y!==(y=(M[0].expiry||M[4]("Unknown"))+"")&&Y(T,y)},i:_e,o:_e,d(M){M&&E(e)}}}function aK(t){let e,n;return e=new ln({props:{lowContrast:!0,hideCloseButton:!0,kind:"error",title:t[4]("Certificate unavailable"),subtitle:t[2]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("Certificate unavailable")),l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function uK(t){let e,n;return e=new Wi({props:{description:t[4]("Loading certificate details…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.description=i[4]("Loading certificate details…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function n4(t){let e,n,i,l,r,s=t[4]("Certificate (PEM)")+"",o,a,u,f=t[4]("Public certificate installed on protected devices. It may be downloaded and shared with those devices.")+"",c,d,h,g,_,k,y=t[4]("Private key (PEM)")+"",T,M,A,C=t[4]("Sensitive signing key stored by GateSentry. Never install or share this value with client devices.")+"",D,R,N,G;return e=new ln({props:{lowContrast:!0,hideCloseButton:!0,kind:"warning",title:t[4]("Advanced certificate settings"),subtitle:t[4]("Replacing certificate material can interrupt HTTPS inspection. Keep the private key secret and update the certificate and key as a matched pair.")}}),h=new t4({props:{settingName:"capem",label:t[4]("HTTPS filtering certificate")}}),N=new t4({props:{settingName:"keypem",label:t[4]("HTTPS filtering private key")}}),{c(){U(e.$$.fragment),n=F(),i=P("div"),l=P("section"),r=P("h4"),o=$(s),a=F(),u=P("p"),c=$(f),d=F(),U(h.$$.fragment),g=F(),_=P("section"),k=P("h4"),T=$(y),M=F(),A=P("p"),D=$(C),R=F(),U(N.$$.fragment),I(r,"id","certificate-pem-heading"),I(r,"class","svelte-1877to5"),I(u,"class","svelte-1877to5"),I(l,"aria-labelledby","certificate-pem-heading"),I(l,"class","svelte-1877to5"),I(k,"id","private-key-heading"),I(k,"class","svelte-1877to5"),I(A,"class","svelte-1877to5"),I(_,"class","private-key svelte-1877to5"),I(_,"aria-labelledby","private-key-heading"),I(i,"class","advanced-grid svelte-1877to5")},m(B,j){z(e,B,j),O(B,n,j),O(B,i,j),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(l,d),z(h,l,null),w(i,g),w(i,_),w(_,k),w(k,T),w(_,M),w(_,A),w(A,D),w(_,R),z(N,_,null),G=!0},p(B,j){const q={};j&16&&(q.title=B[4]("Advanced certificate settings")),j&16&&(q.subtitle=B[4]("Replacing certificate material can interrupt HTTPS inspection. Keep the private key secret and update the certificate and key as a matched pair.")),e.$set(q),(!G||j&16)&&s!==(s=B[4]("Certificate (PEM)")+"")&&Y(o,s),(!G||j&16)&&f!==(f=B[4]("Public certificate installed on protected devices. It may be downloaded and shared with those devices.")+"")&&Y(c,f);const V={};j&16&&(V.label=B[4]("HTTPS filtering certificate")),h.$set(V),(!G||j&16)&&y!==(y=B[4]("Private key (PEM)")+"")&&Y(T,y),(!G||j&16)&&C!==(C=B[4]("Sensitive signing key stored by GateSentry. Never install or share this value with client devices.")+"")&&Y(D,C);const K={};j&16&&(K.label=B[4]("HTTPS filtering private key")),N.$set(K)},i(B){G||(p(e.$$.fragment,B),p(h.$$.fragment,B),p(N.$$.fragment,B),G=!0)},o(B){v(e.$$.fragment,B),v(h.$$.fragment,B),v(N.$$.fragment,B),G=!1},d(B){B&&(E(n),E(i)),H(e,B),H(h),H(N)}}}function fK(t){let e,n,i,l=t[4]("Inspection certificate")+"",r,s,o,a=t[4]("Install this certificate only on devices that you intend GateSentry to inspect.")+"",u,f,c,d,h,g,_,k,y,T,M,A;c=new bt({props:{size:"small",kind:t[3]?"secondary":"tertiary",$$slots:{default:[sK]},$$scope:{ctx:t}}}),c.$on("click",t[5]);const C=[uK,aK,oK],D=[];function R(G,B){return G[1]?0:G[2]?1:G[0]?2:-1}~(h=R(t))&&(g=D[h]=C[h](t)),y=new z5({});let N=t[3]&&n4(t);return{c(){e=P("div"),n=P("div"),i=P("h3"),r=$(l),s=F(),o=P("p"),u=$(a),f=F(),U(c.$$.fragment),d=F(),g&&g.c(),_=F(),k=P("div"),U(y.$$.fragment),T=F(),N&&N.c(),M=je(),I(i,"class","svelte-1877to5"),I(o,"class","svelte-1877to5"),I(e,"class","certificate-heading svelte-1877to5"),I(k,"class","certificate-download svelte-1877to5")},m(G,B){O(G,e,B),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(e,f),z(c,e,null),O(G,d,B),~h&&D[h].m(G,B),O(G,_,B),O(G,k,B),z(y,k,null),O(G,T,B),N&&N.m(G,B),O(G,M,B),A=!0},p(G,[B]){(!A||B&16)&&l!==(l=G[4]("Inspection certificate")+"")&&Y(r,l),(!A||B&16)&&a!==(a=G[4]("Install this certificate only on devices that you intend GateSentry to inspect.")+"")&&Y(u,a);const j={};B&8&&(j.kind=G[3]?"secondary":"tertiary"),B&152&&(j.$$scope={dirty:B,ctx:G}),c.$set(j);let q=h;h=R(G),h===q?~h&&D[h].p(G,B):(g&&(ue(),v(D[q],1,1,()=>{D[q]=null}),fe()),~h?(g=D[h],g?g.p(G,B):(g=D[h]=C[h](G),g.c()),p(g,1),g.m(_.parentNode,_)):g=null),G[3]?N?(N.p(G,B),B&8&&p(N,1)):(N=n4(G),N.c(),p(N,1),N.m(M.parentNode,M)):N&&(ue(),v(N,1,1,()=>{N=null}),fe())},i(G){A||(p(c.$$.fragment,G),p(g),p(y.$$.fragment,G),p(N),A=!0)},o(G){v(c.$$.fragment,G),v(g),v(y.$$.fragment,G),v(N),A=!1},d(G){G&&(E(e),E(d),E(_),E(k),E(T),E(M)),H(c),~h&&D[h].d(G),H(y),N&&N.d(G)}}}function cK(t,e,n){let i,l;ct(t,Ln,f=>n(6,i=f)),ct(t,ti,f=>n(4,l=f));let r=null,s=!0,o="",a=!1;return on(async()=>{try{n(0,r=await i.api.doCall("/certificate/info"))}catch(f){n(2,o=f instanceof Error?f.message:"Certificate details failed")}finally{n(1,s=!1)}}),[r,s,o,a,l,()=>n(3,a=!a)]}class dK extends Oe{constructor(e){super(),Ee(this,e,cK,fK,Se,{})}}function hK(t){let e,n,i,l=t[0]("Privacy Notice for Enabling MITM Filtering")+"",r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G;return{c(){e=P("div"),n=P("div"),i=P("h3"),r=$(l),s=F(),o=P("h4"),o.textContent="Attention System Administrators:",a=F(),u=P("p"),u.textContent=`Before enabling the Man-In-The-Middle (MITM) filtering on this proxy server, it is crucial to understand the significant privacy implications this feature holds. Proceed with utmost caution and awareness of the responsibilities involved.`,f=F(),c=P("h4"),c.textContent="Privacy Implications:",d=F(),h=P("ol"),h.innerHTML=`
  • Inspection of Encrypted Traffic:

    Enabling MITM filtering allows the inspection and potential @@ -81,8 +81,8 @@ function print() { __p += __j.call(arguments, '') } considerations involved and affirm your commitment to upholding the highest standards of privacy and data protection in the use of this feature.`,N=F(),G=P("p"),G.innerHTML=`Note: Adjust the notice to align with your organization's policies and - ensure it adheres to the relevant legal standards in your jurisdiction.`,I(i,"class","notice-title"),I(o,"class","section"),I(c,"class","section"),I(_,"class","section"),I(M,"class","section"),I(n,"class","mitm-privacy-notice")},m(B,$){O(B,e,$),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(n,a),w(n,u),w(n,f),w(n,c),w(n,d),w(n,h),w(n,g),w(n,_),w(n,k),w(n,y),w(n,T),w(n,M),w(n,A),w(n,C),w(n,D),w(n,R),w(n,N),w(n,G)},p(B,[$]){$&1&&l!==(l=B[0]("Privacy Notice for Enabling MITM Filtering")+"")&&Y(r,l)},i:_e,o:_e,d(B){B&&E(e)}}}function mK(t,e,n){let i;return ct(t,ti,l=>n(0,i=l)),[i]}class gK extends Oe{constructor(e){super(),Ee(this,e,mK,hK,Se,{})}}function i4(t){let e,n,i,l;const r=[pK,_K],s=[];function o(a,u){return a[0]==""?0:1}return n=o(t),i=s[n]=r[n](t),{c(){e=P("span"),i.c()},m(a,u){O(a,e,u),s[n].m(e,null),l=!0},p(a,u){let f=n;n=o(a),n===f?s[n].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),p(i,1),i.m(e,null))},i(a){l||(p(i),l=!0)},o(a){v(i),l=!1},d(a){a&&E(e),s[n].d()}}}function _K(t){let e,n;return e=new Ad({props:{labelText:t[1],labelA:t[2],labelB:t[3],toggled:t[0]=="true"}}),e.$on("change",t[5]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.labelText=i[1]),l&4&&(r.labelA=i[2]),l&8&&(r.labelB=i[3]),l&1&&(r.toggled=i[0]=="true"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function pK(t){let e,n;return e=new KT({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bK(t){let e,n,i=!t[4]&&i4(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[4]?i&&(ue(),v(i,1,1,()=>{i=null}),fe()):i?(i.p(l,r),r&16&&p(i,1)):(i=i4(l),i.c(),p(i,1),i.m(e.parentNode,e))},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function vK(t,e,n){let i,l;ct(t,ti,_=>n(9,i=_)),ct(t,Ln,_=>n(10,l=_));let{settingName:r="enable_https_filtering"}=e,{label:s="Label"}=e,{labelA:o="On"}=e,{labelB:a="Off"}=e,{settingValue:u=""}=e,{preClickEvent:f=null}=e,{hide:c=!1}=e,{noNotification:d=!1}=e;const h=()=>{l.api.doCall("/settings/"+r).then(_=>{n(0,u=_.Value)})},g=async()=>{f&&await f();const _="/settings/"+r;var k={key:r,value:u=="true"?"false":"true"};l.api.doCall(_,"post",k).then(function(y){h(),!d&&Ei.add(Ma({title:i("Success"),subtitle:i("Setting updated")},i))})};return sn(()=>{h()}),t.$$set=_=>{"settingName"in _&&n(6,r=_.settingName),"label"in _&&n(1,s=_.label),"labelA"in _&&n(2,o=_.labelA),"labelB"in _&&n(3,a=_.labelB),"settingValue"in _&&n(0,u=_.settingValue),"preClickEvent"in _&&n(7,f=_.preClickEvent),"hide"in _&&n(4,c=_.hide),"noNotification"in _&&n(8,d=_.noNotification)},[u,s,o,a,c,g,r,f,d]}class F5 extends Oe{constructor(e){super(),Ee(this,e,vK,bK,Se,{settingName:6,label:1,labelA:2,labelB:3,settingValue:0,preClickEvent:7,hide:4,noNotification:8})}}function kK(t){let e,n;return e=new gK({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wK(t){let e,n,i,l,r,s;return e=new Od({props:{label:t[2]("HTTPS inspection"),title:t[2]("Privacy notice")}}),i=new Md({props:{hasForm:!0,$$slots:{default:[kK]},$$scope:{ctx:t}}}),r=new Cd({props:{secondaryButtonText:t[2]("Close"),secondaryClass:"bx--btn--primary"}}),r.$on("click:button--secondary",t[5]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&4&&(u.label=o[2]("HTTPS inspection")),a&4&&(u.title=o[2]("Privacy notice")),e.$set(u);const f={};a&128&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&4&&(c.secondaryButtonText=o[2]("Close")),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function yK(t){let e,n,i,l,r,s=t[2]("Only enable inspection after reviewing the privacy notice and installing the GateSentry certificate on protected devices.")+"",o,a,u,f;function c(h){t[4](h)}let d={settingName:"enable_https_filtering",label:t[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)"),labelA:t[2]("Disabled"),labelB:t[2]("Enabled"),noNotification:!0,preClickEvent:t[3]};return t[1]!==void 0&&(d.settingValue=t[1]),n=new F5({props:d}),xe.push(()=>At(n,"settingValue",c)),u=new Ed({props:{open:t[0],$$slots:{default:[wK]},$$scope:{ctx:t}}}),u.$on("close",t[6]),{c(){e=P("div"),U(n.$$.fragment),l=F(),r=P("p"),o=j(s),a=F(),U(u.$$.fragment),I(r,"class","helper svelte-hopfxz"),I(e,"class","https-setting svelte-hopfxz")},m(h,g){O(h,e,g),z(n,e,null),w(e,l),w(e,r),w(r,o),w(e,a),z(u,e,null),f=!0},p(h,[g]){const _={};g&4&&(_.label=h[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)")),g&4&&(_.labelA=h[2]("Disabled")),g&4&&(_.labelB=h[2]("Enabled")),!i&&g&2&&(i=!0,_.settingValue=h[1],Ct(()=>i=!1)),n.$set(_),(!f||g&4)&&s!==(s=h[2]("Only enable inspection after reviewing the privacy notice and installing the GateSentry certificate on protected devices.")+"")&&Y(o,s);const k={};g&1&&(k.open=h[0]),g&133&&(k.$$scope={dirty:g,ctx:h}),u.$set(k)},i(h){f||(p(n.$$.fragment,h),p(u.$$.fragment,h),f=!0)},o(h){v(n.$$.fragment,h),v(u.$$.fragment,h),f=!1},d(h){h&&E(e),H(n),H(u)}}}function TK(t,e,n){let i;ct(t,ti,f=>n(2,i=f));let l=!1,r="";function s(){r==="false"&&n(0,l=!0)}function o(f){r=f,n(1,r)}return[l,r,i,s,o,()=>{n(0,l=!1)},()=>n(0,l=!1)]}class SK extends Oe{constructor(e){super(),Ee(this,e,TK,yK,Se,{})}}function l4(t,e,n){const i=t.slice();return i[21]=e[n],i}function EK(t){let e,n,i,l,r,s,o,a;return e=new ql({props:{label:t[11]("General")}}),i=new ql({props:{label:t[11]("HTTPS inspection")}}),r=new ql({props:{label:t[11]("Connectivity")}}),o=new ql({props:{label:t[11]("Diagnostics")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f&2048&&(c.label=u[11]("General")),e.$set(c);const d={};f&2048&&(d.label=u[11]("HTTPS inspection")),i.$set(d);const h={};f&2048&&(h.label=u[11]("Connectivity")),r.$set(h);const g={};f&2048&&(g.label=u[11]("Diagnostics")),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function OK(t){let e,n,i,l,r=t[11]("Gateway")+"",s,o,a,u=t[11]("Choose where GateSentry stores its local decision log and review the signed-in administrator.")+"",f,c,d,h,g,_=t[11]("Decision log storage")+"",k,y,T,M=t[11]("GateSentry writes filtering decisions to this SQLite database path.")+"",A,C,D,R,N,G,B,$,q,V,K=t[11]("Administrator")+"",x,ie,X,ce=t[11]("This identity comes from the authenticated session and cannot be edited here.")+"",ae,ee,he,ne,re;return R=new B5({props:{keyName:"log_location",title:t[11]("Log location"),labelText:t[11]("Log location"),type:"text",helperText:t[11]("Restart GateSentry after changing this path.")}}),G=new nn({props:{lowContrast:!0,hideCloseButton:!0,kind:"info",title:t[11]("Raspberry Pi storage guidance"),subtitle:t[11]('To reduce SD card writes, set the log location to "/tmp/log.db". This keeps the log in RAM, so history is cleared whenever the device restarts.')}}),ne=new ei({props:{value:t[10].api.username,type:"text",title:t[11]("Admin username"),labelText:t[11]("Admin username"),helperText:t[11]("Change the password from the account menu."),disabled:!0}}),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),d=P("div"),h=P("div"),g=P("h4"),k=j(_),y=F(),T=P("p"),A=j(M),C=F(),D=P("div"),U(R.$$.fragment),N=F(),U(G.$$.fragment),B=F(),$=P("div"),q=P("div"),V=P("h4"),x=j(K),ie=F(),X=P("p"),ae=j(ce),ee=F(),he=P("div"),U(ne.$$.fragment),I(l,"id","gateway-heading"),I(l,"class","svelte-18z99h8"),I(a,"class","svelte-18z99h8"),I(i,"class","section-heading svelte-18z99h8"),I(g,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(h,"class","setting-copy svelte-18z99h8"),I(D,"class","setting-control svelte-18z99h8"),I(d,"class","setting-row svelte-18z99h8"),I(V,"class","svelte-18z99h8"),I(X,"class","svelte-18z99h8"),I(q,"class","setting-copy svelte-18z99h8"),I(he,"class","setting-control svelte-18z99h8"),I($,"class","setting-row svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","gateway-heading"),I(e,"class","tab-panel svelte-18z99h8")},m(oe,Re){O(oe,e,Re),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),w(n,d),w(d,h),w(h,g),w(g,k),w(h,y),w(h,T),w(T,A),w(d,C),w(d,D),z(R,D,null),w(n,N),z(G,n,null),w(n,B),w(n,$),w($,q),w(q,V),w(V,x),w(q,ie),w(q,X),w(X,ae),w($,ee),w($,he),z(ne,he,null),re=!0},p(oe,Re){(!re||Re&2048)&&r!==(r=oe[11]("Gateway")+"")&&Y(s,r),(!re||Re&2048)&&u!==(u=oe[11]("Choose where GateSentry stores its local decision log and review the signed-in administrator.")+"")&&Y(f,u),(!re||Re&2048)&&_!==(_=oe[11]("Decision log storage")+"")&&Y(k,_),(!re||Re&2048)&&M!==(M=oe[11]("GateSentry writes filtering decisions to this SQLite database path.")+"")&&Y(A,M);const qe={};Re&2048&&(qe.title=oe[11]("Log location")),Re&2048&&(qe.labelText=oe[11]("Log location")),Re&2048&&(qe.helperText=oe[11]("Restart GateSentry after changing this path.")),R.$set(qe);const Ce={};Re&2048&&(Ce.title=oe[11]("Raspberry Pi storage guidance")),Re&2048&&(Ce.subtitle=oe[11]('To reduce SD card writes, set the log location to "/tmp/log.db". This keeps the log in RAM, so history is cleared whenever the device restarts.')),G.$set(Ce),(!re||Re&2048)&&K!==(K=oe[11]("Administrator")+"")&&Y(x,K),(!re||Re&2048)&&ce!==(ce=oe[11]("This identity comes from the authenticated session and cannot be edited here.")+"")&&Y(ae,ce);const Ze={};Re&1024&&(Ze.value=oe[10].api.username),Re&2048&&(Ze.title=oe[11]("Admin username")),Re&2048&&(Ze.labelText=oe[11]("Admin username")),Re&2048&&(Ze.helperText=oe[11]("Change the password from the account menu.")),ne.$set(Ze)},i(oe){re||(p(R.$$.fragment,oe),p(G.$$.fragment,oe),p(ne.$$.fragment,oe),re=!0)},o(oe){v(R.$$.fragment,oe),v(G.$$.fragment,oe),v(ne.$$.fragment,oe),re=!1},d(oe){oe&&E(e),H(R),H(G),H(ne)}}}function MK(t){let e,n,i,l,r=t[11]("HTTPS inspection")+"",s,o,a,u=t[11]("Advanced, opt-in inspection for encrypted web traffic. Devices must trust the GateSentry certificate.")+"",f,c,d,h,g,_=t[11]("Inspection status")+"",k,y,T,M=t[11]("Changing this setting affects proxy traffic; DNS filtering remains separate.")+"",A,C,D,R,N,G,B,$;return R=new SK({}),B=new dK({}),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),d=P("div"),h=P("div"),g=P("h4"),k=j(_),y=F(),T=P("p"),A=j(M),C=F(),D=P("div"),U(R.$$.fragment),N=F(),G=P("section"),U(B.$$.fragment),I(l,"id","https-heading"),I(l,"class","svelte-18z99h8"),I(a,"class","svelte-18z99h8"),I(i,"class","section-heading svelte-18z99h8"),I(g,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(h,"class","setting-copy svelte-18z99h8"),I(D,"class","setting-control svelte-18z99h8"),I(d,"class","setting-row svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","https-heading"),I(G,"class","settings-card certificate-card svelte-18z99h8"),I(e,"class","tab-panel svelte-18z99h8")},m(q,V){O(q,e,V),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),w(n,d),w(d,h),w(h,g),w(g,k),w(h,y),w(h,T),w(T,A),w(d,C),w(d,D),z(R,D,null),w(e,N),w(e,G),z(B,G,null),$=!0},p(q,V){(!$||V&2048)&&r!==(r=q[11]("HTTPS inspection")+"")&&Y(s,r),(!$||V&2048)&&u!==(u=q[11]("Advanced, opt-in inspection for encrypted web traffic. Devices must trust the GateSentry certificate.")+"")&&Y(f,u),(!$||V&2048)&&_!==(_=q[11]("Inspection status")+"")&&Y(k,_),(!$||V&2048)&&M!==(M=q[11]("Changing this setting affects proxy traffic; DNS filtering remains separate.")+"")&&Y(A,M)},i(q){$||(p(R.$$.fragment,q),p(B.$$.fragment,q),$=!0)},o(q){v(R.$$.fragment,q),v(B.$$.fragment,q),$=!1},d(q){q&&E(e),H(R),H(B)}}}function r4(t){let e,n;return e=new Rt({props:{type:t[5].enabled?"green":"gray",size:"sm",$$slots:{default:[CK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.type=i[5].enabled?"green":"gray"),l&16779296&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function CK(t){let e=(t[5].enabled?t[11]("Enabled"):t[11]("Disabled"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].enabled?i[11]("Enabled"):i[11]("Disabled"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function s4(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("Tailscale error"),subtitle:t[8]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Tailscale error")),l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function o4(t){let e,n;return e=new nn({props:{kind:"success",title:t[11]("Tailscale updated"),subtitle:t[9]}}),e.$on("close",t[18]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Tailscale updated")),l&512&&(r.subtitle=i[9]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function AK(t){let e,n,i,l=t[11]("Client detected")+"",r,s,o,a,u,f,c,d=t[11]("State")+"",h,g,_,k,y,T,M,A=t[11]("Backend state")+"",C,D,R,N=(t[5].backend_state||t[11]("Unknown"))+"",G,B,$,q,V=t[11]("This node")+"",K,x,ie,X=(t[5].self_name||"—")+"",ce,ae,ee,he,ne=t[11]("Last refreshed")+"",re,oe,Re,qe=g4(t[5].last_refresh)+"",Ce,Ze,be,Ae;a=new Rt({props:{type:t[5].detected?"green":"warm-gray",size:"sm",$$slots:{default:[DK]},$$scope:{ctx:t}}}),k=new Rt({props:{type:ua(t[5].state),size:"sm",$$slots:{default:[IK]},$$scope:{ctx:t}}});let ve=t[5].message&&a4(t);return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=j(l),s=F(),o=P("dd"),U(a.$$.fragment),u=F(),f=P("div"),c=P("dt"),h=j(d),g=F(),_=P("dd"),U(k.$$.fragment),y=F(),T=P("div"),M=P("dt"),C=j(A),D=F(),R=P("dd"),G=j(N),B=F(),$=P("div"),q=P("dt"),K=j(V),x=F(),ie=P("dd"),ce=j(X),ae=F(),ee=P("div"),he=P("dt"),re=j(ne),oe=F(),Re=P("dd"),Ce=j(qe),Ze=F(),ve&&ve.c(),be=je(),I(i,"class","svelte-18z99h8"),I(o,"class","svelte-18z99h8"),I(n,"class","svelte-18z99h8"),I(c,"class","svelte-18z99h8"),I(_,"class","svelte-18z99h8"),I(f,"class","svelte-18z99h8"),I(M,"class","svelte-18z99h8"),I(R,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(q,"class","svelte-18z99h8"),I(ie,"class","svelte-18z99h8"),I($,"class","svelte-18z99h8"),I(he,"class","svelte-18z99h8"),I(Re,"class","svelte-18z99h8"),I(ee,"class","svelte-18z99h8"),I(e,"class","status-grid svelte-18z99h8")},m(me,lt){O(me,e,lt),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),z(a,o,null),w(n,u),w(e,f),w(f,c),w(c,h),w(f,g),w(f,_),z(k,_,null),w(f,y),w(e,T),w(T,M),w(M,C),w(T,D),w(T,R),w(R,G),w(T,B),w(e,$),w($,q),w(q,K),w($,x),w($,ie),w(ie,ce),w($,ae),w(e,ee),w(ee,he),w(he,re),w(ee,oe),w(ee,Re),w(Re,Ce),O(me,Ze,lt),ve&&ve.m(me,lt),O(me,be,lt),Ae=!0},p(me,lt){(!Ae||lt&2048)&&l!==(l=me[11]("Client detected")+"")&&Y(r,l);const De={};lt&32&&(De.type=me[5].detected?"green":"warm-gray"),lt&16779296&&(De.$$scope={dirty:lt,ctx:me}),a.$set(De),(!Ae||lt&2048)&&d!==(d=me[11]("State")+"")&&Y(h,d);const vt={};lt&32&&(vt.type=ua(me[5].state)),lt&16779296&&(vt.$$scope={dirty:lt,ctx:me}),k.$set(vt),(!Ae||lt&2048)&&A!==(A=me[11]("Backend state")+"")&&Y(C,A),(!Ae||lt&2080)&&N!==(N=(me[5].backend_state||me[11]("Unknown"))+"")&&Y(G,N),(!Ae||lt&2048)&&V!==(V=me[11]("This node")+"")&&Y(K,V),(!Ae||lt&32)&&X!==(X=(me[5].self_name||"—")+"")&&Y(ce,X),(!Ae||lt&2048)&&ne!==(ne=me[11]("Last refreshed")+"")&&Y(re,ne),(!Ae||lt&32)&&qe!==(qe=g4(me[5].last_refresh)+"")&&Y(Ce,qe),me[5].message?ve?(ve.p(me,lt),lt&32&&p(ve,1)):(ve=a4(me),ve.c(),p(ve,1),ve.m(be.parentNode,be)):ve&&(ue(),v(ve,1,1,()=>{ve=null}),fe())},i(me){Ae||(p(a.$$.fragment,me),p(k.$$.fragment,me),p(ve),Ae=!0)},o(me){v(a.$$.fragment,me),v(k.$$.fragment,me),v(ve),Ae=!1},d(me){me&&(E(e),E(Ze),E(be)),H(a),H(k),ve&&ve.d(me)}}}function LK(t){let e,n;return e=new Wi({props:{description:t[11]("Checking Tailscale…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.description=i[11]("Checking Tailscale…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function DK(t){let e=(t[5].detected?t[11]("Detected"):t[11]("Not detected"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].detected?i[11]("Detected"):i[11]("Not detected"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function IK(t){let e=(t[5].state||t[11]("Unknown"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].state||i[11]("Unknown"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function a4(t){let e,n;return e=new nn({props:{lowContrast:!0,hideCloseButton:!0,kind:h4(t[5].state),title:m4(t[5].state),subtitle:t[5].message}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.kind=h4(i[5].state)),l&32&&(r.title=m4(i[5].state)),l&32&&(r.subtitle=i[5].message),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function RK(t){var i;let e=(t[7]?t[11]("Saving…"):(i=t[5])!=null&&i.enabled?t[11]("Disable Tailscale"):t[11]("Enable Tailscale"))+"",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r&2208&&e!==(e=(l[7]?l[11]("Saving…"):(s=l[5])!=null&&s.enabled?l[11]("Disable Tailscale"):l[11]("Enable Tailscale"))+"")&&Y(n,e)},d(l){l&&E(n)}}}function PK(t){let e=(t[6]?t[11]("Refreshing…"):t[11]("Refresh status"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2112&&e!==(e=(i[6]?i[11]("Refreshing…"):i[11]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function NK(t){let e,n,i,l,r,s=t[11]("Tailscale")+"",o,a,u,f=t[11]("Discover Tailscale peers and explicitly link them to devices in the device inventory.")+"",c,d,h,g,_,k,y,T,M,A,C=t[11]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"",D,R,N,G=t[11]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"",B,$,q,V,K,x,ie,X=t[5]&&r4(t),ce=t[8]&&s4(t),ae=t[9]&&o4(t);const ee=[LK,AK],he=[];function ne(re,oe){return re[6]&&!re[5]?0:re[5]?1:-1}return~(k=ne(t))&&(y=he[k]=ee[k](t)),V=new bt({props:{size:"small",disabled:t[6]||t[7]||!t[5],$$slots:{default:[RK]},$$scope:{ctx:t}}}),V.$on("click",t[19]),x=new bt({props:{size:"small",kind:"tertiary",disabled:t[6]||t[7],$$slots:{default:[PK]},$$scope:{ctx:t}}}),x.$on("click",t[15]),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("div"),r=P("h3"),o=j(s),a=F(),u=P("p"),c=j(f),d=F(),X&&X.c(),h=F(),ce&&ce.c(),g=F(),ae&&ae.c(),_=F(),y&&y.c(),T=F(),M=P("div"),A=P("p"),D=j(C),R=F(),N=P("p"),B=j(G),$=F(),q=P("div"),U(V.$$.fragment),K=F(),U(x.$$.fragment),I(r,"id","tailscale-heading"),I(r,"class","svelte-18z99h8"),I(u,"class","svelte-18z99h8"),I(l,"class","section-heading svelte-18z99h8"),I(i,"class","card-heading svelte-18z99h8"),I(A,"class","svelte-18z99h8"),I(N,"class","svelte-18z99h8"),I(M,"class","guidance svelte-18z99h8"),I(q,"class","actions svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","tailscale-heading"),I(e,"class","tab-panel svelte-18z99h8")},m(re,oe){O(re,e,oe),w(e,n),w(n,i),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(i,d),X&&X.m(i,null),w(n,h),ce&&ce.m(n,null),w(n,g),ae&&ae.m(n,null),w(n,_),~k&&he[k].m(n,null),w(n,T),w(n,M),w(M,A),w(A,D),w(M,R),w(M,N),w(N,B),w(n,$),w(n,q),z(V,q,null),w(q,K),z(x,q,null),ie=!0},p(re,oe){(!ie||oe&2048)&&s!==(s=re[11]("Tailscale")+"")&&Y(o,s),(!ie||oe&2048)&&f!==(f=re[11]("Discover Tailscale peers and explicitly link them to devices in the device inventory.")+"")&&Y(c,f),re[5]?X?(X.p(re,oe),oe&32&&p(X,1)):(X=r4(re),X.c(),p(X,1),X.m(i,null)):X&&(ue(),v(X,1,1,()=>{X=null}),fe()),re[8]?ce?(ce.p(re,oe),oe&256&&p(ce,1)):(ce=s4(re),ce.c(),p(ce,1),ce.m(n,g)):ce&&(ue(),v(ce,1,1,()=>{ce=null}),fe()),re[9]?ae?(ae.p(re,oe),oe&512&&p(ae,1)):(ae=o4(re),ae.c(),p(ae,1),ae.m(n,_)):ae&&(ue(),v(ae,1,1,()=>{ae=null}),fe());let Re=k;k=ne(re),k===Re?~k&&he[k].p(re,oe):(y&&(ue(),v(he[Re],1,1,()=>{he[Re]=null}),fe()),~k?(y=he[k],y?y.p(re,oe):(y=he[k]=ee[k](re),y.c()),p(y,1),y.m(n,T)):y=null),(!ie||oe&2048)&&C!==(C=re[11]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"")&&Y(D,C),(!ie||oe&2048)&&G!==(G=re[11]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"")&&Y(B,G);const qe={};oe&224&&(qe.disabled=re[6]||re[7]||!re[5]),oe&16779424&&(qe.$$scope={dirty:oe,ctx:re}),V.$set(qe);const Ce={};oe&192&&(Ce.disabled=re[6]||re[7]),oe&16779328&&(Ce.$$scope={dirty:oe,ctx:re}),x.$set(Ce)},i(re){ie||(p(X),p(ce),p(ae),p(y),p(V.$$.fragment,re),p(x.$$.fragment,re),ie=!0)},o(re){v(X),v(ce),v(ae),v(y),v(V.$$.fragment,re),v(x.$$.fragment,re),ie=!1},d(re){re&&E(e),X&&X.d(),ce&&ce.d(),ae&&ae.d(),~k&&he[k].d(),H(V),H(x)}}}function u4(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("Diagnostics error"),subtitle:t[4]}}),e.$on("close",t[20]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Diagnostics error")),l&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function BK(t){let e=(t[2]?t[11]("Checking…"):t[11]("Run diagnostics"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2052&&e!==(e=(i[2]?i[11]("Checking…"):i[11]("Run diagnostics"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function zK(t){let e=(t[3]?t[11]("Preparing…"):t[11]("Preview support bundle"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2056&&e!==(e=(i[3]?i[11]("Preparing…"):i[11]("Preview support bundle"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function HK(t){let e=t[11]("Download preview")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Download preview")+"")&&Y(n,e)},d(i){i&&E(n)}}}function UK(t){let e,n,i=t[11]("Overall status")+"",l,r,s,o,a,u;s=new Rt({props:{type:ua(t[0].overall),size:"sm",$$slots:{default:[GK]},$$scope:{ctx:t}}});let f=it(t[0].checks||[]),c=[];for(let h=0;hv(c[h],1,1,()=>{c[h]=null});return{c(){e=P("div"),n=P("span"),l=j(i),r=F(),U(s.$$.fragment),o=F(),a=P("ul");for(let h=0;h{N=null}),fe());const x={};K&4&&(x.disabled=V[2]),K&16779268&&(x.$$scope={dirty:K,ctx:V}),g.$set(x);const ie={};K&8&&(ie.disabled=V[3]),K&16779272&&(ie.$$scope={dirty:K,ctx:V}),k.$set(ie);const X={};K&10&&(X.disabled=!V[1]||V[3]),K&16779264&&(X.$$scope={dirty:K,ctx:V}),T.$set(X);let ce=A;A=$(V),A===ce?~A&&B[A].p(V,K):(C&&(ue(),v(B[ce],1,1,()=>{B[ce]=null}),fe()),~A?(C=B[A],C?C.p(V,K):(C=B[A]=G[A](V),C.c()),p(C,1),C.m(n,D)):C=null),V[1]?q?q.p(V,K):(q=d4(V),q.c(),q.m(n,null)):q&&(q.d(1),q=null)},i(V){R||(p(N),p(g.$$.fragment,V),p(k.$$.fragment,V),p(T.$$.fragment,V),p(C),R=!0)},o(V){v(N),v(g.$$.fragment,V),v(k.$$.fragment,V),v(T.$$.fragment,V),v(C),R=!1},d(V){V&&E(e),N&&N.d(),H(g),H(k),H(T),~A&&B[A].d(),q&&q.d()}}}function jK(t){let e,n,i,l,r,s,o,a;return e=new Yl({props:{$$slots:{default:[OK]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[MK]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[NK]},$$scope:{ctx:t}}}),o=new Yl({props:{$$slots:{default:[WK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f&16780288&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&16779264&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const h={};f&16780256&&(h.$$scope={dirty:f,ctx:u}),r.$set(h);const g={};f&16779295&&(g.$$scope={dirty:f,ctx:u}),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function $K(t){let e,n;return e=new mg({props:{type:"container",autoWidth:!0,iconDescription:t[11]("Show settings sections"),$$slots:{content:[jK],default:[EK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.iconDescription=i[11]("Show settings sections")),l&16781311&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qK(t){let e=t[11]("Dashboard")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function YK(t){let e=t[11]("Settings")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Settings")+"")&&Y(n,e)},d(i){i&&E(n)}}}function ZK(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[qK]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[YK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&16779264&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&16779264&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function XK(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[ZK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16779264&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KK(t){let e,n;return e=new Nl({props:{title:t[11]("Settings"),description:t[11]("Configure this gateway, HTTPS inspection, network integrations, and support diagnostics."),$$slots:{breadcrumb:[XK],default:[$K]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2048&&(r.title=i[11]("Settings")),l&2048&&(r.description=i[11]("Configure this gateway, HTTPS inspection, network integrations, and support diagnostics.")),l&16781311&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ua(t){return t==="ok"||t==="running"||t==="connected"?"green":t==="failed"||t==="stopped"||t==="unavailable"?"red":t==="degraded"||t==="connecting"?"warm-gray":"gray"}function h4(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function m4(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function g4(t){if(!t)return"Never";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function JK(t,e,n){let i,l;ct(t,Ln,N=>n(10,i=N)),ct(t,ti,N=>n(11,l=N));let r=null,s="",o=!1,a=!1,u="",f=null,c=!1,d=!1,h="",g="";async function _(){n(2,o=!0),n(4,u="");try{n(0,r=await i.api.doCall("/diagnostics"))}catch(N){n(4,u=N instanceof Error?N.message:"Diagnostics failed")}finally{n(2,o=!1)}}async function k(){n(3,a=!0),n(4,u="");try{const N=await i.api.doCall("/diagnostics/bundle");n(1,s=JSON.stringify(N,null,2))}catch(N){n(4,u=N instanceof Error?N.message:"Bundle preview failed")}finally{n(3,a=!1)}}function y(){if(!s)return;const N=URL.createObjectURL(new Blob([s+` -`],{type:"application/json"})),G=document.createElement("a");G.href=N,G.download="gatesentry-support-bundle.json",G.click(),URL.revokeObjectURL(N)}async function T(){n(6,c=!0),n(8,h="");try{n(5,f=await i.api.doCall("/tailscale/status"))}catch(N){n(8,h=N instanceof Error?N.message:"Tailscale status failed")}finally{n(6,c=!1)}}async function M(N){n(7,d=!0),n(8,h=""),n(9,g="");try{await i.api.doCall("/tailscale/config","put",{enabled:N}),n(9,g=N?"Tailscale integration enabled.":"Tailscale integration disabled."),await T()}catch(G){n(8,h=G instanceof Error?G.message:"Tailscale update failed")}finally{n(7,d=!1)}}return sn(()=>{_(),T()}),[r,s,o,a,u,f,c,d,h,g,i,l,_,k,y,T,M,()=>n(8,h=""),()=>n(9,g=""),()=>M(!((f==null?void 0:f.enabled)??!1)),()=>n(4,u="")]}class QK extends Oe{constructor(e){super(),Ee(this,e,JK,KK,Se,{})}}function xK(t){let e,n;return e=new F5({props:{settingName:"enable_dns_server",label:"DNS Server",labelA:"Not running",labelB:"Running"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function eJ(t){let e,n;return e=new jr({props:{title:"DNS server",description:"Devices configured to use GateSentry DNS depend on this service for domain filtering.",$$slots:{default:[xK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tJ(t){let e;return{c(){e=j("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function nJ(t){let e;return{c(){e=j("Services")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iJ(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[tJ]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[nJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function lJ(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[iJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rJ(t){let e,n;return e=new Nl({props:{title:"Services",description:"Control the gateway services running on this installation.",narrow:!0,$$slots:{breadcrumb:[lJ],default:[eJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class sJ extends Oe{constructor(e){super(),Ee(this,e,null,rJ,Se,{})}}function _4(t,e,n){const i=t.slice();return i[36]=e[n],i}function p4(t,e,n){const i=t.slice();return i[39]=e[n],i}function b4(t,e,n){const i=t.slice();return i[42]=e[n],i}function v4(t){let e,n;return e=new nn({props:{kind:"error",title:t[16]("Status unavailable"),subtitle:t[6]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Status unavailable")),l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function k4(t){var uf,Pa;let e=[],n=new Map,i,l,r,s,o=t[16]("Protection")+"",a,u,f,c,d,h=(t[0].dns_running?t[16]("DNS server running"):t[16]("DNS server stopped"))+"",g,_,k,y,T=t[16]("Devices")+"",M,A,C,D=t[22](t[0].device_count)+"",R,N,G,B=t[16]("discovered on the network")+"",$,q,V,K,x=t[16]("Blocklist")+"",ie,X,ce,ae=t[22](t[0].blocked_domains)+"",ee,he,ne,re=t[16]("domains loaded")+"",oe,Re,qe,Ce,Ze=t[16]("HTTPS inspection")+"",be,Ae,ve,me,lt,De=t[16]("optional; needs the certificate")+"",vt,dt,ot,ht,Bt,Ot,Zt=t[16]("Last 24 hours")+"",Ve,Nt,Tt,Gt,fn,an,Qt,Ne=t[22]((uf=t[1])==null?void 0:uf.total)+"",pe,et,gt,Kt=t[16]("requests")+"",ze,kt,Pt,cn,qn=t[22](t[2])+"",nl,Bl,Be,Et=t[16]("blocked")+"",kn,Xe,wt,Mt,Zn,Bn,wn,_r=t[22]((Pa=t[1])==null?void 0:Pa.unique_clients)+"",_l,Jr,ji,gn=t[16]("active clients")+"",Qr,il,Xn,xt,xr,$i,Mn,yn,es,pr=t[16]("Setup")+"",ts,Ps,Ns,ns,pl,br=t[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"",_t,Ut,vi,Bs,is,ni,tr,vr=t[16]("Connect a device")+"",ls,zs,kr,Hs=t[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"",ko,Aa,zl,sf,Us,wr=t[16]("Test from a device:")+"",wo,of,yr,La,bl,nr,Da,vl,yo,Bi,dn,rs=it(t[14]);const af=tt=>tt[42].key;for(let tt=0;tt0&&S4(t);vi=new bt({props:{size:"small",disabled:t[11]||!t[0].dns_running,$$slots:{default:[vJ]},$$scope:{ctx:t}}}),vi.$on("click",t[18]);let li=t[8]&&O4(t);return zl=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[VJ]},$$scope:{ctx:t}}}),yr=new Q1({props:{type:"single",code:`dig @${t[21]()} example.com`}}),nr=new bt({props:{kind:"tertiary",size:"small",$$slots:{default:[WJ]},$$scope:{ctx:t}}}),nr.$on("click",t[25]),vl=new bt({props:{kind:"ghost",size:"small",$$slots:{default:[jJ]},$$scope:{ctx:t}}}),vl.$on("click",t[26]),Bi=new bt({props:{kind:"ghost",size:"small",$$slots:{default:[$J]},$$scope:{ctx:t}}}),Bi.$on("click",t[27]),{c(){for(let tt=0;tt{Hl[Na]=null}),fe()),~Xn?(xt=Hl[Xn],xt?xt.p(tt,at):(xt=Hl[Xn]=Ia[Xn](tt),xt.c()),p(xt,1),xt.m(ht,null)):xt=null),(!dn||at[0]&65536)&&pr!==(pr=tt[16]("Setup")+"")&&Y(ts,pr),tt[15]?Kn?(Kn.p(tt,at),at[0]&32768&&p(Kn,1)):(Kn=T4(tt),Kn.c(),p(Kn,1),Kn.m(yn,null)):Kn&&(ue(),v(Kn,1,1,()=>{Kn=null}),fe()),tt[4].length>0?ii?(ii.p(tt,at),at[0]&16&&p(ii,1)):(ii=S4(tt),ii.c(),p(ii,1),ii.m(Mn,ns)):ii&&(ue(),v(ii,1,1,()=>{ii=null}),fe()),(!dn||at[0]&65536)&&br!==(br=tt[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"")&&Y(_t,br);const Ba={};at[0]&2049&&(Ba.disabled=tt[11]||!tt[0].dns_running),at[0]&67584|at[1]&16384&&(Ba.$$scope={dirty:at,ctx:tt}),vi.$set(Ba),tt[8]?li?(li.p(tt,at),at[0]&256&&p(li,1)):(li=O4(tt),li.c(),p(li,1),li.m(Mn,null)):li&&(ue(),v(li,1,1,()=>{li=null}),fe()),(!dn||at[0]&65536)&&vr!==(vr=tt[16]("Connect a device")+"")&&Y(ls,vr),(!dn||at[0]&65536)&&Hs!==(Hs=tt[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"")&&Y(ko,Hs);const ff={};at[0]&65537|at[1]&16384&&(ff.$$scope={dirty:at,ctx:tt}),zl.$set(ff),(!dn||at[0]&65536)&&wr!==(wr=tt[16]("Test from a device:")+"")&&Y(wo,wr);const cf={};at[0]&65536|at[1]&16384&&(cf.$$scope={dirty:at,ctx:tt}),nr.$set(cf);const df={};at[0]&65536|at[1]&16384&&(df.$$scope={dirty:at,ctx:tt}),vl.$set(df);const On={};at[0]&65536|at[1]&16384&&(On.$$scope={dirty:at,ctx:tt}),Bi.$set(On)},i(tt){if(!dn){for(let at=0;ato[39].key;for(let o=0;oo[36].name;for(let o=0;o{u=null}),fe()),c[10]?f?(f.p(c,d),d[0]&1024&&p(f,1)):(f=A4(c),f.c(),p(f,1),f.m(e,null)):f&&(ue(),v(f,1,1,()=>{f=null}),fe())},i(c){a||(p(n.$$.fragment,c),p(u),p(f),a=!0)},o(c){v(n.$$.fragment,c),v(u),v(f),a=!1},d(c){c&&E(e),H(n),u&&u.d(),f&&f.d()}}}function kJ(t){let e=(t[8]==="ok"?t[16]("Protected"):t[16]("Not protected"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65792&&e!==(e=(i[8]==="ok"?i[16]("Protected"):i[16]("Not protected"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function M4(t){let e,n;return e=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[PJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wJ(t){let e=t[16]("Test domain")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Test domain")+"")&&Y(n,e)},d(i){i&&E(n)}}}function yJ(t){let e=t[7].domain+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].domain+"")&&Y(n,e)},d(i){i&&E(n)}}}function TJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[wJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[yJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function SJ(t){let e=t[16]("Answer")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Answer")+"")&&Y(n,e)},d(i){i&&E(n)}}}function EJ(t){let e=t[7].rcode+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].rcode+"")&&Y(n,e)},d(i){i&&E(n)}}}function OJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[SJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[EJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function C4(t){let e,n;return e=new si({props:{$$slots:{default:[AJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MJ(t){let e=t[16]("Explanation")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Explanation")+"")&&Y(n,e)},d(i){i&&E(n)}}}function CJ(t){let e=t[7].cname+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].cname+"")&&Y(n,e)},d(i){i&&E(n)}}}function AJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[MJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[CJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function LJ(t){let e=t[16]("Upstream")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream")+"")&&Y(n,e)},d(i){i&&E(n)}}}function DJ(t){let e=t[7].upstream+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].upstream+"")&&Y(n,e)},d(i){i&&E(n)}}}function IJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[LJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[DJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function RJ(t){let e,n,i,l,r,s,o;e=new si({props:{$$slots:{default:[TJ]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[OJ]},$$scope:{ctx:t}}});let a=t[7].cname&&C4(t);return s=new si({props:{$$slots:{default:[IJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),a&&a.c(),r=F(),U(s.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),a&&a.m(u,f),O(u,r,f),z(s,u,f),o=!0},p(u,f){const c={};f[0]&65664|f[1]&16384&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65664|f[1]&16384&&(d.$$scope={dirty:f,ctx:u}),i.$set(d),u[7].cname?a?(a.p(u,f),f[0]&128&&p(a,1)):(a=C4(u),a.c(),p(a,1),a.m(r.parentNode,r)):a&&(ue(),v(a,1,1,()=>{a=null}),fe());const h={};f[0]&65664|f[1]&16384&&(h.$$scope={dirty:f,ctx:u}),s.$set(h)},i(u){o||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(a),p(s.$$.fragment,u),o=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(a),v(s.$$.fragment,u),o=!1},d(u){u&&(E(n),E(l),E(r)),H(e,u),H(i,u),a&&a.d(u),H(s,u)}}}function PJ(t){let e,n;return e=new qu({props:{$$slots:{default:[RJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function A4(t){let e,n;return e=new nn({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:t[16]("Protection check failed"),subtitle:t[10]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Protection check failed")),l[0]&1024&&(r.subtitle=i[10]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function NJ(t){let e=t[16]("DNS listener")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS listener")+"")&&Y(n,e)},d(i){i&&E(n)}}}function BJ(t){let e,n=t[0].listen_addr+"",i,l,r=t[0].listen_port+"",s;return{c(){e=P("code"),i=j(n),l=j(":"),s=j(r),I(e,"class","svelte-14a5bfj")},m(o,a){O(o,e,a),w(e,i),w(e,l),w(e,s)},p(o,a){a[0]&1&&n!==(n=o[0].listen_addr+"")&&Y(i,n),a[0]&1&&r!==(r=o[0].listen_port+"")&&Y(s,r)},d(o){o&&E(e)}}}function zJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[NJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[BJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function HJ(t){let e=t[16]("Upstream resolver")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream resolver")+"")&&Y(n,e)},d(i){i&&E(n)}}}function UJ(t){let e,n=t[0].upstream+"",i;return{c(){e=P("code"),i=j(n),I(e,"class","svelte-14a5bfj")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&1&&n!==(n=l[0].upstream+"")&&Y(i,n)},d(l){l&&E(e)}}}function FJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[HJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[UJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function GJ(t){let e,n,i,l;return e=new si({props:{$$slots:{default:[zJ]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[FJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65537|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&65537|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function VJ(t){let e,n;return e=new qu({props:{$$slots:{default:[GJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65537|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function WJ(t){let e=t[16]("Policies")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Policies")+"")&&Y(n,e)},d(i){i&&E(n)}}}function jJ(t){let e=t[16]("Devices")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Devices")+"")&&Y(n,e)},d(i){i&&E(n)}}}function $J(t){let e=t[16]("DNS settings")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS settings")+"")&&Y(n,e)},d(i){i&&E(n)}}}function qJ(t){let e,n,i,l=t[6]&&v4(t),r=t[0]&&k4(t);return{c(){l&&l.c(),e=F(),r&&r.c(),n=je()},m(s,o){l&&l.m(s,o),O(s,e,o),r&&r.m(s,o),O(s,n,o),i=!0},p(s,o){s[6]?l?(l.p(s,o),o[0]&64&&p(l,1)):(l=v4(s),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),s[0]?r?(r.p(s,o),o[0]&1&&p(r,1)):(r=k4(s),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function YJ(t){let e=t[16]("Refresh")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Refresh")+"")&&Y(n,e)},d(i){i&&E(n)}}}function ZJ(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:xq,$$slots:{default:[YJ]},$$scope:{ctx:t}}}),e.$on("click",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function XJ(t){let e,n;return e=new Nl({props:{title:t[16]("Overview"),description:t[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies."),$$slots:{actions:[ZJ],default:[qJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Overview")),l[0]&65536&&(r.description=i[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")),l[0]&131071|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KJ(t,e,n){let i,l,r,s,o,a,u,f,c;ct(t,ti,re=>n(16,f=re)),ct(t,Ln,re=>n(29,c=re));const d=["resolver","blocklist","first_device","protection_check"];let h=null,g=null,_=null,k="",y=null,T="",M="",A="",C=!1,D=null;const R=async()=>{n(6,k="");try{n(0,h=await c.api.doCall("/onboarding/status"))}catch{n(6,k="Unable to load the gateway status.")}},N=async()=>{try{n(1,g=await c.api.doCall("/decisions/summary?days=1"))}catch{n(1,g=null)}},G=async()=>{try{const re=await c.api.doCall("/settings/enable_https_filtering");n(5,_=(re==null?void 0:re.Value)==="true")}catch{n(5,_=null)}},B=()=>Promise.all([R(),N(),G()]),$=async()=>{n(11,C=!0),n(9,M=""),n(10,A=""),n(8,T="");try{const re=await c.api.doCall("/onboarding/protection-check","post",{});n(7,y=re.check),n(8,T=re.state),n(9,M=re.detail),n(10,A=re.action||""),await R()}catch{n(8,T="failed"),n(9,M="The protection check did not complete."),n(10,A="Verify the DNS listener and upstream resolver, then retry the check.")}finally{n(11,C=!1)}},q=re=>f(re==="resolver"?"Resolver and listener":re==="blocklist"?"Blocklists loaded":re==="first_device"?"First device discovered":"Protection verified"),V=re=>h?re==="resolver"?h.resolver.detail||"":re==="blocklist"?h.blocklist.detail||"":re==="first_device"?`${h.device_count} ${f("devices discovered")}`:h.progress.first_explained_protection_at?`${f("Verified")} ${new Date(h.progress.first_explained_protection_at).toLocaleString()}`:f("Not verified yet"):"",K=re=>{const oe=[];return re.bind.state!=="ok"&&oe.push({key:"bind",title:f("DNS listener is not ready"),subtitle:[re.bind.detail,re.bind.action].filter(Boolean).join(" ")}),re.resolver.state!=="ok"&&re.resolver.action&&oe.push({key:"resolver",title:f("Upstream resolver is not reachable"),subtitle:re.resolver.action}),re.blocklist.state!=="ok"&&re.blocklist.action&&oe.push({key:"blocklist",title:f("Blocklist empty"),subtitle:re.blocklist.action}),oe},x=["","0.0.0.0","::","[::]","127.0.0.1","::1"],ie=()=>{const re=(h==null?void 0:h.listen_addr)||"";return x.includes(re)?"":re},X=re=>typeof re=="number"?re.toLocaleString():"—";sn(()=>{B(),D=setInterval(N,3e4)}),Ls(()=>{D&&clearInterval(D)});const ce=()=>n(6,k=""),ae=()=>Vi("/stats"),ee=()=>Vi("/rules"),he=()=>Vi("/devices"),ne=()=>Vi("/dns");return t.$$.update=()=>{var re;t.$$.dirty[0]&1&&n(4,i=((h==null?void 0:h.steps)||[]).filter(oe=>d.includes(oe.name))),t.$$.dirty[0]&16&&n(3,l=i.findIndex(oe=>oe.state!=="ok")),t.$$.dirty[0]&24&&n(15,r=i.length>0&&l===-1),t.$$.dirty[0]&1&&n(14,s=h?K(h):[]),t.$$.dirty[0]&1&&n(13,o=!!(h!=null&&h.progress.first_explained_protection_at)),t.$$.dirty[0]&2&&n(2,a=((re=g==null?void 0:g.by_action)==null?void 0:re.block)||0),t.$$.dirty[0]&6&&n(12,u=g&&g.total>0?(a/g.total*100).toFixed(1)+"%":"—")},[h,g,a,l,i,_,k,y,T,M,A,C,u,o,s,r,f,B,$,q,V,ie,X,ce,ae,ee,he,ne]}class JJ extends Oe{constructor(e){super(),Ee(this,e,KJ,XJ,Se,{},null,[-1,-1])}}const L4="[a-fA-F\\d:]",ys=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${L4})|(?<=${L4})(?=\\s|$))`:"",Wl="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ri="[a-fA-F\\d]{1,4}",zd=` + ensure it adheres to the relevant legal standards in your jurisdiction.`,I(i,"class","notice-title"),I(o,"class","section"),I(c,"class","section"),I(_,"class","section"),I(M,"class","section"),I(n,"class","mitm-privacy-notice")},m(B,j){O(B,e,j),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(n,a),w(n,u),w(n,f),w(n,c),w(n,d),w(n,h),w(n,g),w(n,_),w(n,k),w(n,y),w(n,T),w(n,M),w(n,A),w(n,C),w(n,D),w(n,R),w(n,N),w(n,G)},p(B,[j]){j&1&&l!==(l=B[0]("Privacy Notice for Enabling MITM Filtering")+"")&&Y(r,l)},i:_e,o:_e,d(B){B&&E(e)}}}function mK(t,e,n){let i;return ct(t,ti,l=>n(0,i=l)),[i]}class gK extends Oe{constructor(e){super(),Ee(this,e,mK,hK,Se,{})}}function i4(t){let e,n,i,l;const r=[pK,_K],s=[];function o(a,u){return a[0]==""?0:1}return n=o(t),i=s[n]=r[n](t),{c(){e=P("span"),i.c()},m(a,u){O(a,e,u),s[n].m(e,null),l=!0},p(a,u){let f=n;n=o(a),n===f?s[n].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),p(i,1),i.m(e,null))},i(a){l||(p(i),l=!0)},o(a){v(i),l=!1},d(a){a&&E(e),s[n].d()}}}function _K(t){let e,n;return e=new Ad({props:{labelText:t[1],labelA:t[2],labelB:t[3],toggled:t[0]=="true"}}),e.$on("change",t[5]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.labelText=i[1]),l&4&&(r.labelA=i[2]),l&8&&(r.labelB=i[3]),l&1&&(r.toggled=i[0]=="true"),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function pK(t){let e,n;return e=new KT({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bK(t){let e,n,i=!t[4]&&i4(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[4]?i&&(ue(),v(i,1,1,()=>{i=null}),fe()):i?(i.p(l,r),r&16&&p(i,1)):(i=i4(l),i.c(),p(i,1),i.m(e.parentNode,e))},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function vK(t,e,n){let i,l;ct(t,ti,_=>n(9,i=_)),ct(t,Ln,_=>n(10,l=_));let{settingName:r="enable_https_filtering"}=e,{label:s="Label"}=e,{labelA:o="On"}=e,{labelB:a="Off"}=e,{settingValue:u=""}=e,{preClickEvent:f=null}=e,{hide:c=!1}=e,{noNotification:d=!1}=e;const h=()=>{l.api.doCall("/settings/"+r).then(_=>{n(0,u=_.Value)})},g=async()=>{f&&await f();const _="/settings/"+r;var k={key:r,value:u=="true"?"false":"true"};l.api.doCall(_,"post",k).then(function(y){h(),!d&&Ei.add(Ma({title:i("Success"),subtitle:i("Setting updated")},i))})};return on(()=>{h()}),t.$$set=_=>{"settingName"in _&&n(6,r=_.settingName),"label"in _&&n(1,s=_.label),"labelA"in _&&n(2,o=_.labelA),"labelB"in _&&n(3,a=_.labelB),"settingValue"in _&&n(0,u=_.settingValue),"preClickEvent"in _&&n(7,f=_.preClickEvent),"hide"in _&&n(4,c=_.hide),"noNotification"in _&&n(8,d=_.noNotification)},[u,s,o,a,c,g,r,f,d]}class F5 extends Oe{constructor(e){super(),Ee(this,e,vK,bK,Se,{settingName:6,label:1,labelA:2,labelB:3,settingValue:0,preClickEvent:7,hide:4,noNotification:8})}}function kK(t){let e,n;return e=new gK({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wK(t){let e,n,i,l,r,s;return e=new Od({props:{label:t[2]("HTTPS inspection"),title:t[2]("Privacy notice")}}),i=new Md({props:{hasForm:!0,$$slots:{default:[kK]},$$scope:{ctx:t}}}),r=new Cd({props:{secondaryButtonText:t[2]("Close"),secondaryClass:"bx--btn--primary"}}),r.$on("click:button--secondary",t[5]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a&4&&(u.label=o[2]("HTTPS inspection")),a&4&&(u.title=o[2]("Privacy notice")),e.$set(u);const f={};a&128&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&4&&(c.secondaryButtonText=o[2]("Close")),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function yK(t){let e,n,i,l,r,s=t[2]("Only enable inspection after reviewing the privacy notice and installing the GateSentry certificate on protected devices.")+"",o,a,u,f;function c(h){t[4](h)}let d={settingName:"enable_https_filtering",label:t[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)"),labelA:t[2]("Disabled"),labelB:t[2]("Enabled"),noNotification:!0,preClickEvent:t[3]};return t[1]!==void 0&&(d.settingValue=t[1]),n=new F5({props:d}),xe.push(()=>At(n,"settingValue",c)),u=new Ed({props:{open:t[0],$$slots:{default:[wK]},$$scope:{ctx:t}}}),u.$on("close",t[6]),{c(){e=P("div"),U(n.$$.fragment),l=F(),r=P("p"),o=$(s),a=F(),U(u.$$.fragment),I(r,"class","helper svelte-hopfxz"),I(e,"class","https-setting svelte-hopfxz")},m(h,g){O(h,e,g),z(n,e,null),w(e,l),w(e,r),w(r,o),w(e,a),z(u,e,null),f=!0},p(h,[g]){const _={};g&4&&(_.label=h[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)")),g&4&&(_.labelA=h[2]("Disabled")),g&4&&(_.labelB=h[2]("Enabled")),!i&&g&2&&(i=!0,_.settingValue=h[1],Ct(()=>i=!1)),n.$set(_),(!f||g&4)&&s!==(s=h[2]("Only enable inspection after reviewing the privacy notice and installing the GateSentry certificate on protected devices.")+"")&&Y(o,s);const k={};g&1&&(k.open=h[0]),g&133&&(k.$$scope={dirty:g,ctx:h}),u.$set(k)},i(h){f||(p(n.$$.fragment,h),p(u.$$.fragment,h),f=!0)},o(h){v(n.$$.fragment,h),v(u.$$.fragment,h),f=!1},d(h){h&&E(e),H(n),H(u)}}}function TK(t,e,n){let i;ct(t,ti,f=>n(2,i=f));let l=!1,r="";function s(){r==="false"&&n(0,l=!0)}function o(f){r=f,n(1,r)}return[l,r,i,s,o,()=>{n(0,l=!1)},()=>n(0,l=!1)]}class SK extends Oe{constructor(e){super(),Ee(this,e,TK,yK,Se,{})}}function l4(t,e,n){const i=t.slice();return i[21]=e[n],i}function EK(t){let e,n,i,l,r,s,o,a;return e=new ql({props:{label:t[11]("General")}}),i=new ql({props:{label:t[11]("HTTPS inspection")}}),r=new ql({props:{label:t[11]("Connectivity")}}),o=new ql({props:{label:t[11]("Diagnostics")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f&2048&&(c.label=u[11]("General")),e.$set(c);const d={};f&2048&&(d.label=u[11]("HTTPS inspection")),i.$set(d);const h={};f&2048&&(h.label=u[11]("Connectivity")),r.$set(h);const g={};f&2048&&(g.label=u[11]("Diagnostics")),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function OK(t){let e,n,i,l,r=t[11]("Gateway")+"",s,o,a,u=t[11]("Choose where GateSentry stores its local decision log and review the signed-in administrator.")+"",f,c,d,h,g,_=t[11]("Decision log storage")+"",k,y,T,M=t[11]("GateSentry writes filtering decisions to this SQLite database path.")+"",A,C,D,R,N,G,B,j,q,V,K=t[11]("Administrator")+"",x,ie,X,ce=t[11]("This identity comes from the authenticated session and cannot be edited here.")+"",ae,ee,he,ne,re;return R=new B5({props:{keyName:"log_location",title:t[11]("Log location"),labelText:t[11]("Log location"),type:"text",helperText:t[11]("Restart GateSentry after changing this path.")}}),G=new ln({props:{lowContrast:!0,hideCloseButton:!0,kind:"info",title:t[11]("Raspberry Pi storage guidance"),subtitle:t[11]('To reduce SD card writes, set the log location to "/tmp/log.db". This keeps the log in RAM, so history is cleared whenever the device restarts.')}}),ne=new ei({props:{value:t[10].api.username,type:"text",title:t[11]("Admin username"),labelText:t[11]("Admin username"),helperText:t[11]("Change the password from the account menu."),disabled:!0}}),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),d=P("div"),h=P("div"),g=P("h4"),k=$(_),y=F(),T=P("p"),A=$(M),C=F(),D=P("div"),U(R.$$.fragment),N=F(),U(G.$$.fragment),B=F(),j=P("div"),q=P("div"),V=P("h4"),x=$(K),ie=F(),X=P("p"),ae=$(ce),ee=F(),he=P("div"),U(ne.$$.fragment),I(l,"id","gateway-heading"),I(l,"class","svelte-18z99h8"),I(a,"class","svelte-18z99h8"),I(i,"class","section-heading svelte-18z99h8"),I(g,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(h,"class","setting-copy svelte-18z99h8"),I(D,"class","setting-control svelte-18z99h8"),I(d,"class","setting-row svelte-18z99h8"),I(V,"class","svelte-18z99h8"),I(X,"class","svelte-18z99h8"),I(q,"class","setting-copy svelte-18z99h8"),I(he,"class","setting-control svelte-18z99h8"),I(j,"class","setting-row svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","gateway-heading"),I(e,"class","tab-panel svelte-18z99h8")},m(oe,Re){O(oe,e,Re),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),w(n,d),w(d,h),w(h,g),w(g,k),w(h,y),w(h,T),w(T,A),w(d,C),w(d,D),z(R,D,null),w(n,N),z(G,n,null),w(n,B),w(n,j),w(j,q),w(q,V),w(V,x),w(q,ie),w(q,X),w(X,ae),w(j,ee),w(j,he),z(ne,he,null),re=!0},p(oe,Re){(!re||Re&2048)&&r!==(r=oe[11]("Gateway")+"")&&Y(s,r),(!re||Re&2048)&&u!==(u=oe[11]("Choose where GateSentry stores its local decision log and review the signed-in administrator.")+"")&&Y(f,u),(!re||Re&2048)&&_!==(_=oe[11]("Decision log storage")+"")&&Y(k,_),(!re||Re&2048)&&M!==(M=oe[11]("GateSentry writes filtering decisions to this SQLite database path.")+"")&&Y(A,M);const qe={};Re&2048&&(qe.title=oe[11]("Log location")),Re&2048&&(qe.labelText=oe[11]("Log location")),Re&2048&&(qe.helperText=oe[11]("Restart GateSentry after changing this path.")),R.$set(qe);const Ce={};Re&2048&&(Ce.title=oe[11]("Raspberry Pi storage guidance")),Re&2048&&(Ce.subtitle=oe[11]('To reduce SD card writes, set the log location to "/tmp/log.db". This keeps the log in RAM, so history is cleared whenever the device restarts.')),G.$set(Ce),(!re||Re&2048)&&K!==(K=oe[11]("Administrator")+"")&&Y(x,K),(!re||Re&2048)&&ce!==(ce=oe[11]("This identity comes from the authenticated session and cannot be edited here.")+"")&&Y(ae,ce);const Ze={};Re&1024&&(Ze.value=oe[10].api.username),Re&2048&&(Ze.title=oe[11]("Admin username")),Re&2048&&(Ze.labelText=oe[11]("Admin username")),Re&2048&&(Ze.helperText=oe[11]("Change the password from the account menu.")),ne.$set(Ze)},i(oe){re||(p(R.$$.fragment,oe),p(G.$$.fragment,oe),p(ne.$$.fragment,oe),re=!0)},o(oe){v(R.$$.fragment,oe),v(G.$$.fragment,oe),v(ne.$$.fragment,oe),re=!1},d(oe){oe&&E(e),H(R),H(G),H(ne)}}}function MK(t){let e,n,i,l,r=t[11]("HTTPS inspection")+"",s,o,a,u=t[11]("Advanced, opt-in inspection for encrypted web traffic. Devices must trust the GateSentry certificate.")+"",f,c,d,h,g,_=t[11]("Inspection status")+"",k,y,T,M=t[11]("Changing this setting affects proxy traffic; DNS filtering remains separate.")+"",A,C,D,R,N,G,B,j;return R=new SK({}),B=new dK({}),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),d=P("div"),h=P("div"),g=P("h4"),k=$(_),y=F(),T=P("p"),A=$(M),C=F(),D=P("div"),U(R.$$.fragment),N=F(),G=P("section"),U(B.$$.fragment),I(l,"id","https-heading"),I(l,"class","svelte-18z99h8"),I(a,"class","svelte-18z99h8"),I(i,"class","section-heading svelte-18z99h8"),I(g,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(h,"class","setting-copy svelte-18z99h8"),I(D,"class","setting-control svelte-18z99h8"),I(d,"class","setting-row svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","https-heading"),I(G,"class","settings-card certificate-card svelte-18z99h8"),I(e,"class","tab-panel svelte-18z99h8")},m(q,V){O(q,e,V),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),w(n,d),w(d,h),w(h,g),w(g,k),w(h,y),w(h,T),w(T,A),w(d,C),w(d,D),z(R,D,null),w(e,N),w(e,G),z(B,G,null),j=!0},p(q,V){(!j||V&2048)&&r!==(r=q[11]("HTTPS inspection")+"")&&Y(s,r),(!j||V&2048)&&u!==(u=q[11]("Advanced, opt-in inspection for encrypted web traffic. Devices must trust the GateSentry certificate.")+"")&&Y(f,u),(!j||V&2048)&&_!==(_=q[11]("Inspection status")+"")&&Y(k,_),(!j||V&2048)&&M!==(M=q[11]("Changing this setting affects proxy traffic; DNS filtering remains separate.")+"")&&Y(A,M)},i(q){j||(p(R.$$.fragment,q),p(B.$$.fragment,q),j=!0)},o(q){v(R.$$.fragment,q),v(B.$$.fragment,q),j=!1},d(q){q&&E(e),H(R),H(B)}}}function r4(t){let e,n;return e=new Rt({props:{type:t[5].enabled?"green":"gray",size:"sm",$$slots:{default:[CK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.type=i[5].enabled?"green":"gray"),l&16779296&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function CK(t){let e=(t[5].enabled?t[11]("Enabled"):t[11]("Disabled"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].enabled?i[11]("Enabled"):i[11]("Disabled"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function s4(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("Tailscale error"),subtitle:t[8]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Tailscale error")),l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function o4(t){let e,n;return e=new ln({props:{kind:"success",title:t[11]("Tailscale updated"),subtitle:t[9]}}),e.$on("close",t[18]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Tailscale updated")),l&512&&(r.subtitle=i[9]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function AK(t){let e,n,i,l=t[11]("Client detected")+"",r,s,o,a,u,f,c,d=t[11]("State")+"",h,g,_,k,y,T,M,A=t[11]("Backend state")+"",C,D,R,N=(t[5].backend_state||t[11]("Unknown"))+"",G,B,j,q,V=t[11]("This node")+"",K,x,ie,X=(t[5].self_name||"—")+"",ce,ae,ee,he,ne=t[11]("Last refreshed")+"",re,oe,Re,qe=g4(t[5].last_refresh)+"",Ce,Ze,be,Ae;a=new Rt({props:{type:t[5].detected?"green":"warm-gray",size:"sm",$$slots:{default:[DK]},$$scope:{ctx:t}}}),k=new Rt({props:{type:ua(t[5].state),size:"sm",$$slots:{default:[IK]},$$scope:{ctx:t}}});let ve=t[5].message&&a4(t);return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=$(l),s=F(),o=P("dd"),U(a.$$.fragment),u=F(),f=P("div"),c=P("dt"),h=$(d),g=F(),_=P("dd"),U(k.$$.fragment),y=F(),T=P("div"),M=P("dt"),C=$(A),D=F(),R=P("dd"),G=$(N),B=F(),j=P("div"),q=P("dt"),K=$(V),x=F(),ie=P("dd"),ce=$(X),ae=F(),ee=P("div"),he=P("dt"),re=$(ne),oe=F(),Re=P("dd"),Ce=$(qe),Ze=F(),ve&&ve.c(),be=je(),I(i,"class","svelte-18z99h8"),I(o,"class","svelte-18z99h8"),I(n,"class","svelte-18z99h8"),I(c,"class","svelte-18z99h8"),I(_,"class","svelte-18z99h8"),I(f,"class","svelte-18z99h8"),I(M,"class","svelte-18z99h8"),I(R,"class","svelte-18z99h8"),I(T,"class","svelte-18z99h8"),I(q,"class","svelte-18z99h8"),I(ie,"class","svelte-18z99h8"),I(j,"class","svelte-18z99h8"),I(he,"class","svelte-18z99h8"),I(Re,"class","svelte-18z99h8"),I(ee,"class","svelte-18z99h8"),I(e,"class","status-grid svelte-18z99h8")},m(me,lt){O(me,e,lt),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),z(a,o,null),w(n,u),w(e,f),w(f,c),w(c,h),w(f,g),w(f,_),z(k,_,null),w(f,y),w(e,T),w(T,M),w(M,C),w(T,D),w(T,R),w(R,G),w(T,B),w(e,j),w(j,q),w(q,K),w(j,x),w(j,ie),w(ie,ce),w(j,ae),w(e,ee),w(ee,he),w(he,re),w(ee,oe),w(ee,Re),w(Re,Ce),O(me,Ze,lt),ve&&ve.m(me,lt),O(me,be,lt),Ae=!0},p(me,lt){(!Ae||lt&2048)&&l!==(l=me[11]("Client detected")+"")&&Y(r,l);const De={};lt&32&&(De.type=me[5].detected?"green":"warm-gray"),lt&16779296&&(De.$$scope={dirty:lt,ctx:me}),a.$set(De),(!Ae||lt&2048)&&d!==(d=me[11]("State")+"")&&Y(h,d);const vt={};lt&32&&(vt.type=ua(me[5].state)),lt&16779296&&(vt.$$scope={dirty:lt,ctx:me}),k.$set(vt),(!Ae||lt&2048)&&A!==(A=me[11]("Backend state")+"")&&Y(C,A),(!Ae||lt&2080)&&N!==(N=(me[5].backend_state||me[11]("Unknown"))+"")&&Y(G,N),(!Ae||lt&2048)&&V!==(V=me[11]("This node")+"")&&Y(K,V),(!Ae||lt&32)&&X!==(X=(me[5].self_name||"—")+"")&&Y(ce,X),(!Ae||lt&2048)&&ne!==(ne=me[11]("Last refreshed")+"")&&Y(re,ne),(!Ae||lt&32)&&qe!==(qe=g4(me[5].last_refresh)+"")&&Y(Ce,qe),me[5].message?ve?(ve.p(me,lt),lt&32&&p(ve,1)):(ve=a4(me),ve.c(),p(ve,1),ve.m(be.parentNode,be)):ve&&(ue(),v(ve,1,1,()=>{ve=null}),fe())},i(me){Ae||(p(a.$$.fragment,me),p(k.$$.fragment,me),p(ve),Ae=!0)},o(me){v(a.$$.fragment,me),v(k.$$.fragment,me),v(ve),Ae=!1},d(me){me&&(E(e),E(Ze),E(be)),H(a),H(k),ve&&ve.d(me)}}}function LK(t){let e,n;return e=new Wi({props:{description:t[11]("Checking Tailscale…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.description=i[11]("Checking Tailscale…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function DK(t){let e=(t[5].detected?t[11]("Detected"):t[11]("Not detected"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].detected?i[11]("Detected"):i[11]("Not detected"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function IK(t){let e=(t[5].state||t[11]("Unknown"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2080&&e!==(e=(i[5].state||i[11]("Unknown"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function a4(t){let e,n;return e=new ln({props:{lowContrast:!0,hideCloseButton:!0,kind:h4(t[5].state),title:m4(t[5].state),subtitle:t[5].message}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.kind=h4(i[5].state)),l&32&&(r.title=m4(i[5].state)),l&32&&(r.subtitle=i[5].message),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function RK(t){var i;let e=(t[7]?t[11]("Saving…"):(i=t[5])!=null&&i.enabled?t[11]("Disable Tailscale"):t[11]("Enable Tailscale"))+"",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r&2208&&e!==(e=(l[7]?l[11]("Saving…"):(s=l[5])!=null&&s.enabled?l[11]("Disable Tailscale"):l[11]("Enable Tailscale"))+"")&&Y(n,e)},d(l){l&&E(n)}}}function PK(t){let e=(t[6]?t[11]("Refreshing…"):t[11]("Refresh status"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2112&&e!==(e=(i[6]?i[11]("Refreshing…"):i[11]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function NK(t){let e,n,i,l,r,s=t[11]("Tailscale")+"",o,a,u,f=t[11]("Discover Tailscale peers and explicitly link them to devices in the device inventory.")+"",c,d,h,g,_,k,y,T,M,A,C=t[11]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"",D,R,N,G=t[11]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"",B,j,q,V,K,x,ie,X=t[5]&&r4(t),ce=t[8]&&s4(t),ae=t[9]&&o4(t);const ee=[LK,AK],he=[];function ne(re,oe){return re[6]&&!re[5]?0:re[5]?1:-1}return~(k=ne(t))&&(y=he[k]=ee[k](t)),V=new bt({props:{size:"small",disabled:t[6]||t[7]||!t[5],$$slots:{default:[RK]},$$scope:{ctx:t}}}),V.$on("click",t[19]),x=new bt({props:{size:"small",kind:"tertiary",disabled:t[6]||t[7],$$slots:{default:[PK]},$$scope:{ctx:t}}}),x.$on("click",t[15]),{c(){e=P("div"),n=P("section"),i=P("div"),l=P("div"),r=P("h3"),o=$(s),a=F(),u=P("p"),c=$(f),d=F(),X&&X.c(),h=F(),ce&&ce.c(),g=F(),ae&&ae.c(),_=F(),y&&y.c(),T=F(),M=P("div"),A=P("p"),D=$(C),R=F(),N=P("p"),B=$(G),j=F(),q=P("div"),U(V.$$.fragment),K=F(),U(x.$$.fragment),I(r,"id","tailscale-heading"),I(r,"class","svelte-18z99h8"),I(u,"class","svelte-18z99h8"),I(l,"class","section-heading svelte-18z99h8"),I(i,"class","card-heading svelte-18z99h8"),I(A,"class","svelte-18z99h8"),I(N,"class","svelte-18z99h8"),I(M,"class","guidance svelte-18z99h8"),I(q,"class","actions svelte-18z99h8"),I(n,"class","settings-card svelte-18z99h8"),I(n,"aria-labelledby","tailscale-heading"),I(e,"class","tab-panel svelte-18z99h8")},m(re,oe){O(re,e,oe),w(e,n),w(n,i),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(i,d),X&&X.m(i,null),w(n,h),ce&&ce.m(n,null),w(n,g),ae&&ae.m(n,null),w(n,_),~k&&he[k].m(n,null),w(n,T),w(n,M),w(M,A),w(A,D),w(M,R),w(M,N),w(N,B),w(n,j),w(n,q),z(V,q,null),w(q,K),z(x,q,null),ie=!0},p(re,oe){(!ie||oe&2048)&&s!==(s=re[11]("Tailscale")+"")&&Y(o,s),(!ie||oe&2048)&&f!==(f=re[11]("Discover Tailscale peers and explicitly link them to devices in the device inventory.")+"")&&Y(c,f),re[5]?X?(X.p(re,oe),oe&32&&p(X,1)):(X=r4(re),X.c(),p(X,1),X.m(i,null)):X&&(ue(),v(X,1,1,()=>{X=null}),fe()),re[8]?ce?(ce.p(re,oe),oe&256&&p(ce,1)):(ce=s4(re),ce.c(),p(ce,1),ce.m(n,g)):ce&&(ue(),v(ce,1,1,()=>{ce=null}),fe()),re[9]?ae?(ae.p(re,oe),oe&512&&p(ae,1)):(ae=o4(re),ae.c(),p(ae,1),ae.m(n,_)):ae&&(ue(),v(ae,1,1,()=>{ae=null}),fe());let Re=k;k=ne(re),k===Re?~k&&he[k].p(re,oe):(y&&(ue(),v(he[Re],1,1,()=>{he[Re]=null}),fe()),~k?(y=he[k],y?y.p(re,oe):(y=he[k]=ee[k](re),y.c()),p(y,1),y.m(n,T)):y=null),(!ie||oe&2048)&&C!==(C=re[11]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"")&&Y(D,C),(!ie||oe&2048)&&G!==(G=re[11]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"")&&Y(B,G);const qe={};oe&224&&(qe.disabled=re[6]||re[7]||!re[5]),oe&16779424&&(qe.$$scope={dirty:oe,ctx:re}),V.$set(qe);const Ce={};oe&192&&(Ce.disabled=re[6]||re[7]),oe&16779328&&(Ce.$$scope={dirty:oe,ctx:re}),x.$set(Ce)},i(re){ie||(p(X),p(ce),p(ae),p(y),p(V.$$.fragment,re),p(x.$$.fragment,re),ie=!0)},o(re){v(X),v(ce),v(ae),v(y),v(V.$$.fragment,re),v(x.$$.fragment,re),ie=!1},d(re){re&&E(e),X&&X.d(),ce&&ce.d(),ae&&ae.d(),~k&&he[k].d(),H(V),H(x)}}}function u4(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("Diagnostics error"),subtitle:t[4]}}),e.$on("close",t[20]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Diagnostics error")),l&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function BK(t){let e=(t[2]?t[11]("Checking…"):t[11]("Run diagnostics"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2052&&e!==(e=(i[2]?i[11]("Checking…"):i[11]("Run diagnostics"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function zK(t){let e=(t[3]?t[11]("Preparing…"):t[11]("Preview support bundle"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2056&&e!==(e=(i[3]?i[11]("Preparing…"):i[11]("Preview support bundle"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function HK(t){let e=t[11]("Download preview")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Download preview")+"")&&Y(n,e)},d(i){i&&E(n)}}}function UK(t){let e,n,i=t[11]("Overall status")+"",l,r,s,o,a,u;s=new Rt({props:{type:ua(t[0].overall),size:"sm",$$slots:{default:[GK]},$$scope:{ctx:t}}});let f=it(t[0].checks||[]),c=[];for(let h=0;hv(c[h],1,1,()=>{c[h]=null});return{c(){e=P("div"),n=P("span"),l=$(i),r=F(),U(s.$$.fragment),o=F(),a=P("ul");for(let h=0;h{N=null}),fe());const x={};K&4&&(x.disabled=V[2]),K&16779268&&(x.$$scope={dirty:K,ctx:V}),g.$set(x);const ie={};K&8&&(ie.disabled=V[3]),K&16779272&&(ie.$$scope={dirty:K,ctx:V}),k.$set(ie);const X={};K&10&&(X.disabled=!V[1]||V[3]),K&16779264&&(X.$$scope={dirty:K,ctx:V}),T.$set(X);let ce=A;A=j(V),A===ce?~A&&B[A].p(V,K):(C&&(ue(),v(B[ce],1,1,()=>{B[ce]=null}),fe()),~A?(C=B[A],C?C.p(V,K):(C=B[A]=G[A](V),C.c()),p(C,1),C.m(n,D)):C=null),V[1]?q?q.p(V,K):(q=d4(V),q.c(),q.m(n,null)):q&&(q.d(1),q=null)},i(V){R||(p(N),p(g.$$.fragment,V),p(k.$$.fragment,V),p(T.$$.fragment,V),p(C),R=!0)},o(V){v(N),v(g.$$.fragment,V),v(k.$$.fragment,V),v(T.$$.fragment,V),v(C),R=!1},d(V){V&&E(e),N&&N.d(),H(g),H(k),H(T),~A&&B[A].d(),q&&q.d()}}}function jK(t){let e,n,i,l,r,s,o,a;return e=new Yl({props:{$$slots:{default:[OK]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[MK]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[NK]},$$scope:{ctx:t}}}),o=new Yl({props:{$$slots:{default:[WK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f&16780288&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&16779264&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const h={};f&16780256&&(h.$$scope={dirty:f,ctx:u}),r.$set(h);const g={};f&16779295&&(g.$$scope={dirty:f,ctx:u}),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function $K(t){let e,n;return e=new mg({props:{type:"container",autoWidth:!0,iconDescription:t[11]("Show settings sections"),$$slots:{content:[jK],default:[EK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.iconDescription=i[11]("Show settings sections")),l&16781311&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qK(t){let e=t[11]("Dashboard")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function YK(t){let e=t[11]("Settings")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Settings")+"")&&Y(n,e)},d(i){i&&E(n)}}}function ZK(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[qK]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[YK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&16779264&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&16779264&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function XK(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[ZK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16779264&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KK(t){let e,n;return e=new Nl({props:{title:t[11]("Settings"),description:t[11]("Configure this gateway, HTTPS inspection, network integrations, and support diagnostics."),$$slots:{breadcrumb:[XK],default:[$K]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2048&&(r.title=i[11]("Settings")),l&2048&&(r.description=i[11]("Configure this gateway, HTTPS inspection, network integrations, and support diagnostics.")),l&16781311&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ua(t){return t==="ok"||t==="running"||t==="connected"?"green":t==="failed"||t==="stopped"||t==="unavailable"?"red":t==="degraded"||t==="connecting"?"warm-gray":"gray"}function h4(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function m4(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function g4(t){if(!t)return"Never";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function JK(t,e,n){let i,l;ct(t,Ln,N=>n(10,i=N)),ct(t,ti,N=>n(11,l=N));let r=null,s="",o=!1,a=!1,u="",f=null,c=!1,d=!1,h="",g="";async function _(){n(2,o=!0),n(4,u="");try{n(0,r=await i.api.doCall("/diagnostics"))}catch(N){n(4,u=N instanceof Error?N.message:"Diagnostics failed")}finally{n(2,o=!1)}}async function k(){n(3,a=!0),n(4,u="");try{const N=await i.api.doCall("/diagnostics/bundle");n(1,s=JSON.stringify(N,null,2))}catch(N){n(4,u=N instanceof Error?N.message:"Bundle preview failed")}finally{n(3,a=!1)}}function y(){if(!s)return;const N=URL.createObjectURL(new Blob([s+` +`],{type:"application/json"})),G=document.createElement("a");G.href=N,G.download="gatesentry-support-bundle.json",G.click(),URL.revokeObjectURL(N)}async function T(){n(6,c=!0),n(8,h="");try{n(5,f=await i.api.doCall("/tailscale/status"))}catch(N){n(8,h=N instanceof Error?N.message:"Tailscale status failed")}finally{n(6,c=!1)}}async function M(N){n(7,d=!0),n(8,h=""),n(9,g="");try{await i.api.doCall("/tailscale/config","put",{enabled:N}),n(9,g=N?"Tailscale integration enabled.":"Tailscale integration disabled."),await T()}catch(G){n(8,h=G instanceof Error?G.message:"Tailscale update failed")}finally{n(7,d=!1)}}return on(()=>{_(),T()}),[r,s,o,a,u,f,c,d,h,g,i,l,_,k,y,T,M,()=>n(8,h=""),()=>n(9,g=""),()=>M(!((f==null?void 0:f.enabled)??!1)),()=>n(4,u="")]}class QK extends Oe{constructor(e){super(),Ee(this,e,JK,KK,Se,{})}}function xK(t){let e,n;return e=new F5({props:{settingName:"enable_dns_server",label:"DNS Server",labelA:"Not running",labelB:"Running"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function eJ(t){let e,n;return e=new jr({props:{title:"DNS server",description:"Devices configured to use GateSentry DNS depend on this service for domain filtering.",$$slots:{default:[xK]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tJ(t){let e;return{c(){e=$("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function nJ(t){let e;return{c(){e=$("Services")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iJ(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[tJ]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[nJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function lJ(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[iJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rJ(t){let e,n;return e=new Nl({props:{title:"Services",description:"Control the gateway services running on this installation.",$$slots:{breadcrumb:[lJ],default:[eJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class sJ extends Oe{constructor(e){super(),Ee(this,e,null,rJ,Se,{})}}function _4(t,e,n){const i=t.slice();return i[36]=e[n],i}function p4(t,e,n){const i=t.slice();return i[39]=e[n],i}function b4(t,e,n){const i=t.slice();return i[42]=e[n],i}function v4(t){let e,n;return e=new ln({props:{kind:"error",title:t[16]("Status unavailable"),subtitle:t[6]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Status unavailable")),l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function k4(t){var uf,Pa;let e=[],n=new Map,i,l,r,s,o=t[16]("Protection")+"",a,u,f,c,d,h=(t[0].dns_running?t[16]("DNS server running"):t[16]("DNS server stopped"))+"",g,_,k,y,T=t[16]("Devices")+"",M,A,C,D=t[22](t[0].device_count)+"",R,N,G,B=t[16]("discovered on the network")+"",j,q,V,K,x=t[16]("Blocklist")+"",ie,X,ce,ae=t[22](t[0].blocked_domains)+"",ee,he,ne,re=t[16]("domains loaded")+"",oe,Re,qe,Ce,Ze=t[16]("HTTPS inspection")+"",be,Ae,ve,me,lt,De=t[16]("optional; needs the certificate")+"",vt,dt,ot,ht,Bt,Ot,Zt=t[16]("Last 24 hours")+"",Ve,Nt,Tt,Gt,fn,an,Qt,Ne=t[22]((uf=t[1])==null?void 0:uf.total)+"",pe,et,gt,Kt=t[16]("requests")+"",ze,kt,Pt,cn,qn=t[22](t[2])+"",nl,Bl,Be,Et=t[16]("blocked")+"",kn,Xe,wt,Mt,Zn,Bn,wn,_r=t[22]((Pa=t[1])==null?void 0:Pa.unique_clients)+"",_l,Jr,ji,gn=t[16]("active clients")+"",Qr,il,Xn,xt,xr,$i,Mn,yn,es,pr=t[16]("Setup")+"",ts,Rs,Ps,ns,pl,br=t[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"",_t,Ut,vi,Ns,is,ni,tr,vr=t[16]("Connect a device")+"",ls,Bs,kr,zs=t[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"",ko,Aa,zl,sf,Hs,wr=t[16]("Test from a device:")+"",wo,of,yr,La,bl,nr,Da,vl,yo,Bi,dn,rs=it(t[14]);const af=tt=>tt[42].key;for(let tt=0;tt0&&S4(t);vi=new bt({props:{size:"small",disabled:t[11]||!t[0].dns_running,$$slots:{default:[vJ]},$$scope:{ctx:t}}}),vi.$on("click",t[18]);let li=t[8]&&O4(t);return zl=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[VJ]},$$scope:{ctx:t}}}),yr=new Q1({props:{type:"single",code:`dig @${t[21]()} example.com`}}),nr=new bt({props:{kind:"tertiary",size:"small",$$slots:{default:[WJ]},$$scope:{ctx:t}}}),nr.$on("click",t[25]),vl=new bt({props:{kind:"ghost",size:"small",$$slots:{default:[jJ]},$$scope:{ctx:t}}}),vl.$on("click",t[26]),Bi=new bt({props:{kind:"ghost",size:"small",$$slots:{default:[$J]},$$scope:{ctx:t}}}),Bi.$on("click",t[27]),{c(){for(let tt=0;tt{Hl[Na]=null}),fe()),~Xn?(xt=Hl[Xn],xt?xt.p(tt,at):(xt=Hl[Xn]=Ia[Xn](tt),xt.c()),p(xt,1),xt.m(ht,null)):xt=null),(!dn||at[0]&65536)&&pr!==(pr=tt[16]("Setup")+"")&&Y(ts,pr),tt[15]?Kn?(Kn.p(tt,at),at[0]&32768&&p(Kn,1)):(Kn=T4(tt),Kn.c(),p(Kn,1),Kn.m(yn,null)):Kn&&(ue(),v(Kn,1,1,()=>{Kn=null}),fe()),tt[4].length>0?ii?(ii.p(tt,at),at[0]&16&&p(ii,1)):(ii=S4(tt),ii.c(),p(ii,1),ii.m(Mn,ns)):ii&&(ue(),v(ii,1,1,()=>{ii=null}),fe()),(!dn||at[0]&65536)&&br!==(br=tt[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"")&&Y(_t,br);const Ba={};at[0]&2049&&(Ba.disabled=tt[11]||!tt[0].dns_running),at[0]&67584|at[1]&16384&&(Ba.$$scope={dirty:at,ctx:tt}),vi.$set(Ba),tt[8]?li?(li.p(tt,at),at[0]&256&&p(li,1)):(li=O4(tt),li.c(),p(li,1),li.m(Mn,null)):li&&(ue(),v(li,1,1,()=>{li=null}),fe()),(!dn||at[0]&65536)&&vr!==(vr=tt[16]("Connect a device")+"")&&Y(ls,vr),(!dn||at[0]&65536)&&zs!==(zs=tt[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"")&&Y(ko,zs);const ff={};at[0]&65537|at[1]&16384&&(ff.$$scope={dirty:at,ctx:tt}),zl.$set(ff),(!dn||at[0]&65536)&&wr!==(wr=tt[16]("Test from a device:")+"")&&Y(wo,wr);const cf={};at[0]&65536|at[1]&16384&&(cf.$$scope={dirty:at,ctx:tt}),nr.$set(cf);const df={};at[0]&65536|at[1]&16384&&(df.$$scope={dirty:at,ctx:tt}),vl.$set(df);const On={};at[0]&65536|at[1]&16384&&(On.$$scope={dirty:at,ctx:tt}),Bi.$set(On)},i(tt){if(!dn){for(let at=0;ato[39].key;for(let o=0;oo[36].name;for(let o=0;o{u=null}),fe()),c[10]?f?(f.p(c,d),d[0]&1024&&p(f,1)):(f=A4(c),f.c(),p(f,1),f.m(e,null)):f&&(ue(),v(f,1,1,()=>{f=null}),fe())},i(c){a||(p(n.$$.fragment,c),p(u),p(f),a=!0)},o(c){v(n.$$.fragment,c),v(u),v(f),a=!1},d(c){c&&E(e),H(n),u&&u.d(),f&&f.d()}}}function kJ(t){let e=(t[8]==="ok"?t[16]("Protected"):t[16]("Not protected"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65792&&e!==(e=(i[8]==="ok"?i[16]("Protected"):i[16]("Not protected"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function M4(t){let e,n;return e=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[PJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wJ(t){let e=t[16]("Test domain")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Test domain")+"")&&Y(n,e)},d(i){i&&E(n)}}}function yJ(t){let e=t[7].domain+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].domain+"")&&Y(n,e)},d(i){i&&E(n)}}}function TJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[wJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[yJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function SJ(t){let e=t[16]("Answer")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Answer")+"")&&Y(n,e)},d(i){i&&E(n)}}}function EJ(t){let e=t[7].rcode+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].rcode+"")&&Y(n,e)},d(i){i&&E(n)}}}function OJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[SJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[EJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function C4(t){let e,n;return e=new si({props:{$$slots:{default:[AJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MJ(t){let e=t[16]("Explanation")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Explanation")+"")&&Y(n,e)},d(i){i&&E(n)}}}function CJ(t){let e=t[7].cname+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].cname+"")&&Y(n,e)},d(i){i&&E(n)}}}function AJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[MJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[CJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function LJ(t){let e=t[16]("Upstream")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream")+"")&&Y(n,e)},d(i){i&&E(n)}}}function DJ(t){let e=t[7].upstream+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].upstream+"")&&Y(n,e)},d(i){i&&E(n)}}}function IJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[LJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[DJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function RJ(t){let e,n,i,l,r,s,o;e=new si({props:{$$slots:{default:[TJ]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[OJ]},$$scope:{ctx:t}}});let a=t[7].cname&&C4(t);return s=new si({props:{$$slots:{default:[IJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),a&&a.c(),r=F(),U(s.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),a&&a.m(u,f),O(u,r,f),z(s,u,f),o=!0},p(u,f){const c={};f[0]&65664|f[1]&16384&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65664|f[1]&16384&&(d.$$scope={dirty:f,ctx:u}),i.$set(d),u[7].cname?a?(a.p(u,f),f[0]&128&&p(a,1)):(a=C4(u),a.c(),p(a,1),a.m(r.parentNode,r)):a&&(ue(),v(a,1,1,()=>{a=null}),fe());const h={};f[0]&65664|f[1]&16384&&(h.$$scope={dirty:f,ctx:u}),s.$set(h)},i(u){o||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(a),p(s.$$.fragment,u),o=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(a),v(s.$$.fragment,u),o=!1},d(u){u&&(E(n),E(l),E(r)),H(e,u),H(i,u),a&&a.d(u),H(s,u)}}}function PJ(t){let e,n;return e=new qu({props:{$$slots:{default:[RJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function A4(t){let e,n;return e=new ln({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:t[16]("Protection check failed"),subtitle:t[10]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Protection check failed")),l[0]&1024&&(r.subtitle=i[10]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function NJ(t){let e=t[16]("DNS listener")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS listener")+"")&&Y(n,e)},d(i){i&&E(n)}}}function BJ(t){let e,n=t[0].listen_addr+"",i,l,r=t[0].listen_port+"",s;return{c(){e=P("code"),i=$(n),l=$(":"),s=$(r),I(e,"class","svelte-14a5bfj")},m(o,a){O(o,e,a),w(e,i),w(e,l),w(e,s)},p(o,a){a[0]&1&&n!==(n=o[0].listen_addr+"")&&Y(i,n),a[0]&1&&r!==(r=o[0].listen_port+"")&&Y(s,r)},d(o){o&&E(e)}}}function zJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[NJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[BJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function HJ(t){let e=t[16]("Upstream resolver")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream resolver")+"")&&Y(n,e)},d(i){i&&E(n)}}}function UJ(t){let e,n=t[0].upstream+"",i;return{c(){e=P("code"),i=$(n),I(e,"class","svelte-14a5bfj")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&1&&n!==(n=l[0].upstream+"")&&Y(i,n)},d(l){l&&E(e)}}}function FJ(t){let e,n,i,l;return e=new qt({props:{noWrap:!0,$$slots:{default:[HJ]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[UJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function GJ(t){let e,n,i,l;return e=new si({props:{$$slots:{default:[zJ]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[FJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&65537|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&65537|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function VJ(t){let e,n;return e=new qu({props:{$$slots:{default:[GJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65537|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function WJ(t){let e=t[16]("Policies")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Policies")+"")&&Y(n,e)},d(i){i&&E(n)}}}function jJ(t){let e=t[16]("Devices")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Devices")+"")&&Y(n,e)},d(i){i&&E(n)}}}function $J(t){let e=t[16]("DNS settings")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS settings")+"")&&Y(n,e)},d(i){i&&E(n)}}}function qJ(t){let e,n,i,l=t[6]&&v4(t),r=t[0]&&k4(t);return{c(){l&&l.c(),e=F(),r&&r.c(),n=je()},m(s,o){l&&l.m(s,o),O(s,e,o),r&&r.m(s,o),O(s,n,o),i=!0},p(s,o){s[6]?l?(l.p(s,o),o[0]&64&&p(l,1)):(l=v4(s),l.c(),p(l,1),l.m(e.parentNode,e)):l&&(ue(),v(l,1,1,()=>{l=null}),fe()),s[0]?r?(r.p(s,o),o[0]&1&&p(r,1)):(r=k4(s),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function YJ(t){let e=t[16]("Refresh")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Refresh")+"")&&Y(n,e)},d(i){i&&E(n)}}}function ZJ(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:xq,$$slots:{default:[YJ]},$$scope:{ctx:t}}}),e.$on("click",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function XJ(t){let e,n;return e=new Nl({props:{title:t[16]("Overview"),description:t[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies."),$$slots:{actions:[ZJ],default:[qJ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Overview")),l[0]&65536&&(r.description=i[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")),l[0]&131071|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KJ(t,e,n){let i,l,r,s,o,a,u,f,c;ct(t,ti,re=>n(16,f=re)),ct(t,Ln,re=>n(29,c=re));const d=["resolver","blocklist","first_device","protection_check"];let h=null,g=null,_=null,k="",y=null,T="",M="",A="",C=!1,D=null;const R=async()=>{n(6,k="");try{n(0,h=await c.api.doCall("/onboarding/status"))}catch{n(6,k="Unable to load the gateway status.")}},N=async()=>{try{n(1,g=await c.api.doCall("/decisions/summary?days=1"))}catch{n(1,g=null)}},G=async()=>{try{const re=await c.api.doCall("/settings/enable_https_filtering");n(5,_=(re==null?void 0:re.Value)==="true")}catch{n(5,_=null)}},B=()=>Promise.all([R(),N(),G()]),j=async()=>{n(11,C=!0),n(9,M=""),n(10,A=""),n(8,T="");try{const re=await c.api.doCall("/onboarding/protection-check","post",{});n(7,y=re.check),n(8,T=re.state),n(9,M=re.detail),n(10,A=re.action||""),await R()}catch{n(8,T="failed"),n(9,M="The protection check did not complete."),n(10,A="Verify the DNS listener and upstream resolver, then retry the check.")}finally{n(11,C=!1)}},q=re=>f(re==="resolver"?"Resolver and listener":re==="blocklist"?"Blocklists loaded":re==="first_device"?"First device discovered":"Protection verified"),V=re=>h?re==="resolver"?h.resolver.detail||"":re==="blocklist"?h.blocklist.detail||"":re==="first_device"?`${h.device_count} ${f("devices discovered")}`:h.progress.first_explained_protection_at?`${f("Verified")} ${new Date(h.progress.first_explained_protection_at).toLocaleString()}`:f("Not verified yet"):"",K=re=>{const oe=[];return re.bind.state!=="ok"&&oe.push({key:"bind",title:f("DNS listener is not ready"),subtitle:[re.bind.detail,re.bind.action].filter(Boolean).join(" ")}),re.resolver.state!=="ok"&&re.resolver.action&&oe.push({key:"resolver",title:f("Upstream resolver is not reachable"),subtitle:re.resolver.action}),re.blocklist.state!=="ok"&&re.blocklist.action&&oe.push({key:"blocklist",title:f("Blocklist empty"),subtitle:re.blocklist.action}),oe},x=["","0.0.0.0","::","[::]","127.0.0.1","::1"],ie=()=>{const re=(h==null?void 0:h.listen_addr)||"";return x.includes(re)?"":re},X=re=>typeof re=="number"?re.toLocaleString():"—";on(()=>{B(),D=setInterval(N,3e4)}),Ls(()=>{D&&clearInterval(D)});const ce=()=>n(6,k=""),ae=()=>Vi("/stats"),ee=()=>Vi("/rules"),he=()=>Vi("/devices"),ne=()=>Vi("/dns");return t.$$.update=()=>{var re;t.$$.dirty[0]&1&&n(4,i=((h==null?void 0:h.steps)||[]).filter(oe=>d.includes(oe.name))),t.$$.dirty[0]&16&&n(3,l=i.findIndex(oe=>oe.state!=="ok")),t.$$.dirty[0]&24&&n(15,r=i.length>0&&l===-1),t.$$.dirty[0]&1&&n(14,s=h?K(h):[]),t.$$.dirty[0]&1&&n(13,o=!!(h!=null&&h.progress.first_explained_protection_at)),t.$$.dirty[0]&2&&n(2,a=((re=g==null?void 0:g.by_action)==null?void 0:re.block)||0),t.$$.dirty[0]&6&&n(12,u=g&&g.total>0?(a/g.total*100).toFixed(1)+"%":"—")},[h,g,a,l,i,_,k,y,T,M,A,C,u,o,s,r,f,B,j,q,V,ie,X,ce,ae,ee,he,ne]}class JJ extends Oe{constructor(e){super(),Ee(this,e,KJ,XJ,Se,{},null,[-1,-1])}}const L4="[a-fA-F\\d:]",ys=t=>t&&t.includeBoundaries?`(?:(?<=\\s|^)(?=${L4})|(?<=${L4})(?=\\s|$))`:"",Wl="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",ri="[a-fA-F\\d]{1,4}",zd=` (?: (?:${ri}:){7}(?:${ri}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8 (?:${ri}:){6}(?:${Wl}|:${ri}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4 @@ -93,9 +93,9 @@ function print() { __p += __j.call(arguments, '') } (?:${ri}:){1}(?:(?::${ri}){0,4}:${Wl}|(?::${ri}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::${ri}){0,5}:${Wl}|(?::${ri}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),QJ=new RegExp(`(?:^${Wl}$)|(?:^${zd}$)`),xJ=new RegExp(`^${Wl}$`),eQ=new RegExp(`^${zd}$`),kg=t=>t&&t.exact?QJ:new RegExp(`(?:${ys(t)}${Wl}${ys(t)})|(?:${ys(t)}${zd}${ys(t)})`,"g");kg.v4=t=>t&&t.exact?xJ:new RegExp(`${ys(t)}${Wl}${ys(t)}`,"g");kg.v6=t=>t&&t.exact?eQ:new RegExp(`${ys(t)}${zd}${ys(t)}`,"g");function tQ(t){const e=(...n)=>t(...n);return Object.defineProperty(e,"name",{value:`functionTimeout(${t.name||""})`,configurable:!0}),e}const{toString:nQ}=Object.prototype;function iQ(t){return nQ.call(t)==="[object RegExp]"}const D4={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function lQ(t,e={}){if(!iQ(t))throw new TypeError("Expected a RegExp instance");const n=Object.keys(D4).map(l=>(typeof e[l]=="boolean"?e[l]:t[l])?D4[l]:"").join(""),i=new RegExp(e.source||t.source,n);return i.lastIndex=typeof e.lastIndex=="number"?e.lastIndex:t.lastIndex,i}function rQ(t,e,{timeout:n}={}){try{return tQ(()=>lQ(t).test(e),{timeout:n})()}catch(i){throw i}}const sQ=15,oQ={timeout:400};function to(t){return t.length>sQ?!1:rQ(kg.v4({exact:!0}),t,oQ)}function I4(t){let e,n,i;function l(s){t[14](s)}let r={modalHeading:t[1],modalLabel:t[2],primaryButtonText:t[3],secondaryButtonText:t[4],primaryButtonDisabled:t[5],hasForm:t[6],shouldSubmitOnEnter:t[7],danger:t[8],size:t[9],preventCloseOnClickOutside:t[10],$$slots:{default:[aQ]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.open=t[0]),e=new xT({props:r}),xe.push(()=>At(e,"open",l)),e.$on("submit",t[15]),e.$on("click:button--secondary",t[12]),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&2&&(a.modalHeading=s[1]),o&4&&(a.modalLabel=s[2]),o&8&&(a.primaryButtonText=s[3]),o&16&&(a.secondaryButtonText=s[4]),o&32&&(a.primaryButtonDisabled=s[5]),o&64&&(a.hasForm=s[6]),o&128&&(a.shouldSubmitOnEnter=s[7]),o&256&&(a.danger=s[8]),o&512&&(a.size=s[9]),o&1024&&(a.preventCloseOnClickOutside=s[10]),o&131072&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.open=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function aQ(t){let e;const n=t[13].default,i=He(n,t,t[17],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&131072)&&Fe(i,n,l,l[17],e?Ue(n,l[17],r,null):Ge(l[17]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function uQ(t){let e,n,i=t[0]&&I4(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[0]?i?(i.p(l,r),r&1&&p(i,1)):(i=I4(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function fQ(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{title:s=""}=e,{label:o=""}=e,{primaryButtonText:a=""}=e,{secondaryButtonText:u=""}=e,{primaryButtonDisabled:f=!1}=e,{hasForm:c=!1}=e,{shouldSubmitOnEnter:d=!1}=e,{danger:h=!1}=e,{size:g=void 0}=e,{preventCloseOnClickOutside:_=!1}=e;const k=on(),y=()=>{n(0,r=!1),k("close")};function T(C){r=C,n(0,r)}const M=()=>k("submit"),A=()=>k("close");return t.$$set=C=>{"open"in C&&n(0,r=C.open),"title"in C&&n(1,s=C.title),"label"in C&&n(2,o=C.label),"primaryButtonText"in C&&n(3,a=C.primaryButtonText),"secondaryButtonText"in C&&n(4,u=C.secondaryButtonText),"primaryButtonDisabled"in C&&n(5,f=C.primaryButtonDisabled),"hasForm"in C&&n(6,c=C.hasForm),"shouldSubmitOnEnter"in C&&n(7,d=C.shouldSubmitOnEnter),"danger"in C&&n(8,h=C.danger),"size"in C&&n(9,g=C.size),"preventCloseOnClickOutside"in C&&n(10,_=C.preventCloseOnClickOutside),"$$scope"in C&&n(17,l=C.$$scope)},[r,s,o,a,u,f,c,d,h,g,_,k,y,i,T,M,A,l]}class Uc extends Oe{constructor(e){super(),Ee(this,e,fQ,uQ,Se,{open:0,title:1,label:2,primaryButtonText:3,secondaryButtonText:4,primaryButtonDisabled:5,hasForm:6,shouldSubmitOnEnter:7,danger:8,size:9,preventCloseOnClickOutside:10})}}function R4(t){let e,n;return e=new nn({props:{kind:"error",title:t[9]("Custom records unavailable"),subtitle:t[3]}}),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.title=i[9]("Custom records unavailable")),l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function cQ(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[10],rows:t[0],$$slots:{cell:[vQ,({row:l,cell:r})=>({27:l,28:r}),({row:l,cell:r})=>(l?134217728:0)|(r?268435456:0)],default:[gQ]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","table-region svelte-7gav5a")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&1&&(s.rows=l[0]),r&939524737&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function dQ(t){let e,n;return e=new hi({props:{state:"empty",title:t[9]("No custom records"),message:t[9]("Add a record when a local domain should resolve to a specific IPv4 address."),$$slots:{default:[wQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.title=i[9]("No custom records")),l&512&&(r.message=i[9]("Add a record when a local domain should resolve to a specific IPv4 address.")),l&536871424&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function hQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[9]("Loading custom DNS records…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.message=i[9]("Loading custom DNS records…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mQ(t){let e,n;return e=new hg({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function gQ(t){let e,n;return e=new dg({props:{size:"sm",$$slots:{default:[mQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536870912&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _Q(t){let e=t[28].value+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&268435456&&e!==(e=i[28].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function pQ(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[9]("Record actions"),$$slots:{default:[bQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.iconDescription=i[9]("Record actions")),l&671089281&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bQ(t){let e,n,i,l;function r(){return t[17](t[27])}e=new Al({props:{text:t[9]("Edit")}}),e.$on("click",r);function s(){return t[18](t[27])}return i=new Al({props:{danger:!0,text:t[9]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a&512&&(u.text=t[9]("Edit")),e.$set(u);const f={};a&512&&(f.text=t[9]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function vQ(t){let e,n,i,l;const r=[pQ,_Q],s=[];function o(a,u){return a[28].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function kQ(t){let e=t[9]("Add record")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&512&&e!==(e=i[9]("Add record")+"")&&Y(n,e)},d(i){i&&E(n)}}}function wQ(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[kQ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871424&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function yQ(t){let e,n,i,l,r,s=t[3]&&R4(t);const o=[hQ,dQ,cQ],a=[];function u(f,c){return f[1]&&f[0].length===0?0:f[0].length===0?1:2}return n=u(t),i=a[n]=o[n](t),{c(){s&&s.c(),e=F(),i.c(),l=je()},m(f,c){s&&s.m(f,c),O(f,e,c),a[n].m(f,c),O(f,l,c),r=!0},p(f,c){f[3]?s?(s.p(f,c),c&8&&p(s,1)):(s=R4(f),s.c(),p(s,1),s.m(e.parentNode,e)):s&&(ue(),v(s,1,1,()=>{s=null}),fe());let d=n;n=u(f),n===d?a[n].p(f,c):(ue(),v(a[d],1,1,()=>{a[d]=null}),fe(),i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),p(i,1),i.m(l.parentNode,l))},i(f){r||(p(s),p(i),r=!0)},o(f){v(s),v(i),r=!1},d(f){f&&(E(e),E(l)),s&&s.d(f),a[n].d(f)}}}function TQ(t){let e=t[9]("Add record")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&512&&e!==(e=i[9]("Add record")+"")&&Y(n,e)},d(i){i&&E(n)}}}function SQ(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[TQ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871424&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function EQ(t){let e,n,i,l,r,s,o;function a(d){t[19](d)}let u={labelText:t[9]("Domain"),type:"text",placeholder:"printer.home",disabled:t[2]};t[4]!==void 0&&(u.value=t[4]),n=new ei({props:u}),xe.push(()=>At(n,"value",a));function f(d){t[20](d)}let c={labelText:t[9]("IPv4 address"),helperText:t[5]&&!to(t[5].trim())?t[9]("Enter a valid IPv4 address."):"",invalid:!!t[5]&&!to(t[5].trim()),invalidText:t[9]("Enter a valid IPv4 address."),type:"text",placeholder:"192.168.1.20",disabled:t[2]};return t[5]!==void 0&&(c.value=t[5]),r=new ei({props:c}),xe.push(()=>At(r,"value",f)),{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),I(e,"class","record-form svelte-7gav5a")},m(d,h){O(d,e,h),z(n,e,null),w(e,l),z(r,e,null),o=!0},p(d,h){const g={};h&512&&(g.labelText=d[9]("Domain")),h&4&&(g.disabled=d[2]),!i&&h&16&&(i=!0,g.value=d[4],Ct(()=>i=!1)),n.$set(g);const _={};h&512&&(_.labelText=d[9]("IPv4 address")),h&544&&(_.helperText=d[5]&&!to(d[5].trim())?d[9]("Enter a valid IPv4 address."):""),h&32&&(_.invalid=!!d[5]&&!to(d[5].trim())),h&512&&(_.invalidText=d[9]("Enter a valid IPv4 address.")),h&4&&(_.disabled=d[2]),!s&&h&32&&(s=!0,_.value=d[5],Ct(()=>s=!1)),r.$set(_)},i(d){o||(p(n.$$.fragment,d),p(r.$$.fragment,d),o=!0)},o(d){v(n.$$.fragment,d),v(r.$$.fragment,d),o=!1},d(d){d&&E(e),H(n),H(r)}}}function OQ(t){var c;let e,n=t[9]("GateSentry will stop resolving")+"",i,l,r,s=(((c=t[7])==null?void 0:c.domain)??"")+"",o,a,u=t[9]("to the configured local address.")+"",f;return{c(){e=P("p"),i=j(n),l=F(),r=P("strong"),o=j(s),a=F(),f=j(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h&512&&n!==(n=d[9]("GateSentry will stop resolving")+"")&&Y(i,n),h&128&&s!==(s=(((g=d[7])==null?void 0:g.domain)??"")+"")&&Y(o,s),h&512&&u!==(u=d[9]("to the configured local address.")+"")&&Y(f,u)},d(d){d&&E(e)}}}function MQ(t){let e,n,i,l,r,s,o;e=new jr({props:{title:t[9]("Custom A records"),description:t[9]("Resolve selected domains to local IPv4 addresses before using the upstream resolver."),$$slots:{actions:[SQ],default:[yQ]},$$scope:{ctx:t}}});function a(f){t[21](f)}let u={title:t[6]==null?t[9]("Add custom record"):t[9]("Edit custom record"),label:t[9]("DNS"),primaryButtonText:t[2]?t[9]("Saving…"):t[9]("Save record"),secondaryButtonText:t[9]("Cancel"),primaryButtonDisabled:!t[4].trim()||!to(t[5].trim())||t[2],hasForm:!0,shouldSubmitOnEnter:!0,preventCloseOnClickOutside:t[2],$$slots:{default:[EQ]},$$scope:{ctx:t}};return t[8]!==void 0&&(u.open=t[8]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("submit",t[14]),i.$on("close",t[11]),s=new Zu({props:{open:t[7]!=null,title:t[9]("Delete custom DNS record?"),label:t[9]("DNS"),confirmText:t[9]("Delete record"),cancelText:t[9]("Cancel"),danger:!0,busy:t[2],$$slots:{default:[OQ]},$$scope:{ctx:t}}}),s.$on("submit",t[15]),s.$on("close",t[22]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,[c]){const d={};c&512&&(d.title=f[9]("Custom A records")),c&512&&(d.description=f[9]("Resolve selected domains to local IPv4 addresses before using the upstream resolver.")),c&536871563&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c&576&&(h.title=f[6]==null?f[9]("Add custom record"):f[9]("Edit custom record")),c&512&&(h.label=f[9]("DNS")),c&516&&(h.primaryButtonText=f[2]?f[9]("Saving…"):f[9]("Save record")),c&512&&(h.secondaryButtonText=f[9]("Cancel")),c&52&&(h.primaryButtonDisabled=!f[4].trim()||!to(f[5].trim())||f[2]),c&4&&(h.preventCloseOnClickOutside=f[2]),c&536871476&&(h.$$scope={dirty:c,ctx:f}),!l&&c&256&&(l=!0,h.open=f[8],Ct(()=>l=!1)),i.$set(h);const g={};c&128&&(g.open=f[7]!=null),c&512&&(g.title=f[9]("Delete custom DNS record?")),c&512&&(g.label=f[9]("DNS")),c&512&&(g.confirmText=f[9]("Delete record")),c&512&&(g.cancelText=f[9]("Cancel")),c&4&&(g.busy=f[2]),c&536871552&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}const P4="/dns/custom_entries";function CQ(t,e,n){let i,l;ct(t,ti,K=>n(9,i=K)),ct(t,Ln,K=>n(23,l=K));const r=on(),s=[{key:"domain",value:i("Domain")},{key:"ip",value:i("IP address")},{key:"actions",value:i("Actions")}];let o=[],a=!0,u=!1,f="",c="",d="",h=null,g=null,_=!1;const k=async()=>{n(1,a=!0),n(3,f="");try{const K=await l.api.doCall(P4),x=Array.isArray(K==null?void 0:K.data)?K.data:[];n(0,o=x.map((ie,X)=>({id:X+1,domain:String(ie.domain??""),ip:String(ie.ip??"")})))}catch(K){n(3,f=K instanceof Error&&K.message?K.message:i("Custom DNS records could not be loaded."))}finally{n(1,a=!1)}},y=()=>{n(8,_=!1),n(6,h=null),n(4,c=""),n(5,d="")},T=()=>{y(),n(8,_=!0)},M=K=>{const x=o.find(ie=>ie.id===K);x&&(n(6,h=K),n(4,c=x.domain),n(5,d=x.ip),n(8,_=!0))},A=async K=>{if(u)return!1;n(2,u=!0);try{const x=K.map(({domain:X,ip:ce})=>({domain:X,ip:ce})),ie=await l.api.doCall(P4,"post",x,{"Content-Type":"application/json"});if(!(ie!=null&&ie.ok))throw new Error((ie==null?void 0:ie.error)||i("The DNS records were not accepted."));return Ei.add(Ma({title:i("DNS records updated"),subtitle:i("Custom A records were saved.")},i)),r("updatednsinfo"),await k(),!0}catch(x){return Ei.add(Ss({title:i("DNS records not saved"),subtitle:x instanceof Error&&x.message?x.message:i("Custom DNS records could not be saved.")},i)),!1}finally{n(2,u=!1)}},C=async()=>{const K=c.trim(),x=d.trim();if(!K||!to(x)||u)return;const ie=h==null?[...o,{id:o.length+1,domain:K,ip:x}]:o.map(X=>X.id===h?{...X,domain:K,ip:x}:X);await A(ie)&&y()},D=async()=>{if(!g||u)return;const K=g;await A(o.filter(ie=>ie.id!==K.id))&&n(7,g=null)};sn(k);const R=()=>n(3,f=""),N=K=>M(K.id),G=K=>n(7,g=o.find(x=>x.id===K.id)??null);function B(K){c=K,n(4,c)}function $(K){d=K,n(5,d)}function q(K){_=K,n(8,_)}return[o,a,u,f,c,d,h,g,_,i,s,y,T,M,C,D,R,N,G,B,$,q,()=>n(7,g=null)]}class AQ extends Oe{constructor(e){super(),Ee(this,e,CQ,MQ,Se,{})}}function LQ(t){let e=t[10]("Browse compatible lists")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Browse compatible lists")+"")&&Y(n,e)},d(i){i&&E(n)}}}function DQ(t){let e;return{c(){e=j("0.0.0.0 domain.com")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function IQ(t){let e;return{c(){e=j("domain.com")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function N4(t){let e,n;return e=new nn({props:{kind:"error",title:t[10]("Block lists unavailable"),subtitle:t[4]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.title=i[10]("Block lists unavailable")),l&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function RQ(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[11],rows:t[9],$$slots:{cell:[UQ,({row:l,cell:r})=>({27:l,28:r}),({row:l,cell:r})=>(l?134217728:0)|(r?268435456:0)]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","table-region svelte-1u70jgc")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&512&&(s.rows=l[9]),r&939525696&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function PQ(t){let e,n;return e=new hi({props:{state:"empty",title:t[10]("No block-list sources"),message:t[10]("Add a compatible HTTP or HTTPS list to begin blocking its domains."),$$slots:{default:[GQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.title=i[10]("No block-list sources")),l&1024&&(r.message=i[10]("Add a compatible HTTP or HTTPS list to begin blocking its domains.")),l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function NQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[10]("Loading DNS block lists…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.message=i[10]("Loading DNS block lists…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function BQ(t){let e,n=t[28].value+"",i;return{c(){e=P("span"),i=j(n),I(e,"class","url-cell svelte-1u70jgc")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&268435456&&n!==(n=l[28].value+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function zQ(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[10]("Block-list actions"),$$slots:{default:[HQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.iconDescription=i[10]("Block-list actions")),l&671090240&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function HQ(t){let e,n,i,l;function r(){return t[18](t[27])}e=new Al({props:{text:t[10]("Edit")}}),e.$on("click",r);function s(){return t[19](t[27])}return i=new Al({props:{danger:!0,text:t[10]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a&1024&&(u.text=t[10]("Edit")),e.$set(u);const f={};a&1024&&(f.text=t[10]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function UQ(t){let e,n,i,l;const r=[zQ,BQ],s=[];function o(a,u){return a[28].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function FQ(t){let e=t[10]("Add block list")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Add block list")+"")&&Y(n,e)},d(i){i&&E(n)}}}function GQ(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[FQ]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function VQ(t){let e,n,i=t[10]("Each source may contain either hosts-file entries or one domain per line.")+"",l,r,s,o,a,u,f,c,d,h,g,_,k,y,T;s=new UT({props:{href:"https://github.com/hagezi/dns-blocklists#fake",target:"_blank",inline:!0,$$slots:{default:[LQ]},$$scope:{ctx:t}}}),u=new Q1({props:{type:"single",$$slots:{default:[DQ]},$$scope:{ctx:t}}}),c=new Q1({props:{type:"single",$$slots:{default:[IQ]},$$scope:{ctx:t}}});let M=t[4]&&N4(t);const A=[NQ,PQ,RQ],C=[];function D(R,N){return R[2]&&R[0].length===0?0:R[0].length===0?1:2}return _=D(t),k=C[_]=A[_](t),{c(){e=P("div"),n=P("p"),l=j(i),r=F(),U(s.$$.fragment),o=F(),a=P("div"),U(u.$$.fragment),f=F(),U(c.$$.fragment),h=F(),M&&M.c(),g=F(),k.c(),y=je(),I(n,"class","svelte-1u70jgc"),I(a,"class","format-examples svelte-1u70jgc"),I(a,"aria-label",d=t[10]("Supported block-list formats")),I(e,"class","format-guidance svelte-1u70jgc")},m(R,N){O(R,e,N),w(e,n),w(n,l),w(n,r),z(s,n,null),w(e,o),w(e,a),z(u,a,null),w(a,f),z(c,a,null),O(R,h,N),M&&M.m(R,N),O(R,g,N),C[_].m(R,N),O(R,y,N),T=!0},p(R,N){(!T||N&1024)&&i!==(i=R[10]("Each source may contain either hosts-file entries or one domain per line.")+"")&&Y(l,i);const G={};N&536871936&&(G.$$scope={dirty:N,ctx:R}),s.$set(G);const B={};N&536870912&&(B.$$scope={dirty:N,ctx:R}),u.$set(B);const $={};N&536870912&&($.$$scope={dirty:N,ctx:R}),c.$set($),(!T||N&1024&&d!==(d=R[10]("Supported block-list formats")))&&I(a,"aria-label",d),R[4]?M?(M.p(R,N),N&16&&p(M,1)):(M=N4(R),M.c(),p(M,1),M.m(g.parentNode,g)):M&&(ue(),v(M,1,1,()=>{M=null}),fe());let q=_;_=D(R),_===q?C[_].p(R,N):(ue(),v(C[q],1,1,()=>{C[q]=null}),fe(),k=C[_],k?k.p(R,N):(k=C[_]=A[_](R),k.c()),p(k,1),k.m(y.parentNode,y))},i(R){T||(p(s.$$.fragment,R),p(u.$$.fragment,R),p(c.$$.fragment,R),p(M),p(k),T=!0)},o(R){v(s.$$.fragment,R),v(u.$$.fragment,R),v(c.$$.fragment,R),v(M),v(k),T=!1},d(R){R&&(E(e),E(h),E(g),E(y)),H(s),H(u),H(c),M&&M.d(R),C[_].d(R)}}}function WQ(t){let e=t[10]("Add block list")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Add block list")+"")&&Y(n,e)},d(i){i&&E(n)}}}function jQ(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[WQ]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $Q(t){let e,n,i;function l(s){t[20](s)}let r={labelText:t[10]("Block-list URL"),helperText:t[10]("Use a complete HTTP or HTTPS URL to a plain-text domain list."),invalid:!!t[1]&&!t[8],invalidText:t[10]("Enter a complete HTTP or HTTPS URL."),type:"url",placeholder:"https://example.org/blocklist.txt",disabled:t[3]};return t[1]!==void 0&&(r.value=t[1]),e=new ei({props:r}),xe.push(()=>At(e,"value",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&1024&&(a.labelText=s[10]("Block-list URL")),o&1024&&(a.helperText=s[10]("Use a complete HTTP or HTTPS URL to a plain-text domain list.")),o&258&&(a.invalid=!!s[1]&&!s[8]),o&1024&&(a.invalidText=s[10]("Enter a complete HTTP or HTTPS URL.")),o&8&&(a.disabled=s[3]),!n&&o&2&&(n=!0,a.value=s[1],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function qQ(t){var u;let e,n=t[10]("GateSentry will stop downloading and applying")+"",i,l,r,s=(((u=t[6])==null?void 0:u.content)??"")+"",o,a;return{c(){e=P("p"),i=j(n),l=F(),r=P("strong"),o=j(s),a=j(".")},m(f,c){O(f,e,c),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a)},p(f,c){var d;c&1024&&n!==(n=f[10]("GateSentry will stop downloading and applying")+"")&&Y(i,n),c&64&&s!==(s=(((d=f[6])==null?void 0:d.content)??"")+"")&&Y(o,s)},d(f){f&&E(e)}}}function YQ(t){let e,n,i,l,r,s,o;e=new jr({props:{title:t[10]("DNS block lists"),description:t[10]("GateSentry downloads these domain lists and applies them to DNS requests from every protected client."),$$slots:{actions:[jQ],default:[VQ]},$$scope:{ctx:t}}});function a(f){t[21](f)}let u={title:t[5]==null?t[10]("Add DNS block list"):t[10]("Edit DNS block list"),label:t[10]("DNS"),primaryButtonText:t[3]?t[10]("Saving…"):t[10]("Save block list"),secondaryButtonText:t[10]("Cancel"),primaryButtonDisabled:!t[8]||t[3],hasForm:!0,shouldSubmitOnEnter:!0,preventCloseOnClickOutside:t[3],$$slots:{default:[$Q]},$$scope:{ctx:t}};return t[7]!==void 0&&(u.open=t[7]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("submit",t[15]),i.$on("close",t[12]),s=new Zu({props:{open:t[6]!=null,title:t[10]("Remove DNS block list?"),label:t[10]("DNS"),confirmText:t[10]("Remove block list"),cancelText:t[10]("Cancel"),danger:!0,busy:t[3],$$slots:{default:[qQ]},$$scope:{ctx:t}}}),s.$on("submit",t[16]),s.$on("close",t[22]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,[c]){const d={};c&1024&&(d.title=f[10]("DNS block lists")),c&1024&&(d.description=f[10]("GateSentry downloads these domain lists and applies them to DNS requests from every protected client.")),c&536872533&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c&1056&&(h.title=f[5]==null?f[10]("Add DNS block list"):f[10]("Edit DNS block list")),c&1024&&(h.label=f[10]("DNS")),c&1032&&(h.primaryButtonText=f[3]?f[10]("Saving…"):f[10]("Save block list")),c&1024&&(h.secondaryButtonText=f[10]("Cancel")),c&264&&(h.primaryButtonDisabled=!f[8]||f[3]),c&8&&(h.preventCloseOnClickOutside=f[3]),c&536872202&&(h.$$scope={dirty:c,ctx:f}),!l&&c&128&&(l=!0,h.open=f[7],Ct(()=>l=!1)),i.$set(h);const g={};c&64&&(g.open=f[6]!=null),c&1024&&(g.title=f[10]("Remove DNS block list?")),c&1024&&(g.label=f[10]("DNS")),c&1024&&(g.confirmText=f[10]("Remove block list")),c&1024&&(g.cancelText=f[10]("Cancel")),c&8&&(g.busy=f[3]),c&536872e3&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}function ZQ(t,e,n){let i,l,r,s;ct(t,ti,K=>n(10,r=K)),ct(t,Ln,K=>n(23,s=K));const o=on(),a=[{key:"content",value:r("Block-list URL")},{key:"actions",value:r("Actions")}];let u=[],f=!0,c=!1,d="",h=null,g="",_=null,k=!1;const y=async()=>{n(2,f=!0),n(4,d="");try{const K=await s.api.getSetting("dns_custom_entries"),x=JSON.parse((K==null?void 0:K.Value)||"[]");n(0,u=Array.isArray(x)?x.map(String):[])}catch(K){n(0,u=[]),n(4,d=K instanceof Error&&K.message?K.message:r("DNS block lists could not be loaded."))}finally{n(2,f=!1)}},T=()=>{n(7,k=!1),n(5,h=null),n(1,g="")},M=()=>{T(),n(7,k=!0)},A=K=>{const x=u[K];x!=null&&(n(5,h=K),n(1,g=x),n(7,k=!0))},C=async K=>{if(c)return!1;n(3,c=!0);try{if(await s.api.setSetting("dns_custom_entries",JSON.stringify(K))===!1)throw new Error(r("The block-list setting was rejected."));return n(0,u=K),o("updatednsinfo"),Ei.add(Ma({title:r("Block lists updated"),subtitle:r("DNS block-list sources were saved.")},r)),!0}catch(x){return Ei.add(Ss({title:r("Block lists not saved"),subtitle:x instanceof Error&&x.message?x.message:r("Unable to save block lists.")},r)),!1}finally{n(3,c=!1)}},D=async()=>{const K=g.trim();if(!l||c)return;const x=h==null?[...u,K]:u.map((ie,X)=>X===h?K:ie);await C(x)&&T()},R=async()=>{if(!_||c)return;const K=_;await C(u.filter((x,ie)=>ie!==K.id))&&n(6,_=null)};sn(y);const N=()=>n(4,d=""),G=K=>A(Number(K.id)),B=K=>n(6,_=i.find(x=>x.id===Number(K.id))??null);function $(K){g=K,n(1,g)}function q(K){k=K,n(7,k)}const V=()=>n(6,_=null);return t.$$.update=()=>{t.$$.dirty&1&&n(9,i=u.map((K,x)=>({id:x,content:K}))),t.$$.dirty&2&&n(8,l=/^https?:\/\/\S+$/i.test(g.trim()))},[u,g,f,c,d,h,_,k,l,i,r,a,T,M,A,D,R,N,G,B,$,q,V]}class XQ extends Oe{constructor(e){super(),Ee(this,e,ZQ,YQ,Se,{})}}function B4(t){let e,n;return e=new nn({props:{kind:"error",title:t[4]("DNS status unavailable"),subtitle:t[3]}}),e.$on("close",t[8]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS status unavailable")),l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KQ(t){let e,n,i,l=t[4]("Blocked domains")+"",r,s,o,a=(t[0].number_domains_blocked??0)+"",u,f,c,d,h=t[4]("Last updated")+"",g,_,k,y=t[6](t[0].last_updated)+"",T,M,A,C,D=t[4]("Next update")+"",R,N,G,B=t[6](t[0].next_update)+"",$;return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=j(l),s=F(),o=P("dd"),u=j(a),f=F(),c=P("div"),d=P("dt"),g=j(h),_=F(),k=P("dd"),T=j(y),M=F(),A=P("div"),C=P("dt"),R=j(D),N=F(),G=P("dd"),$=j(B),I(i,"class","svelte-1m4hl0s"),I(o,"class","svelte-1m4hl0s"),I(n,"class","svelte-1m4hl0s"),I(d,"class","svelte-1m4hl0s"),I(k,"class","svelte-1m4hl0s"),I(c,"class","svelte-1m4hl0s"),I(C,"class","svelte-1m4hl0s"),I(G,"class","svelte-1m4hl0s"),I(A,"class","svelte-1m4hl0s"),I(e,"class","status-list svelte-1m4hl0s")},m(q,V){O(q,e,V),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(n,f),w(e,c),w(c,d),w(d,g),w(c,_),w(c,k),w(k,T),w(c,M),w(e,A),w(A,C),w(C,R),w(A,N),w(A,G),w(G,$)},p(q,V){V&16&&l!==(l=q[4]("Blocked domains")+"")&&Y(r,l),V&1&&a!==(a=(q[0].number_domains_blocked??0)+"")&&Y(u,a),V&16&&h!==(h=q[4]("Last updated")+"")&&Y(g,h),V&1&&y!==(y=q[6](q[0].last_updated)+"")&&Y(T,y),V&16&&D!==(D=q[4]("Next update")+"")&&Y(R,D),V&1&&B!==(B=q[6](q[0].next_update)+"")&&Y($,B)},i:_e,o:_e,d(q){q&&E(e)}}}function JQ(t){let e,n;return e=new hi({props:{state:"error",title:t[4]("DNS status is unavailable"),message:t[3]||t[4]("Try refreshing after the DNS service is ready."),retryLabel:t[4]("Retry"),onRetry:t[5]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS status is unavailable")),l&24&&(r.message=i[3]||i[4]("Try refreshing after the DNS service is ready.")),l&16&&(r.retryLabel=i[4]("Retry")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function QQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[4]("Loading DNS status…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.message=i[4]("Loading DNS status…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xQ(t){let e,n,i,l;const r=[QQ,JQ,KQ],s=[];function o(a,u){return a[1]&&!a[0]?0:a[0]?2:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function ex(t){let e,n;return e=new Ql({props:{keyName:"dns_resolver",title:t[4]("DNS resolver"),labelText:t[4]("DNS resolver"),type:"text",helperText:t[4]("Enter an IP address or resolver address reachable from this gateway.")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS resolver")),l&16&&(r.labelText=i[4]("DNS resolver")),l&16&&(r.helperText=i[4]("Enter an IP address or resolver address reachable from this gateway.")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tx(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[3]&&B4(t);return l=new jr({props:{title:t[4]("DNS status"),description:t[4]("Block-list totals and update schedule reported by the running DNS service."),$$slots:{default:[xQ]},$$scope:{ctx:t}}}),s=new jr({props:{title:t[4]("Upstream resolver"),description:t[4]("Choose the DNS server GateSentry asks after applying local records and block lists."),$$slots:{default:[ex]},$$scope:{ctx:t}}}),a=new AQ({}),a.$on("updatednsinfo",t[7]),f=new XQ({}),f.$on("updatednsinfo",t[7]),{c(){d&&d.c(),e=F(),n=P("div"),i=P("div"),U(l.$$.fragment),r=F(),U(s.$$.fragment),o=F(),U(a.$$.fragment),u=F(),U(f.$$.fragment),I(i,"class","dns-column svelte-1m4hl0s"),I(n,"class","dns-grid svelte-1m4hl0s")},m(h,g){d&&d.m(h,g),O(h,e,g),O(h,n,g),w(n,i),z(l,i,null),w(i,r),z(s,i,null),w(i,o),z(a,i,null),w(n,u),z(f,n,null),c=!0},p(h,g){h[3]?d?(d.p(h,g),g&8&&p(d,1)):(d=B4(h),d.c(),p(d,1),d.m(e.parentNode,e)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const _={};g&16&&(_.title=h[4]("DNS status")),g&16&&(_.description=h[4]("Block-list totals and update schedule reported by the running DNS service.")),g&4123&&(_.$$scope={dirty:g,ctx:h}),l.$set(_);const k={};g&16&&(k.title=h[4]("Upstream resolver")),g&16&&(k.description=h[4]("Choose the DNS server GateSentry asks after applying local records and block lists.")),g&4112&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){c||(p(d),p(l.$$.fragment,h),p(s.$$.fragment,h),p(a.$$.fragment,h),p(f.$$.fragment,h),c=!0)},o(h){v(d),v(l.$$.fragment,h),v(s.$$.fragment,h),v(a.$$.fragment,h),v(f.$$.fragment,h),c=!1},d(h){h&&(E(e),E(n)),d&&d.d(h),H(l),H(s),H(a),H(f)}}}function nx(t){let e=t[4]("Dashboard")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function ix(t){let e=t[4]("DNS server")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("DNS server")+"")&&Y(n,e)},d(i){i&&E(n)}}}function lx(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[nx]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[ix]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&4112&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&4112&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function rx(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[lx]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4112&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sx(t){let e=(t[2]?t[4]("Refreshing…"):t[4]("Refresh status"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&20&&e!==(e=(i[2]?i[4]("Refreshing…"):i[4]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function ox(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[2],$$slots:{default:[sx]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.disabled=i[2]),l&4116&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ax(t){let e,n;return e=new Nl({props:{title:t[4]("DNS server"),description:t[4]("Review DNS block-list health, choose an upstream resolver, and manage local names and list sources."),$$slots:{actions:[ox],breadcrumb:[rx],default:[tx]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&16&&(r.title=i[4]("DNS server")),l&16&&(r.description=i[4]("Review DNS block-list health, choose an upstream resolver, and manage local names and list sources.")),l&4127&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ux(t,e,n){let i,l;ct(t,ti,_=>n(4,i=_)),ct(t,Ln,_=>n(11,l=_));let r=null,s=!0,o=!1,a="",u=null,f=!1;const c=async()=>{if(!(o||f)){n(2,o=!0),n(3,a="");try{n(0,r=await l.api.doCall("/dns/info"))}catch(_){n(3,a=_ instanceof Error&&_.message?_.message:i("DNS status could not be loaded."))}finally{n(1,s=!1),n(2,o=!1)}}},d=_=>{if(!_)return i("Not scheduled");const k=new Date(_*1e3);return Number.isNaN(k.getTime())?i("Unknown"):k.toLocaleString()},h=()=>{n(0,r=null),n(1,s=!0),u&&clearTimeout(u),u=setTimeout(()=>{u=null,c()},3e3)};return sn(c),Ls(()=>{f=!0,u&&clearTimeout(u)}),[r,s,o,a,i,c,d,h,()=>n(3,a="")]}class fx extends Oe{constructor(e){super(),Ee(this,e,ux,ax,Se,{})}}var G5=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(G5||{}),V5=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(V5||{}),W5=(t=>(t.UPDATE="model-update",t))(W5||{}),j5=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t))(j5||{}),$5=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))($5||{}),q5=(t=>(t.CHANGE="zoom-domain-change",t))(q5||{}),Y5=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(Y5||{}),Z5=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(Z5||{}),X5=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(X5||{}),K5=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(K5||{}),J5=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(J5||{}),Q5=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(Q5||{}),x5=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(x5||{}),eS=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(eS||{}),tS=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(tS||{}),nS=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(nS||{}),iS=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(iS||{}),lS=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(lS||{}),rS=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(rS||{}),sS=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(sS||{}),oS=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(oS||{}),aS=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(aS||{}),uS=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(uS||{}),fS=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(fS||{}),cS=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(cS||{}),dS=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(dS||{}),hS=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(hS||{});const cx=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:fS,Area:X5,Axis:Z5,Bar:x5,Boxplot:eS,CanvasZoom:Y5,Chart:G5,Choropleth:hS,CirclePack:uS,Gauge:Q5,Heatmap:dS,Legend:aS,Line:nS,Meter:cS,Modal:V5,Model:W5,Pie:J5,Radar:iS,Scatter:tS,Threshold:oS,Toolbar:j5,Tooltip:sS,Tree:lS,Treemap:rS,WordCloud:K5,ZoomBar:$5,ZoomDomain:q5},Symbol.toStringTag,{value:"Module"})),$e=cx;var vn=(t=>(t.HTML="html",t.SVG="svg",t))(vn||{}),mS=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(mS||{}),Oi=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(Oi||{}),Qe=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(Qe||{}),or=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(or||{}),Zl=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(Zl||{}),tl=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(tl||{}),St=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(St||{}),ku=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(ku||{}),Il=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(Il||{}),Au=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(Au||{}),gS=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(gS||{}),fi=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(fi||{}),In=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(In||{}),Hd=(t=>(t.CENTER="center",t))(Hd||{}),$o=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))($o||{}),_S=(t=>(t.SEMI="semi",t.FULL="full",t))(_S||{}),mc=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(mc||{}),ks=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(ks||{}),Vn=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(Vn||{}),gm=(t=>(t.LEFT="left",t.RIGHT="right",t))(gm||{}),_i=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(_i||{}),pS=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(pS||{}),wg=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(wg||{}),bS=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(bS||{});function gc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function dx(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function yg(t){let e,n,i;t.length!==2?(e=gc,n=(o,a)=>gc(t(o),a),i=(o,a)=>t(o)-a):(e=t===gc||t===dx?t:hx,n=t,i=t);function l(o,a,u=0,f=o.length){if(u>>1;n(o[c],a)<0?u=c+1:f=c}while(u>>1;n(o[c],a)<=0?u=c+1:f=c}while(uu&&i(o[c-1],a)>-i(o[c],a)?c-1:c}return{left:l,center:s,right:r}}function hx(){return 0}function mx(t){return t===null?NaN:+t}const gx=yg(gc),_x=gx.right;yg(mx).center;const vS=_x;function px(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(l=+l)>=l&&++n}return n}function xo(t,e){let n,i;if(e===void 0)for(const l of t)l!=null&&(n===void 0?l>=l&&(n=i=l):(n>l&&(n=l),i=r&&(n=i=r):(n>r&&(n=r),it}const Sx=Math.sqrt(50),Ex=Math.sqrt(10),Ox=Math.sqrt(2);function Fc(t,e,n){const i=(e-t)/Math.max(0,n),l=Math.floor(Math.log10(i)),r=i/Math.pow(10,l),s=r>=Sx?10:r>=Ex?5:r>=Ox?2:1;let o,a,u;return l<0?(u=Math.pow(10,-l)/s,o=Math.round(t*u),a=Math.round(e*u),o/ue&&--a,u=-u):(u=Math.pow(10,l)*s,o=Math.round(t/u),a=Math.round(e/u),o*ue&&--a),a0))return[];if(t===e)return[t];const i=e=l))return[];const o=r-l+1,a=new Array(o);if(i)if(s<0)for(let u=0;u0?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):l<0&&(t=Math.ceil(t*l)/l,e=Math.floor(e*l)/l),i=l}}function Cx(t){return Math.max(1,Math.ceil(Math.log(px(t))/Math.LN2)+1)}function Ax(){var t=wx,e=xo,n=Cx;function i(l){Array.isArray(l)||(l=Array.from(l));var r,s=l.length,o,a,u=new Array(s);for(r=0;r=d)if(M>=d&&e===xo){const C=fa(c,d,A);isFinite(C)&&(C>0?d=(Math.floor(d/C)+1)*C:C<0&&(d=(Math.ceil(d*-C)+1)/-C))}else h.pop()}for(var g=h.length,_=0,k=g;h[_]<=c;)++_;for(;h[k-1]>d;)--k;(_||k0?h[r-1]:c,T.x1=r0)for(r=0;r=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n=l)&&(n=l)}return n}function Dx(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n>l||n===void 0&&l>=l)&&(n=l)}return n}function Ix(t,e,n){t=+t,e=+e,n=(l=arguments.length)<2?(e=t,t=0,1):l<3?1:+n;for(var i=-1,l=Math.max(0,Math.ceil((e-t)/n))|0,r=new Array(l);++i+t(e)}function zx(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Hx(){return!this.__axis}function Ud(t,e){var n=[],i=null,l=null,r=6,s=6,o=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===_c||t===hu?-1:1,f=t===hu||t===pc?"x":"y",c=t===_c||t===pm?Px:Nx;function d(h){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),_=l??(e.tickFormat?e.tickFormat.apply(e,n):Rx),k=Math.max(r,0)+o,y=e.range(),T=+y[0]+a,M=+y[y.length-1]+a,A=(e.bandwidth?zx:Bx)(e.copy(),a),C=h.selection?h.selection():h,D=C.selectAll(".domain").data([null]),R=C.selectAll(".tick").data(g,e).order(),N=R.exit(),G=R.enter().append("g").attr("class","tick"),B=R.select("line"),$=R.select("text");D=D.merge(D.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(G),B=B.merge(G.append("line").attr("stroke","currentColor").attr(f+"2",u*r)),$=$.merge(G.append("text").attr("fill","currentColor").attr(f,u*k).attr("dy",t===_c?"0em":t===pm?"0.71em":"0.32em")),h!==C&&(D=D.transition(h),R=R.transition(h),B=B.transition(h),$=$.transition(h),N=N.transition(h).attr("opacity",U4).attr("transform",function(q){return isFinite(q=A(q))?c(q+a):this.getAttribute("transform")}),G.attr("opacity",U4).attr("transform",function(q){var V=this.parentNode.__axis;return c((V&&isFinite(V=V(q))?V:A(q))+a)})),N.remove(),D.attr("d",t===hu||t===pc?s?"M"+u*s+","+T+"H"+a+"V"+M+"H"+u*s:"M"+a+","+T+"V"+M:s?"M"+T+","+u*s+"V"+a+"H"+M+"V"+u*s:"M"+T+","+a+"H"+M),R.attr("opacity",1).attr("transform",function(q){return c(A(q)+a)}),B.attr(f+"2",u*r),$.attr(f,u*k).text(_),C.filter(Hx).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===pc?"start":t===hu?"end":"middle"),C.each(function(){this.__axis=A})}return d.scale=function(h){return arguments.length?(e=h,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(i=h==null?null:Array.from(h),d):i&&i.slice()},d.tickFormat=function(h){return arguments.length?(l=h,d):l},d.tickSize=function(h){return arguments.length?(r=s=+h,d):r},d.tickSizeInner=function(h){return arguments.length?(r=+h,d):r},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(o=+h,d):o},d.offset=function(h){return arguments.length?(a=+h,d):a},d}function Ux(t){return Ud(_c,t)}function Fx(t){return Ud(pc,t)}function kS(t){return Ud(pm,t)}function wS(t){return Ud(hu,t)}var Gx={value:()=>{}};function Tg(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}bc.prototype=Tg.prototype={constructor:bc,on:function(t,e){var n=this._,i=Vx(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),G4.hasOwnProperty(e)?{space:G4[e],local:t}:t}function jx(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===bm&&e.documentElement.namespaceURI===bm?e.createElement(t):e.createElementNS(n,t)}}function $x(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yS(t){var e=Fd(t);return(e.local?$x:jx)(e)}function qx(){}function Sg(t){return t==null?qx:function(){return this.querySelector(t)}}function Yx(t){typeof t!="function"&&(t=Sg(t));for(var e=this._groups,n=e.length,i=new Array(n),l=0;l=M&&(M=T+1);!(C=k[M])&&++M=0;)(s=i[l])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function bee(t){t||(t=vee);function e(c,d){return c&&d?t(c.__data__,d.__data__):!c-!d}for(var n=this._groups,i=n.length,l=new Array(i),r=0;re?1:t>=e?0:NaN}function kee(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function wee(){return Array.from(this)}function yee(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Ree:typeof e=="function"?Nee:Pee)(t,e,n??"")):ca(this.node(),t)}function ca(t,e){return t.style.getPropertyValue(e)||MS(t).getComputedStyle(t,null).getPropertyValue(e)}function zee(t){return function(){delete this[t]}}function Hee(t,e){return function(){this[t]=e}}function Uee(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Fee(t,e){return arguments.length>1?this.each((e==null?zee:typeof e=="function"?Uee:Hee)(t,e)):this.node()[t]}function CS(t){return t.trim().split(/^|\s+/)}function Eg(t){return t.classList||new AS(t)}function AS(t){this._node=t,this._names=CS(t.getAttribute("class")||"")}AS.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function LS(t,e){for(var n=Eg(t),i=-1,l=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function mte(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,l=e.length,r;n>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?tc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?tc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ote.exec(t))?new xi(e[1],e[2],e[3],1):(e=Mte.exec(t))?new xi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Cte.exec(t))?tc(e[1],e[2],e[3],e[4]):(e=Ate.exec(t))?tc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Lte.exec(t))?Z4(e[1],e[2]/100,e[3]/100,1):(e=Dte.exec(t))?Z4(e[1],e[2]/100,e[3]/100,e[4]):V4.hasOwnProperty(t)?$4(V4[t]):t==="transparent"?new xi(NaN,NaN,NaN,0):null}function $4(t){return new xi(t>>16&255,t>>8&255,t&255,1)}function tc(t,e,n,i){return i<=0&&(t=e=n=NaN),new xi(t,e,n,i)}function Pte(t){return t instanceof Ku||(t=oo(t)),t?(t=t.rgb(),new xi(t.r,t.g,t.b,t.opacity)):new xi}function wm(t,e,n,i){return arguments.length===1?Pte(t):new xi(t,e,n,i??1)}function xi(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}Og(xi,wm,PS(Ku,{brighter(t){return t=t==null?Wc:Math.pow(Wc,t),new xi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Lu:Math.pow(Lu,t),new xi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new xi(io(this.r),io(this.g),io(this.b),jc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:q4,formatHex:q4,formatHex8:Nte,formatRgb:Y4,toString:Y4}));function q4(){return`#${no(this.r)}${no(this.g)}${no(this.b)}`}function Nte(){return`#${no(this.r)}${no(this.g)}${no(this.b)}${no((isNaN(this.opacity)?1:this.opacity)*255)}`}function Y4(){const t=jc(this.opacity);return`${t===1?"rgb(":"rgba("}${io(this.r)}, ${io(this.g)}, ${io(this.b)}${t===1?")":`, ${t})`}`}function jc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function io(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function no(t){return t=io(t),(t<16?"0":"")+t.toString(16)}function Z4(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $l(t,e,n,i)}function NS(t){if(t instanceof $l)return new $l(t.h,t.s,t.l,t.opacity);if(t instanceof Ku||(t=oo(t)),!t)return new $l;if(t instanceof $l)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,l=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,o=r-l,a=(r+l)/2;return o?(e===r?s=(n-i)/o+(n0&&a<1?0:s,new $l(s,o,a,t.opacity)}function Bte(t,e,n,i){return arguments.length===1?NS(t):new $l(t,e,n,i??1)}function $l(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}Og($l,Bte,PS(Ku,{brighter(t){return t=t==null?Wc:Math.pow(Wc,t),new $l(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Lu:Math.pow(Lu,t),new $l(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,l=2*n-i;return new xi(E1(t>=240?t-240:t+120,l,i),E1(t,l,i),E1(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new $l(X4(this.h),nc(this.s),nc(this.l),jc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=jc(this.opacity);return`${t===1?"hsl(":"hsla("}${X4(this.h)}, ${nc(this.s)*100}%, ${nc(this.l)*100}%${t===1?")":`, ${t})`}`}}));function X4(t){return t=(t||0)%360,t<0?t+360:t}function nc(t){return Math.max(0,Math.min(1,t||0))}function E1(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Mg=t=>()=>t;function zte(t,e){return function(n){return t+n*e}}function Hte(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Ute(t){return(t=+t)==1?BS:function(e,n){return n-e?Hte(e,n,t):Mg(isNaN(e)?n:e)}}function BS(t,e){var n=e-t;return n?zte(t,n):Mg(isNaN(t)?e:t)}const $c=function t(e){var n=Ute(e);function i(l,r){var s=n((l=wm(l)).r,(r=wm(r)).r),o=n(l.g,r.g),a=n(l.b,r.b),u=BS(l.opacity,r.opacity);return function(f){return l.r=s(f),l.g=o(f),l.b=a(f),l.opacity=u(f),l+""}}return i.gamma=t,i}(1);function Fte(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),l;return function(r){for(l=0;ln&&(r=e.slice(n,r),o[s]?o[s]+=r:o[++s]=r),(i=i[0])===(l=l[0])?o[s]?o[s]+=l:o[++s]=l:(o[++s]=null,a.push({i:s,x:jl(i,l)})),n=O1.lastIndex;return n180?f+=360:f-u>180&&(u+=360),d.push({i:c.push(l(c)+"rotate(",null,i)-2,x:jl(u,f)})):f&&c.push(l(c)+"rotate("+f+i)}function o(u,f,c,d){u!==f?d.push({i:c.push(l(c)+"skewX(",null,i)-2,x:jl(u,f)}):f&&c.push(l(c)+"skewX("+f+i)}function a(u,f,c,d,h,g){if(u!==c||f!==d){var _=h.push(l(h)+"scale(",null,",",null,")");g.push({i:_-4,x:jl(u,c)},{i:_-2,x:jl(f,d)})}else(c!==1||d!==1)&&h.push(l(h)+"scale("+c+","+d+")")}return function(u,f){var c=[],d=[];return u=t(u),f=t(f),r(u.translateX,u.translateY,f.translateX,f.translateY,c,d),s(u.rotate,f.rotate,c,d),o(u.skewX,f.skewX,c,d),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,d),u=f=null,function(h){for(var g=-1,_=d.length,k;++g<_;)c[(k=d[g]).i]=k.x(h);return c.join("")}}}var Kte=US(Zte,"px, ","px)","deg)"),Jte=US(Xte,", ",")",")"),da=0,mu=0,tu=0,FS=1e3,qc,gu,Yc=0,ao=0,Vd=0,Iu=typeof performance=="object"&&performance.now?performance:Date,GS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Cg(){return ao||(GS(Qte),ao=Iu.now()+Vd)}function Qte(){ao=0}function Zc(){this._call=this._time=this._next=null}Zc.prototype=VS.prototype={constructor:Zc,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Cg():+n)+(e==null?0:+e),!this._next&&gu!==this&&(gu?gu._next=this:qc=this,gu=this),this._call=t,this._time=n,Sm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sm())}};function VS(t,e,n){var i=new Zc;return i.restart(t,e,n),i}function xte(){Cg(),++da;for(var t=qc,e;t;)(e=ao-t._time)>=0&&t._call.call(void 0,e),t=t._next;--da}function J4(){ao=(Yc=Iu.now())+Vd,da=mu=0;try{xte()}finally{da=0,tne(),ao=0}}function ene(){var t=Iu.now(),e=t-Yc;e>FS&&(Vd-=e,Yc=t)}function tne(){for(var t,e=qc,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:qc=n);gu=t,Sm(i)}function Sm(t){if(!da){mu&&(mu=clearTimeout(mu));var e=t-ao;e>24?(t<1/0&&(mu=setTimeout(J4,t-Iu.now()-Vd)),tu&&(tu=clearInterval(tu))):(tu||(Yc=Iu.now(),tu=setInterval(ene,FS)),da=1,GS(J4))}}function Q4(t,e,n){var i=new Zc;return e=e==null?0:+e,i.restart(l=>{i.stop(),t(l+e)},e,n),i}var nne=Tg("start","end","cancel","interrupt"),ine=[],WS=0,x4=1,Em=2,vc=3,ew=4,Om=5,kc=6;function Wd(t,e,n,i,l,r){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;lne(t,n,{name:e,index:i,group:l,on:nne,tween:ine,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:WS})}function Ag(t,e){var n=xl(t,e);if(n.state>WS)throw new Error("too late; already scheduled");return n}function gr(t,e){var n=xl(t,e);if(n.state>vc)throw new Error("too late; already running");return n}function xl(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function lne(t,e,n){var i=t.__transition,l;i[e]=n,n.timer=VS(r,0,n.time);function r(u){n.state=x4,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,d,h;if(n.state!==x4)return a();for(f in i)if(h=i[f],h.name===n.name){if(h.state===vc)return Q4(s);h.state===ew?(h.state=kc,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fEm&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Pne(t,e,n){var i,l,r=Rne(e)?Ag:gr;return function(){var s=r(this,t),o=s.on;o!==i&&(l=(i=o).copy()).on(e,n),s.on=l}}function Nne(t,e){var n=this._id;return arguments.length<2?xl(this.node(),n).on.on(t):this.each(Pne(n,t,e))}function Bne(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function zne(){return this.on("end.remove",Bne(this._id))}function Hne(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Sg(t));for(var i=this._groups,l=i.length,r=new Array(l),s=0;s+t;function YS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var sie={time:null,delay:0,duration:250,ease:YS};function oie(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function aie(t){var e,n;t instanceof $r?(e=t._id,t=t._name):(e=qS(),(n=sie).time=Cg(),t=t==null?null:t+"");for(var i=this._groups,l=i.length,r=0;r()=>t;function uie(t,{sourceEvent:e,target:n,selection:i,mode:l,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:l,enumerable:!0,configurable:!0},_:{value:r}})}function fie(t){t.stopImmediatePropagation()}function C1(t){t.preventDefault(),t.stopImmediatePropagation()}var tw={name:"drag"},A1={name:"space"},Uo={name:"handle"},Fo={name:"center"};const{abs:nw,max:Li,min:Di}=Math;function iw(t){return[+t[0],+t[1]]}function lw(t){return[iw(t[0]),iw(t[1])]}var wc={name:"x",handles:["w","e"].map(Xc),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},L1={name:"y",handles:["n","s"].map(Xc),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Rr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},rw={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},sw={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},cie={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},die={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xc(t){return{type:t}}function hie(t){return!t.ctrlKey&&!t.button}function mie(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function gie(){return navigator.maxTouchPoints||"ontouchstart"in this}function D1(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function _ie(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function ZS(){return pie(wc)}function pie(t){var e=mie,n=hie,i=gie,l=!0,r=Tg("start","brush","end"),s=6,o;function a(k){var y=k.property("__brush",_).selectAll(".overlay").data([Xc("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Rr.overlay).merge(y).each(function(){var M=D1(this).extent;rt(this).attr("x",M[0][0]).attr("y",M[0][1]).attr("width",M[1][0]-M[0][0]).attr("height",M[1][1]-M[0][1])}),k.selectAll(".selection").data([Xc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Rr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var T=k.selectAll(".handle").data(t.handles,function(M){return M.type});T.exit().remove(),T.enter().append("rect").attr("class",function(M){return"handle handle--"+M.type}).attr("cursor",function(M){return Rr[M.type]}),k.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}a.move=function(k,y,T){k.tween?k.on("start.brush",function(M){f(this,arguments).beforestart().start(M)}).on("interrupt.brush end.brush",function(M){f(this,arguments).end(M)}).tween("brush",function(){var M=this,A=M.__brush,C=f(M,arguments),D=A.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,A.extent),N=Gd(D,R);function G(B){A.selection=B===1&&R===null?null:N(B),u.call(M),C.brush()}return D!==null&&R!==null?G:G(1)}):k.each(function(){var M=this,A=arguments,C=M.__brush,D=t.input(typeof y=="function"?y.apply(M,A):y,C.extent),R=f(M,A).beforestart();Mm(M),C.selection=D===null?null:D,u.call(M),R.start(T).brush(T).end(T)})},a.clear=function(k,y){a.move(k,null,y)};function u(){var k=rt(this),y=D1(this).selection;y?(k.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),k.selectAll(".handle").style("display",null).attr("x",function(T){return T.type[T.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(T){return T.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(T){return T.type==="n"||T.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(T){return T.type==="e"||T.type==="w"?y[1][1]-y[0][1]+s:s})):k.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(k,y,T){var M=k.__brush.emitter;return M&&(!T||!M.clean)?M:new c(k,y,T)}function c(k,y,T){this.that=k,this.args=y,this.state=k.__brush,this.active=0,this.clean=T}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(k,y){return this.starting?(this.starting=!1,this.emit("start",k,y)):this.emit("brush",k),this},brush:function(k,y){return this.emit("brush",k,y),this},end:function(k,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",k,y)),this},emit:function(k,y,T){var M=rt(this.that).datum();r.call(k,this.that,new uie(k,{sourceEvent:y,target:a,selection:t.output(this.state.selection),mode:T,dispatch:r}),M)}};function d(k){if(o&&!k.touches||!n.apply(this,arguments))return;var y=this,T=k.target.__data__.type,M=(l&&k.metaKey?T="overlay":T)==="selection"?tw:l&&k.altKey?Fo:Uo,A=t===L1?null:cie[T],C=t===wc?null:die[T],D=D1(y),R=D.extent,N=D.selection,G=R[0][0],B,$,q=R[0][1],V,K,x=R[1][0],ie,X,ce=R[1][1],ae,ee,he=0,ne=0,re,oe=A&&C&&l&&k.shiftKey,Re,qe,Ce=Array.from(k.touches||[k],ot=>{const ht=ot.identifier;return ot=so(ot,y),ot.point0=ot.slice(),ot.identifier=ht,ot});Mm(y);var Ze=f(y,arguments,!0).beforestart();if(T==="overlay"){N&&(re=!0);const ot=[Ce[0],Ce[1]||Ce[0]];D.selection=N=[[B=t===L1?G:Di(ot[0][0],ot[1][0]),V=t===wc?q:Di(ot[0][1],ot[1][1])],[ie=t===L1?x:Li(ot[0][0],ot[1][0]),ae=t===wc?ce:Li(ot[0][1],ot[1][1])]],Ce.length>1&<(k)}else B=N[0][0],V=N[0][1],ie=N[1][0],ae=N[1][1];$=B,K=V,X=ie,ee=ae;var be=rt(y).attr("pointer-events","none"),Ae=be.selectAll(".overlay").attr("cursor",Rr[T]);if(k.touches)Ze.moved=me,Ze.ended=De;else{var ve=rt(k.view).on("mousemove.brush",me,!0).on("mouseup.brush",De,!0);l&&ve.on("keydown.brush",vt,!0).on("keyup.brush",dt,!0),Tte(k.view)}u.call(y),Ze.start(k,M.name);function me(ot){for(const ht of ot.changedTouches||[ot])for(const Bt of Ce)Bt.identifier===ht.identifier&&(Bt.cur=so(ht,y));if(oe&&!Re&&!qe&&Ce.length===1){const ht=Ce[0];nw(ht.cur[0]-ht[0])>nw(ht.cur[1]-ht[1])?qe=!0:Re=!0}for(const ht of Ce)ht.cur&&(ht[0]=ht.cur[0],ht[1]=ht.cur[1]);re=!0,C1(ot),lt(ot)}function lt(ot){const ht=Ce[0],Bt=ht.point0;var Ot;switch(he=ht[0]-Bt[0],ne=ht[1]-Bt[1],M){case A1:case tw:{A&&(he=Li(G-B,Di(x-ie,he)),$=B+he,X=ie+he),C&&(ne=Li(q-V,Di(ce-ae,ne)),K=V+ne,ee=ae+ne);break}case Uo:{Ce[1]?(A&&($=Li(G,Di(x,Ce[0][0])),X=Li(G,Di(x,Ce[1][0])),A=1),C&&(K=Li(q,Di(ce,Ce[0][1])),ee=Li(q,Di(ce,Ce[1][1])),C=1)):(A<0?(he=Li(G-B,Di(x-B,he)),$=B+he,X=ie):A>0&&(he=Li(G-ie,Di(x-ie,he)),$=B,X=ie+he),C<0?(ne=Li(q-V,Di(ce-V,ne)),K=V+ne,ee=ae):C>0&&(ne=Li(q-ae,Di(ce-ae,ne)),K=V,ee=ae+ne));break}case Fo:{A&&($=Li(G,Di(x,B-he*A)),X=Li(G,Di(x,ie+he*A))),C&&(K=Li(q,Di(ce,V-ne*C)),ee=Li(q,Di(ce,ae+ne*C)));break}}X<$&&(A*=-1,Ot=B,B=ie,ie=Ot,Ot=$,$=X,X=Ot,T in rw&&Ae.attr("cursor",Rr[T=rw[T]])),ee0&&(B=$-he),C<0?ae=ee-ne:C>0&&(V=K-ne),M=A1,Ae.attr("cursor",Rr.selection),lt(ot));break}default:return}C1(ot)}function dt(ot){switch(ot.keyCode){case 16:{oe&&(Re=qe=oe=!1,lt(ot));break}case 18:{M===Fo&&(A<0?ie=X:A>0&&(B=$),C<0?ae=ee:C>0&&(V=K),M=Uo,lt(ot));break}case 32:{M===A1&&(ot.altKey?(A&&(ie=X-he*A,B=$+he*A),C&&(ae=ee-ne*C,V=K+ne*C),M=Fo):(A<0?ie=X:A>0&&(B=$),C<0?ae=ee:C>0&&(V=K),M=Uo),Ae.attr("cursor",Rr[T]),lt(ot));break}default:return}C1(ot)}}function h(k){f(this,arguments).moved(k)}function g(k){f(this,arguments).ended(k)}function _(){var k=this.__brush||{selection:null};return k.extent=lw(e.apply(this,arguments)),k.dim=t,k}return a.extent=function(k){return arguments.length?(e=typeof k=="function"?k:M1(lw(k)),a):e},a.filter=function(k){return arguments.length?(n=typeof k=="function"?k:M1(!!k),a):n},a.touchable=function(k){return arguments.length?(i=typeof k=="function"?k:M1(!!k),a):i},a.handleSize=function(k){return arguments.length?(s=+k,a):s},a.keyModifiers=function(k){return arguments.length?(l=!!k,a):l},a.on=function(){var k=r.on.apply(r,arguments);return k===r?a:k},a}const Cm=Math.PI,Am=2*Cm,Ks=1e-6,bie=Am-Ks;function XS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return XS;const n=10**e;return function(i){this._+=i[0];for(let l=1,r=i.length;lKs)if(!(Math.abs(c*a-u*f)>Ks)||!r)this._append`L${this._x1=e},${this._y1=n}`;else{let h=i-s,g=l-o,_=a*a+u*u,k=h*h+g*g,y=Math.sqrt(_),T=Math.sqrt(d),M=r*Math.tan((Cm-Math.acos((_+d-k)/(2*y*T)))/2),A=M/T,C=M/y;Math.abs(A-1)>Ks&&this._append`L${e+A*f},${n+A*c}`,this._append`A${r},${r},0,0,${+(c*h>f*g)},${this._x1=e+C*a},${this._y1=n+C*u}`}}arc(e,n,i,l,r,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(l),a=i*Math.sin(l),u=e+o,f=n+a,c=1^s,d=s?l-r:r-l;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Ks||Math.abs(this._y1-f)>Ks)&&this._append`L${u},${f}`,i&&(d<0&&(d=d%Am+Am),d>bie?this._append`A${i},${i},0,1,${c},${e-o},${n-a}A${i},${i},0,1,${c},${this._x1=u},${this._y1=f}`:d>Ks&&this._append`A${i},${i},0,${+(d>=Cm)},${c},${this._x1=e+i*Math.cos(r)},${this._y1=n+i*Math.sin(r)}`)}rect(e,n,i,l){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+l}h${-i}Z`}toString(){return this._}}function wie(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Kc(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function ha(t){return t=Kc(Math.abs(t)),t?t[1]:NaN}function yie(t,e){return function(n,i){for(var l=n.length,r=[],s=0,o=t[0],a=0;l>0&&o>0&&(a+o+1>i&&(o=Math.max(1,i-a)),r.push(n.substring(l-=o,l+o)),!((a+=o+1)>i));)o=t[s=(s+1)%t.length];return r.reverse().join(e)}}function Tie(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Sie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ru(t){if(!(e=Sie.exec(t)))throw new Error("invalid format: "+t);var e;return new Dg({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ru.prototype=Dg.prototype;function Dg(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Dg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Eie(t){e:for(var e=t.length,n=1,i=-1,l;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(l+1):t}var KS;function Oie(t,e){var n=Kc(t,e);if(!n)return t+"";var i=n[0],l=n[1],r=l-(KS=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,s=i.length;return r===s?i:r>s?i+new Array(r-s+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Kc(t,Math.max(0,e+r-1))[0]}function ow(t,e){var n=Kc(t,e);if(!n)return t+"";var i=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+i:i.length>l+1?i.slice(0,l+1)+"."+i.slice(l+1):i+new Array(l-i.length+2).join("0")}const aw={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:wie,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ow(t*100,e),r:ow,s:Oie,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function uw(t){return t}var fw=Array.prototype.map,cw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mie(t){var e=t.grouping===void 0||t.thousands===void 0?uw:yie(fw.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",l=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?uw:Tie(fw.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",a=t.nan===void 0?"NaN":t.nan+"";function u(c){c=Ru(c);var d=c.fill,h=c.align,g=c.sign,_=c.symbol,k=c.zero,y=c.width,T=c.comma,M=c.precision,A=c.trim,C=c.type;C==="n"?(T=!0,C="g"):aw[C]||(M===void 0&&(M=12),A=!0,C="g"),(k||d==="0"&&h==="=")&&(k=!0,d="0",h="=");var D=_==="$"?n:_==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",R=_==="$"?i:/[%p]/.test(C)?s:"",N=aw[C],G=/[defgprs%]/.test(C);M=M===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function B($){var q=D,V=R,K,x,ie;if(C==="c")V=N($)+V,$="";else{$=+$;var X=$<0||1/$<0;if($=isNaN($)?a:N(Math.abs($),M),A&&($=Eie($)),X&&+$==0&&g!=="+"&&(X=!1),q=(X?g==="("?g:o:g==="-"||g==="("?"":g)+q,V=(C==="s"?cw[8+KS/3]:"")+V+(X&&g==="("?")":""),G){for(K=-1,x=$.length;++Kie||ie>57){V=(ie===46?l+$.slice(K+1):$.slice(K))+V,$=$.slice(0,K);break}}}T&&!k&&($=e($,1/0));var ce=q.length+$.length+V.length,ae=ce>1)+q+$+V+ae.slice(ce);break;default:$=ae+q+$+V;break}return r($)}return B.toString=function(){return c+""},B}function f(c,d){var h=u((c=Ru(c),c.type="f",c)),g=Math.max(-8,Math.min(8,Math.floor(ha(d)/3)))*3,_=Math.pow(10,-g),k=cw[8+g/3];return function(y){return h(_*y)+k}}return{format:u,formatPrefix:f}}var lc,Ig,JS;Cie({thousands:",",grouping:[3],currency:["$",""]});function Cie(t){return lc=Mie(t),Ig=lc.format,JS=lc.formatPrefix,lc}function Aie(t){return Math.max(0,-ha(Math.abs(t)))}function Lie(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ha(e)/3)))*3-ha(Math.abs(t)))}function Die(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ha(e)-ha(t))+1}function Ju(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const dw=Symbol("implicit");function Rg(){var t=new z4,e=[],n=[],i=dw;function l(r){let s=t.get(r);if(s===void 0){if(i!==dw)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return l.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new z4;for(const s of r)t.has(s)||t.set(s,e.push(s)-1);return l},l.range=function(r){return arguments.length?(n=Array.from(r),l):n.slice()},l.unknown=function(r){return arguments.length?(i=r,l):i},l.copy=function(){return Rg(e,n).unknown(i)},Ju.apply(l,arguments),l}function Pg(){var t=Rg().unknown(void 0),e=t.domain,n=t.range,i=0,l=1,r,s,o=!1,a=0,u=0,f=.5;delete t.unknown;function c(){var d=e().length,h=le&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Nie(t,e,n){var i=t[0],l=t[1],r=e[0],s=e[1];return l2?Bie:Nie,a=u=null,c}function c(d){return d==null||isNaN(d=+d)?r:(a||(a=o(t.map(i),e,n)))(i(s(d)))}return c.invert=function(d){return s(l((u||(u=o(e,t.map(i),jl)))(d)))},c.domain=function(d){return arguments.length?(t=Array.from(d,Rie),f()):t.slice()},c.range=function(d){return arguments.length?(e=Array.from(d),f()):e.slice()},c.rangeRound=function(d){return e=Array.from(d),n=Yte,f()},c.clamp=function(d){return arguments.length?(s=d?!0:qo,f()):s!==qo},c.interpolate=function(d){return arguments.length?(n=d,f()):n},c.unknown=function(d){return arguments.length?(r=d,c):r},function(d,h){return i=d,l=h,f()}}function xS(){return QS()(qo,qo)}function zie(t,e,n,i){var l=_m(t,e,n),r;switch(i=Ru(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(r=Lie(l,s))&&(i.precision=r),JS(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=Die(l,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=Aie(l))&&(i.precision=r-(i.type==="%")*2);break}}return Ig(i)}function Hie(t){var e=t.domain;return t.ticks=function(n){var i=e();return Gc(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var l=e();return zie(l[0],l[l.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),l=0,r=i.length-1,s=i[l],o=i[r],a,u,f=10;for(o0;){if(u=fa(s,o,n),u===a)return i[l]=s,i[r]=o,e(i);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;a=u}return t},t}function Jc(){var t=xS();return t.copy=function(){return Ng(t,Jc())},Ju.apply(t,arguments),Hie(t)}function eE(t,e){t=t.slice();var n=0,i=t.length-1,l=t[n],r=t[i],s;return rMath.pow(t,e)}function Wie(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function _w(t){return(e,n)=>-t(-e,n)}function jie(t){const e=t(mw,gw),n=e.domain;let i=10,l,r;function s(){return l=Wie(i),r=Vie(i),n()[0]<0?(l=_w(l),r=_w(r),t(Uie,Fie)):t(mw,gw),e}return e.base=function(o){return arguments.length?(i=+o,s()):i},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const a=n();let u=a[0],f=a[a.length-1];const c=f0){for(;d<=h;++d)for(g=1;gf)break;y.push(_)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(_=d>0?g/r(-d):g*r(d),!(_f)break;y.push(_)}y.length*2{if(o==null&&(o=10),a==null&&(a=i===10?"s":","),typeof a!="function"&&(!(i%1)&&(a=Ru(a)).precision==null&&(a.trim=!0),a=Ig(a)),o===1/0)return a;const u=Math.max(1,i*o/e.ticks().length);return f=>{let c=f/r(Math.round(l(f)));return c*in(eE(n(),{floor:o=>r(Math.floor(l(o))),ceil:o=>r(Math.ceil(l(o)))})),e}function tE(){const t=jie(QS()).domain([1,10]);return t.copy=()=>Ng(t,tE()).base(t.base()),Ju.apply(t,arguments),t}const I1=new Date,R1=new Date;function mi(t,e,n,i){function l(r){return t(r=arguments.length===0?new Date:new Date(+r)),r}return l.floor=r=>(t(r=new Date(+r)),r),l.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),l.round=r=>{const s=l(r),o=l.ceil(r);return r-s(e(r=new Date(+r),s==null?1:Math.floor(s)),r),l.range=(r,s,o)=>{const a=[];if(r=l.ceil(r),o=o==null?1:Math.floor(o),!(r0))return a;let u;do a.push(u=new Date(+r)),e(r,o),t(r);while(umi(s=>{if(s>=s)for(;t(s),!r(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!r(s););else for(;--o>=0;)for(;e(s,1),!r(s););}),n&&(l.count=(r,s)=>(I1.setTime(+r),R1.setTime(+s),t(I1),t(R1),Math.floor(n(I1,R1))),l.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?l.filter(i?s=>i(s)%r===0:s=>l.count(0,s)%r===0):l)),l}const Qc=mi(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Qc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?mi(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Qc);Qc.range;const Ur=1e3,Cl=Ur*60,Fr=Cl*60,qr=Fr*24,Bg=qr*7,pw=qr*30,P1=qr*365,Yo=mi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ur)},(t,e)=>(e-t)/Ur,t=>t.getUTCSeconds());Yo.range;const zg=mi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ur)},(t,e)=>{t.setTime(+t+e*Cl)},(t,e)=>(e-t)/Cl,t=>t.getMinutes());zg.range;const $ie=mi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Cl)},(t,e)=>(e-t)/Cl,t=>t.getUTCMinutes());$ie.range;const Hg=mi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ur-t.getMinutes()*Cl)},(t,e)=>{t.setTime(+t+e*Fr)},(t,e)=>(e-t)/Fr,t=>t.getHours());Hg.range;const qie=mi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Fr)},(t,e)=>(e-t)/Fr,t=>t.getUTCHours());qie.range;const Qu=mi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cl)/qr,t=>t.getDate()-1);Qu.range;const Ug=mi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/qr,t=>t.getUTCDate()-1);Ug.range;const Yie=mi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/qr,t=>Math.floor(t/qr));Yie.range;function mo(t){return mi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Cl)/Bg)}const jd=mo(0),xc=mo(1),Zie=mo(2),Xie=mo(3),ma=mo(4),Kie=mo(5),Jie=mo(6);jd.range;xc.range;Zie.range;Xie.range;ma.range;Kie.range;Jie.range;function go(t){return mi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Bg)}const nE=go(0),ed=go(1),Qie=go(2),xie=go(3),ga=go(4),ele=go(5),tle=go(6);nE.range;ed.range;Qie.range;xie.range;ga.range;ele.range;tle.range;const Fg=mi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Fg.range;const nle=mi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());nle.range;const Yr=mi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Yr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:mi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Yr.range;const uo=mi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());uo.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:mi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});uo.range;function ile(t,e,n,i,l,r){const s=[[Yo,1,Ur],[Yo,5,5*Ur],[Yo,15,15*Ur],[Yo,30,30*Ur],[r,1,Cl],[r,5,5*Cl],[r,15,15*Cl],[r,30,30*Cl],[l,1,Fr],[l,3,3*Fr],[l,6,6*Fr],[l,12,12*Fr],[i,1,qr],[i,2,2*qr],[n,1,Bg],[e,1,pw],[e,3,3*pw],[t,1,P1]];function o(u,f,c){const d=fk).right(s,d);if(h===s.length)return t.every(_m(u/P1,f/P1,c));if(h===0)return Qc.every(Math.max(_m(u,f,c),1));const[g,_]=s[d/s[h-1][2]53)return null;"w"in me||(me.w=1),"Z"in me?(De=B1(nu(me.y,0,1)),vt=De.getUTCDay(),De=vt>4||vt===0?ed.ceil(De):ed(De),De=Ug.offset(De,(me.V-1)*7),me.y=De.getUTCFullYear(),me.m=De.getUTCMonth(),me.d=De.getUTCDate()+(me.w+6)%7):(De=N1(nu(me.y,0,1)),vt=De.getDay(),De=vt>4||vt===0?xc.ceil(De):xc(De),De=Qu.offset(De,(me.V-1)*7),me.y=De.getFullYear(),me.m=De.getMonth(),me.d=De.getDate()+(me.w+6)%7)}else("W"in me||"U"in me)&&("w"in me||(me.w="u"in me?me.u%7:"W"in me?1:0),vt="Z"in me?B1(nu(me.y,0,1)).getUTCDay():N1(nu(me.y,0,1)).getDay(),me.m=0,me.d="W"in me?(me.w+6)%7+me.W*7-(vt+5)%7:me.w+me.U*7-(vt+6)%7);return"Z"in me?(me.H+=me.Z/100|0,me.M+=me.Z%100,B1(me)):N1(me)}}function N(be,Ae,ve,me){for(var lt=0,De=Ae.length,vt=ve.length,dt,ot;lt=vt)return-1;if(dt=Ae.charCodeAt(lt++),dt===37){if(dt=Ae.charAt(lt++),ot=C[dt in bw?Ae.charAt(lt++):dt],!ot||(me=ot(be,ve,me))<0)return-1}else if(dt!=ve.charCodeAt(me++))return-1}return me}function G(be,Ae,ve){var me=u.exec(Ae.slice(ve));return me?(be.p=f.get(me[0].toLowerCase()),ve+me[0].length):-1}function B(be,Ae,ve){var me=h.exec(Ae.slice(ve));return me?(be.w=g.get(me[0].toLowerCase()),ve+me[0].length):-1}function $(be,Ae,ve){var me=c.exec(Ae.slice(ve));return me?(be.w=d.get(me[0].toLowerCase()),ve+me[0].length):-1}function q(be,Ae,ve){var me=y.exec(Ae.slice(ve));return me?(be.m=T.get(me[0].toLowerCase()),ve+me[0].length):-1}function V(be,Ae,ve){var me=_.exec(Ae.slice(ve));return me?(be.m=k.get(me[0].toLowerCase()),ve+me[0].length):-1}function K(be,Ae,ve){return N(be,e,Ae,ve)}function x(be,Ae,ve){return N(be,n,Ae,ve)}function ie(be,Ae,ve){return N(be,i,Ae,ve)}function X(be){return s[be.getDay()]}function ce(be){return r[be.getDay()]}function ae(be){return a[be.getMonth()]}function ee(be){return o[be.getMonth()]}function he(be){return l[+(be.getHours()>=12)]}function ne(be){return 1+~~(be.getMonth()/3)}function re(be){return s[be.getUTCDay()]}function oe(be){return r[be.getUTCDay()]}function Re(be){return a[be.getUTCMonth()]}function qe(be){return o[be.getUTCMonth()]}function Ce(be){return l[+(be.getUTCHours()>=12)]}function Ze(be){return 1+~~(be.getUTCMonth()/3)}return{format:function(be){var Ae=D(be+="",M);return Ae.toString=function(){return be},Ae},parse:function(be){var Ae=R(be+="",!1);return Ae.toString=function(){return be},Ae},utcFormat:function(be){var Ae=D(be+="",A);return Ae.toString=function(){return be},Ae},utcParse:function(be){var Ae=R(be+="",!0);return Ae.toString=function(){return be},Ae}}}var bw={"-":"",_:" ",0:"0"},bi=/^\s*\d+/,ole=/^%/,ale=/[\\^$*+?|[\]().{}]/g;function un(t,e,n){var i=t<0?"-":"",l=(i?-t:t)+"",r=l.length;return i+(r[e.toLowerCase(),n]))}function fle(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function cle(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function dle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function hle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function mle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function vw(t,e,n){var i=bi.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function kw(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function gle(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function _le(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function ple(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function ww(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function ble(t,e,n){var i=bi.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function yw(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function vle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function kle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function wle(t,e,n){var i=bi.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function yle(t,e,n){var i=bi.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Tle(t,e,n){var i=ole.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Sle(t,e,n){var i=bi.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Ele(t,e,n){var i=bi.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Tw(t,e){return un(t.getDate(),e,2)}function Ole(t,e){return un(t.getHours(),e,2)}function Mle(t,e){return un(t.getHours()%12||12,e,2)}function Cle(t,e){return un(1+Qu.count(Yr(t),t),e,3)}function iE(t,e){return un(t.getMilliseconds(),e,3)}function Ale(t,e){return iE(t,e)+"000"}function Lle(t,e){return un(t.getMonth()+1,e,2)}function Dle(t,e){return un(t.getMinutes(),e,2)}function Ile(t,e){return un(t.getSeconds(),e,2)}function Rle(t){var e=t.getDay();return e===0?7:e}function Ple(t,e){return un(jd.count(Yr(t)-1,t),e,2)}function lE(t){var e=t.getDay();return e>=4||e===0?ma(t):ma.ceil(t)}function Nle(t,e){return t=lE(t),un(ma.count(Yr(t),t)+(Yr(t).getDay()===4),e,2)}function Ble(t){return t.getDay()}function zle(t,e){return un(xc.count(Yr(t)-1,t),e,2)}function Hle(t,e){return un(t.getFullYear()%100,e,2)}function Ule(t,e){return t=lE(t),un(t.getFullYear()%100,e,2)}function Fle(t,e){return un(t.getFullYear()%1e4,e,4)}function Gle(t,e){var n=t.getDay();return t=n>=4||n===0?ma(t):ma.ceil(t),un(t.getFullYear()%1e4,e,4)}function Vle(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+un(e/60|0,"0",2)+un(e%60,"0",2)}function Sw(t,e){return un(t.getUTCDate(),e,2)}function Wle(t,e){return un(t.getUTCHours(),e,2)}function jle(t,e){return un(t.getUTCHours()%12||12,e,2)}function $le(t,e){return un(1+Ug.count(uo(t),t),e,3)}function rE(t,e){return un(t.getUTCMilliseconds(),e,3)}function qle(t,e){return rE(t,e)+"000"}function Yle(t,e){return un(t.getUTCMonth()+1,e,2)}function Zle(t,e){return un(t.getUTCMinutes(),e,2)}function Xle(t,e){return un(t.getUTCSeconds(),e,2)}function Kle(t){var e=t.getUTCDay();return e===0?7:e}function Jle(t,e){return un(nE.count(uo(t)-1,t),e,2)}function sE(t){var e=t.getUTCDay();return e>=4||e===0?ga(t):ga.ceil(t)}function Qle(t,e){return t=sE(t),un(ga.count(uo(t),t)+(uo(t).getUTCDay()===4),e,2)}function xle(t){return t.getUTCDay()}function ere(t,e){return un(ed.count(uo(t)-1,t),e,2)}function tre(t,e){return un(t.getUTCFullYear()%100,e,2)}function nre(t,e){return t=sE(t),un(t.getUTCFullYear()%100,e,2)}function ire(t,e){return un(t.getUTCFullYear()%1e4,e,4)}function lre(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ga(t):ga.ceil(t),un(t.getUTCFullYear()%1e4,e,4)}function rre(){return"+0000"}function Ew(){return"%"}function Ow(t){return+t}function Mw(t){return Math.floor(+t/1e3)}var Go,oE;sre({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function sre(t){return Go=sle(t),oE=Go.format,Go.parse,Go.utcFormat,Go.utcParse,Go}function ore(t){return new Date(t)}function are(t){return t instanceof Date?+t:+new Date(+t)}function aE(t,e,n,i,l,r,s,o,a,u){var f=xS(),c=f.invert,d=f.domain,h=u(".%L"),g=u(":%S"),_=u("%I:%M"),k=u("%I %p"),y=u("%a %d"),T=u("%b %d"),M=u("%B"),A=u("%Y");function C(D){return(a(D)1?0:t<-1?Pu:Math.acos(t)}function Aw(t){return t>=1?td:t<=-1?-td:Math.asin(t)}function Gg(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new kie(e)}function dre(t){return t.innerRadius}function hre(t){return t.outerRadius}function mre(t){return t.startAngle}function gre(t){return t.endAngle}function _re(t){return t&&t.padAngle}function pre(t,e,n,i,l,r,s,o){var a=n-t,u=i-e,f=s-l,c=o-r,d=c*a-f*u;if(!(d*dK*K+x*x&&(N=B,G=$),{cx:N,cy:G,x01:-f,y01:-c,x11:N*(l/C-1),y11:G*(l/C-1)}}function bre(){var t=dre,e=hre,n=bn(0),i=null,l=mre,r=gre,s=_re,o=null,a=Gg(u);function u(){var f,c,d=+t.apply(this,arguments),h=+e.apply(this,arguments),g=l.apply(this,arguments)-td,_=r.apply(this,arguments)-td,k=Cw(_-g),y=_>g;if(o||(o=f=a()),hRi))o.moveTo(0,0);else if(k>fre-Ri)o.moveTo(h*Xs(g),h*sr(g)),o.arc(0,0,h,g,_,!y),d>Ri&&(o.moveTo(d*Xs(_),d*sr(_)),o.arc(0,0,d,_,g,y));else{var T=g,M=_,A=g,C=_,D=k,R=k,N=s.apply(this,arguments)/2,G=N>Ri&&(i?+i.apply(this,arguments):Zo(d*d+h*h)),B=z1(Cw(h-d)/2,+n.apply(this,arguments)),$=B,q=B,V,K;if(G>Ri){var x=Aw(G/d*sr(N)),ie=Aw(G/h*sr(N));(D-=x*2)>Ri?(x*=y?1:-1,A+=x,C-=x):(D=0,A=C=(g+_)/2),(R-=ie*2)>Ri?(ie*=y?1:-1,T+=ie,M-=ie):(R=0,T=M=(g+_)/2)}var X=h*Xs(T),ce=h*sr(T),ae=d*Xs(C),ee=d*sr(C);if(B>Ri){var he=h*Xs(M),ne=h*sr(M),re=d*Xs(A),oe=d*sr(A),Re;if(kRi?q>Ri?(V=rc(re,oe,X,ce,h,q,y),K=rc(he,ne,ae,ee,h,q,y),o.moveTo(V.cx+V.x01,V.cy+V.y01),qRi)||!(D>Ri)?o.lineTo(ae,ee):$>Ri?(V=rc(ae,ee,he,ne,d,-$,y),K=rc(X,ce,re,oe,d,-$,y),o.lineTo(V.cx+V.x01,V.cy+V.y01),$=h;--g)o.point(M[g],A[g]);o.lineEnd(),o.areaEnd()}y&&(M[d]=+t(k,d,c),A[d]=+e(k,d,c),o.point(i?+i(k,d,c):M[d],n?+n(k,d,c):A[d]))}if(T)return o=null,T+""||null}function f(){return jg().defined(l).curve(s).context(r)}return u.x=function(c){return arguments.length?(t=typeof c=="function"?c:bn(+c),i=null,u):t},u.x0=function(c){return arguments.length?(t=typeof c=="function"?c:bn(+c),u):t},u.x1=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:bn(+c),u):i},u.y=function(c){return arguments.length?(e=typeof c=="function"?c:bn(+c),n=null,u):e},u.y0=function(c){return arguments.length?(e=typeof c=="function"?c:bn(+c),u):e},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:bn(+c),u):n},u.lineX0=u.lineY0=function(){return f().x(t).y(e)},u.lineY1=function(){return f().x(t).y(n)},u.lineX1=function(){return f().x(i).y(e)},u.defined=function(c){return arguments.length?(l=typeof c=="function"?c:bn(!!c),u):l},u.curve=function(c){return arguments.length?(s=c,r!=null&&(o=s(r)),u):s},u.context=function(c){return arguments.length?(c==null?r=o=null:o=s(r=c),u):r},u}function Os(){}function nd(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function $d(t){this._context=t}$d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function vre(t){return new $d(t)}function hE(t){this._context=t}hE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function kre(t){return new hE(t)}function mE(t){this._context=t}mE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wre(t){return new mE(t)}function gE(t,e){this._basis=new $d(t),this._beta=e}gE.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],l=e[0],r=t[n]-i,s=e[n]-l,o=-1,a;++o<=n;)a=o/n,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+a*r),this._beta*e[o]+(1-this._beta)*(l+a*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const yre=function t(e){function n(i){return e===1?new $d(i):new gE(i,e)}return n.beta=function(i){return t(+i)},n}(.85);function id(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function qg(t,e){this._context=t,this._k=(1-e)/6}qg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:id(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Tre=function t(e){function n(i){return new qg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Yg(t,e){this._context=t,this._k=(1-e)/6}Yg.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Sre=function t(e){function n(i){return new Yg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Zg(t,e){this._context=t,this._k=(1-e)/6}Zg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ere=function t(e){function n(i){return new Zg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Xg(t,e,n){var i=t._x1,l=t._y1,r=t._x2,s=t._y2;if(t._l01_a>Ri){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,l=(l*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Ri){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*u+t._y1*t._l23_2a-n*t._l12_2a)/f}t._context.bezierCurveTo(i,l,r,s,t._x2,t._y2)}function _E(t,e){this._context=t,this._alpha=e}_E.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ore=function t(e){function n(i){return e?new _E(i,e):new qg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function pE(t,e){this._context=t,this._alpha=e}pE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Mre=function t(e){function n(i){return e?new pE(i,e):new Yg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function bE(t,e){this._context=t,this._alpha=e}bE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Cre=function t(e){function n(i){return e?new bE(i,e):new Zg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function vE(t){this._context=t}vE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Are(t){return new vE(t)}function Lw(t){return t<0?-1:1}function Dw(t,e,n){var i=t._x1-t._x0,l=e-t._x1,r=(t._y1-t._y0)/(i||l<0&&-0),s=(n-t._y1)/(l||i<0&&-0),o=(r*l+s*i)/(i+l);return(Lw(r)+Lw(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(o))||0}function Iw(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function H1(t,e,n){var i=t._x0,l=t._y0,r=t._x1,s=t._y1,o=(r-i)/3;t._context.bezierCurveTo(i+o,l+o*e,r-o,s-o*n,r,s)}function ld(t){this._context=t}ld.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:H1(this,this._t0,Iw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,H1(this,Iw(this,n=Dw(this,t,e)),n);break;default:H1(this,this._t0,n=Dw(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function kE(t){this._context=new wE(t)}(kE.prototype=Object.create(ld.prototype)).point=function(t,e){ld.prototype.point.call(this,e,t)};function wE(t){this._context=t}wE.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,l,r){this._context.bezierCurveTo(e,t,i,n,r,l)}};function Lre(t){return new ld(t)}function Dre(t){return new kE(t)}function yE(t){this._context=t}yE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=Rw(t),l=Rw(e),r=0,s=1;s=0;--e)l[e]=(s[e]-l[e+1])/r[e];for(r[n-1]=(t[n]+l[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Rre(t){return new qd(t,.5)}function Pre(t){return new qd(t,0)}function Nre(t){return new qd(t,1)}function Pw(t,e){if((s=t.length)>1)for(var n=1,i,l,r=t[e[0]],s,o=r.length;n=0;)n[e]=e;return n}function Bre(t,e){return t[e]}function zre(t){const e=[];return e.key=t,e}function U1(){var t=bn([]),e=Nw,n=Pw,i=Bre;function l(r){var s=Array.from(t.apply(this,arguments),zre),o,a=s.length,u=-1,f;for(const c of r)for(o=0,++u;o0)for(var n,i=0,l,r,s,o,a,u=t[e[0]].length;i0?(l[0]=s,l[1]=s+=r):r<0?(l[1]=o,l[0]=o+=r):(l[0]=0,l[1]=r)}function _u(t,e,n){this.k=t,this.x=e,this.y=n}_u.prototype={constructor:_u,scale:function(t){return t===1?this:new _u(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new _u(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};_u.prototype;function F1(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}function ru(t){return function(e,n){var i=n!=null&&n.context?String(n.context):"standalone",l;if(i==="formatting"&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):r;l=t.formattingValues[s]||t.formattingValues[r]}else{var o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[a]||t.values[o]}var u=t.argumentCallback?t.argumentCallback(e):e;return l[u]}}function su(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(l);if(!r)return null;var s=r[0],o=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],a=Array.isArray(o)?Fre(o,function(c){return c.test(s)}):Ure(o,function(c){return c.test(s)}),u;u=t.valueCallback?t.valueCallback(a):a,u=n.valueCallback?n.valueCallback(u):u;var f=e.slice(s.length);return{value:u,rest:f}}}function Ure(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function Fre(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},i=e.match(t.matchPattern);if(!i)return null;var l=i[0],r=e.match(t.parsePattern);if(!r)return null;var s=t.valueCallback?t.valueCallback(r[0]):r[0];s=n.valueCallback?n.valueCallback(s):s;var o=e.slice(l.length);return{value:s,rest:o}}}function rd(t){"@babel/helpers - typeof";return rd=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},rd(t)}function ci(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Ft(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function mn(t){Ft(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||rd(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Yd(t,e){Ft(2,arguments);var n=mn(t).getTime(),i=ci(e);return new Date(n+i)}var Vre={};function Zd(){return Vre}function Dm(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function Wre(t){return Ft(1,arguments),t instanceof Date||rd(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function jre(t){if(Ft(1,arguments),!Wre(t)&&typeof t!="number")return!1;var e=mn(t);return!isNaN(Number(e))}function $re(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,-n)}var qre=864e5;function Yre(t){Ft(1,arguments);var e=mn(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),l=n-i;return Math.floor(l/qre)+1}function sd(t){Ft(1,arguments);var e=1,n=mn(t),i=n.getUTCDay(),l=(i=l.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function Zre(t){Ft(1,arguments);var e=TE(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=sd(n);return i}var Xre=6048e5;function Kre(t){Ft(1,arguments);var e=mn(t),n=sd(e).getTime()-Zre(e).getTime();return Math.round(n/Xre)+1}function od(t,e){var n,i,l,r,s,o,a,u;Ft(1,arguments);var f=Zd(),c=ci((n=(i=(l=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&l!==void 0?l:f.weekStartsOn)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=mn(t),h=d.getUTCDay(),g=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(c+1,0,h),g.setUTCHours(0,0,0,0);var _=od(g,e),k=new Date(0);k.setUTCFullYear(c,0,h),k.setUTCHours(0,0,0,0);var y=od(k,e);return f.getTime()>=_.getTime()?c+1:f.getTime()>=y.getTime()?c:c-1}function Jre(t,e){var n,i,l,r,s,o,a,u;Ft(1,arguments);var f=Zd(),c=ci((n=(i=(l=(r=e==null?void 0:e.firstWeekContainsDate)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:f.firstWeekContainsDate)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=SE(t,e),h=new Date(0);h.setUTCFullYear(d,0,c),h.setUTCHours(0,0,0,0);var g=od(h,e);return g}var Qre=6048e5;function xre(t,e){Ft(1,arguments);var n=mn(t),i=od(n,e).getTime()-Jre(n,e).getTime();return Math.round(i/Qre)+1}function En(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length0?n:1-n;return En(e==="yy"?i%100:i,e.length)},M:function(t,e){var n=t.getUTCMonth();return e==="M"?String(n+1):En(n+1,2)},d:function(t,e){return En(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,e){return En(t.getUTCHours()%12||12,e.length)},H:function(t,e){return En(t.getUTCHours(),e.length)},m:function(t,e){return En(t.getUTCMinutes(),e.length)},s:function(t,e){return En(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,i=t.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return En(l,e.length)}};const _s=ese;var Vo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tse={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){var i=t.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return _s.y(t,e)},Y:function(t,e,n,i){var l=SE(t,i),r=l>0?l:1-l;if(e==="YY"){var s=r%100;return En(s,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):En(r,e.length)},R:function(t,e){var n=TE(t);return En(n,e.length)},u:function(t,e){var n=t.getUTCFullYear();return En(n,e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return En(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return En(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return _s.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return En(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var l=xre(t,i);return e==="wo"?n.ordinalNumber(l,{unit:"week"}):En(l,e.length)},I:function(t,e,n){var i=Kre(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):En(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):_s.d(t,e)},D:function(t,e,n){var i=Yre(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):En(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return En(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return En(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),l=i===0?7:i;switch(e){case"i":return String(l);case"ii":return En(l,e.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours(),l=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i=t.getUTCHours(),l;switch(i===12?l=Vo.noon:i===0?l=Vo.midnight:l=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i=t.getUTCHours(),l;switch(i>=17?l=Vo.evening:i>=12?l=Vo.afternoon:i>=4?l=Vo.morning:l=Vo.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return _s.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):_s.H(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):En(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):En(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):_s.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):_s.s(t,e)},S:function(t,e){return _s.S(t,e)},X:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return zw(r);case"XXXX":case"XX":return Js(r);case"XXXXX":case"XXX":default:return Js(r,":")}},x:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"x":return zw(r);case"xxxx":case"xx":return Js(r);case"xxxxx":case"xxx":default:return Js(r,":")}},O:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Bw(r,":");case"OOOO":default:return"GMT"+Js(r,":")}},z:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Bw(r,":");case"zzzz":default:return"GMT"+Js(r,":")}},t:function(t,e,n,i){var l=i._originalDate||t,r=Math.floor(l.getTime()/1e3);return En(r,e.length)},T:function(t,e,n,i){var l=i._originalDate||t,r=l.getTime();return En(r,e.length)}};function Bw(t,e){var n=t>0?"-":"+",i=Math.abs(t),l=Math.floor(i/60),r=i%60;if(r===0)return n+String(l);var s=e||"";return n+String(l)+s+En(r,2)}function zw(t,e){if(t%60===0){var n=t>0?"-":"+";return n+En(Math.abs(t)/60,2)}return Js(t,e)}function Js(t,e){var n=e||"",i=t>0?"-":"+",l=Math.abs(t),r=En(Math.floor(l/60),2),s=En(l%60,2);return i+r+n+s}const nse=tse;var Hw=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},EE=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ise=function(t,e){var n=t.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return Hw(t,e);var r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Hw(i,e)).replace("{{time}}",EE(l,e))},lse={p:EE,P:ise};const rse=lse;var sse=["D","DD"],ose=["YY","YYYY"];function ase(t){return sse.indexOf(t)!==-1}function use(t){return ose.indexOf(t)!==-1}function Uw(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var fse={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},cse=function(t,e,n){var i,l=fse[t];return typeof l=="string"?i=l:e===1?i=l.one:i=l.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const dse=cse;var hse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_se={date:F1({formats:hse,defaultWidth:"full"}),time:F1({formats:mse,defaultWidth:"full"}),dateTime:F1({formats:gse,defaultWidth:"full"})};const pse=_se;var bse={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vse=function(t,e,n,i){return bse[t]};const kse=vse;var wse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Tse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Sse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ese={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ose={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Mse=function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Cse={ordinalNumber:Mse,era:ru({values:wse,defaultWidth:"wide"}),quarter:ru({values:yse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ru({values:Tse,defaultWidth:"wide"}),day:ru({values:Sse,defaultWidth:"wide"}),dayPeriod:ru({values:Ese,defaultWidth:"wide",formattingValues:Ose,defaultFormattingWidth:"wide"})};const Ase=Cse;var Lse=/^(\d+)(th|st|nd|rd)?/i,Dse=/\d+/i,Ise={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Rse={any:[/^b/i,/^(a|c)/i]},Pse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Nse={any:[/1/i,/2/i,/3/i,/4/i]},Bse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},zse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Use={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Fse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Gse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Vse={ordinalNumber:Gre({matchPattern:Lse,parsePattern:Dse,valueCallback:function(t){return parseInt(t,10)}}),era:su({matchPatterns:Ise,defaultMatchWidth:"wide",parsePatterns:Rse,defaultParseWidth:"any"}),quarter:su({matchPatterns:Pse,defaultMatchWidth:"wide",parsePatterns:Nse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:su({matchPatterns:Bse,defaultMatchWidth:"wide",parsePatterns:zse,defaultParseWidth:"any"}),day:su({matchPatterns:Hse,defaultMatchWidth:"wide",parsePatterns:Use,defaultParseWidth:"any"}),dayPeriod:su({matchPatterns:Fse,defaultMatchWidth:"any",parsePatterns:Gse,defaultParseWidth:"any"})};const Wse=Vse;var jse={code:"en-US",formatDistance:dse,formatLong:pse,formatRelative:kse,localize:Ase,match:Wse,options:{weekStartsOn:0,firstWeekContainsDate:1}};const OE=jse;var $se=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yse=/^'([^]*?)'?$/,Zse=/''/g,Xse=/[a-zA-Z]/;function _a(t,e,n){var i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A;Ft(2,arguments);var C=String(e),D=Zd(),R=(i=(l=n==null?void 0:n.locale)!==null&&l!==void 0?l:D.locale)!==null&&i!==void 0?i:OE,N=ci((r=(s=(o=(a=n==null?void 0:n.firstWeekContainsDate)!==null&&a!==void 0?a:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:D.firstWeekContainsDate)!==null&&s!==void 0?s:(c=D.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var G=ci((h=(g=(_=(k=n==null?void 0:n.weekStartsOn)!==null&&k!==void 0?k:n==null||(y=n.locale)===null||y===void 0||(T=y.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&_!==void 0?_:D.weekStartsOn)!==null&&g!==void 0?g:(M=D.locale)===null||M===void 0||(A=M.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&h!==void 0?h:0);if(!(G>=0&&G<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!R.localize)throw new RangeError("locale must contain localize property");if(!R.formatLong)throw new RangeError("locale must contain formatLong property");var B=mn(t);if(!jre(B))throw new RangeError("Invalid time value");var $=Dm(B),q=$re(B,$),V={firstWeekContainsDate:N,weekStartsOn:G,locale:R,_originalDate:B},K=C.match(qse).map(function(x){var ie=x[0];if(ie==="p"||ie==="P"){var X=rse[ie];return X(x,R.formatLong)}return x}).join("").match($se).map(function(x){if(x==="''")return"'";var ie=x[0];if(ie==="'")return Kse(x);var X=nse[ie];if(X)return!(n!=null&&n.useAdditionalWeekYearTokens)&&use(x)&&Uw(x,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&ase(x)&&Uw(x,e,String(t)),X(q,x,R.localize,V);if(ie.match(Xse))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ie+"`");return x}).join("");return K}function Kse(t){var e=t.match(Yse);return e?e[1].replace(Zse,"'"):t}var Jse=typeof global=="object"&&global&&global.Object===Object&&global;const ME=Jse;var Qse=typeof self=="object"&&self&&self.Object===Object&&self,xse=ME||Qse||Function("return this")();const er=xse;var eoe=er.Symbol;const Rl=eoe;var CE=Object.prototype,toe=CE.hasOwnProperty,noe=CE.toString,ou=Rl?Rl.toStringTag:void 0;function ioe(t){var e=toe.call(t,ou),n=t[ou];try{t[ou]=void 0;var i=!0}catch{}var l=noe.call(t);return i&&(e?t[ou]=n:delete t[ou]),l}var loe=Object.prototype,roe=loe.toString;function soe(t){return roe.call(t)}var ooe="[object Null]",aoe="[object Undefined]",Fw=Rl?Rl.toStringTag:void 0;function _o(t){return t==null?t===void 0?aoe:ooe:Fw&&Fw in Object(t)?ioe(t):soe(t)}function cr(t){return t!=null&&typeof t=="object"}var uoe="[object Symbol]";function Xd(t){return typeof t=="symbol"||cr(t)&&_o(t)==uoe}function foe(t,e){for(var n=-1,i=t==null?0:t.length,l=Array(i);++n0){if(++e>=Noe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Uoe(t){return function(){return t}}var Foe=function(){try{var t=bo(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ad=Foe;var Goe=ad?function(t,e){return ad(t,"toString",{configurable:!0,enumerable:!1,value:Uoe(e),writable:!0})}:Kg;const Voe=Goe;var Woe=Hoe(Voe);const joe=Woe;function $oe(t,e){for(var n=-1,i=t==null?0:t.length;++n-1}var Joe=9007199254740991,Qoe=/^(?:0|[1-9]\d*)$/;function Qg(t,e){var n=typeof t;return e=e??Joe,!!e&&(n=="number"||n!="symbol"&&Qoe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=nae}function Ca(t){return t!=null&&xg(t.length)&&!Jg(t)}function RE(t,e,n){if(!Pl(n))return!1;var i=typeof e;return(i=="number"?Ca(n)&&Qg(e,n.length):i=="string"&&e in n)?xu(n[e],t):!1}function iae(t){return IE(function(e,n){var i=-1,l=n.length,r=l>1?n[l-1]:void 0,s=l>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(l--,r):void 0,s&&RE(n[0],n[1],s)&&(r=l<3?void 0:r,l=1),e=Object(e);++i-1}function bue(t,e){var n=this.__data__,i=xd(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function Zr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0&&n(o)?e>1?r_(o,e-1,n,i,l):l_(l,o):i||(l[l.length]=o)}return l}var Bue=HE(Object.getPrototypeOf,Object);const s_=Bue;var zue="[object Object]",Hue=Function.prototype,Uue=Object.prototype,VE=Hue.toString,Fue=Uue.hasOwnProperty,Gue=VE.call(Object);function Vue(t){if(!cr(t)||_o(t)!=zue)return!1;var e=s_(t);if(e===null)return!0;var n=Fue.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&VE.call(n)==Gue}function Wue(){this.__data__=new Zr,this.size=0}function jue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function $ue(t){return this.__data__.get(t)}function que(t){return this.__data__.has(t)}var Yue=200;function Zue(t,e){var n=this.__data__;if(n instanceof Zr){var i=n.__data__;if(!Bu||i.lengtho))return!1;var u=r.get(t),f=r.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=n&Lce?new zu:void 0;for(r.set(t,e),r.set(e,t);++c=Cde){var u=e?null:Mde(t);if(u)return u_(u);s=!1,l=eO,a=new zu}else a=e?[]:o;e:for(;++i{const e=Math.min(t.width,t.height);return[e*3/400,e*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:_i.RADIUS,name:"Radius"}]}}),Yde=jt({},rf,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:_i.AREA,name:"Poor area"},{type:_i.AREA,name:"Satisfactory area"},{type:_i.AREA,name:"Great area"},{type:_i.QUARTILE,name:"Quartiles"}]}}),Zde=jt({},co,{bars:{dividerSize:1.5},timeScale:jt(ih,{addSpaceOnEdges:0})}),Xde=jt({},Ni,{tooltip:jt({},oO,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[e*20/400,e*75/400]},wordMapsTo:"word"}}),dO=jt({},Ni,{pie:{labels:{formatter:null,enabled:!0},alignment:Il.LEFT,sortFunction:null,valueMapsTo:"value"}}),Kde=jt({},Ni,{legend:{enabled:!1},gauge:{type:_S.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,numberFormatter:t=>Number(t.toFixed(2))%1!==0?t.toFixed(2).toLocaleString():t.toFixed().toLocaleString(),alignment:Il.LEFT}}),Jde=jt({},dO,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20),numberFormatter:t=>Math.floor(t).toLocaleString()},alignment:Il.LEFT}}),hO=jt({},Ni,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Qde=jt({},hO,{legend:{enabled:!0}}),xde=jt({},Ni,{radar:{axes:{angle:"key",value:"value"},alignment:Il.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:t=>t??"N/A"}}),ehe=jt({},co,{comboChartTypes:[]}),the=jt({tree:{type:gS.TREE}},Ni,{}),nhe=jt({},Ni,{data:jt(Ni.data,{groupMapsTo:"name"})}),ihe=jt({},Ni,Dde,{data:jt(Ni.data,{groupMapsTo:"name"})}),lhe=jt({},Ni,{alluvial:{data:jt(Ni.data,{groupMapsTo:"source"}),nodeAlignment:Il.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),rhe=jt({},Ni,{axes:aO,heatmap:{divider:{state:pS.AUTO},colorLegend:{type:"linear"}}}),she=jt({},uO,{choropleth:{colorLegend:{type:"linear"}}}),ohe={alluvialChart:lhe,areaChart:cO,axisChart:rf,boxplotChart:Wde,bubbleChart:qde,bulletChart:Yde,chart:Ni,circlePackChart:ihe,choroplethChart:she,comboChart:ehe,donutChart:Jde,gaugeChart:Kde,groupedBarChart:Gde,heatmapChart:rhe,histogramChart:Zde,lineChart:fO,lollipopChart:jde,meterChart:hO,pieChart:dO,proportionalMeterChart:Qde,radarChart:xde,scatterChart:c_,simpleBarChart:Fde,stackedAreaChart:$de,stackedBarChart:Vde,thematicChart:uO,treeChart:the,treemapChart:nhe,wordCloudChart:Xde};function ahe(t,e,n){let i=null;return function(...l){const r=this;r.mousePosition=so(l[0],n),clearTimeout(i),i=setTimeout(function(){t.apply(r,l)},e)}}function uhe(t,e){var n;const i=lf(t),l=Object.keys(e.axes||{});(n=e==null?void 0:e.toolbar)!=null&&n.controls&&delete i.toolbar.controls,l.length===0&&delete i.axes;for(const r in i.axes)if(l.includes(r)){const s=e.axes[r];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),s.mapsTo==null){const a=s.scaleType;a==null?s.mapsTo="value":a===St.TIME?s.mapsTo="date":a===St.LABELS&&(s.mapsTo="key")}}else delete i.axes[r];return mO(i,e),jt(i,e)}function Nr(t){if(!t)return;const e=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=t.getAttribute("transform").match(e);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Uu(t,e,n){if(n>t.length)return t;if(e===Zl.MID_LINE)return t.substr(0,n/2)+"..."+t.substr(-n/2);if(e===Zl.FRONT_LINE)return"..."+t.substr(-n);if(e===Zl.END_LINE)return t.substr(0,n)+"..."}function mO(t,e){const n=ye(t,"legend","additionalItems"),i=ye(e,"legend","additionalItems");if(n&&i){const l=i.map(o=>o.type),r=n.map(o=>o.type),s=Nde.filter(o=>r.includes(o.type)&&!l.includes(o.type));t.legend.additionalItems=s,e.legend.additionalItems=Lde(s,i,"name")}}const ye=(t,...e)=>{let n=t;if(n){for(const i of e)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},gO=(t,e)=>e===tl.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t,d_=(t,e)=>{const{x0:n,x1:i,y0:l,y1:r}=gO(t,e);return`M${n},${l}L${n},${r}L${i},${r}L${i},${l}L${n},${l}`};function na(t,e,n){return n===tl.VERTICAL?[t,e]:[e,t]}var _O=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(_O||{});const $1=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function pO(t,e,n,i,l){const r=e===0,s=Number(_a(new Date(t),"c"))===2,o=Number(_a(new Date(t),"q"))===1,a=e!==0?n[e-1]:null;switch(i){case"15seconds":return r||oc(t)||uu(t,a)||ps(t);case"minute":return r||oc(t)||uu(t,a)||ps(t);case"30minutes":return r||oc(t)||uu(t,a)||ps(t);case"hourly":return r||oc(t)||uu(t,a)||ps(t);case"daily":return l?r||s||ps(t):r||uu(t,a)||ps(t);case"weekly":return r||s||ps(t);case"monthly":return r||ps(t);case"quarterly":return r||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Um(t,e,n,i,l){const r=l.showDayName,s=i==="daily"&&r?"weekly":i,o=new Date(t),a=ye(l,"timeIntervalFormats")[s],u=ye(a,"primary"),f=ye(a,"secondary");let c=pO(t,e,n,i,r)?u:f;i==="15seconds"&&o.getMilliseconds()!==0&&(c=c.replace("pp","h:mm:ss.SSS a"));const d=l.localeObject;return _a(o,c,{locale:d})}function fd(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function fhe(t){if(t)return t.slice(1).map((e,n)=>e-t[n])}function che(t){const e=$1.reduce((n,[,i],l)=>{const r=$1[n][1],s=Math.abs(r-t),o=Math.abs(i-t);return s(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(oi||{});function dhe(t,e){return t&&lO(t,e,tf)}function hhe(t,e){return function(n,i){if(n==null)return n;if(!Ca(n))return t(n,i);for(var l=n.length,r=e?l:-1,s=Object(n);(e?r--:++re.includes(o[r]))),s&&Object.keys(s).forEach(o=>{const a=s[o].mapsTo,u=s[o].scaleType;if((u===St.LINEAR||u===St.LOG)&&(i=i.map(f=>({...f,[a]:f[a]===null?f[a]:Number(f[a])}))),a&&s[o].domain)if(u===St.LABELS)i=i.filter(f=>s[o].domain.includes(f[a]));else{const[f,c]=s[o].domain;i=i.filter(d=>!(a in d)||d[a]>=f&&d[a]<=c)}}),i.filter(o=>l.find(a=>a.name===o[r]))}getDisplayData(e){if(!this.get("data"))return null;const{ACTIVE:n}=Ti.items.status,i=this.getDataGroups(e),{groupMapsTo:l}=this.getOptions().data;return this.getAllDataFromDomain(e).filter(r=>i.find(s=>s.name===r[l]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(e){const n=this.sanitize(lf(e)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(e){return ye(this.getOptions(),"data","loading")?[]:e?this.get("dataGroups").filter(n=>e.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(e){const{ACTIVE:n}=Ti.items.status;return this.getDataGroups(e).filter(i=>i.status===n)}getDataGroupNames(e){return this.getDataGroups(e).map(n=>n.name)}getActiveDataGroupNames(e){return this.getActiveDataGroups(e).map(n=>n.name)}aggregateBinDataByGroup(e){return yhe(e,"group")}getBinConfigurations(){const e=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),l=this.services.cartesianScales.getDomainIdentifier(),r=n.axes[i],{groupMapsTo:s}=n.data,{bins:o=Rde.defaultBins}=r,a=Array.isArray(o),u=Ax().value(h=>h[l]).thresholds(o)(e);if(a)u[u.length-1].x1=o[o.length-1];else{const h=u[0].x1-u[0].x0;u[u.length-1].x1=+u[u.length-1].x0+h}const f=a?[o[0],o[o.length-1]]:[u[0].x0,u[u.length-1].x1],c=Array.from(new Set(e.map(h=>h[s]))),d=[];return u.forEach(h=>{const g=`${h.x0}-${h.x1}`,_=this.aggregateBinDataByGroup(h);c.forEach(k=>{d.push({group:k,key:g,value:_[k]||0,bin:h.x0})})}),{bins:u,binsDomain:f}}getBinnedStackedData(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this.getActiveDataGroupNames(),{bins:l}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:l});return U1().keys(i)(r).map((s,o)=>Object.keys(s).filter(a=>!isNaN(a)).map(a=>{const u=s[a];return u[n]=i[o],u}))}getGroupedData(e){const n=this.getDisplayData(e),i={},{groupMapsTo:l}=this.getOptions().data;return n.map(r=>{const s=r[l];i[s]!==null&&i[s]!==void 0?i[s].push(r):i[s]=[r]}),Object.keys(i).map(r=>({name:r,data:i[r]}))}getStackKeys({bins:e=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),l=this.getDisplayData(n);let r;e?r=e.map(a=>`${a.x0}-${a.x1}`):r=Hu(l.map(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a);return a[u]instanceof Date?p6(a[u]):a[u]&&typeof a[u].toString=="function"?a[u].toString():a[u]}));const s=this.services.cartesianScales.domainAxisPosition,o=i.axes[s].scaleType;return o===St.TIME?r.sort((a,u)=>{const f=new Date(a),c=new Date(u);return f-c}):(o===St.LOG||o===St.LINEAR)&&r.sort((a,u)=>a-u),r}getDataValuesGroupedByKeys({bins:e=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.getDisplayData(n),s=this.getDataGroupNames(),o=this.getStackKeys({bins:e,groups:n});return e?o.map(a=>{const[u,f]=a.split("-"),c={x0:u,x1:f},d=e.find(h=>h.x0.toString()===u.toString());return s.forEach(h=>{c[h]=d.filter(g=>g[l]===h).length}),c}):o.map(a=>{const u={sharedStackKey:a};return s.forEach(f=>{const c=r.find(h=>{const g=this.services.cartesianScales.getDomainIdentifier(h);return h[l]===f&&Object.prototype.hasOwnProperty.call(h,g)&&(h[g]instanceof Date?p6(h[g])===a:h[g].toString()===a)}),d=this.services.cartesianScales.getRangeIdentifier(u);u[f]=c?c[d]:null}),u})}getStackedData({percentage:e=!1,groups:n=null,divergent:i=!1}){const l=this.getOptions(),{groupMapsTo:r}=l.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(e){const a=bhe(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{s.forEach(f=>{a[u.sharedStackKey]+=u[f]})}),o.forEach(u=>{s.forEach(f=>{const c=a[u.sharedStackKey];a[u.sharedStackKey]?u[f]=u[f]/c*100:u[f]=0})})}return(i?U1().offset(Hre):U1()).keys(s)(o).map((a,u)=>Object.keys(a).filter(f=>!isNaN(f)).map(f=>{const c=a[f];return c[r]=s[u],c}))}getOptions(){return this.state.options}set(e,n){this.state=Object.assign({},this.state,e);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(e){return e?this.state[e]:this.state}setOptions(e){const n=this.getOptions();mO(n,e),this.set({options:jt(n,e)})}update(e=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent($e.Model.UPDATE,{animate:e}))}toggleDataLabel(e){const{ACTIVE:n,DISABLED:i}=Ti.items.status,l=this.getDataGroups(),r=l.some(u=>u.status===i),s=l.filter(u=>u.status===n);if(r)if(s.length===1&&s[0].name===e)l.forEach((u,f)=>{l[f].status=n});else{const u=l.findIndex(f=>f.name===e);l[u].status=l[u].status===i?n:i}else l.forEach((u,f)=>{l[f].status=u.name===e?n:i});const o=l.filter(u=>u.status===n),a=this.getOptions();l.some(u=>u.status===i)?a.data.selectedGroups=o.map(u=>u.name):a.data.selectedGroups=[],this.services.events.dispatchEvent($e.Legend.ITEMS_UPDATE,{dataGroups:l}),this.set({dataGroups:l})}getIsFilled(e,n,i,l){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(e,n,i,l):l}getFillColor(e,n,i){const l=this.getOptions(),r=ye(this.colorScale,e);return l.getFillColor?l.getFillColor(e,n,i,r):r}getStrokeColor(e,n,i){const l=this.getOptions(),r=ye(this.colorScale,e);return l.getStrokeColor?l.getStrokeColor(e,n,i,r):r}isUserProvidedColorScaleValid(){const e=ye(this.getOptions(),"color","scale"),n=this.getDataGroups();return e==null||Object.keys(e).length==0?!1:n.some(i=>Object.keys(e).includes(i.name))}getColorClassName(e){const n=this.colorClassNames(e.dataGroupName);let i=e.originalClassName;return e.classNameTypes.forEach(l=>i=e.originalClassName?`${i} ${l}-${n}`:`${l}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(e){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:l}=e;return i.forEach(r=>{r.data.forEach((s,o)=>{let a;const u=ye(r,"label");if(u===null){const c=ye(l,o);c?a=c:a="Ungrouped"}else a=u;const f={group:a,key:l[o]};isNaN(s)?(f.value=s.value,f.date=s.date):f.value=s,n.push(f)})}),n}getTabularDataArray(){return[]}exportToCSV(){const e=this.getTabularDataArray().map(l=>l.map(r=>`"${r==="–"?"–":r}"`));let n="",i="";e.forEach(function(l,r){i=l.join(","),n+=r{this.allDataGroups.indexOf(e)===-1&&this.allDataGroups.push(e)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(e){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:l}=Ti.items.status,r=this.getOptions(),s=Hu(e.map(a=>a[n]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(a=>s.includes(a))||(r.data.selectedGroups=[]));const o=a=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(a)?i:l;return s.map(a=>({name:a,status:o(a)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const e=this.getOptions(),n=ye(e,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const e=ye(this.getOptions(),"color","pairing");let n=ye(e,"numberOfVariants");(!n||n5?14:n,s=`${r}-color`;i=i<=l[s]?i:1;const o=this.allDataGroups.map((a,u)=>`${r}-${i}-${u%14+1}`);this.colorClassNames=Rg().range(o).domain(this.allDataGroups)}}class The extends vO{constructor(e){super(e),this.axisFlavor=wg.DEFAULT}assignRangeAndDomains(){const{cartesianScales:e}=this.services,n=this.getOptions(),i=e.isDualAxes(),l={primaryDomain:e.domainAxisPosition,primaryRange:e.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(l.secondaryDomain=e.secondaryDomainAxisPosition,l.secondaryRange=e.secondaryRangeAxisPosition),Object.keys(l).forEach(r=>{const s=l[r];e.scales[s]?l[r]={position:s,label:e.getScaleLabel(s),identifier:ye(n,"axes",s,"mapsTo")}:l[r]=null}),l}getTabularDataArray(){const e=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:l}=this.services,{primaryDomain:r,primaryRange:s,secondaryDomain:o,secondaryRange:a}=this.assignRangeAndDomains(),u=l.getDomainAxisScaleType();let f;return u===St.TIME&&(f=c=>_a(c,"MMM d, yyyy")),[["Group",r.label,s.label,...o?[o.label]:[],...a?[a.label]:[]],...e.map(c=>[c[i],c[r.identifier]===null?"–":f?f(c[r.identifier]):c[r.identifier],c[s.identifier]===null||isNaN(c[s.identifier])?"–":c[s.identifier].toLocaleString(),...o?[c[o.identifier]===null?"–":c[o.identifier]]:[],...a?[c[a.identifier]===null||isNaN(c[a.identifier])?"–":c[a.identifier]]:[]])]}setData(e){let n;if(e&&(n=super.setData(e),ye(this.getOptions(),"zoomBar",Qe.TOP,"enabled"))){const i=ye(this.getOptions(),"zoomBar",Qe.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(e){const n=e?this.sanitize(lf(e)):this.getDisplayData();let i=n;const{cartesianScales:l}=this.services;if(n&&l.domainAxisPosition&&l.rangeAxisPosition){const r=l.getDomainIdentifier(),s=l.getRangeIdentifier();let o=n.map(a=>a[r].getTime());o=Hu(o).sort(),i=o.map(a=>{let u=0;const f={};return n.forEach(c=>{c[r].getTime()===a&&(u+=c[s])}),f[r]=new Date(a),f[s]=u,f})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(e){const n=this.getOptions();if(!n.axes)return e;const i=[];return Object.keys(Qe).forEach(l=>{const r=Qe[l],s=n.axes[r];if(s&&s.scaleType===St.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&e.forEach(l=>{i.forEach(r=>{ye(l,r,"getTime")===null&&(l[r]=new Date(l[r]))})}),e}sanitize(e){return e=super.sanitize(e),e=this.sanitizeDateValues(e),e}}var She=/\s/;function Ehe(t){for(var e=t.length;e--&&She.test(t.charAt(e)););return e}var Ohe=/^\s+/;function Mhe(t){return t&&t.slice(0,Ehe(t)+1).replace(Ohe,"")}var b6=0/0,Che=/^[-+]0x[0-9a-f]+$/i,Ahe=/^0b[01]+$/i,Lhe=/^0o[0-7]+$/i,Dhe=parseInt;function yu(t){if(typeof t=="number")return t;if(Xd(t))return b6;if(Pl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Pl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Mhe(t);var n=Ahe.test(t);return n||Lhe.test(t)?Dhe(t.slice(2),n?2:8):Che.test(t)?b6:+t}var Ihe=function(){return er.Date.now()};const q1=Ihe;var Rhe="Expected a function",Phe=Math.max,Nhe=Math.min;function Bhe(t,e,n){var i,l,r,s,o,a,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Rhe);e=yu(e)||0,Pl(n)&&(f=!!n.leading,c="maxWait"in n,r=c?Phe(yu(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d);function h(D){var R=i,N=l;return i=l=void 0,u=D,s=t.apply(N,R),s}function g(D){return u=D,o=setTimeout(y,e),f?h(D):s}function _(D){var R=D-a,N=D-u,G=e-R;return c?Nhe(G,r-N):G}function k(D){var R=D-a,N=D-u;return a===void 0||R>=e||R<0||c&&N>=r}function y(){var D=q1();if(k(D))return T(D);o=setTimeout(y,_(D))}function T(D){return o=void 0,d&&i?h(D):(i=l=void 0,s)}function M(){o!==void 0&&clearTimeout(o),u=0,i=a=l=o=void 0}function A(){return o===void 0?s:T(q1())}function C(){var D=q1(),R=k(D);if(i=arguments,l=this,a=D,R){if(o===void 0)return g(a);if(c)return clearTimeout(o),o=setTimeout(y,e),h(a)}return o===void 0&&(o=setTimeout(y,e)),s}return C.cancel=M,C.flush=A,C}function zhe(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),l=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(l),e&&(i.href=e),l.href=t,l.href}const Hhe=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Vr(t){const e=[];for(let n=0,i=t.length;nfl||t.height>fl)&&(t.width>fl&&t.height>fl?t.width>t.height?(t.height*=fl/t.width,t.width=fl):(t.width*=fl/t.height,t.height=fl):t.width>fl?(t.height*=fl/t.width,t.width=fl):(t.width*=fl/t.height,t.height=fl))}function dd(t){return new Promise((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}async function Whe(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function jhe(t,e,n){const i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),r=document.createElementNS(i,"foreignObject");return l.setAttribute("width",`${e}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${e} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),l.appendChild(r),r.appendChild(t),Whe(l)}const el=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||el(n,e)};function $he(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function qhe(t){return Vr(t).map(e=>{const n=t.getPropertyValue(e),i=t.getPropertyPriority(e);return`${e}: ${n}${i?" !important":""};`}).join(" ")}function Yhe(t,e,n){const i=`.${t}:${e}`,l=n.cssText?$he(n):qhe(n);return document.createTextNode(`${i}{${l}}`)}function v6(t,e,n){const i=window.getComputedStyle(t,n),l=i.getPropertyValue("content");if(l===""||l==="none")return;const r=Hhe();try{e.className=`${e.className} ${r}`}catch{return}const s=document.createElement("style");s.appendChild(Yhe(r,n,i)),e.appendChild(s)}function Zhe(t,e){v6(t,e,":before"),v6(t,e,":after")}const k6="application/font-woff",w6="image/jpeg",Xhe={woff:k6,woff2:k6,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:w6,jpeg:w6,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Khe(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function h_(t){const e=Khe(t).toLowerCase();return Xhe[e]||""}function Jhe(t){return t.split(/,/)[1]}function Gm(t){return t.search(/^(data:)/)!==-1}function wO(t,e){return`data:${e};base64,${t}`}async function yO(t,e,n){const i=await fetch(t,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const l=await i.blob();return new Promise((r,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{r(n({res:i,result:o.result}))}catch(a){s(a)}},o.readAsDataURL(l)})}const Y1={};function Qhe(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function m_(t,e,n){const i=Qhe(t,e,n.includeQueryParams);if(Y1[i]!=null)return Y1[i];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let l;try{const r=await yO(t,n.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),Jhe(o)));l=wO(r,e)}catch(r){l=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;r&&(s=typeof r=="string"?r:r.message),s&&console.warn(s)}return Y1[i]=l,l}async function xhe(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):dd(e)}async function e1e(t,e){if(t.currentSrc){const r=document.createElement("canvas"),s=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,s==null||s.drawImage(t,0,0,r.width,r.height);const o=r.toDataURL();return dd(o)}const n=t.poster,i=h_(n),l=await m_(n,i,e);return dd(l)}async function t1e(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await lh(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function n1e(t,e){return el(t,HTMLCanvasElement)?xhe(t):el(t,HTMLVideoElement)?e1e(t,e):el(t,HTMLIFrameElement)?t1e(t):t.cloneNode(!1)}const i1e=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function l1e(t,e,n){var i,l;let r=[];return i1e(t)&&t.assignedNodes?r=Vr(t.assignedNodes()):el(t,HTMLIFrameElement)&&!((i=t.contentDocument)===null||i===void 0)&&i.body?r=Vr(t.contentDocument.body.childNodes):r=Vr(((l=t.shadowRoot)!==null&&l!==void 0?l:t).childNodes),r.length===0||el(t,HTMLVideoElement)||await r.reduce((s,o)=>s.then(()=>lh(o,n)).then(a=>{a&&e.appendChild(a)}),Promise.resolve()),e}function r1e(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Vr(i).forEach(l=>{let r=i.getPropertyValue(l);l==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),el(t,HTMLIFrameElement)&&l==="display"&&r==="inline"&&(r="block"),l==="d"&&e.getAttribute("d")&&(r=`path(${e.getAttribute("d")})`),n.setProperty(l,r,i.getPropertyPriority(l))})}function s1e(t,e){el(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),el(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function o1e(t,e){if(el(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(l=>t.value===l.getAttribute("value"));i&&i.setAttribute("selected","")}}function a1e(t,e){return el(e,Element)&&(r1e(t,e),Zhe(t,e),s1e(t,e),o1e(t,e)),e}async function u1e(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const i={};for(let r=0;rn1e(i,e)).then(i=>l1e(t,i,e)).then(i=>a1e(t,i)).then(i=>u1e(i,e))}const TO=/url\((['"]?)([^'"]+?)\1\)/g,f1e=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,c1e=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function d1e(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function h1e(t){const e=[];return t.replace(TO,(n,i,l)=>(e.push(l),n)),e.filter(n=>!Gm(n))}async function m1e(t,e,n,i,l){try{const r=n?zhe(e,n):e,s=h_(e);let o;if(l){const a=await l(r);o=wO(a,s)}else o=await m_(r,s,i);return t.replace(d1e(e),`$1${o}$3`)}catch{}return t}function g1e(t,{preferredFontFormat:e}){return e?t.replace(c1e,n=>{for(;;){const[i,,l]=f1e.exec(n)||[];if(!l)return"";if(l===e)return`src: ${i};`}}):t}function SO(t){return t.search(TO)!==-1}async function EO(t,e,n){if(!SO(t))return t;const i=g1e(t,n);return h1e(i).reduce((l,r)=>l.then(s=>m1e(s,r,e,n)),Promise.resolve(i))}async function ac(t,e,n){var i;const l=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(t);if(l){const r=await EO(l,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function _1e(t,e){await ac("background",t,e)||await ac("background-image",t,e),await ac("mask",t,e)||await ac("mask-image",t,e)}async function p1e(t,e){const n=el(t,HTMLImageElement);if(!(n&&!Gm(t.src))&&!(el(t,SVGImageElement)&&!Gm(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,l=await m_(i,h_(i),e);await new Promise((r,s)=>{t.onload=r,t.onerror=s;const o=t;o.decode&&(o.decode=r),o.loading==="lazy"&&(o.loading="eager"),n?(t.srcset="",t.src=l):t.href.baseVal=l})}async function b1e(t,e){const n=Vr(t.childNodes).map(i=>OO(i,e));await Promise.all(n).then(()=>t)}async function OO(t,e){el(t,Element)&&(await _1e(t,e),await p1e(t,e),await b1e(t,e))}function v1e(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(l=>{n[l]=i[l]}),t}const y6={};async function T6(t){let e=y6[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},y6[t]=e,e}async function S6(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,l=(n.match(/url\([^)]+\)/g)||[]).map(async r=>{let s=r.replace(i,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),yO(s,e.fetchRequestInit,({result:o})=>(n=n.replace(r,`url(${o})`),[r,o]))});return Promise.all(l).then(()=>n)}function E6(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=t.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=l.exec(i);if(a===null)break;e.push(a[0])}i=i.replace(l,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let a=r.exec(i);if(a===null){if(a=o.exec(i),a===null)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(a[0])}return e}async function k1e(t,e){const n=[],i=[];return t.forEach(l=>{if("cssRules"in l)try{Vr(l.cssRules||[]).forEach((r,s)=>{if(r.type===CSSRule.IMPORT_RULE){let o=s+1;const a=r.href,u=T6(a).then(f=>S6(f,e)).then(f=>E6(f).forEach(c=>{try{l.insertRule(c,c.startsWith("@import")?o+=1:l.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:c,error:d})}})).catch(f=>{console.error("Error loading remote css",f.toString())});i.push(u)}})}catch(r){const s=t.find(o=>o.href==null)||document.styleSheets[0];l.href!=null&&i.push(T6(l.href).then(o=>S6(o,e)).then(o=>E6(o).forEach(a=>{s.insertRule(a,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",r)}}),Promise.all(i).then(()=>(t.forEach(l=>{if("cssRules"in l)try{Vr(l.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${l.href}`,r)}}),n))}function w1e(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>SO(e.style.getPropertyValue("src")))}async function y1e(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Vr(t.ownerDocument.styleSheets),i=await k1e(n,e);return w1e(i)}async function T1e(t,e){const n=await y1e(t,e);return(await Promise.all(n.map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return EO(i.cssText,l,e)}))).join(` -`)}async function S1e(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await T1e(t,e);if(n){const i=document.createElement("style"),l=document.createTextNode(n);i.appendChild(l),t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}}async function E1e(t,e={}){const{width:n,height:i}=kO(t,e),l=await lh(t,e,!0);return await S1e(l,e),await OO(l,e),v1e(l,e),await jhe(l,n,i)}async function MO(t,e={}){const{width:n,height:i}=kO(t,e),l=await E1e(t,e),r=await dd(l),s=document.createElement("canvas"),o=s.getContext("2d"),a=e.pixelRatio||Ghe(),u=e.canvasWidth||n,f=e.canvasHeight||i;return s.width=u*a,s.height=f*a,e.skipAutoScale||Vhe(s),s.style.width=`${u}`,s.style.height=`${f}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(r,0,0,s.width,s.height),s}async function O1e(t,e={}){return(await MO(t,e)).toDataURL()}async function M1e(t,e={}){return(await MO(t,e)).toDataURL("image/jpeg",e.quality||1)}class Kr{constructor(e,n){this.model=e,this.services=n,this.init()}init(){}update(){}setModel(e){this.model=e}setServices(e){this.services=e}}const C1e="DONT_STYLE_ME_css_styles_verifier";class ft extends Kr{constructor(e,n){super(e,n),this.chartID=""}static getHTMLElementSize(e){return{width:e.clientWidth,height:e.clientHeight}}static getSVGElementSize(e,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){e.attr||(e=rt(e));const i={width:0,height:0},l=d=>{d&&Object.keys(i).forEach(h=>{if(d[h]){const g=d[h],_=parseFloat(g);g&&_>i[h]&&(""+g).indexOf("%")===-1&&(i[h]=_)}})},r={width:e.attr("width"),height:e.attr("height")},s=e.node();let o,a,u,f;try{typeof s.getBBox=="function"&&(o=s.getBBox(),a={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(u=s.getBoundingClientRect(),f={width:u.width,height:u.height})}catch(d){console.error(d)}let c;if(s instanceof SVGSVGElement&&(c={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(l(r),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(l(c),i.width>0&&i.height>0))return c;if(n.useBBox&&(l(a),i.width>0&&i.height>0))return a;if(n.useBoundingRect&&(l(f),i.width>0&&i.height>0))return f}try{const d={width:ye(e.node(),"width","baseVal","value"),height:ye(e.node(),"height","baseVal","value")};l(d)}catch{l(c),l(a),l(r)}return i}static appendOrSelect(e,n){const i=e.select(`${n}`);if(i.empty()){let l=n.split("#"),r,s;return l.length===2?(r=l[0],l=l[1].split("."),s=l[0]):(l=n.split("."),r=l[0]),e.append(r).attr("id",s).attr("class",l.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(e){return`chart-${this.chartID}-${e}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const e=this.model.getOptions(),n=ye(e,"style","prefix"),i=rt(this.getHolder()).append("div").classed(`${Qi}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",C1e),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const e=this.getHolder(),{width:n,height:i,theme:l}=this.model.getOptions();n!==this.width&&(e.style.width=n,this.width=n),i!==this.height&&(e.style.height=i,this.height=i),rt(this.getHolder()).classed(`${Qi}--chart-holder`,!0).attr("data-carbon-theme",l)}getHolder(){return this.model.get("holder")}exportToJPG(){const e=this,n=this.getHolder(),i=rt(n);i.classed("filled",!0),M1e(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const e=this,n=this.getHolder(),i=rt(n);i.classed("filled",!0),O1e(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.png"),i.classed("filled",!1)}).catch(function(l){console.error("oops, something went wrong!",l)})}toggleFullscreen(){const e=this.getHolder();rt(e).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const e=rt(this.getHolder()),n=e.classed("fullscreen");e.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=ft.getSVGElementSize(rt(this.mainContainer),{useBBox:!0}),n=rt(this.mainContainer).attr("class"),i=rt(this.mainContainer).selectAll(`.${n} > svg`);let l=0;i.nodes().forEach(function(r){l+=Number(ft.getSVGElementSize(rt(r),{useBBox:!0}).height)}),l<=e?rt(this.mainContainer).attr("height",l):rt(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const e=this.getHolder();e&&rt(e).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent($e.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent($e.Chart.MOUSEOUT)})}addResizeListener(){const e=this.getHolder();if(!e)return;let n=e.clientWidth,i=e.clientHeight;const l=Bhe(()=>{var r;e&&(Math.abs(n-e.clientWidth)>1||Math.abs(i-e.clientHeight)>1)&&(n=e.clientWidth,i=e.clientHeight,(r=this.services.events)==null||r.dispatchEvent($e.Chart.RESIZE))},12.5);new ResizeObserver(l).observe(e)}}class Fu extends Kr{static appendOrUpdateLinearGradient(e){let n=e.svg.select(`defs linearGradient#${e.id}`);n.empty()&&(n=e.svg.append("defs").append("linearGradient").attr("id",e.id).attr("x1",e.x1).attr("x2",e.x2).attr("y1",e.y1).attr("y2",e.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(e.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(e){return(Math.abs(e[1])*100/Math.abs(e[0]-e[1])).toFixed(2)+"%"}static getStops(e,n){const i=e[0]<0&&e[1]>0;let l=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(l=[{offset:"0%",color:n,opacity:"0.6"},{offset:Fu.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),l}}var A1e={value:function(){}};function CO(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Tc.prototype=CO.prototype={constructor:Tc,on:function(t,e){var n=this._,i=L1e(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=e?t:e)),t}function N1e(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=yu(n),n=n===n?n:0),e!==void 0&&(e=yu(e),e=e===e?e:0),P1e(yu(t),e,n)}function B1e(t,e){return nh(t,e)}function z1e(t,e){var n;return bO(t,function(i,l,r){return n=e(i,l,r),!n}),!!n}function H1e(t,e,n){var i=Pi(t)?xE:z1e;return n&&RE(t,e,n)&&(e=void 0),i(t,f_(e))}class $n{constructor(e,n,i){if(this.type="",this.renderType=vn.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=n,i&&(this.configs=i,this.configs.id)){const l=ye(this.model.getOptions(),"style","prefix");this.id=`${l}--${this.configs.id}`}this.parent||this.setParent(rt(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var n;const i=this.parent;if(this.parent=e,!(i&&i.node()===e.node())&&this.type){const l=ye(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Qi}--${l}--${this.type}`,!0),i&&i.classed(`${Qi}--${l}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const n=ye(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",l=ft.appendOrSelect(this.parent,`${this.renderType===vn.SVG?"svg":"div"}${i}.${Qi}--${n}--${this.type}`);if(e.withinChartClip){const r=this.model.get("chartClipId");if(r){const s=rt(`#${r}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&l.attr("clip-path",`url(#${r})`)}}return l.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?jt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const AO=class LO extends $n{constructor(){super(...arguments),this.type="toolbar",this.renderType=vn.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener($e.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener($e.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(ye(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("

      "));const{buttonList:i,overflowMenuItemList:l}=this.getControlConfigs();l&&i.push(this.getOverflowButtonConfig());const r=n.selectAll("div.toolbar-control").data(i,a=>a.id);r.exit().remove();const s=r.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;s.merge(r).classed("disabled",a=>a.shouldBeDisabled()).attr("aria-disabled",a=>a.shouldBeDisabled()).attr("aria-label",a=>a.title).html(a=>` +`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),QJ=new RegExp(`(?:^${Wl}$)|(?:^${zd}$)`),xJ=new RegExp(`^${Wl}$`),eQ=new RegExp(`^${zd}$`),kg=t=>t&&t.exact?QJ:new RegExp(`(?:${ys(t)}${Wl}${ys(t)})|(?:${ys(t)}${zd}${ys(t)})`,"g");kg.v4=t=>t&&t.exact?xJ:new RegExp(`${ys(t)}${Wl}${ys(t)}`,"g");kg.v6=t=>t&&t.exact?eQ:new RegExp(`${ys(t)}${zd}${ys(t)}`,"g");function tQ(t){const e=(...n)=>t(...n);return Object.defineProperty(e,"name",{value:`functionTimeout(${t.name||""})`,configurable:!0}),e}const{toString:nQ}=Object.prototype;function iQ(t){return nQ.call(t)==="[object RegExp]"}const D4={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function lQ(t,e={}){if(!iQ(t))throw new TypeError("Expected a RegExp instance");const n=Object.keys(D4).map(l=>(typeof e[l]=="boolean"?e[l]:t[l])?D4[l]:"").join(""),i=new RegExp(e.source||t.source,n);return i.lastIndex=typeof e.lastIndex=="number"?e.lastIndex:t.lastIndex,i}function rQ(t,e,{timeout:n}={}){try{return tQ(()=>lQ(t).test(e),{timeout:n})()}catch(i){throw i}}const sQ=15,oQ={timeout:400};function eo(t){return t.length>sQ?!1:rQ(kg.v4({exact:!0}),t,oQ)}function I4(t){let e,n,i;function l(s){t[14](s)}let r={modalHeading:t[1],modalLabel:t[2],primaryButtonText:t[3],secondaryButtonText:t[4],primaryButtonDisabled:t[5],hasForm:t[6],shouldSubmitOnEnter:t[7],danger:t[8],size:t[9],preventCloseOnClickOutside:t[10],$$slots:{default:[aQ]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.open=t[0]),e=new xT({props:r}),xe.push(()=>At(e,"open",l)),e.$on("submit",t[15]),e.$on("click:button--secondary",t[12]),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&2&&(a.modalHeading=s[1]),o&4&&(a.modalLabel=s[2]),o&8&&(a.primaryButtonText=s[3]),o&16&&(a.secondaryButtonText=s[4]),o&32&&(a.primaryButtonDisabled=s[5]),o&64&&(a.hasForm=s[6]),o&128&&(a.shouldSubmitOnEnter=s[7]),o&256&&(a.danger=s[8]),o&512&&(a.size=s[9]),o&1024&&(a.preventCloseOnClickOutside=s[10]),o&131072&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.open=s[0],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function aQ(t){let e;const n=t[13].default,i=He(n,t,t[17],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&131072)&&Fe(i,n,l,l[17],e?Ue(n,l[17],r,null):Ge(l[17]),null)},i(l){e||(p(i,l),e=!0)},o(l){v(i,l),e=!1},d(l){i&&i.d(l)}}}function uQ(t){let e,n,i=t[0]&&I4(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,[r]){l[0]?i?(i.p(l,r),r&1&&p(i,1)):(i=I4(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function fQ(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{title:s=""}=e,{label:o=""}=e,{primaryButtonText:a=""}=e,{secondaryButtonText:u=""}=e,{primaryButtonDisabled:f=!1}=e,{hasForm:c=!1}=e,{shouldSubmitOnEnter:d=!1}=e,{danger:h=!1}=e,{size:g=void 0}=e,{preventCloseOnClickOutside:_=!1}=e;const k=nn(),y=()=>{n(0,r=!1),k("close")};function T(C){r=C,n(0,r)}const M=()=>k("submit"),A=()=>k("close");return t.$$set=C=>{"open"in C&&n(0,r=C.open),"title"in C&&n(1,s=C.title),"label"in C&&n(2,o=C.label),"primaryButtonText"in C&&n(3,a=C.primaryButtonText),"secondaryButtonText"in C&&n(4,u=C.secondaryButtonText),"primaryButtonDisabled"in C&&n(5,f=C.primaryButtonDisabled),"hasForm"in C&&n(6,c=C.hasForm),"shouldSubmitOnEnter"in C&&n(7,d=C.shouldSubmitOnEnter),"danger"in C&&n(8,h=C.danger),"size"in C&&n(9,g=C.size),"preventCloseOnClickOutside"in C&&n(10,_=C.preventCloseOnClickOutside),"$$scope"in C&&n(17,l=C.$$scope)},[r,s,o,a,u,f,c,d,h,g,_,k,y,i,T,M,A,l]}class Uc extends Oe{constructor(e){super(),Ee(this,e,fQ,uQ,Se,{open:0,title:1,label:2,primaryButtonText:3,secondaryButtonText:4,primaryButtonDisabled:5,hasForm:6,shouldSubmitOnEnter:7,danger:8,size:9,preventCloseOnClickOutside:10})}}function R4(t){let e,n;return e=new ln({props:{kind:"error",title:t[9]("Custom records unavailable"),subtitle:t[3]}}),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.title=i[9]("Custom records unavailable")),l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function cQ(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[10],rows:t[0],$$slots:{cell:[vQ,({row:l,cell:r})=>({27:l,28:r}),({row:l,cell:r})=>(l?134217728:0)|(r?268435456:0)],default:[gQ]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","table-region svelte-7gav5a")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&1&&(s.rows=l[0]),r&939524737&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function dQ(t){let e,n;return e=new hi({props:{state:"empty",title:t[9]("No custom records"),message:t[9]("Add a record when a local domain should resolve to a specific IPv4 address.")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.title=i[9]("No custom records")),l&512&&(r.message=i[9]("Add a record when a local domain should resolve to a specific IPv4 address.")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function hQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[9]("Loading custom DNS records…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.message=i[9]("Loading custom DNS records…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mQ(t){let e,n;return e=new hg({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function gQ(t){let e,n;return e=new dg({props:{size:"sm",$$slots:{default:[mQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536870912&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _Q(t){let e=t[28].value+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&268435456&&e!==(e=i[28].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function pQ(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[9]("Record actions"),$$slots:{default:[bQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&512&&(r.iconDescription=i[9]("Record actions")),l&671089281&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function bQ(t){let e,n,i,l;function r(){return t[17](t[27])}e=new Al({props:{text:t[9]("Edit")}}),e.$on("click",r);function s(){return t[18](t[27])}return i=new Al({props:{danger:!0,text:t[9]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a&512&&(u.text=t[9]("Edit")),e.$set(u);const f={};a&512&&(f.text=t[9]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function vQ(t){let e,n,i,l;const r=[pQ,_Q],s=[];function o(a,u){return a[28].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function kQ(t){let e,n,i,l,r,s=t[3]&&R4(t);const o=[hQ,dQ,cQ],a=[];function u(f,c){return f[1]&&f[0].length===0?0:f[0].length===0?1:2}return n=u(t),i=a[n]=o[n](t),{c(){s&&s.c(),e=F(),i.c(),l=je()},m(f,c){s&&s.m(f,c),O(f,e,c),a[n].m(f,c),O(f,l,c),r=!0},p(f,c){f[3]?s?(s.p(f,c),c&8&&p(s,1)):(s=R4(f),s.c(),p(s,1),s.m(e.parentNode,e)):s&&(ue(),v(s,1,1,()=>{s=null}),fe());let d=n;n=u(f),n===d?a[n].p(f,c):(ue(),v(a[d],1,1,()=>{a[d]=null}),fe(),i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),p(i,1),i.m(l.parentNode,l))},i(f){r||(p(s),p(i),r=!0)},o(f){v(s),v(i),r=!1},d(f){f&&(E(e),E(l)),s&&s.d(f),a[n].d(f)}}}function wQ(t){let e=t[9]("Add record")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&512&&e!==(e=i[9]("Add record")+"")&&Y(n,e)},d(i){i&&E(n)}}}function yQ(t){let e,n;return e=new bt({props:{size:"small",icon:ho,$$slots:{default:[wQ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871424&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function TQ(t){let e,n,i,l,r,s,o;function a(d){t[19](d)}let u={labelText:t[9]("Domain"),type:"text",placeholder:"printer.home",disabled:t[2]};t[4]!==void 0&&(u.value=t[4]),n=new ei({props:u}),xe.push(()=>At(n,"value",a));function f(d){t[20](d)}let c={labelText:t[9]("IPv4 address"),helperText:t[5]&&!eo(t[5].trim())?t[9]("Enter a valid IPv4 address."):"",invalid:!!t[5]&&!eo(t[5].trim()),invalidText:t[9]("Enter a valid IPv4 address."),type:"text",placeholder:"192.168.1.20",disabled:t[2]};return t[5]!==void 0&&(c.value=t[5]),r=new ei({props:c}),xe.push(()=>At(r,"value",f)),{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),I(e,"class","record-form svelte-7gav5a")},m(d,h){O(d,e,h),z(n,e,null),w(e,l),z(r,e,null),o=!0},p(d,h){const g={};h&512&&(g.labelText=d[9]("Domain")),h&4&&(g.disabled=d[2]),!i&&h&16&&(i=!0,g.value=d[4],Ct(()=>i=!1)),n.$set(g);const _={};h&512&&(_.labelText=d[9]("IPv4 address")),h&544&&(_.helperText=d[5]&&!eo(d[5].trim())?d[9]("Enter a valid IPv4 address."):""),h&32&&(_.invalid=!!d[5]&&!eo(d[5].trim())),h&512&&(_.invalidText=d[9]("Enter a valid IPv4 address.")),h&4&&(_.disabled=d[2]),!s&&h&32&&(s=!0,_.value=d[5],Ct(()=>s=!1)),r.$set(_)},i(d){o||(p(n.$$.fragment,d),p(r.$$.fragment,d),o=!0)},o(d){v(n.$$.fragment,d),v(r.$$.fragment,d),o=!1},d(d){d&&E(e),H(n),H(r)}}}function SQ(t){var c;let e,n=t[9]("GateSentry will stop resolving")+"",i,l,r,s=(((c=t[7])==null?void 0:c.domain)??"")+"",o,a,u=t[9]("to the configured local address.")+"",f;return{c(){e=P("p"),i=$(n),l=F(),r=P("strong"),o=$(s),a=F(),f=$(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h&512&&n!==(n=d[9]("GateSentry will stop resolving")+"")&&Y(i,n),h&128&&s!==(s=(((g=d[7])==null?void 0:g.domain)??"")+"")&&Y(o,s),h&512&&u!==(u=d[9]("to the configured local address.")+"")&&Y(f,u)},d(d){d&&E(e)}}}function EQ(t){let e,n,i,l,r,s,o;e=new jr({props:{title:t[9]("Custom A records"),description:t[9]("Resolve selected domains to local IPv4 addresses before using the upstream resolver."),$$slots:{actions:[yQ],default:[kQ]},$$scope:{ctx:t}}});function a(f){t[21](f)}let u={title:t[6]==null?t[9]("Add custom record"):t[9]("Edit custom record"),label:t[9]("DNS"),primaryButtonText:t[2]?t[9]("Saving…"):t[9]("Save record"),secondaryButtonText:t[9]("Cancel"),primaryButtonDisabled:!t[4].trim()||!eo(t[5].trim())||t[2],hasForm:!0,shouldSubmitOnEnter:!0,preventCloseOnClickOutside:t[2],$$slots:{default:[TQ]},$$scope:{ctx:t}};return t[8]!==void 0&&(u.open=t[8]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("submit",t[14]),i.$on("close",t[11]),s=new Zu({props:{open:t[7]!=null,title:t[9]("Delete custom DNS record?"),label:t[9]("DNS"),confirmText:t[9]("Delete record"),cancelText:t[9]("Cancel"),danger:!0,busy:t[2],$$slots:{default:[SQ]},$$scope:{ctx:t}}}),s.$on("submit",t[15]),s.$on("close",t[22]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,[c]){const d={};c&512&&(d.title=f[9]("Custom A records")),c&512&&(d.description=f[9]("Resolve selected domains to local IPv4 addresses before using the upstream resolver.")),c&536871563&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c&576&&(h.title=f[6]==null?f[9]("Add custom record"):f[9]("Edit custom record")),c&512&&(h.label=f[9]("DNS")),c&516&&(h.primaryButtonText=f[2]?f[9]("Saving…"):f[9]("Save record")),c&512&&(h.secondaryButtonText=f[9]("Cancel")),c&52&&(h.primaryButtonDisabled=!f[4].trim()||!eo(f[5].trim())||f[2]),c&4&&(h.preventCloseOnClickOutside=f[2]),c&536871476&&(h.$$scope={dirty:c,ctx:f}),!l&&c&256&&(l=!0,h.open=f[8],Ct(()=>l=!1)),i.$set(h);const g={};c&128&&(g.open=f[7]!=null),c&512&&(g.title=f[9]("Delete custom DNS record?")),c&512&&(g.label=f[9]("DNS")),c&512&&(g.confirmText=f[9]("Delete record")),c&512&&(g.cancelText=f[9]("Cancel")),c&4&&(g.busy=f[2]),c&536871552&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}const P4="/dns/custom_entries";function OQ(t,e,n){let i,l;ct(t,ti,K=>n(9,i=K)),ct(t,Ln,K=>n(23,l=K));const r=nn(),s=[{key:"domain",value:i("Domain")},{key:"ip",value:i("IP address")},{key:"actions",value:i("Actions")}];let o=[],a=!0,u=!1,f="",c="",d="",h=null,g=null,_=!1;const k=async()=>{n(1,a=!0),n(3,f="");try{const K=await l.api.doCall(P4),x=Array.isArray(K==null?void 0:K.data)?K.data:[];n(0,o=x.map((ie,X)=>({id:X+1,domain:String(ie.domain??""),ip:String(ie.ip??"")})))}catch(K){n(3,f=K instanceof Error&&K.message?K.message:i("Custom DNS records could not be loaded."))}finally{n(1,a=!1)}},y=()=>{n(8,_=!1),n(6,h=null),n(4,c=""),n(5,d="")},T=()=>{y(),n(8,_=!0)},M=K=>{const x=o.find(ie=>ie.id===K);x&&(n(6,h=K),n(4,c=x.domain),n(5,d=x.ip),n(8,_=!0))},A=async K=>{if(u)return!1;n(2,u=!0);try{const x=K.map(({domain:X,ip:ce})=>({domain:X,ip:ce})),ie=await l.api.doCall(P4,"post",x,{"Content-Type":"application/json"});if(!(ie!=null&&ie.ok))throw new Error((ie==null?void 0:ie.error)||i("The DNS records were not accepted."));return Ei.add(Ma({title:i("DNS records updated"),subtitle:i("Custom A records were saved.")},i)),r("updatednsinfo"),await k(),!0}catch(x){return Ei.add(Ss({title:i("DNS records not saved"),subtitle:x instanceof Error&&x.message?x.message:i("Custom DNS records could not be saved.")},i)),!1}finally{n(2,u=!1)}},C=async()=>{const K=c.trim(),x=d.trim();if(!K||!eo(x)||u)return;const ie=h==null?[...o,{id:o.length+1,domain:K,ip:x}]:o.map(X=>X.id===h?{...X,domain:K,ip:x}:X);await A(ie)&&y()},D=async()=>{if(!g||u)return;const K=g;await A(o.filter(ie=>ie.id!==K.id))&&n(7,g=null)};on(k);const R=()=>n(3,f=""),N=K=>M(K.id),G=K=>n(7,g=o.find(x=>x.id===K.id)??null);function B(K){c=K,n(4,c)}function j(K){d=K,n(5,d)}function q(K){_=K,n(8,_)}return[o,a,u,f,c,d,h,g,_,i,s,y,T,M,C,D,R,N,G,B,j,q,()=>n(7,g=null)]}class MQ extends Oe{constructor(e){super(),Ee(this,e,OQ,EQ,Se,{})}}function CQ(t){let e=t[10]("Browse compatible lists")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Browse compatible lists")+"")&&Y(n,e)},d(i){i&&E(n)}}}function AQ(t){let e;return{c(){e=$("0.0.0.0 domain.com")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function LQ(t){let e;return{c(){e=$("domain.com")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function N4(t){let e,n;return e=new ln({props:{kind:"error",title:t[10]("Block lists unavailable"),subtitle:t[4]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.title=i[10]("Block lists unavailable")),l&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function DQ(t){let e,n,i;return n=new ml({props:{sortable:!0,size:"compact",headers:t[11],rows:t[9],$$slots:{cell:[zQ,({row:l,cell:r})=>({27:l,28:r}),({row:l,cell:r})=>(l?134217728:0)|(r?268435456:0)]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","table-region svelte-1u70jgc")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r&512&&(s.rows=l[9]),r&939525696&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function IQ(t){let e,n;return e=new hi({props:{state:"empty",title:t[10]("No block-list sources"),message:t[10]("Add a compatible HTTP or HTTPS list to begin blocking its domains."),$$slots:{default:[UQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.title=i[10]("No block-list sources")),l&1024&&(r.message=i[10]("Add a compatible HTTP or HTTPS list to begin blocking its domains.")),l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function RQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[10]("Loading DNS block lists…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.message=i[10]("Loading DNS block lists…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function PQ(t){let e,n=t[28].value+"",i;return{c(){e=P("span"),i=$(n),I(e,"class","url-cell svelte-1u70jgc")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&268435456&&n!==(n=l[28].value+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function NQ(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[10]("Block-list actions"),$$slots:{default:[BQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1024&&(r.iconDescription=i[10]("Block-list actions")),l&671090240&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function BQ(t){let e,n,i,l;function r(){return t[18](t[27])}e=new Al({props:{text:t[10]("Edit")}}),e.$on("click",r);function s(){return t[19](t[27])}return i=new Al({props:{danger:!0,text:t[10]("Delete")}}),i.$on("click",s),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),l=!0},p(o,a){t=o;const u={};a&1024&&(u.text=t[10]("Edit")),e.$set(u);const f={};a&1024&&(f.text=t[10]("Delete")),i.$set(f)},i(o){l||(p(e.$$.fragment,o),p(i.$$.fragment,o),l=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),l=!1},d(o){o&&E(n),H(e,o),H(i,o)}}}function zQ(t){let e,n,i,l;const r=[NQ,PQ],s=[];function o(a,u){return a[28].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function HQ(t){let e=t[10]("Add block list")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Add block list")+"")&&Y(n,e)},d(i){i&&E(n)}}}function UQ(t){let e,n;return e=new bt({props:{size:"small",icon:ho,$$slots:{default:[HQ]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function FQ(t){let e,n,i=t[10]("Each source may contain either hosts-file entries or one domain per line.")+"",l,r,s,o,a,u,f,c,d,h,g,_,k,y,T;s=new UT({props:{href:"https://github.com/hagezi/dns-blocklists#fake",target:"_blank",inline:!0,$$slots:{default:[CQ]},$$scope:{ctx:t}}}),u=new Q1({props:{type:"single",$$slots:{default:[AQ]},$$scope:{ctx:t}}}),c=new Q1({props:{type:"single",$$slots:{default:[LQ]},$$scope:{ctx:t}}});let M=t[4]&&N4(t);const A=[RQ,IQ,DQ],C=[];function D(R,N){return R[2]&&R[0].length===0?0:R[0].length===0?1:2}return _=D(t),k=C[_]=A[_](t),{c(){e=P("div"),n=P("p"),l=$(i),r=F(),U(s.$$.fragment),o=F(),a=P("div"),U(u.$$.fragment),f=F(),U(c.$$.fragment),h=F(),M&&M.c(),g=F(),k.c(),y=je(),I(n,"class","svelte-1u70jgc"),I(a,"class","format-examples svelte-1u70jgc"),I(a,"aria-label",d=t[10]("Supported block-list formats")),I(e,"class","format-guidance svelte-1u70jgc")},m(R,N){O(R,e,N),w(e,n),w(n,l),w(n,r),z(s,n,null),w(e,o),w(e,a),z(u,a,null),w(a,f),z(c,a,null),O(R,h,N),M&&M.m(R,N),O(R,g,N),C[_].m(R,N),O(R,y,N),T=!0},p(R,N){(!T||N&1024)&&i!==(i=R[10]("Each source may contain either hosts-file entries or one domain per line.")+"")&&Y(l,i);const G={};N&536871936&&(G.$$scope={dirty:N,ctx:R}),s.$set(G);const B={};N&536870912&&(B.$$scope={dirty:N,ctx:R}),u.$set(B);const j={};N&536870912&&(j.$$scope={dirty:N,ctx:R}),c.$set(j),(!T||N&1024&&d!==(d=R[10]("Supported block-list formats")))&&I(a,"aria-label",d),R[4]?M?(M.p(R,N),N&16&&p(M,1)):(M=N4(R),M.c(),p(M,1),M.m(g.parentNode,g)):M&&(ue(),v(M,1,1,()=>{M=null}),fe());let q=_;_=D(R),_===q?C[_].p(R,N):(ue(),v(C[q],1,1,()=>{C[q]=null}),fe(),k=C[_],k?k.p(R,N):(k=C[_]=A[_](R),k.c()),p(k,1),k.m(y.parentNode,y))},i(R){T||(p(s.$$.fragment,R),p(u.$$.fragment,R),p(c.$$.fragment,R),p(M),p(k),T=!0)},o(R){v(s.$$.fragment,R),v(u.$$.fragment,R),v(c.$$.fragment,R),v(M),v(k),T=!1},d(R){R&&(E(e),E(h),E(g),E(y)),H(s),H(u),H(c),M&&M.d(R),C[_].d(R)}}}function GQ(t){let e=t[10]("Add block list")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Add block list")+"")&&Y(n,e)},d(i){i&&E(n)}}}function VQ(t){let e,n;return e=new bt({props:{size:"small",icon:ho,$$slots:{default:[GQ]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&536871936&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function WQ(t){let e,n,i;function l(s){t[20](s)}let r={labelText:t[10]("Block-list URL"),helperText:t[10]("Use a complete HTTP or HTTPS URL to a plain-text domain list."),invalid:!!t[1]&&!t[8],invalidText:t[10]("Enter a complete HTTP or HTTPS URL."),type:"url",placeholder:"https://example.org/blocklist.txt",disabled:t[3]};return t[1]!==void 0&&(r.value=t[1]),e=new ei({props:r}),xe.push(()=>At(e,"value",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o&1024&&(a.labelText=s[10]("Block-list URL")),o&1024&&(a.helperText=s[10]("Use a complete HTTP or HTTPS URL to a plain-text domain list.")),o&258&&(a.invalid=!!s[1]&&!s[8]),o&1024&&(a.invalidText=s[10]("Enter a complete HTTP or HTTPS URL.")),o&8&&(a.disabled=s[3]),!n&&o&2&&(n=!0,a.value=s[1],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function jQ(t){var u;let e,n=t[10]("GateSentry will stop downloading and applying")+"",i,l,r,s=(((u=t[6])==null?void 0:u.content)??"")+"",o,a;return{c(){e=P("p"),i=$(n),l=F(),r=P("strong"),o=$(s),a=$(".")},m(f,c){O(f,e,c),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a)},p(f,c){var d;c&1024&&n!==(n=f[10]("GateSentry will stop downloading and applying")+"")&&Y(i,n),c&64&&s!==(s=(((d=f[6])==null?void 0:d.content)??"")+"")&&Y(o,s)},d(f){f&&E(e)}}}function $Q(t){let e,n,i,l,r,s,o;e=new jr({props:{title:t[10]("DNS block lists"),description:t[10]("GateSentry downloads these domain lists and applies them to DNS requests from every protected client."),$$slots:{actions:[VQ],default:[FQ]},$$scope:{ctx:t}}});function a(f){t[21](f)}let u={title:t[5]==null?t[10]("Add DNS block list"):t[10]("Edit DNS block list"),label:t[10]("DNS"),primaryButtonText:t[3]?t[10]("Saving…"):t[10]("Save block list"),secondaryButtonText:t[10]("Cancel"),primaryButtonDisabled:!t[8]||t[3],hasForm:!0,shouldSubmitOnEnter:!0,preventCloseOnClickOutside:t[3],$$slots:{default:[WQ]},$$scope:{ctx:t}};return t[7]!==void 0&&(u.open=t[7]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("submit",t[15]),i.$on("close",t[12]),s=new Zu({props:{open:t[6]!=null,title:t[10]("Remove DNS block list?"),label:t[10]("DNS"),confirmText:t[10]("Remove block list"),cancelText:t[10]("Cancel"),danger:!0,busy:t[3],$$slots:{default:[jQ]},$$scope:{ctx:t}}}),s.$on("submit",t[16]),s.$on("close",t[22]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,[c]){const d={};c&1024&&(d.title=f[10]("DNS block lists")),c&1024&&(d.description=f[10]("GateSentry downloads these domain lists and applies them to DNS requests from every protected client.")),c&536872533&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c&1056&&(h.title=f[5]==null?f[10]("Add DNS block list"):f[10]("Edit DNS block list")),c&1024&&(h.label=f[10]("DNS")),c&1032&&(h.primaryButtonText=f[3]?f[10]("Saving…"):f[10]("Save block list")),c&1024&&(h.secondaryButtonText=f[10]("Cancel")),c&264&&(h.primaryButtonDisabled=!f[8]||f[3]),c&8&&(h.preventCloseOnClickOutside=f[3]),c&536872202&&(h.$$scope={dirty:c,ctx:f}),!l&&c&128&&(l=!0,h.open=f[7],Ct(()=>l=!1)),i.$set(h);const g={};c&64&&(g.open=f[6]!=null),c&1024&&(g.title=f[10]("Remove DNS block list?")),c&1024&&(g.label=f[10]("DNS")),c&1024&&(g.confirmText=f[10]("Remove block list")),c&1024&&(g.cancelText=f[10]("Cancel")),c&8&&(g.busy=f[3]),c&536872e3&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}function qQ(t,e,n){let i,l,r,s;ct(t,ti,K=>n(10,r=K)),ct(t,Ln,K=>n(23,s=K));const o=nn(),a=[{key:"content",value:r("Block-list URL")},{key:"actions",value:r("Actions")}];let u=[],f=!0,c=!1,d="",h=null,g="",_=null,k=!1;const y=async()=>{n(2,f=!0),n(4,d="");try{const K=await s.api.getSetting("dns_custom_entries"),x=JSON.parse((K==null?void 0:K.Value)||"[]");n(0,u=Array.isArray(x)?x.map(String):[])}catch(K){n(0,u=[]),n(4,d=K instanceof Error&&K.message?K.message:r("DNS block lists could not be loaded."))}finally{n(2,f=!1)}},T=()=>{n(7,k=!1),n(5,h=null),n(1,g="")},M=()=>{T(),n(7,k=!0)},A=K=>{const x=u[K];x!=null&&(n(5,h=K),n(1,g=x),n(7,k=!0))},C=async K=>{if(c)return!1;n(3,c=!0);try{if(await s.api.setSetting("dns_custom_entries",JSON.stringify(K))===!1)throw new Error(r("The block-list setting was rejected."));return n(0,u=K),o("updatednsinfo"),Ei.add(Ma({title:r("Block lists updated"),subtitle:r("DNS block-list sources were saved.")},r)),!0}catch(x){return Ei.add(Ss({title:r("Block lists not saved"),subtitle:x instanceof Error&&x.message?x.message:r("Unable to save block lists.")},r)),!1}finally{n(3,c=!1)}},D=async()=>{const K=g.trim();if(!l||c)return;const x=h==null?[...u,K]:u.map((ie,X)=>X===h?K:ie);await C(x)&&T()},R=async()=>{if(!_||c)return;const K=_;await C(u.filter((x,ie)=>ie!==K.id))&&n(6,_=null)};on(y);const N=()=>n(4,d=""),G=K=>A(Number(K.id)),B=K=>n(6,_=i.find(x=>x.id===Number(K.id))??null);function j(K){g=K,n(1,g)}function q(K){k=K,n(7,k)}const V=()=>n(6,_=null);return t.$$.update=()=>{t.$$.dirty&1&&n(9,i=u.map((K,x)=>({id:x,content:K}))),t.$$.dirty&2&&n(8,l=/^https?:\/\/\S+$/i.test(g.trim()))},[u,g,f,c,d,h,_,k,l,i,r,a,T,M,A,D,R,N,G,B,j,q,V]}class YQ extends Oe{constructor(e){super(),Ee(this,e,qQ,$Q,Se,{})}}function B4(t){let e,n;return e=new ln({props:{kind:"error",title:t[4]("DNS status unavailable"),subtitle:t[3]}}),e.$on("close",t[8]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS status unavailable")),l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ZQ(t){let e,n,i,l=t[4]("Blocked domains")+"",r,s,o,a=(t[0].number_domains_blocked??0)+"",u,f,c,d,h=t[4]("Last updated")+"",g,_,k,y=t[6](t[0].last_updated)+"",T,M,A,C,D=t[4]("Next update")+"",R,N,G,B=t[6](t[0].next_update)+"",j;return{c(){e=P("dl"),n=P("div"),i=P("dt"),r=$(l),s=F(),o=P("dd"),u=$(a),f=F(),c=P("div"),d=P("dt"),g=$(h),_=F(),k=P("dd"),T=$(y),M=F(),A=P("div"),C=P("dt"),R=$(D),N=F(),G=P("dd"),j=$(B),I(i,"class","svelte-1m4hl0s"),I(o,"class","svelte-1m4hl0s"),I(n,"class","svelte-1m4hl0s"),I(d,"class","svelte-1m4hl0s"),I(k,"class","svelte-1m4hl0s"),I(c,"class","svelte-1m4hl0s"),I(C,"class","svelte-1m4hl0s"),I(G,"class","svelte-1m4hl0s"),I(A,"class","svelte-1m4hl0s"),I(e,"class","status-list svelte-1m4hl0s")},m(q,V){O(q,e,V),w(e,n),w(n,i),w(i,r),w(n,s),w(n,o),w(o,u),w(n,f),w(e,c),w(c,d),w(d,g),w(c,_),w(c,k),w(k,T),w(c,M),w(e,A),w(A,C),w(C,R),w(A,N),w(A,G),w(G,j)},p(q,V){V&16&&l!==(l=q[4]("Blocked domains")+"")&&Y(r,l),V&1&&a!==(a=(q[0].number_domains_blocked??0)+"")&&Y(u,a),V&16&&h!==(h=q[4]("Last updated")+"")&&Y(g,h),V&1&&y!==(y=q[6](q[0].last_updated)+"")&&Y(T,y),V&16&&D!==(D=q[4]("Next update")+"")&&Y(R,D),V&1&&B!==(B=q[6](q[0].next_update)+"")&&Y(j,B)},i:_e,o:_e,d(q){q&&E(e)}}}function XQ(t){let e,n;return e=new hi({props:{state:"error",title:t[4]("DNS status is unavailable"),message:t[3]||t[4]("Try refreshing after the DNS service is ready."),retryLabel:t[4]("Retry"),onRetry:t[5]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS status is unavailable")),l&24&&(r.message=i[3]||i[4]("Try refreshing after the DNS service is ready.")),l&16&&(r.retryLabel=i[4]("Retry")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function KQ(t){let e,n;return e=new hi({props:{state:"loading",message:t[4]("Loading DNS status…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.message=i[4]("Loading DNS status…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function JQ(t){let e,n,i,l;const r=[KQ,XQ,ZQ],s=[];function o(a,u){return a[1]&&!a[0]?0:a[0]?2:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function QQ(t){let e,n;return e=new Ql({props:{keyName:"dns_resolver",title:t[4]("DNS resolver"),labelText:t[4]("DNS resolver"),type:"text",helperText:t[4]("Enter an IP address or resolver address reachable from this gateway.")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]("DNS resolver")),l&16&&(r.labelText=i[4]("DNS resolver")),l&16&&(r.helperText=i[4]("Enter an IP address or resolver address reachable from this gateway.")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xQ(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[3]&&B4(t);return l=new jr({props:{title:t[4]("DNS status"),description:t[4]("Block-list totals and update schedule reported by the running DNS service."),$$slots:{default:[JQ]},$$scope:{ctx:t}}}),s=new jr({props:{title:t[4]("Upstream resolver"),description:t[4]("Choose the DNS server GateSentry asks after applying local records and block lists."),$$slots:{default:[QQ]},$$scope:{ctx:t}}}),a=new MQ({}),a.$on("updatednsinfo",t[7]),f=new YQ({}),f.$on("updatednsinfo",t[7]),{c(){d&&d.c(),e=F(),n=P("div"),i=P("div"),U(l.$$.fragment),r=F(),U(s.$$.fragment),o=F(),U(a.$$.fragment),u=F(),U(f.$$.fragment),I(i,"class","dns-column svelte-1m4hl0s"),I(n,"class","dns-grid svelte-1m4hl0s")},m(h,g){d&&d.m(h,g),O(h,e,g),O(h,n,g),w(n,i),z(l,i,null),w(i,r),z(s,i,null),w(i,o),z(a,i,null),w(n,u),z(f,n,null),c=!0},p(h,g){h[3]?d?(d.p(h,g),g&8&&p(d,1)):(d=B4(h),d.c(),p(d,1),d.m(e.parentNode,e)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const _={};g&16&&(_.title=h[4]("DNS status")),g&16&&(_.description=h[4]("Block-list totals and update schedule reported by the running DNS service.")),g&4123&&(_.$$scope={dirty:g,ctx:h}),l.$set(_);const k={};g&16&&(k.title=h[4]("Upstream resolver")),g&16&&(k.description=h[4]("Choose the DNS server GateSentry asks after applying local records and block lists.")),g&4112&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){c||(p(d),p(l.$$.fragment,h),p(s.$$.fragment,h),p(a.$$.fragment,h),p(f.$$.fragment,h),c=!0)},o(h){v(d),v(l.$$.fragment,h),v(s.$$.fragment,h),v(a.$$.fragment,h),v(f.$$.fragment,h),c=!1},d(h){h&&(E(e),E(n)),d&&d.d(h),H(l),H(s),H(a),H(f)}}}function ex(t){let e=t[4]("Dashboard")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function tx(t){let e=t[4]("DNS server")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("DNS server")+"")&&Y(n,e)},d(i){i&&E(n)}}}function nx(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[ex]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[tx]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&4112&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&4112&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function ix(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[nx]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4112&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lx(t){let e=(t[2]?t[4]("Refreshing…"):t[4]("Refresh status"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&20&&e!==(e=(i[2]?i[4]("Refreshing…"):i[4]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function rx(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[2],$$slots:{default:[lx]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.disabled=i[2]),l&4116&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sx(t){let e,n;return e=new Nl({props:{title:t[4]("DNS server"),description:t[4]("Review DNS block-list health, choose an upstream resolver, and manage local names and list sources."),$$slots:{actions:[rx],breadcrumb:[ix],default:[xQ]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&16&&(r.title=i[4]("DNS server")),l&16&&(r.description=i[4]("Review DNS block-list health, choose an upstream resolver, and manage local names and list sources.")),l&4127&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ox(t,e,n){let i,l;ct(t,ti,_=>n(4,i=_)),ct(t,Ln,_=>n(11,l=_));let r=null,s=!0,o=!1,a="",u=null,f=!1;const c=async()=>{if(!(o||f)){n(2,o=!0),n(3,a="");try{n(0,r=await l.api.doCall("/dns/info"))}catch(_){n(3,a=_ instanceof Error&&_.message?_.message:i("DNS status could not be loaded."))}finally{n(1,s=!1),n(2,o=!1)}}},d=_=>{if(!_)return i("Not scheduled");const k=new Date(_*1e3);return Number.isNaN(k.getTime())?i("Unknown"):k.toLocaleString()},h=()=>{n(0,r=null),n(1,s=!0),u&&clearTimeout(u),u=setTimeout(()=>{u=null,c()},3e3)};return on(c),Ls(()=>{f=!0,u&&clearTimeout(u)}),[r,s,o,a,i,c,d,h,()=>n(3,a="")]}class ax extends Oe{constructor(e){super(),Ee(this,e,ox,sx,Se,{})}}var G5=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(G5||{}),V5=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(V5||{}),W5=(t=>(t.UPDATE="model-update",t))(W5||{}),j5=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t))(j5||{}),$5=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))($5||{}),q5=(t=>(t.CHANGE="zoom-domain-change",t))(q5||{}),Y5=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(Y5||{}),Z5=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(Z5||{}),X5=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(X5||{}),K5=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(K5||{}),J5=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(J5||{}),Q5=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(Q5||{}),x5=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(x5||{}),eS=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(eS||{}),tS=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(tS||{}),nS=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(nS||{}),iS=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(iS||{}),lS=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(lS||{}),rS=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(rS||{}),sS=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(sS||{}),oS=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(oS||{}),aS=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(aS||{}),uS=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(uS||{}),fS=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(fS||{}),cS=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(cS||{}),dS=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(dS||{}),hS=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(hS||{});const ux=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:fS,Area:X5,Axis:Z5,Bar:x5,Boxplot:eS,CanvasZoom:Y5,Chart:G5,Choropleth:hS,CirclePack:uS,Gauge:Q5,Heatmap:dS,Legend:aS,Line:nS,Meter:cS,Modal:V5,Model:W5,Pie:J5,Radar:iS,Scatter:tS,Threshold:oS,Toolbar:j5,Tooltip:sS,Tree:lS,Treemap:rS,WordCloud:K5,ZoomBar:$5,ZoomDomain:q5},Symbol.toStringTag,{value:"Module"})),$e=ux;var vn=(t=>(t.HTML="html",t.SVG="svg",t))(vn||{}),mS=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(mS||{}),Oi=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(Oi||{}),Qe=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(Qe||{}),or=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(or||{}),Zl=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(Zl||{}),tl=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(tl||{}),St=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(St||{}),ku=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(ku||{}),Il=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(Il||{}),Au=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(Au||{}),gS=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(gS||{}),fi=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(fi||{}),In=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(In||{}),Hd=(t=>(t.CENTER="center",t))(Hd||{}),$o=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))($o||{}),_S=(t=>(t.SEMI="semi",t.FULL="full",t))(_S||{}),mc=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(mc||{}),ks=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(ks||{}),Vn=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(Vn||{}),gm=(t=>(t.LEFT="left",t.RIGHT="right",t))(gm||{}),_i=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(_i||{}),pS=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(pS||{}),wg=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(wg||{}),bS=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(bS||{});function gc(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function fx(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function yg(t){let e,n,i;t.length!==2?(e=gc,n=(o,a)=>gc(t(o),a),i=(o,a)=>t(o)-a):(e=t===gc||t===fx?t:cx,n=t,i=t);function l(o,a,u=0,f=o.length){if(u>>1;n(o[c],a)<0?u=c+1:f=c}while(u>>1;n(o[c],a)<=0?u=c+1:f=c}while(uu&&i(o[c-1],a)>-i(o[c],a)?c-1:c}return{left:l,center:s,right:r}}function cx(){return 0}function dx(t){return t===null?NaN:+t}const hx=yg(gc),mx=hx.right;yg(dx).center;const vS=mx;function gx(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(l=+l)>=l&&++n}return n}function xo(t,e){let n,i;if(e===void 0)for(const l of t)l!=null&&(n===void 0?l>=l&&(n=i=l):(n>l&&(n=l),i=r&&(n=i=r):(n>r&&(n=r),it}const yx=Math.sqrt(50),Tx=Math.sqrt(10),Sx=Math.sqrt(2);function Fc(t,e,n){const i=(e-t)/Math.max(0,n),l=Math.floor(Math.log10(i)),r=i/Math.pow(10,l),s=r>=yx?10:r>=Tx?5:r>=Sx?2:1;let o,a,u;return l<0?(u=Math.pow(10,-l)/s,o=Math.round(t*u),a=Math.round(e*u),o/ue&&--a,u=-u):(u=Math.pow(10,l)*s,o=Math.round(t/u),a=Math.round(e/u),o*ue&&--a),a0))return[];if(t===e)return[t];const i=e=l))return[];const o=r-l+1,a=new Array(o);if(i)if(s<0)for(let u=0;u0?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):l<0&&(t=Math.ceil(t*l)/l,e=Math.floor(e*l)/l),i=l}}function Ox(t){return Math.max(1,Math.ceil(Math.log(gx(t))/Math.LN2)+1)}function Mx(){var t=vx,e=xo,n=Ox;function i(l){Array.isArray(l)||(l=Array.from(l));var r,s=l.length,o,a,u=new Array(s);for(r=0;r=d)if(M>=d&&e===xo){const C=fa(c,d,A);isFinite(C)&&(C>0?d=(Math.floor(d/C)+1)*C:C<0&&(d=(Math.ceil(d*-C)+1)/-C))}else h.pop()}for(var g=h.length,_=0,k=g;h[_]<=c;)++_;for(;h[k-1]>d;)--k;(_||k0?h[r-1]:c,T.x1=r0)for(r=0;r=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n=l)&&(n=l)}return n}function Ax(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n>l||n===void 0&&l>=l)&&(n=l)}return n}function Lx(t,e,n){t=+t,e=+e,n=(l=arguments.length)<2?(e=t,t=0,1):l<3?1:+n;for(var i=-1,l=Math.max(0,Math.ceil((e-t)/n))|0,r=new Array(l);++i+t(e)}function Nx(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function Bx(){return!this.__axis}function Ud(t,e){var n=[],i=null,l=null,r=6,s=6,o=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===_c||t===hu?-1:1,f=t===hu||t===pc?"x":"y",c=t===_c||t===pm?Ix:Rx;function d(h){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),_=l??(e.tickFormat?e.tickFormat.apply(e,n):Dx),k=Math.max(r,0)+o,y=e.range(),T=+y[0]+a,M=+y[y.length-1]+a,A=(e.bandwidth?Nx:Px)(e.copy(),a),C=h.selection?h.selection():h,D=C.selectAll(".domain").data([null]),R=C.selectAll(".tick").data(g,e).order(),N=R.exit(),G=R.enter().append("g").attr("class","tick"),B=R.select("line"),j=R.select("text");D=D.merge(D.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),R=R.merge(G),B=B.merge(G.append("line").attr("stroke","currentColor").attr(f+"2",u*r)),j=j.merge(G.append("text").attr("fill","currentColor").attr(f,u*k).attr("dy",t===_c?"0em":t===pm?"0.71em":"0.32em")),h!==C&&(D=D.transition(h),R=R.transition(h),B=B.transition(h),j=j.transition(h),N=N.transition(h).attr("opacity",U4).attr("transform",function(q){return isFinite(q=A(q))?c(q+a):this.getAttribute("transform")}),G.attr("opacity",U4).attr("transform",function(q){var V=this.parentNode.__axis;return c((V&&isFinite(V=V(q))?V:A(q))+a)})),N.remove(),D.attr("d",t===hu||t===pc?s?"M"+u*s+","+T+"H"+a+"V"+M+"H"+u*s:"M"+a+","+T+"V"+M:s?"M"+T+","+u*s+"V"+a+"H"+M+"V"+u*s:"M"+T+","+a+"H"+M),R.attr("opacity",1).attr("transform",function(q){return c(A(q)+a)}),B.attr(f+"2",u*r),j.attr(f,u*k).text(_),C.filter(Bx).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===pc?"start":t===hu?"end":"middle"),C.each(function(){this.__axis=A})}return d.scale=function(h){return arguments.length?(e=h,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(i=h==null?null:Array.from(h),d):i&&i.slice()},d.tickFormat=function(h){return arguments.length?(l=h,d):l},d.tickSize=function(h){return arguments.length?(r=s=+h,d):r},d.tickSizeInner=function(h){return arguments.length?(r=+h,d):r},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(o=+h,d):o},d.offset=function(h){return arguments.length?(a=+h,d):a},d}function zx(t){return Ud(_c,t)}function Hx(t){return Ud(pc,t)}function kS(t){return Ud(pm,t)}function wS(t){return Ud(hu,t)}var Ux={value:()=>{}};function Tg(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}bc.prototype=Tg.prototype={constructor:bc,on:function(t,e){var n=this._,i=Fx(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),G4.hasOwnProperty(e)?{space:G4[e],local:t}:t}function Vx(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===bm&&e.documentElement.namespaceURI===bm?e.createElement(t):e.createElementNS(n,t)}}function Wx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yS(t){var e=Fd(t);return(e.local?Wx:Vx)(e)}function jx(){}function Sg(t){return t==null?jx:function(){return this.querySelector(t)}}function $x(t){typeof t!="function"&&(t=Sg(t));for(var e=this._groups,n=e.length,i=new Array(n),l=0;l=M&&(M=T+1);!(C=k[M])&&++M=0;)(s=i[l])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function _ee(t){t||(t=pee);function e(c,d){return c&&d?t(c.__data__,d.__data__):!c-!d}for(var n=this._groups,i=n.length,l=new Array(i),r=0;re?1:t>=e?0:NaN}function bee(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function vee(){return Array.from(this)}function kee(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?Dee:typeof e=="function"?Ree:Iee)(t,e,n??"")):ca(this.node(),t)}function ca(t,e){return t.style.getPropertyValue(e)||MS(t).getComputedStyle(t,null).getPropertyValue(e)}function Nee(t){return function(){delete this[t]}}function Bee(t,e){return function(){this[t]=e}}function zee(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Hee(t,e){return arguments.length>1?this.each((e==null?Nee:typeof e=="function"?zee:Bee)(t,e)):this.node()[t]}function CS(t){return t.trim().split(/^|\s+/)}function Eg(t){return t.classList||new AS(t)}function AS(t){this._node=t,this._names=CS(t.getAttribute("class")||"")}AS.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function LS(t,e){for(var n=Eg(t),i=-1,l=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function dte(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,l=e.length,r;n>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?tc(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?tc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ste.exec(t))?new xi(e[1],e[2],e[3],1):(e=Ete.exec(t))?new xi(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ote.exec(t))?tc(e[1],e[2],e[3],e[4]):(e=Mte.exec(t))?tc(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Cte.exec(t))?Z4(e[1],e[2]/100,e[3]/100,1):(e=Ate.exec(t))?Z4(e[1],e[2]/100,e[3]/100,e[4]):V4.hasOwnProperty(t)?$4(V4[t]):t==="transparent"?new xi(NaN,NaN,NaN,0):null}function $4(t){return new xi(t>>16&255,t>>8&255,t&255,1)}function tc(t,e,n,i){return i<=0&&(t=e=n=NaN),new xi(t,e,n,i)}function Ite(t){return t instanceof Ku||(t=so(t)),t?(t=t.rgb(),new xi(t.r,t.g,t.b,t.opacity)):new xi}function wm(t,e,n,i){return arguments.length===1?Ite(t):new xi(t,e,n,i??1)}function xi(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}Og(xi,wm,PS(Ku,{brighter(t){return t=t==null?Wc:Math.pow(Wc,t),new xi(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Lu:Math.pow(Lu,t),new xi(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new xi(no(this.r),no(this.g),no(this.b),jc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:q4,formatHex:q4,formatHex8:Rte,formatRgb:Y4,toString:Y4}));function q4(){return`#${to(this.r)}${to(this.g)}${to(this.b)}`}function Rte(){return`#${to(this.r)}${to(this.g)}${to(this.b)}${to((isNaN(this.opacity)?1:this.opacity)*255)}`}function Y4(){const t=jc(this.opacity);return`${t===1?"rgb(":"rgba("}${no(this.r)}, ${no(this.g)}, ${no(this.b)}${t===1?")":`, ${t})`}`}function jc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function no(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function to(t){return t=no(t),(t<16?"0":"")+t.toString(16)}function Z4(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $l(t,e,n,i)}function NS(t){if(t instanceof $l)return new $l(t.h,t.s,t.l,t.opacity);if(t instanceof Ku||(t=so(t)),!t)return new $l;if(t instanceof $l)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,l=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,o=r-l,a=(r+l)/2;return o?(e===r?s=(n-i)/o+(n0&&a<1?0:s,new $l(s,o,a,t.opacity)}function Pte(t,e,n,i){return arguments.length===1?NS(t):new $l(t,e,n,i??1)}function $l(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}Og($l,Pte,PS(Ku,{brighter(t){return t=t==null?Wc:Math.pow(Wc,t),new $l(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Lu:Math.pow(Lu,t),new $l(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,l=2*n-i;return new xi(E1(t>=240?t-240:t+120,l,i),E1(t,l,i),E1(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new $l(X4(this.h),nc(this.s),nc(this.l),jc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=jc(this.opacity);return`${t===1?"hsl(":"hsla("}${X4(this.h)}, ${nc(this.s)*100}%, ${nc(this.l)*100}%${t===1?")":`, ${t})`}`}}));function X4(t){return t=(t||0)%360,t<0?t+360:t}function nc(t){return Math.max(0,Math.min(1,t||0))}function E1(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Mg=t=>()=>t;function Nte(t,e){return function(n){return t+n*e}}function Bte(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function zte(t){return(t=+t)==1?BS:function(e,n){return n-e?Bte(e,n,t):Mg(isNaN(e)?n:e)}}function BS(t,e){var n=e-t;return n?Nte(t,n):Mg(isNaN(t)?e:t)}const $c=function t(e){var n=zte(e);function i(l,r){var s=n((l=wm(l)).r,(r=wm(r)).r),o=n(l.g,r.g),a=n(l.b,r.b),u=BS(l.opacity,r.opacity);return function(f){return l.r=s(f),l.g=o(f),l.b=a(f),l.opacity=u(f),l+""}}return i.gamma=t,i}(1);function Hte(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),l;return function(r){for(l=0;ln&&(r=e.slice(n,r),o[s]?o[s]+=r:o[++s]=r),(i=i[0])===(l=l[0])?o[s]?o[s]+=l:o[++s]=l:(o[++s]=null,a.push({i:s,x:jl(i,l)})),n=O1.lastIndex;return n180?f+=360:f-u>180&&(u+=360),d.push({i:c.push(l(c)+"rotate(",null,i)-2,x:jl(u,f)})):f&&c.push(l(c)+"rotate("+f+i)}function o(u,f,c,d){u!==f?d.push({i:c.push(l(c)+"skewX(",null,i)-2,x:jl(u,f)}):f&&c.push(l(c)+"skewX("+f+i)}function a(u,f,c,d,h,g){if(u!==c||f!==d){var _=h.push(l(h)+"scale(",null,",",null,")");g.push({i:_-4,x:jl(u,c)},{i:_-2,x:jl(f,d)})}else(c!==1||d!==1)&&h.push(l(h)+"scale("+c+","+d+")")}return function(u,f){var c=[],d=[];return u=t(u),f=t(f),r(u.translateX,u.translateY,f.translateX,f.translateY,c,d),s(u.rotate,f.rotate,c,d),o(u.skewX,f.skewX,c,d),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,d),u=f=null,function(h){for(var g=-1,_=d.length,k;++g<_;)c[(k=d[g]).i]=k.x(h);return c.join("")}}}var Zte=US(qte,"px, ","px)","deg)"),Xte=US(Yte,", ",")",")"),da=0,mu=0,tu=0,FS=1e3,qc,gu,Yc=0,oo=0,Vd=0,Iu=typeof performance=="object"&&performance.now?performance:Date,GS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Cg(){return oo||(GS(Kte),oo=Iu.now()+Vd)}function Kte(){oo=0}function Zc(){this._call=this._time=this._next=null}Zc.prototype=VS.prototype={constructor:Zc,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Cg():+n)+(e==null?0:+e),!this._next&&gu!==this&&(gu?gu._next=this:qc=this,gu=this),this._call=t,this._time=n,Sm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Sm())}};function VS(t,e,n){var i=new Zc;return i.restart(t,e,n),i}function Jte(){Cg(),++da;for(var t=qc,e;t;)(e=oo-t._time)>=0&&t._call.call(void 0,e),t=t._next;--da}function J4(){oo=(Yc=Iu.now())+Vd,da=mu=0;try{Jte()}finally{da=0,xte(),oo=0}}function Qte(){var t=Iu.now(),e=t-Yc;e>FS&&(Vd-=e,Yc=t)}function xte(){for(var t,e=qc,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:qc=n);gu=t,Sm(i)}function Sm(t){if(!da){mu&&(mu=clearTimeout(mu));var e=t-oo;e>24?(t<1/0&&(mu=setTimeout(J4,t-Iu.now()-Vd)),tu&&(tu=clearInterval(tu))):(tu||(Yc=Iu.now(),tu=setInterval(Qte,FS)),da=1,GS(J4))}}function Q4(t,e,n){var i=new Zc;return e=e==null?0:+e,i.restart(l=>{i.stop(),t(l+e)},e,n),i}var ene=Tg("start","end","cancel","interrupt"),tne=[],WS=0,x4=1,Em=2,vc=3,ew=4,Om=5,kc=6;function Wd(t,e,n,i,l,r){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;nne(t,n,{name:e,index:i,group:l,on:ene,tween:tne,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:WS})}function Ag(t,e){var n=xl(t,e);if(n.state>WS)throw new Error("too late; already scheduled");return n}function gr(t,e){var n=xl(t,e);if(n.state>vc)throw new Error("too late; already running");return n}function xl(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function nne(t,e,n){var i=t.__transition,l;i[e]=n,n.timer=VS(r,0,n.time);function r(u){n.state=x4,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,d,h;if(n.state!==x4)return a();for(f in i)if(h=i[f],h.name===n.name){if(h.state===vc)return Q4(s);h.state===ew?(h.state=kc,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fEm&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Ine(t,e,n){var i,l,r=Dne(e)?Ag:gr;return function(){var s=r(this,t),o=s.on;o!==i&&(l=(i=o).copy()).on(e,n),s.on=l}}function Rne(t,e){var n=this._id;return arguments.length<2?xl(this.node(),n).on.on(t):this.each(Ine(n,t,e))}function Pne(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Nne(){return this.on("end.remove",Pne(this._id))}function Bne(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Sg(t));for(var i=this._groups,l=i.length,r=new Array(l),s=0;s+t;function YS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var lie={time:null,delay:0,duration:250,ease:YS};function rie(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function sie(t){var e,n;t instanceof $r?(e=t._id,t=t._name):(e=qS(),(n=lie).time=Cg(),t=t==null?null:t+"");for(var i=this._groups,l=i.length,r=0;r()=>t;function oie(t,{sourceEvent:e,target:n,selection:i,mode:l,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:l,enumerable:!0,configurable:!0},_:{value:r}})}function aie(t){t.stopImmediatePropagation()}function C1(t){t.preventDefault(),t.stopImmediatePropagation()}var tw={name:"drag"},A1={name:"space"},Uo={name:"handle"},Fo={name:"center"};const{abs:nw,max:Li,min:Di}=Math;function iw(t){return[+t[0],+t[1]]}function lw(t){return[iw(t[0]),iw(t[1])]}var wc={name:"x",handles:["w","e"].map(Xc),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},L1={name:"y",handles:["n","s"].map(Xc),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Rr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},rw={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},sw={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},uie={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},fie={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Xc(t){return{type:t}}function cie(t){return!t.ctrlKey&&!t.button}function die(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function hie(){return navigator.maxTouchPoints||"ontouchstart"in this}function D1(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function mie(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function ZS(){return gie(wc)}function gie(t){var e=die,n=cie,i=hie,l=!0,r=Tg("start","brush","end"),s=6,o;function a(k){var y=k.property("__brush",_).selectAll(".overlay").data([Xc("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Rr.overlay).merge(y).each(function(){var M=D1(this).extent;rt(this).attr("x",M[0][0]).attr("y",M[0][1]).attr("width",M[1][0]-M[0][0]).attr("height",M[1][1]-M[0][1])}),k.selectAll(".selection").data([Xc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Rr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var T=k.selectAll(".handle").data(t.handles,function(M){return M.type});T.exit().remove(),T.enter().append("rect").attr("class",function(M){return"handle handle--"+M.type}).attr("cursor",function(M){return Rr[M.type]}),k.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}a.move=function(k,y,T){k.tween?k.on("start.brush",function(M){f(this,arguments).beforestart().start(M)}).on("interrupt.brush end.brush",function(M){f(this,arguments).end(M)}).tween("brush",function(){var M=this,A=M.__brush,C=f(M,arguments),D=A.selection,R=t.input(typeof y=="function"?y.apply(this,arguments):y,A.extent),N=Gd(D,R);function G(B){A.selection=B===1&&R===null?null:N(B),u.call(M),C.brush()}return D!==null&&R!==null?G:G(1)}):k.each(function(){var M=this,A=arguments,C=M.__brush,D=t.input(typeof y=="function"?y.apply(M,A):y,C.extent),R=f(M,A).beforestart();Mm(M),C.selection=D===null?null:D,u.call(M),R.start(T).brush(T).end(T)})},a.clear=function(k,y){a.move(k,null,y)};function u(){var k=rt(this),y=D1(this).selection;y?(k.selectAll(".selection").style("display",null).attr("x",y[0][0]).attr("y",y[0][1]).attr("width",y[1][0]-y[0][0]).attr("height",y[1][1]-y[0][1]),k.selectAll(".handle").style("display",null).attr("x",function(T){return T.type[T.type.length-1]==="e"?y[1][0]-s/2:y[0][0]-s/2}).attr("y",function(T){return T.type[0]==="s"?y[1][1]-s/2:y[0][1]-s/2}).attr("width",function(T){return T.type==="n"||T.type==="s"?y[1][0]-y[0][0]+s:s}).attr("height",function(T){return T.type==="e"||T.type==="w"?y[1][1]-y[0][1]+s:s})):k.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(k,y,T){var M=k.__brush.emitter;return M&&(!T||!M.clean)?M:new c(k,y,T)}function c(k,y,T){this.that=k,this.args=y,this.state=k.__brush,this.active=0,this.clean=T}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(k,y){return this.starting?(this.starting=!1,this.emit("start",k,y)):this.emit("brush",k),this},brush:function(k,y){return this.emit("brush",k,y),this},end:function(k,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",k,y)),this},emit:function(k,y,T){var M=rt(this.that).datum();r.call(k,this.that,new oie(k,{sourceEvent:y,target:a,selection:t.output(this.state.selection),mode:T,dispatch:r}),M)}};function d(k){if(o&&!k.touches||!n.apply(this,arguments))return;var y=this,T=k.target.__data__.type,M=(l&&k.metaKey?T="overlay":T)==="selection"?tw:l&&k.altKey?Fo:Uo,A=t===L1?null:uie[T],C=t===wc?null:fie[T],D=D1(y),R=D.extent,N=D.selection,G=R[0][0],B,j,q=R[0][1],V,K,x=R[1][0],ie,X,ce=R[1][1],ae,ee,he=0,ne=0,re,oe=A&&C&&l&&k.shiftKey,Re,qe,Ce=Array.from(k.touches||[k],ot=>{const ht=ot.identifier;return ot=ro(ot,y),ot.point0=ot.slice(),ot.identifier=ht,ot});Mm(y);var Ze=f(y,arguments,!0).beforestart();if(T==="overlay"){N&&(re=!0);const ot=[Ce[0],Ce[1]||Ce[0]];D.selection=N=[[B=t===L1?G:Di(ot[0][0],ot[1][0]),V=t===wc?q:Di(ot[0][1],ot[1][1])],[ie=t===L1?x:Li(ot[0][0],ot[1][0]),ae=t===wc?ce:Li(ot[0][1],ot[1][1])]],Ce.length>1&<(k)}else B=N[0][0],V=N[0][1],ie=N[1][0],ae=N[1][1];j=B,K=V,X=ie,ee=ae;var be=rt(y).attr("pointer-events","none"),Ae=be.selectAll(".overlay").attr("cursor",Rr[T]);if(k.touches)Ze.moved=me,Ze.ended=De;else{var ve=rt(k.view).on("mousemove.brush",me,!0).on("mouseup.brush",De,!0);l&&ve.on("keydown.brush",vt,!0).on("keyup.brush",dt,!0),wte(k.view)}u.call(y),Ze.start(k,M.name);function me(ot){for(const ht of ot.changedTouches||[ot])for(const Bt of Ce)Bt.identifier===ht.identifier&&(Bt.cur=ro(ht,y));if(oe&&!Re&&!qe&&Ce.length===1){const ht=Ce[0];nw(ht.cur[0]-ht[0])>nw(ht.cur[1]-ht[1])?qe=!0:Re=!0}for(const ht of Ce)ht.cur&&(ht[0]=ht.cur[0],ht[1]=ht.cur[1]);re=!0,C1(ot),lt(ot)}function lt(ot){const ht=Ce[0],Bt=ht.point0;var Ot;switch(he=ht[0]-Bt[0],ne=ht[1]-Bt[1],M){case A1:case tw:{A&&(he=Li(G-B,Di(x-ie,he)),j=B+he,X=ie+he),C&&(ne=Li(q-V,Di(ce-ae,ne)),K=V+ne,ee=ae+ne);break}case Uo:{Ce[1]?(A&&(j=Li(G,Di(x,Ce[0][0])),X=Li(G,Di(x,Ce[1][0])),A=1),C&&(K=Li(q,Di(ce,Ce[0][1])),ee=Li(q,Di(ce,Ce[1][1])),C=1)):(A<0?(he=Li(G-B,Di(x-B,he)),j=B+he,X=ie):A>0&&(he=Li(G-ie,Di(x-ie,he)),j=B,X=ie+he),C<0?(ne=Li(q-V,Di(ce-V,ne)),K=V+ne,ee=ae):C>0&&(ne=Li(q-ae,Di(ce-ae,ne)),K=V,ee=ae+ne));break}case Fo:{A&&(j=Li(G,Di(x,B-he*A)),X=Li(G,Di(x,ie+he*A))),C&&(K=Li(q,Di(ce,V-ne*C)),ee=Li(q,Di(ce,ae+ne*C)));break}}X0&&(B=j-he),C<0?ae=ee-ne:C>0&&(V=K-ne),M=A1,Ae.attr("cursor",Rr.selection),lt(ot));break}default:return}C1(ot)}function dt(ot){switch(ot.keyCode){case 16:{oe&&(Re=qe=oe=!1,lt(ot));break}case 18:{M===Fo&&(A<0?ie=X:A>0&&(B=j),C<0?ae=ee:C>0&&(V=K),M=Uo,lt(ot));break}case 32:{M===A1&&(ot.altKey?(A&&(ie=X-he*A,B=j+he*A),C&&(ae=ee-ne*C,V=K+ne*C),M=Fo):(A<0?ie=X:A>0&&(B=j),C<0?ae=ee:C>0&&(V=K),M=Uo),Ae.attr("cursor",Rr[T]),lt(ot));break}default:return}C1(ot)}}function h(k){f(this,arguments).moved(k)}function g(k){f(this,arguments).ended(k)}function _(){var k=this.__brush||{selection:null};return k.extent=lw(e.apply(this,arguments)),k.dim=t,k}return a.extent=function(k){return arguments.length?(e=typeof k=="function"?k:M1(lw(k)),a):e},a.filter=function(k){return arguments.length?(n=typeof k=="function"?k:M1(!!k),a):n},a.touchable=function(k){return arguments.length?(i=typeof k=="function"?k:M1(!!k),a):i},a.handleSize=function(k){return arguments.length?(s=+k,a):s},a.keyModifiers=function(k){return arguments.length?(l=!!k,a):l},a.on=function(){var k=r.on.apply(r,arguments);return k===r?a:k},a}const Cm=Math.PI,Am=2*Cm,Xs=1e-6,_ie=Am-Xs;function XS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return XS;const n=10**e;return function(i){this._+=i[0];for(let l=1,r=i.length;lXs)if(!(Math.abs(c*a-u*f)>Xs)||!r)this._append`L${this._x1=e},${this._y1=n}`;else{let h=i-s,g=l-o,_=a*a+u*u,k=h*h+g*g,y=Math.sqrt(_),T=Math.sqrt(d),M=r*Math.tan((Cm-Math.acos((_+d-k)/(2*y*T)))/2),A=M/T,C=M/y;Math.abs(A-1)>Xs&&this._append`L${e+A*f},${n+A*c}`,this._append`A${r},${r},0,0,${+(c*h>f*g)},${this._x1=e+C*a},${this._y1=n+C*u}`}}arc(e,n,i,l,r,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(l),a=i*Math.sin(l),u=e+o,f=n+a,c=1^s,d=s?l-r:r-l;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Xs||Math.abs(this._y1-f)>Xs)&&this._append`L${u},${f}`,i&&(d<0&&(d=d%Am+Am),d>_ie?this._append`A${i},${i},0,1,${c},${e-o},${n-a}A${i},${i},0,1,${c},${this._x1=u},${this._y1=f}`:d>Xs&&this._append`A${i},${i},0,${+(d>=Cm)},${c},${this._x1=e+i*Math.cos(r)},${this._y1=n+i*Math.sin(r)}`)}rect(e,n,i,l){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+l}h${-i}Z`}toString(){return this._}}function vie(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Kc(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function ha(t){return t=Kc(Math.abs(t)),t?t[1]:NaN}function kie(t,e){return function(n,i){for(var l=n.length,r=[],s=0,o=t[0],a=0;l>0&&o>0&&(a+o+1>i&&(o=Math.max(1,i-a)),r.push(n.substring(l-=o,l+o)),!((a+=o+1)>i));)o=t[s=(s+1)%t.length];return r.reverse().join(e)}}function wie(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var yie=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ru(t){if(!(e=yie.exec(t)))throw new Error("invalid format: "+t);var e;return new Dg({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ru.prototype=Dg.prototype;function Dg(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Dg.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Tie(t){e:for(var e=t.length,n=1,i=-1,l;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(l+1):t}var KS;function Sie(t,e){var n=Kc(t,e);if(!n)return t+"";var i=n[0],l=n[1],r=l-(KS=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,s=i.length;return r===s?i:r>s?i+new Array(r-s+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Kc(t,Math.max(0,e+r-1))[0]}function ow(t,e){var n=Kc(t,e);if(!n)return t+"";var i=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+i:i.length>l+1?i.slice(0,l+1)+"."+i.slice(l+1):i+new Array(l-i.length+2).join("0")}const aw={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:vie,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ow(t*100,e),r:ow,s:Sie,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function uw(t){return t}var fw=Array.prototype.map,cw=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Eie(t){var e=t.grouping===void 0||t.thousands===void 0?uw:kie(fw.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",l=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?uw:wie(fw.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",a=t.nan===void 0?"NaN":t.nan+"";function u(c){c=Ru(c);var d=c.fill,h=c.align,g=c.sign,_=c.symbol,k=c.zero,y=c.width,T=c.comma,M=c.precision,A=c.trim,C=c.type;C==="n"?(T=!0,C="g"):aw[C]||(M===void 0&&(M=12),A=!0,C="g"),(k||d==="0"&&h==="=")&&(k=!0,d="0",h="=");var D=_==="$"?n:_==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",R=_==="$"?i:/[%p]/.test(C)?s:"",N=aw[C],G=/[defgprs%]/.test(C);M=M===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function B(j){var q=D,V=R,K,x,ie;if(C==="c")V=N(j)+V,j="";else{j=+j;var X=j<0||1/j<0;if(j=isNaN(j)?a:N(Math.abs(j),M),A&&(j=Tie(j)),X&&+j==0&&g!=="+"&&(X=!1),q=(X?g==="("?g:o:g==="-"||g==="("?"":g)+q,V=(C==="s"?cw[8+KS/3]:"")+V+(X&&g==="("?")":""),G){for(K=-1,x=j.length;++Kie||ie>57){V=(ie===46?l+j.slice(K+1):j.slice(K))+V,j=j.slice(0,K);break}}}T&&!k&&(j=e(j,1/0));var ce=q.length+j.length+V.length,ae=ce>1)+q+j+V+ae.slice(ce);break;default:j=ae+q+j+V;break}return r(j)}return B.toString=function(){return c+""},B}function f(c,d){var h=u((c=Ru(c),c.type="f",c)),g=Math.max(-8,Math.min(8,Math.floor(ha(d)/3)))*3,_=Math.pow(10,-g),k=cw[8+g/3];return function(y){return h(_*y)+k}}return{format:u,formatPrefix:f}}var lc,Ig,JS;Oie({thousands:",",grouping:[3],currency:["$",""]});function Oie(t){return lc=Eie(t),Ig=lc.format,JS=lc.formatPrefix,lc}function Mie(t){return Math.max(0,-ha(Math.abs(t)))}function Cie(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ha(e)/3)))*3-ha(Math.abs(t)))}function Aie(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ha(e)-ha(t))+1}function Ju(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const dw=Symbol("implicit");function Rg(){var t=new z4,e=[],n=[],i=dw;function l(r){let s=t.get(r);if(s===void 0){if(i!==dw)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return l.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new z4;for(const s of r)t.has(s)||t.set(s,e.push(s)-1);return l},l.range=function(r){return arguments.length?(n=Array.from(r),l):n.slice()},l.unknown=function(r){return arguments.length?(i=r,l):i},l.copy=function(){return Rg(e,n).unknown(i)},Ju.apply(l,arguments),l}function Pg(){var t=Rg().unknown(void 0),e=t.domain,n=t.range,i=0,l=1,r,s,o=!1,a=0,u=0,f=.5;delete t.unknown;function c(){var d=e().length,h=le&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Rie(t,e,n){var i=t[0],l=t[1],r=e[0],s=e[1];return l2?Pie:Rie,a=u=null,c}function c(d){return d==null||isNaN(d=+d)?r:(a||(a=o(t.map(i),e,n)))(i(s(d)))}return c.invert=function(d){return s(l((u||(u=o(e,t.map(i),jl)))(d)))},c.domain=function(d){return arguments.length?(t=Array.from(d,Die),f()):t.slice()},c.range=function(d){return arguments.length?(e=Array.from(d),f()):e.slice()},c.rangeRound=function(d){return e=Array.from(d),n=$te,f()},c.clamp=function(d){return arguments.length?(s=d?!0:qo,f()):s!==qo},c.interpolate=function(d){return arguments.length?(n=d,f()):n},c.unknown=function(d){return arguments.length?(r=d,c):r},function(d,h){return i=d,l=h,f()}}function xS(){return QS()(qo,qo)}function Nie(t,e,n,i){var l=_m(t,e,n),r;switch(i=Ru(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(r=Cie(l,s))&&(i.precision=r),JS(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=Aie(l,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=Mie(l))&&(i.precision=r-(i.type==="%")*2);break}}return Ig(i)}function Bie(t){var e=t.domain;return t.ticks=function(n){var i=e();return Gc(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var l=e();return Nie(l[0],l[l.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),l=0,r=i.length-1,s=i[l],o=i[r],a,u,f=10;for(o0;){if(u=fa(s,o,n),u===a)return i[l]=s,i[r]=o,e(i);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;a=u}return t},t}function Jc(){var t=xS();return t.copy=function(){return Ng(t,Jc())},Ju.apply(t,arguments),Bie(t)}function eE(t,e){t=t.slice();var n=0,i=t.length-1,l=t[n],r=t[i],s;return rMath.pow(t,e)}function Gie(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function _w(t){return(e,n)=>-t(-e,n)}function Vie(t){const e=t(mw,gw),n=e.domain;let i=10,l,r;function s(){return l=Gie(i),r=Fie(i),n()[0]<0?(l=_w(l),r=_w(r),t(zie,Hie)):t(mw,gw),e}return e.base=function(o){return arguments.length?(i=+o,s()):i},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const a=n();let u=a[0],f=a[a.length-1];const c=f0){for(;d<=h;++d)for(g=1;gf)break;y.push(_)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(_=d>0?g/r(-d):g*r(d),!(_f)break;y.push(_)}y.length*2{if(o==null&&(o=10),a==null&&(a=i===10?"s":","),typeof a!="function"&&(!(i%1)&&(a=Ru(a)).precision==null&&(a.trim=!0),a=Ig(a)),o===1/0)return a;const u=Math.max(1,i*o/e.ticks().length);return f=>{let c=f/r(Math.round(l(f)));return c*in(eE(n(),{floor:o=>r(Math.floor(l(o))),ceil:o=>r(Math.ceil(l(o)))})),e}function tE(){const t=Vie(QS()).domain([1,10]);return t.copy=()=>Ng(t,tE()).base(t.base()),Ju.apply(t,arguments),t}const I1=new Date,R1=new Date;function mi(t,e,n,i){function l(r){return t(r=arguments.length===0?new Date:new Date(+r)),r}return l.floor=r=>(t(r=new Date(+r)),r),l.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),l.round=r=>{const s=l(r),o=l.ceil(r);return r-s(e(r=new Date(+r),s==null?1:Math.floor(s)),r),l.range=(r,s,o)=>{const a=[];if(r=l.ceil(r),o=o==null?1:Math.floor(o),!(r0))return a;let u;do a.push(u=new Date(+r)),e(r,o),t(r);while(umi(s=>{if(s>=s)for(;t(s),!r(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!r(s););else for(;--o>=0;)for(;e(s,1),!r(s););}),n&&(l.count=(r,s)=>(I1.setTime(+r),R1.setTime(+s),t(I1),t(R1),Math.floor(n(I1,R1))),l.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?l.filter(i?s=>i(s)%r===0:s=>l.count(0,s)%r===0):l)),l}const Qc=mi(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Qc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?mi(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Qc);Qc.range;const Ur=1e3,Cl=Ur*60,Fr=Cl*60,qr=Fr*24,Bg=qr*7,pw=qr*30,P1=qr*365,Yo=mi(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Ur)},(t,e)=>(e-t)/Ur,t=>t.getUTCSeconds());Yo.range;const zg=mi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ur)},(t,e)=>{t.setTime(+t+e*Cl)},(t,e)=>(e-t)/Cl,t=>t.getMinutes());zg.range;const Wie=mi(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Cl)},(t,e)=>(e-t)/Cl,t=>t.getUTCMinutes());Wie.range;const Hg=mi(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Ur-t.getMinutes()*Cl)},(t,e)=>{t.setTime(+t+e*Fr)},(t,e)=>(e-t)/Fr,t=>t.getHours());Hg.range;const jie=mi(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*Fr)},(t,e)=>(e-t)/Fr,t=>t.getUTCHours());jie.range;const Qu=mi(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cl)/qr,t=>t.getDate()-1);Qu.range;const Ug=mi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/qr,t=>t.getUTCDate()-1);Ug.range;const $ie=mi(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/qr,t=>Math.floor(t/qr));$ie.range;function mo(t){return mi(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Cl)/Bg)}const jd=mo(0),xc=mo(1),qie=mo(2),Yie=mo(3),ma=mo(4),Zie=mo(5),Xie=mo(6);jd.range;xc.range;qie.range;Yie.range;ma.range;Zie.range;Xie.range;function go(t){return mi(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/Bg)}const nE=go(0),ed=go(1),Kie=go(2),Jie=go(3),ga=go(4),Qie=go(5),xie=go(6);nE.range;ed.range;Kie.range;Jie.range;ga.range;Qie.range;xie.range;const Fg=mi(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Fg.range;const ele=mi(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());ele.range;const Yr=mi(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Yr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:mi(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Yr.range;const ao=mi(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());ao.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:mi(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});ao.range;function tle(t,e,n,i,l,r){const s=[[Yo,1,Ur],[Yo,5,5*Ur],[Yo,15,15*Ur],[Yo,30,30*Ur],[r,1,Cl],[r,5,5*Cl],[r,15,15*Cl],[r,30,30*Cl],[l,1,Fr],[l,3,3*Fr],[l,6,6*Fr],[l,12,12*Fr],[i,1,qr],[i,2,2*qr],[n,1,Bg],[e,1,pw],[e,3,3*pw],[t,1,P1]];function o(u,f,c){const d=fk).right(s,d);if(h===s.length)return t.every(_m(u/P1,f/P1,c));if(h===0)return Qc.every(Math.max(_m(u,f,c),1));const[g,_]=s[d/s[h-1][2]53)return null;"w"in me||(me.w=1),"Z"in me?(De=B1(nu(me.y,0,1)),vt=De.getUTCDay(),De=vt>4||vt===0?ed.ceil(De):ed(De),De=Ug.offset(De,(me.V-1)*7),me.y=De.getUTCFullYear(),me.m=De.getUTCMonth(),me.d=De.getUTCDate()+(me.w+6)%7):(De=N1(nu(me.y,0,1)),vt=De.getDay(),De=vt>4||vt===0?xc.ceil(De):xc(De),De=Qu.offset(De,(me.V-1)*7),me.y=De.getFullYear(),me.m=De.getMonth(),me.d=De.getDate()+(me.w+6)%7)}else("W"in me||"U"in me)&&("w"in me||(me.w="u"in me?me.u%7:"W"in me?1:0),vt="Z"in me?B1(nu(me.y,0,1)).getUTCDay():N1(nu(me.y,0,1)).getDay(),me.m=0,me.d="W"in me?(me.w+6)%7+me.W*7-(vt+5)%7:me.w+me.U*7-(vt+6)%7);return"Z"in me?(me.H+=me.Z/100|0,me.M+=me.Z%100,B1(me)):N1(me)}}function N(be,Ae,ve,me){for(var lt=0,De=Ae.length,vt=ve.length,dt,ot;lt=vt)return-1;if(dt=Ae.charCodeAt(lt++),dt===37){if(dt=Ae.charAt(lt++),ot=C[dt in bw?Ae.charAt(lt++):dt],!ot||(me=ot(be,ve,me))<0)return-1}else if(dt!=ve.charCodeAt(me++))return-1}return me}function G(be,Ae,ve){var me=u.exec(Ae.slice(ve));return me?(be.p=f.get(me[0].toLowerCase()),ve+me[0].length):-1}function B(be,Ae,ve){var me=h.exec(Ae.slice(ve));return me?(be.w=g.get(me[0].toLowerCase()),ve+me[0].length):-1}function j(be,Ae,ve){var me=c.exec(Ae.slice(ve));return me?(be.w=d.get(me[0].toLowerCase()),ve+me[0].length):-1}function q(be,Ae,ve){var me=y.exec(Ae.slice(ve));return me?(be.m=T.get(me[0].toLowerCase()),ve+me[0].length):-1}function V(be,Ae,ve){var me=_.exec(Ae.slice(ve));return me?(be.m=k.get(me[0].toLowerCase()),ve+me[0].length):-1}function K(be,Ae,ve){return N(be,e,Ae,ve)}function x(be,Ae,ve){return N(be,n,Ae,ve)}function ie(be,Ae,ve){return N(be,i,Ae,ve)}function X(be){return s[be.getDay()]}function ce(be){return r[be.getDay()]}function ae(be){return a[be.getMonth()]}function ee(be){return o[be.getMonth()]}function he(be){return l[+(be.getHours()>=12)]}function ne(be){return 1+~~(be.getMonth()/3)}function re(be){return s[be.getUTCDay()]}function oe(be){return r[be.getUTCDay()]}function Re(be){return a[be.getUTCMonth()]}function qe(be){return o[be.getUTCMonth()]}function Ce(be){return l[+(be.getUTCHours()>=12)]}function Ze(be){return 1+~~(be.getUTCMonth()/3)}return{format:function(be){var Ae=D(be+="",M);return Ae.toString=function(){return be},Ae},parse:function(be){var Ae=R(be+="",!1);return Ae.toString=function(){return be},Ae},utcFormat:function(be){var Ae=D(be+="",A);return Ae.toString=function(){return be},Ae},utcParse:function(be){var Ae=R(be+="",!0);return Ae.toString=function(){return be},Ae}}}var bw={"-":"",_:" ",0:"0"},bi=/^\s*\d+/,rle=/^%/,sle=/[\\^$*+?|[\]().{}]/g;function un(t,e,n){var i=t<0?"-":"",l=(i?-t:t)+"",r=l.length;return i+(r[e.toLowerCase(),n]))}function ale(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function ule(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function fle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function cle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function dle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function vw(t,e,n){var i=bi.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function kw(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function hle(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function mle(t,e,n){var i=bi.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function gle(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function ww(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function _le(t,e,n){var i=bi.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function yw(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function ple(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function ble(t,e,n){var i=bi.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function vle(t,e,n){var i=bi.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function kle(t,e,n){var i=bi.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function wle(t,e,n){var i=rle.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function yle(t,e,n){var i=bi.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Tle(t,e,n){var i=bi.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Tw(t,e){return un(t.getDate(),e,2)}function Sle(t,e){return un(t.getHours(),e,2)}function Ele(t,e){return un(t.getHours()%12||12,e,2)}function Ole(t,e){return un(1+Qu.count(Yr(t),t),e,3)}function iE(t,e){return un(t.getMilliseconds(),e,3)}function Mle(t,e){return iE(t,e)+"000"}function Cle(t,e){return un(t.getMonth()+1,e,2)}function Ale(t,e){return un(t.getMinutes(),e,2)}function Lle(t,e){return un(t.getSeconds(),e,2)}function Dle(t){var e=t.getDay();return e===0?7:e}function Ile(t,e){return un(jd.count(Yr(t)-1,t),e,2)}function lE(t){var e=t.getDay();return e>=4||e===0?ma(t):ma.ceil(t)}function Rle(t,e){return t=lE(t),un(ma.count(Yr(t),t)+(Yr(t).getDay()===4),e,2)}function Ple(t){return t.getDay()}function Nle(t,e){return un(xc.count(Yr(t)-1,t),e,2)}function Ble(t,e){return un(t.getFullYear()%100,e,2)}function zle(t,e){return t=lE(t),un(t.getFullYear()%100,e,2)}function Hle(t,e){return un(t.getFullYear()%1e4,e,4)}function Ule(t,e){var n=t.getDay();return t=n>=4||n===0?ma(t):ma.ceil(t),un(t.getFullYear()%1e4,e,4)}function Fle(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+un(e/60|0,"0",2)+un(e%60,"0",2)}function Sw(t,e){return un(t.getUTCDate(),e,2)}function Gle(t,e){return un(t.getUTCHours(),e,2)}function Vle(t,e){return un(t.getUTCHours()%12||12,e,2)}function Wle(t,e){return un(1+Ug.count(ao(t),t),e,3)}function rE(t,e){return un(t.getUTCMilliseconds(),e,3)}function jle(t,e){return rE(t,e)+"000"}function $le(t,e){return un(t.getUTCMonth()+1,e,2)}function qle(t,e){return un(t.getUTCMinutes(),e,2)}function Yle(t,e){return un(t.getUTCSeconds(),e,2)}function Zle(t){var e=t.getUTCDay();return e===0?7:e}function Xle(t,e){return un(nE.count(ao(t)-1,t),e,2)}function sE(t){var e=t.getUTCDay();return e>=4||e===0?ga(t):ga.ceil(t)}function Kle(t,e){return t=sE(t),un(ga.count(ao(t),t)+(ao(t).getUTCDay()===4),e,2)}function Jle(t){return t.getUTCDay()}function Qle(t,e){return un(ed.count(ao(t)-1,t),e,2)}function xle(t,e){return un(t.getUTCFullYear()%100,e,2)}function ere(t,e){return t=sE(t),un(t.getUTCFullYear()%100,e,2)}function tre(t,e){return un(t.getUTCFullYear()%1e4,e,4)}function nre(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ga(t):ga.ceil(t),un(t.getUTCFullYear()%1e4,e,4)}function ire(){return"+0000"}function Ew(){return"%"}function Ow(t){return+t}function Mw(t){return Math.floor(+t/1e3)}var Go,oE;lre({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lre(t){return Go=lle(t),oE=Go.format,Go.parse,Go.utcFormat,Go.utcParse,Go}function rre(t){return new Date(t)}function sre(t){return t instanceof Date?+t:+new Date(+t)}function aE(t,e,n,i,l,r,s,o,a,u){var f=xS(),c=f.invert,d=f.domain,h=u(".%L"),g=u(":%S"),_=u("%I:%M"),k=u("%I %p"),y=u("%a %d"),T=u("%b %d"),M=u("%B"),A=u("%Y");function C(D){return(a(D)1?0:t<-1?Pu:Math.acos(t)}function Aw(t){return t>=1?td:t<=-1?-td:Math.asin(t)}function Gg(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new bie(e)}function fre(t){return t.innerRadius}function cre(t){return t.outerRadius}function dre(t){return t.startAngle}function hre(t){return t.endAngle}function mre(t){return t&&t.padAngle}function gre(t,e,n,i,l,r,s,o){var a=n-t,u=i-e,f=s-l,c=o-r,d=c*a-f*u;if(!(d*dK*K+x*x&&(N=B,G=j),{cx:N,cy:G,x01:-f,y01:-c,x11:N*(l/C-1),y11:G*(l/C-1)}}function _re(){var t=fre,e=cre,n=bn(0),i=null,l=dre,r=hre,s=mre,o=null,a=Gg(u);function u(){var f,c,d=+t.apply(this,arguments),h=+e.apply(this,arguments),g=l.apply(this,arguments)-td,_=r.apply(this,arguments)-td,k=Cw(_-g),y=_>g;if(o||(o=f=a()),hRi))o.moveTo(0,0);else if(k>are-Ri)o.moveTo(h*Zs(g),h*sr(g)),o.arc(0,0,h,g,_,!y),d>Ri&&(o.moveTo(d*Zs(_),d*sr(_)),o.arc(0,0,d,_,g,y));else{var T=g,M=_,A=g,C=_,D=k,R=k,N=s.apply(this,arguments)/2,G=N>Ri&&(i?+i.apply(this,arguments):Zo(d*d+h*h)),B=z1(Cw(h-d)/2,+n.apply(this,arguments)),j=B,q=B,V,K;if(G>Ri){var x=Aw(G/d*sr(N)),ie=Aw(G/h*sr(N));(D-=x*2)>Ri?(x*=y?1:-1,A+=x,C-=x):(D=0,A=C=(g+_)/2),(R-=ie*2)>Ri?(ie*=y?1:-1,T+=ie,M-=ie):(R=0,T=M=(g+_)/2)}var X=h*Zs(T),ce=h*sr(T),ae=d*Zs(C),ee=d*sr(C);if(B>Ri){var he=h*Zs(M),ne=h*sr(M),re=d*Zs(A),oe=d*sr(A),Re;if(kRi?q>Ri?(V=rc(re,oe,X,ce,h,q,y),K=rc(he,ne,ae,ee,h,q,y),o.moveTo(V.cx+V.x01,V.cy+V.y01),qRi)||!(D>Ri)?o.lineTo(ae,ee):j>Ri?(V=rc(ae,ee,he,ne,d,-j,y),K=rc(X,ce,re,oe,d,-j,y),o.lineTo(V.cx+V.x01,V.cy+V.y01),j=h;--g)o.point(M[g],A[g]);o.lineEnd(),o.areaEnd()}y&&(M[d]=+t(k,d,c),A[d]=+e(k,d,c),o.point(i?+i(k,d,c):M[d],n?+n(k,d,c):A[d]))}if(T)return o=null,T+""||null}function f(){return jg().defined(l).curve(s).context(r)}return u.x=function(c){return arguments.length?(t=typeof c=="function"?c:bn(+c),i=null,u):t},u.x0=function(c){return arguments.length?(t=typeof c=="function"?c:bn(+c),u):t},u.x1=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:bn(+c),u):i},u.y=function(c){return arguments.length?(e=typeof c=="function"?c:bn(+c),n=null,u):e},u.y0=function(c){return arguments.length?(e=typeof c=="function"?c:bn(+c),u):e},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:bn(+c),u):n},u.lineX0=u.lineY0=function(){return f().x(t).y(e)},u.lineY1=function(){return f().x(t).y(n)},u.lineX1=function(){return f().x(i).y(e)},u.defined=function(c){return arguments.length?(l=typeof c=="function"?c:bn(!!c),u):l},u.curve=function(c){return arguments.length?(s=c,r!=null&&(o=s(r)),u):s},u.context=function(c){return arguments.length?(c==null?r=o=null:o=s(r=c),u):r},u}function Os(){}function nd(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function $d(t){this._context=t}$d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function pre(t){return new $d(t)}function hE(t){this._context=t}hE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function bre(t){return new hE(t)}function mE(t){this._context=t}mE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:nd(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function vre(t){return new mE(t)}function gE(t,e){this._basis=new $d(t),this._beta=e}gE.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],l=e[0],r=t[n]-i,s=e[n]-l,o=-1,a;++o<=n;)a=o/n,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+a*r),this._beta*e[o]+(1-this._beta)*(l+a*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const kre=function t(e){function n(i){return e===1?new $d(i):new gE(i,e)}return n.beta=function(i){return t(+i)},n}(.85);function id(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function qg(t,e){this._context=t,this._k=(1-e)/6}qg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:id(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const wre=function t(e){function n(i){return new qg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Yg(t,e){this._context=t,this._k=(1-e)/6}Yg.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const yre=function t(e){function n(i){return new Yg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Zg(t,e){this._context=t,this._k=(1-e)/6}Zg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:id(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Tre=function t(e){function n(i){return new Zg(i,e)}return n.tension=function(i){return t(+i)},n}(0);function Xg(t,e,n){var i=t._x1,l=t._y1,r=t._x2,s=t._y2;if(t._l01_a>Ri){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,l=(l*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Ri){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*u+t._y1*t._l23_2a-n*t._l12_2a)/f}t._context.bezierCurveTo(i,l,r,s,t._x2,t._y2)}function _E(t,e){this._context=t,this._alpha=e}_E.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Sre=function t(e){function n(i){return e?new _E(i,e):new qg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function pE(t,e){this._context=t,this._alpha=e}pE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ere=function t(e){function n(i){return e?new pE(i,e):new Yg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function bE(t,e){this._context=t,this._alpha=e}bE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Xg(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Ore=function t(e){function n(i){return e?new bE(i,e):new Zg(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function vE(t){this._context=t}vE.prototype={areaStart:Os,areaEnd:Os,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Mre(t){return new vE(t)}function Lw(t){return t<0?-1:1}function Dw(t,e,n){var i=t._x1-t._x0,l=e-t._x1,r=(t._y1-t._y0)/(i||l<0&&-0),s=(n-t._y1)/(l||i<0&&-0),o=(r*l+s*i)/(i+l);return(Lw(r)+Lw(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(o))||0}function Iw(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function H1(t,e,n){var i=t._x0,l=t._y0,r=t._x1,s=t._y1,o=(r-i)/3;t._context.bezierCurveTo(i+o,l+o*e,r-o,s-o*n,r,s)}function ld(t){this._context=t}ld.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:H1(this,this._t0,Iw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,H1(this,Iw(this,n=Dw(this,t,e)),n);break;default:H1(this,this._t0,n=Dw(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function kE(t){this._context=new wE(t)}(kE.prototype=Object.create(ld.prototype)).point=function(t,e){ld.prototype.point.call(this,e,t)};function wE(t){this._context=t}wE.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,l,r){this._context.bezierCurveTo(e,t,i,n,r,l)}};function Cre(t){return new ld(t)}function Are(t){return new kE(t)}function yE(t){this._context=t}yE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=Rw(t),l=Rw(e),r=0,s=1;s=0;--e)l[e]=(s[e]-l[e+1])/r[e];for(r[n-1]=(t[n]+l[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Dre(t){return new qd(t,.5)}function Ire(t){return new qd(t,0)}function Rre(t){return new qd(t,1)}function Pw(t,e){if((s=t.length)>1)for(var n=1,i,l,r=t[e[0]],s,o=r.length;n=0;)n[e]=e;return n}function Pre(t,e){return t[e]}function Nre(t){const e=[];return e.key=t,e}function U1(){var t=bn([]),e=Nw,n=Pw,i=Pre;function l(r){var s=Array.from(t.apply(this,arguments),Nre),o,a=s.length,u=-1,f;for(const c of r)for(o=0,++u;o0)for(var n,i=0,l,r,s,o,a,u=t[e[0]].length;i0?(l[0]=s,l[1]=s+=r):r<0?(l[1]=o,l[0]=o+=r):(l[0]=0,l[1]=r)}function _u(t,e,n){this.k=t,this.x=e,this.y=n}_u.prototype={constructor:_u,scale:function(t){return t===1?this:new _u(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new _u(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};_u.prototype;function F1(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}function ru(t){return function(e,n){var i=n!=null&&n.context?String(n.context):"standalone",l;if(i==="formatting"&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):r;l=t.formattingValues[s]||t.formattingValues[r]}else{var o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[a]||t.values[o]}var u=t.argumentCallback?t.argumentCallback(e):e;return l[u]}}function su(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(l);if(!r)return null;var s=r[0],o=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],a=Array.isArray(o)?Hre(o,function(c){return c.test(s)}):zre(o,function(c){return c.test(s)}),u;u=t.valueCallback?t.valueCallback(a):a,u=n.valueCallback?n.valueCallback(u):u;var f=e.slice(s.length);return{value:u,rest:f}}}function zre(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function Hre(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},i=e.match(t.matchPattern);if(!i)return null;var l=i[0],r=e.match(t.parsePattern);if(!r)return null;var s=t.valueCallback?t.valueCallback(r[0]):r[0];s=n.valueCallback?n.valueCallback(s):s;var o=e.slice(l.length);return{value:s,rest:o}}}function rd(t){"@babel/helpers - typeof";return rd=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},rd(t)}function ci(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Ft(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function mn(t){Ft(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||rd(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Yd(t,e){Ft(2,arguments);var n=mn(t).getTime(),i=ci(e);return new Date(n+i)}var Fre={};function Zd(){return Fre}function Dm(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function Gre(t){return Ft(1,arguments),t instanceof Date||rd(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Vre(t){if(Ft(1,arguments),!Gre(t)&&typeof t!="number")return!1;var e=mn(t);return!isNaN(Number(e))}function Wre(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,-n)}var jre=864e5;function $re(t){Ft(1,arguments);var e=mn(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),l=n-i;return Math.floor(l/jre)+1}function sd(t){Ft(1,arguments);var e=1,n=mn(t),i=n.getUTCDay(),l=(i=l.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function qre(t){Ft(1,arguments);var e=TE(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=sd(n);return i}var Yre=6048e5;function Zre(t){Ft(1,arguments);var e=mn(t),n=sd(e).getTime()-qre(e).getTime();return Math.round(n/Yre)+1}function od(t,e){var n,i,l,r,s,o,a,u;Ft(1,arguments);var f=Zd(),c=ci((n=(i=(l=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&l!==void 0?l:f.weekStartsOn)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=mn(t),h=d.getUTCDay(),g=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(c+1,0,h),g.setUTCHours(0,0,0,0);var _=od(g,e),k=new Date(0);k.setUTCFullYear(c,0,h),k.setUTCHours(0,0,0,0);var y=od(k,e);return f.getTime()>=_.getTime()?c+1:f.getTime()>=y.getTime()?c:c-1}function Xre(t,e){var n,i,l,r,s,o,a,u;Ft(1,arguments);var f=Zd(),c=ci((n=(i=(l=(r=e==null?void 0:e.firstWeekContainsDate)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:f.firstWeekContainsDate)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=SE(t,e),h=new Date(0);h.setUTCFullYear(d,0,c),h.setUTCHours(0,0,0,0);var g=od(h,e);return g}var Kre=6048e5;function Jre(t,e){Ft(1,arguments);var n=mn(t),i=od(n,e).getTime()-Xre(n,e).getTime();return Math.round(i/Kre)+1}function En(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length0?n:1-n;return En(e==="yy"?i%100:i,e.length)},M:function(t,e){var n=t.getUTCMonth();return e==="M"?String(n+1):En(n+1,2)},d:function(t,e){return En(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,e){return En(t.getUTCHours()%12||12,e.length)},H:function(t,e){return En(t.getUTCHours(),e.length)},m:function(t,e){return En(t.getUTCMinutes(),e.length)},s:function(t,e){return En(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,i=t.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return En(l,e.length)}};const _s=Qre;var Vo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xre={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){var i=t.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return _s.y(t,e)},Y:function(t,e,n,i){var l=SE(t,i),r=l>0?l:1-l;if(e==="YY"){var s=r%100;return En(s,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):En(r,e.length)},R:function(t,e){var n=TE(t);return En(n,e.length)},u:function(t,e){var n=t.getUTCFullYear();return En(n,e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return En(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return En(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return _s.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return En(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var l=Jre(t,i);return e==="wo"?n.ordinalNumber(l,{unit:"week"}):En(l,e.length)},I:function(t,e,n){var i=Zre(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):En(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):_s.d(t,e)},D:function(t,e,n){var i=$re(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):En(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return En(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return En(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),l=i===0?7:i;switch(e){case"i":return String(l);case"ii":return En(l,e.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours(),l=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i=t.getUTCHours(),l;switch(i===12?l=Vo.noon:i===0?l=Vo.midnight:l=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i=t.getUTCHours(),l;switch(i>=17?l=Vo.evening:i>=12?l=Vo.afternoon:i>=4?l=Vo.morning:l=Vo.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return _s.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):_s.H(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):En(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):En(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):_s.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):_s.s(t,e)},S:function(t,e){return _s.S(t,e)},X:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return zw(r);case"XXXX":case"XX":return Ks(r);case"XXXXX":case"XXX":default:return Ks(r,":")}},x:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"x":return zw(r);case"xxxx":case"xx":return Ks(r);case"xxxxx":case"xxx":default:return Ks(r,":")}},O:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Bw(r,":");case"OOOO":default:return"GMT"+Ks(r,":")}},z:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Bw(r,":");case"zzzz":default:return"GMT"+Ks(r,":")}},t:function(t,e,n,i){var l=i._originalDate||t,r=Math.floor(l.getTime()/1e3);return En(r,e.length)},T:function(t,e,n,i){var l=i._originalDate||t,r=l.getTime();return En(r,e.length)}};function Bw(t,e){var n=t>0?"-":"+",i=Math.abs(t),l=Math.floor(i/60),r=i%60;if(r===0)return n+String(l);var s=e||"";return n+String(l)+s+En(r,2)}function zw(t,e){if(t%60===0){var n=t>0?"-":"+";return n+En(Math.abs(t)/60,2)}return Ks(t,e)}function Ks(t,e){var n=e||"",i=t>0?"-":"+",l=Math.abs(t),r=En(Math.floor(l/60),2),s=En(l%60,2);return i+r+n+s}const ese=xre;var Hw=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},EE=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},tse=function(t,e){var n=t.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return Hw(t,e);var r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",Hw(i,e)).replace("{{time}}",EE(l,e))},nse={p:EE,P:tse};const ise=nse;var lse=["D","DD"],rse=["YY","YYYY"];function sse(t){return lse.indexOf(t)!==-1}function ose(t){return rse.indexOf(t)!==-1}function Uw(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ase={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},use=function(t,e,n){var i,l=ase[t];return typeof l=="string"?i=l:e===1?i=l.one:i=l.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const fse=use;var cse={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dse={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hse={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mse={date:F1({formats:cse,defaultWidth:"full"}),time:F1({formats:dse,defaultWidth:"full"}),dateTime:F1({formats:hse,defaultWidth:"full"})};const gse=mse;var _se={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},pse=function(t,e,n,i){return _se[t]};const bse=pse;var vse={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},yse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Tse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Sse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ese=function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Ose={ordinalNumber:Ese,era:ru({values:vse,defaultWidth:"wide"}),quarter:ru({values:kse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:ru({values:wse,defaultWidth:"wide"}),day:ru({values:yse,defaultWidth:"wide"}),dayPeriod:ru({values:Tse,defaultWidth:"wide",formattingValues:Sse,defaultFormattingWidth:"wide"})};const Mse=Ose;var Cse=/^(\d+)(th|st|nd|rd)?/i,Ase=/\d+/i,Lse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Dse={any:[/^b/i,/^(a|c)/i]},Ise={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rse={any:[/1/i,/2/i,/3/i,/4/i]},Pse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Nse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Bse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Hse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Use={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fse={ordinalNumber:Ure({matchPattern:Cse,parsePattern:Ase,valueCallback:function(t){return parseInt(t,10)}}),era:su({matchPatterns:Lse,defaultMatchWidth:"wide",parsePatterns:Dse,defaultParseWidth:"any"}),quarter:su({matchPatterns:Ise,defaultMatchWidth:"wide",parsePatterns:Rse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:su({matchPatterns:Pse,defaultMatchWidth:"wide",parsePatterns:Nse,defaultParseWidth:"any"}),day:su({matchPatterns:Bse,defaultMatchWidth:"wide",parsePatterns:zse,defaultParseWidth:"any"}),dayPeriod:su({matchPatterns:Hse,defaultMatchWidth:"any",parsePatterns:Use,defaultParseWidth:"any"})};const Gse=Fse;var Vse={code:"en-US",formatDistance:fse,formatLong:gse,formatRelative:bse,localize:Mse,match:Gse,options:{weekStartsOn:0,firstWeekContainsDate:1}};const OE=Vse;var Wse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,jse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$se=/^'([^]*?)'?$/,qse=/''/g,Yse=/[a-zA-Z]/;function _a(t,e,n){var i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A;Ft(2,arguments);var C=String(e),D=Zd(),R=(i=(l=n==null?void 0:n.locale)!==null&&l!==void 0?l:D.locale)!==null&&i!==void 0?i:OE,N=ci((r=(s=(o=(a=n==null?void 0:n.firstWeekContainsDate)!==null&&a!==void 0?a:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:D.firstWeekContainsDate)!==null&&s!==void 0?s:(c=D.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(N>=1&&N<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var G=ci((h=(g=(_=(k=n==null?void 0:n.weekStartsOn)!==null&&k!==void 0?k:n==null||(y=n.locale)===null||y===void 0||(T=y.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&_!==void 0?_:D.weekStartsOn)!==null&&g!==void 0?g:(M=D.locale)===null||M===void 0||(A=M.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&h!==void 0?h:0);if(!(G>=0&&G<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!R.localize)throw new RangeError("locale must contain localize property");if(!R.formatLong)throw new RangeError("locale must contain formatLong property");var B=mn(t);if(!Vre(B))throw new RangeError("Invalid time value");var j=Dm(B),q=Wre(B,j),V={firstWeekContainsDate:N,weekStartsOn:G,locale:R,_originalDate:B},K=C.match(jse).map(function(x){var ie=x[0];if(ie==="p"||ie==="P"){var X=ise[ie];return X(x,R.formatLong)}return x}).join("").match(Wse).map(function(x){if(x==="''")return"'";var ie=x[0];if(ie==="'")return Zse(x);var X=ese[ie];if(X)return!(n!=null&&n.useAdditionalWeekYearTokens)&&ose(x)&&Uw(x,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&sse(x)&&Uw(x,e,String(t)),X(q,x,R.localize,V);if(ie.match(Yse))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ie+"`");return x}).join("");return K}function Zse(t){var e=t.match($se);return e?e[1].replace(qse,"'"):t}var Xse=typeof global=="object"&&global&&global.Object===Object&&global;const ME=Xse;var Kse=typeof self=="object"&&self&&self.Object===Object&&self,Jse=ME||Kse||Function("return this")();const er=Jse;var Qse=er.Symbol;const Rl=Qse;var CE=Object.prototype,xse=CE.hasOwnProperty,eoe=CE.toString,ou=Rl?Rl.toStringTag:void 0;function toe(t){var e=xse.call(t,ou),n=t[ou];try{t[ou]=void 0;var i=!0}catch{}var l=eoe.call(t);return i&&(e?t[ou]=n:delete t[ou]),l}var noe=Object.prototype,ioe=noe.toString;function loe(t){return ioe.call(t)}var roe="[object Null]",soe="[object Undefined]",Fw=Rl?Rl.toStringTag:void 0;function _o(t){return t==null?t===void 0?soe:roe:Fw&&Fw in Object(t)?toe(t):loe(t)}function cr(t){return t!=null&&typeof t=="object"}var ooe="[object Symbol]";function Xd(t){return typeof t=="symbol"||cr(t)&&_o(t)==ooe}function aoe(t,e){for(var n=-1,i=t==null?0:t.length,l=Array(i);++n0){if(++e>=Roe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function zoe(t){return function(){return t}}var Hoe=function(){try{var t=bo(Object,"defineProperty");return t({},"",{}),t}catch{}}();const ad=Hoe;var Uoe=ad?function(t,e){return ad(t,"toString",{configurable:!0,enumerable:!1,value:zoe(e),writable:!0})}:Kg;const Foe=Uoe;var Goe=Boe(Foe);const Voe=Goe;function Woe(t,e){for(var n=-1,i=t==null?0:t.length;++n-1}var Xoe=9007199254740991,Koe=/^(?:0|[1-9]\d*)$/;function Qg(t,e){var n=typeof t;return e=e??Xoe,!!e&&(n=="number"||n!="symbol"&&Koe.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=eae}function Ca(t){return t!=null&&xg(t.length)&&!Jg(t)}function RE(t,e,n){if(!Pl(n))return!1;var i=typeof e;return(i=="number"?Ca(n)&&Qg(e,n.length):i=="string"&&e in n)?xu(n[e],t):!1}function tae(t){return IE(function(e,n){var i=-1,l=n.length,r=l>1?n[l-1]:void 0,s=l>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(l--,r):void 0,s&&RE(n[0],n[1],s)&&(r=l<3?void 0:r,l=1),e=Object(e);++i-1}function _ue(t,e){var n=this.__data__,i=xd(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function Zr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0&&n(o)?e>1?r_(o,e-1,n,i,l):l_(l,o):i||(l[l.length]=o)}return l}var Pue=HE(Object.getPrototypeOf,Object);const s_=Pue;var Nue="[object Object]",Bue=Function.prototype,zue=Object.prototype,VE=Bue.toString,Hue=zue.hasOwnProperty,Uue=VE.call(Object);function Fue(t){if(!cr(t)||_o(t)!=Nue)return!1;var e=s_(t);if(e===null)return!0;var n=Hue.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&VE.call(n)==Uue}function Gue(){this.__data__=new Zr,this.size=0}function Vue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Wue(t){return this.__data__.get(t)}function jue(t){return this.__data__.has(t)}var $ue=200;function que(t,e){var n=this.__data__;if(n instanceof Zr){var i=n.__data__;if(!Bu||i.length<$ue-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xr(i)}return n.set(t,e),this.size=n.size,this}function Xl(t){var e=this.__data__=new Zr(t);this.size=e.size}Xl.prototype.clear=Gue;Xl.prototype.delete=Vue;Xl.prototype.get=Wue;Xl.prototype.has=jue;Xl.prototype.set=que;function Yue(t,e){return t&&ef(e,tf(e),t)}function Zue(t,e){return t&&ef(e,nf(e),t)}var WE=typeof dl=="object"&&dl&&!dl.nodeType&&dl,Jw=WE&&typeof hl=="object"&&hl&&!hl.nodeType&&hl,Xue=Jw&&Jw.exports===WE,Qw=Xue?er.Buffer:void 0,xw=Qw?Qw.allocUnsafe:void 0;function jE(t,e){if(e)return t.slice();var n=t.length,i=xw?xw(n):new t.constructor(n);return t.copy(i),i}function Kue(t,e){for(var n=-1,i=t==null?0:t.length,l=0,r=[];++no))return!1;var u=r.get(t),f=r.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=n&Cce?new zu:void 0;for(r.set(t,e),r.set(e,t);++c=Ode){var u=e?null:Ede(t);if(u)return u_(u);s=!1,l=eO,a=new zu}else a=e?[]:o;e:for(;++i{const e=Math.min(t.width,t.height);return[e*3/400,e*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:_i.RADIUS,name:"Radius"}]}}),$de=jt({},rf,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:_i.AREA,name:"Poor area"},{type:_i.AREA,name:"Satisfactory area"},{type:_i.AREA,name:"Great area"},{type:_i.QUARTILE,name:"Quartiles"}]}}),qde=jt({},fo,{bars:{dividerSize:1.5},timeScale:jt(ih,{addSpaceOnEdges:0})}),Yde=jt({},Ni,{tooltip:jt({},oO,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[e*20/400,e*75/400]},wordMapsTo:"word"}}),dO=jt({},Ni,{pie:{labels:{formatter:null,enabled:!0},alignment:Il.LEFT,sortFunction:null,valueMapsTo:"value"}}),Zde=jt({},Ni,{legend:{enabled:!1},gauge:{type:_S.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,numberFormatter:t=>Number(t.toFixed(2))%1!==0?t.toFixed(2).toLocaleString():t.toFixed().toLocaleString(),alignment:Il.LEFT}}),Xde=jt({},dO,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20),numberFormatter:t=>Math.floor(t).toLocaleString()},alignment:Il.LEFT}}),hO=jt({},Ni,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),Kde=jt({},hO,{legend:{enabled:!0}}),Jde=jt({},Ni,{radar:{axes:{angle:"key",value:"value"},alignment:Il.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:t=>t??"N/A"}}),Qde=jt({},fo,{comboChartTypes:[]}),xde=jt({tree:{type:gS.TREE}},Ni,{}),ehe=jt({},Ni,{data:jt(Ni.data,{groupMapsTo:"name"})}),the=jt({},Ni,Ade,{data:jt(Ni.data,{groupMapsTo:"name"})}),nhe=jt({},Ni,{alluvial:{data:jt(Ni.data,{groupMapsTo:"source"}),nodeAlignment:Il.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),ihe=jt({},Ni,{axes:aO,heatmap:{divider:{state:pS.AUTO},colorLegend:{type:"linear"}}}),lhe=jt({},uO,{choropleth:{colorLegend:{type:"linear"}}}),rhe={alluvialChart:nhe,areaChart:cO,axisChart:rf,boxplotChart:Gde,bubbleChart:jde,bulletChart:$de,chart:Ni,circlePackChart:the,choroplethChart:lhe,comboChart:Qde,donutChart:Xde,gaugeChart:Zde,groupedBarChart:Ude,heatmapChart:ihe,histogramChart:qde,lineChart:fO,lollipopChart:Vde,meterChart:hO,pieChart:dO,proportionalMeterChart:Kde,radarChart:Jde,scatterChart:c_,simpleBarChart:Hde,stackedAreaChart:Wde,stackedBarChart:Fde,thematicChart:uO,treeChart:xde,treemapChart:ehe,wordCloudChart:Yde};function she(t,e,n){let i=null;return function(...l){const r=this;r.mousePosition=ro(l[0],n),clearTimeout(i),i=setTimeout(function(){t.apply(r,l)},e)}}function ohe(t,e){var n;const i=lf(t),l=Object.keys(e.axes||{});(n=e==null?void 0:e.toolbar)!=null&&n.controls&&delete i.toolbar.controls,l.length===0&&delete i.axes;for(const r in i.axes)if(l.includes(r)){const s=e.axes[r];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),s.mapsTo==null){const a=s.scaleType;a==null?s.mapsTo="value":a===St.TIME?s.mapsTo="date":a===St.LABELS&&(s.mapsTo="key")}}else delete i.axes[r];return mO(i,e),jt(i,e)}function Nr(t){if(!t)return;const e=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=t.getAttribute("transform").match(e);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Uu(t,e,n){if(n>t.length)return t;if(e===Zl.MID_LINE)return t.substr(0,n/2)+"..."+t.substr(-n/2);if(e===Zl.FRONT_LINE)return"..."+t.substr(-n);if(e===Zl.END_LINE)return t.substr(0,n)+"..."}function mO(t,e){const n=ye(t,"legend","additionalItems"),i=ye(e,"legend","additionalItems");if(n&&i){const l=i.map(o=>o.type),r=n.map(o=>o.type),s=Rde.filter(o=>r.includes(o.type)&&!l.includes(o.type));t.legend.additionalItems=s,e.legend.additionalItems=Cde(s,i,"name")}}const ye=(t,...e)=>{let n=t;if(n){for(const i of e)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},gO=(t,e)=>e===tl.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t,d_=(t,e)=>{const{x0:n,x1:i,y0:l,y1:r}=gO(t,e);return`M${n},${l}L${n},${r}L${i},${r}L${i},${l}L${n},${l}`};function na(t,e,n){return n===tl.VERTICAL?[t,e]:[e,t]}var _O=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(_O||{});const $1=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function pO(t,e,n,i,l){const r=e===0,s=Number(_a(new Date(t),"c"))===2,o=Number(_a(new Date(t),"q"))===1,a=e!==0?n[e-1]:null;switch(i){case"15seconds":return r||oc(t)||uu(t,a)||ps(t);case"minute":return r||oc(t)||uu(t,a)||ps(t);case"30minutes":return r||oc(t)||uu(t,a)||ps(t);case"hourly":return r||oc(t)||uu(t,a)||ps(t);case"daily":return l?r||s||ps(t):r||uu(t,a)||ps(t);case"weekly":return r||s||ps(t);case"monthly":return r||ps(t);case"quarterly":return r||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function Um(t,e,n,i,l){const r=l.showDayName,s=i==="daily"&&r?"weekly":i,o=new Date(t),a=ye(l,"timeIntervalFormats")[s],u=ye(a,"primary"),f=ye(a,"secondary");let c=pO(t,e,n,i,r)?u:f;i==="15seconds"&&o.getMilliseconds()!==0&&(c=c.replace("pp","h:mm:ss.SSS a"));const d=l.localeObject;return _a(o,c,{locale:d})}function fd(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function ahe(t){if(t)return t.slice(1).map((e,n)=>e-t[n])}function uhe(t){const e=$1.reduce((n,[,i],l)=>{const r=$1[n][1],s=Math.abs(r-t),o=Math.abs(i-t);return s(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(oi||{});function fhe(t,e){return t&&lO(t,e,tf)}function che(t,e){return function(n,i){if(n==null)return n;if(!Ca(n))return t(n,i);for(var l=n.length,r=e?l:-1,s=Object(n);(e?r--:++re.includes(o[r]))),s&&Object.keys(s).forEach(o=>{const a=s[o].mapsTo,u=s[o].scaleType;if((u===St.LINEAR||u===St.LOG)&&(i=i.map(f=>({...f,[a]:f[a]===null?f[a]:Number(f[a])}))),a&&s[o].domain)if(u===St.LABELS)i=i.filter(f=>s[o].domain.includes(f[a]));else{const[f,c]=s[o].domain;i=i.filter(d=>!(a in d)||d[a]>=f&&d[a]<=c)}}),i.filter(o=>l.find(a=>a.name===o[r]))}getDisplayData(e){if(!this.get("data"))return null;const{ACTIVE:n}=Ti.items.status,i=this.getDataGroups(e),{groupMapsTo:l}=this.getOptions().data;return this.getAllDataFromDomain(e).filter(r=>i.find(s=>s.name===r[l]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(e){const n=this.sanitize(lf(e)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(e){return ye(this.getOptions(),"data","loading")?[]:e?this.get("dataGroups").filter(n=>e.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(e){const{ACTIVE:n}=Ti.items.status;return this.getDataGroups(e).filter(i=>i.status===n)}getDataGroupNames(e){return this.getDataGroups(e).map(n=>n.name)}getActiveDataGroupNames(e){return this.getActiveDataGroups(e).map(n=>n.name)}aggregateBinDataByGroup(e){return khe(e,"group")}getBinConfigurations(){const e=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),l=this.services.cartesianScales.getDomainIdentifier(),r=n.axes[i],{groupMapsTo:s}=n.data,{bins:o=Dde.defaultBins}=r,a=Array.isArray(o),u=Mx().value(h=>h[l]).thresholds(o)(e);if(a)u[u.length-1].x1=o[o.length-1];else{const h=u[0].x1-u[0].x0;u[u.length-1].x1=+u[u.length-1].x0+h}const f=a?[o[0],o[o.length-1]]:[u[0].x0,u[u.length-1].x1],c=Array.from(new Set(e.map(h=>h[s]))),d=[];return u.forEach(h=>{const g=`${h.x0}-${h.x1}`,_=this.aggregateBinDataByGroup(h);c.forEach(k=>{d.push({group:k,key:g,value:_[k]||0,bin:h.x0})})}),{bins:u,binsDomain:f}}getBinnedStackedData(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this.getActiveDataGroupNames(),{bins:l}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:l});return U1().keys(i)(r).map((s,o)=>Object.keys(s).filter(a=>!isNaN(a)).map(a=>{const u=s[a];return u[n]=i[o],u}))}getGroupedData(e){const n=this.getDisplayData(e),i={},{groupMapsTo:l}=this.getOptions().data;return n.map(r=>{const s=r[l];i[s]!==null&&i[s]!==void 0?i[s].push(r):i[s]=[r]}),Object.keys(i).map(r=>({name:r,data:i[r]}))}getStackKeys({bins:e=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),l=this.getDisplayData(n);let r;e?r=e.map(a=>`${a.x0}-${a.x1}`):r=Hu(l.map(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a);return a[u]instanceof Date?p6(a[u]):a[u]&&typeof a[u].toString=="function"?a[u].toString():a[u]}));const s=this.services.cartesianScales.domainAxisPosition,o=i.axes[s].scaleType;return o===St.TIME?r.sort((a,u)=>{const f=new Date(a),c=new Date(u);return f-c}):(o===St.LOG||o===St.LINEAR)&&r.sort((a,u)=>a-u),r}getDataValuesGroupedByKeys({bins:e=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.getDisplayData(n),s=this.getDataGroupNames(),o=this.getStackKeys({bins:e,groups:n});return e?o.map(a=>{const[u,f]=a.split("-"),c={x0:u,x1:f},d=e.find(h=>h.x0.toString()===u.toString());return s.forEach(h=>{c[h]=d.filter(g=>g[l]===h).length}),c}):o.map(a=>{const u={sharedStackKey:a};return s.forEach(f=>{const c=r.find(h=>{const g=this.services.cartesianScales.getDomainIdentifier(h);return h[l]===f&&Object.prototype.hasOwnProperty.call(h,g)&&(h[g]instanceof Date?p6(h[g])===a:h[g].toString()===a)}),d=this.services.cartesianScales.getRangeIdentifier(u);u[f]=c?c[d]:null}),u})}getStackedData({percentage:e=!1,groups:n=null,divergent:i=!1}){const l=this.getOptions(),{groupMapsTo:r}=l.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(e){const a=_he(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{s.forEach(f=>{a[u.sharedStackKey]+=u[f]})}),o.forEach(u=>{s.forEach(f=>{const c=a[u.sharedStackKey];a[u.sharedStackKey]?u[f]=u[f]/c*100:u[f]=0})})}return(i?U1().offset(Bre):U1()).keys(s)(o).map((a,u)=>Object.keys(a).filter(f=>!isNaN(f)).map(f=>{const c=a[f];return c[r]=s[u],c}))}getOptions(){return this.state.options}set(e,n){this.state=Object.assign({},this.state,e);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(e){return e?this.state[e]:this.state}setOptions(e){const n=this.getOptions();mO(n,e),this.set({options:jt(n,e)})}update(e=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent($e.Model.UPDATE,{animate:e}))}toggleDataLabel(e){const{ACTIVE:n,DISABLED:i}=Ti.items.status,l=this.getDataGroups(),r=l.some(u=>u.status===i),s=l.filter(u=>u.status===n);if(r)if(s.length===1&&s[0].name===e)l.forEach((u,f)=>{l[f].status=n});else{const u=l.findIndex(f=>f.name===e);l[u].status=l[u].status===i?n:i}else l.forEach((u,f)=>{l[f].status=u.name===e?n:i});const o=l.filter(u=>u.status===n),a=this.getOptions();l.some(u=>u.status===i)?a.data.selectedGroups=o.map(u=>u.name):a.data.selectedGroups=[],this.services.events.dispatchEvent($e.Legend.ITEMS_UPDATE,{dataGroups:l}),this.set({dataGroups:l})}getIsFilled(e,n,i,l){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(e,n,i,l):l}getFillColor(e,n,i){const l=this.getOptions(),r=ye(this.colorScale,e);return l.getFillColor?l.getFillColor(e,n,i,r):r}getStrokeColor(e,n,i){const l=this.getOptions(),r=ye(this.colorScale,e);return l.getStrokeColor?l.getStrokeColor(e,n,i,r):r}isUserProvidedColorScaleValid(){const e=ye(this.getOptions(),"color","scale"),n=this.getDataGroups();return e==null||Object.keys(e).length==0?!1:n.some(i=>Object.keys(e).includes(i.name))}getColorClassName(e){const n=this.colorClassNames(e.dataGroupName);let i=e.originalClassName;return e.classNameTypes.forEach(l=>i=e.originalClassName?`${i} ${l}-${n}`:`${l}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(e){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:l}=e;return i.forEach(r=>{r.data.forEach((s,o)=>{let a;const u=ye(r,"label");if(u===null){const c=ye(l,o);c?a=c:a="Ungrouped"}else a=u;const f={group:a,key:l[o]};isNaN(s)?(f.value=s.value,f.date=s.date):f.value=s,n.push(f)})}),n}getTabularDataArray(){return[]}exportToCSV(){const e=this.getTabularDataArray().map(l=>l.map(r=>`"${r==="–"?"–":r}"`));let n="",i="";e.forEach(function(l,r){i=l.join(","),n+=r{this.allDataGroups.indexOf(e)===-1&&this.allDataGroups.push(e)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(e){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:l}=Ti.items.status,r=this.getOptions(),s=Hu(e.map(a=>a[n]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(a=>s.includes(a))||(r.data.selectedGroups=[]));const o=a=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(a)?i:l;return s.map(a=>({name:a,status:o(a)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const e=this.getOptions(),n=ye(e,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const e=ye(this.getOptions(),"color","pairing");let n=ye(e,"numberOfVariants");(!n||n5?14:n,s=`${r}-color`;i=i<=l[s]?i:1;const o=this.allDataGroups.map((a,u)=>`${r}-${i}-${u%14+1}`);this.colorClassNames=Rg().range(o).domain(this.allDataGroups)}}class whe extends vO{constructor(e){super(e),this.axisFlavor=wg.DEFAULT}assignRangeAndDomains(){const{cartesianScales:e}=this.services,n=this.getOptions(),i=e.isDualAxes(),l={primaryDomain:e.domainAxisPosition,primaryRange:e.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(l.secondaryDomain=e.secondaryDomainAxisPosition,l.secondaryRange=e.secondaryRangeAxisPosition),Object.keys(l).forEach(r=>{const s=l[r];e.scales[s]?l[r]={position:s,label:e.getScaleLabel(s),identifier:ye(n,"axes",s,"mapsTo")}:l[r]=null}),l}getTabularDataArray(){const e=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:l}=this.services,{primaryDomain:r,primaryRange:s,secondaryDomain:o,secondaryRange:a}=this.assignRangeAndDomains(),u=l.getDomainAxisScaleType();let f;return u===St.TIME&&(f=c=>_a(c,"MMM d, yyyy")),[["Group",r.label,s.label,...o?[o.label]:[],...a?[a.label]:[]],...e.map(c=>[c[i],c[r.identifier]===null?"–":f?f(c[r.identifier]):c[r.identifier],c[s.identifier]===null||isNaN(c[s.identifier])?"–":c[s.identifier].toLocaleString(),...o?[c[o.identifier]===null?"–":c[o.identifier]]:[],...a?[c[a.identifier]===null||isNaN(c[a.identifier])?"–":c[a.identifier]]:[]])]}setData(e){let n;if(e&&(n=super.setData(e),ye(this.getOptions(),"zoomBar",Qe.TOP,"enabled"))){const i=ye(this.getOptions(),"zoomBar",Qe.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(e){const n=e?this.sanitize(lf(e)):this.getDisplayData();let i=n;const{cartesianScales:l}=this.services;if(n&&l.domainAxisPosition&&l.rangeAxisPosition){const r=l.getDomainIdentifier(),s=l.getRangeIdentifier();let o=n.map(a=>a[r].getTime());o=Hu(o).sort(),i=o.map(a=>{let u=0;const f={};return n.forEach(c=>{c[r].getTime()===a&&(u+=c[s])}),f[r]=new Date(a),f[s]=u,f})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(e){const n=this.getOptions();if(!n.axes)return e;const i=[];return Object.keys(Qe).forEach(l=>{const r=Qe[l],s=n.axes[r];if(s&&s.scaleType===St.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&e.forEach(l=>{i.forEach(r=>{ye(l,r,"getTime")===null&&(l[r]=new Date(l[r]))})}),e}sanitize(e){return e=super.sanitize(e),e=this.sanitizeDateValues(e),e}}var yhe=/\s/;function The(t){for(var e=t.length;e--&&yhe.test(t.charAt(e)););return e}var She=/^\s+/;function Ehe(t){return t&&t.slice(0,The(t)+1).replace(She,"")}var b6=0/0,Ohe=/^[-+]0x[0-9a-f]+$/i,Mhe=/^0b[01]+$/i,Che=/^0o[0-7]+$/i,Ahe=parseInt;function yu(t){if(typeof t=="number")return t;if(Xd(t))return b6;if(Pl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Pl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ehe(t);var n=Mhe.test(t);return n||Che.test(t)?Ahe(t.slice(2),n?2:8):Ohe.test(t)?b6:+t}var Lhe=function(){return er.Date.now()};const q1=Lhe;var Dhe="Expected a function",Ihe=Math.max,Rhe=Math.min;function Phe(t,e,n){var i,l,r,s,o,a,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Dhe);e=yu(e)||0,Pl(n)&&(f=!!n.leading,c="maxWait"in n,r=c?Ihe(yu(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d);function h(D){var R=i,N=l;return i=l=void 0,u=D,s=t.apply(N,R),s}function g(D){return u=D,o=setTimeout(y,e),f?h(D):s}function _(D){var R=D-a,N=D-u,G=e-R;return c?Rhe(G,r-N):G}function k(D){var R=D-a,N=D-u;return a===void 0||R>=e||R<0||c&&N>=r}function y(){var D=q1();if(k(D))return T(D);o=setTimeout(y,_(D))}function T(D){return o=void 0,d&&i?h(D):(i=l=void 0,s)}function M(){o!==void 0&&clearTimeout(o),u=0,i=a=l=o=void 0}function A(){return o===void 0?s:T(q1())}function C(){var D=q1(),R=k(D);if(i=arguments,l=this,a=D,R){if(o===void 0)return g(a);if(c)return clearTimeout(o),o=setTimeout(y,e),h(a)}return o===void 0&&(o=setTimeout(y,e)),s}return C.cancel=M,C.flush=A,C}function Nhe(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),l=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(l),e&&(i.href=e),l.href=t,l.href}const Bhe=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function Vr(t){const e=[];for(let n=0,i=t.length;nfl||t.height>fl)&&(t.width>fl&&t.height>fl?t.width>t.height?(t.height*=fl/t.width,t.width=fl):(t.width*=fl/t.height,t.height=fl):t.width>fl?(t.height*=fl/t.width,t.width=fl):(t.width*=fl/t.height,t.height=fl))}function dd(t){return new Promise((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}async function Ghe(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function Vhe(t,e,n){const i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),r=document.createElementNS(i,"foreignObject");return l.setAttribute("width",`${e}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${e} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),l.appendChild(r),r.appendChild(t),Ghe(l)}const el=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||el(n,e)};function Whe(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function jhe(t){return Vr(t).map(e=>{const n=t.getPropertyValue(e),i=t.getPropertyPriority(e);return`${e}: ${n}${i?" !important":""};`}).join(" ")}function $he(t,e,n){const i=`.${t}:${e}`,l=n.cssText?Whe(n):jhe(n);return document.createTextNode(`${i}{${l}}`)}function v6(t,e,n){const i=window.getComputedStyle(t,n),l=i.getPropertyValue("content");if(l===""||l==="none")return;const r=Bhe();try{e.className=`${e.className} ${r}`}catch{return}const s=document.createElement("style");s.appendChild($he(r,n,i)),e.appendChild(s)}function qhe(t,e){v6(t,e,":before"),v6(t,e,":after")}const k6="application/font-woff",w6="image/jpeg",Yhe={woff:k6,woff2:k6,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:w6,jpeg:w6,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Zhe(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function h_(t){const e=Zhe(t).toLowerCase();return Yhe[e]||""}function Xhe(t){return t.split(/,/)[1]}function Gm(t){return t.search(/^(data:)/)!==-1}function wO(t,e){return`data:${e};base64,${t}`}async function yO(t,e,n){const i=await fetch(t,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const l=await i.blob();return new Promise((r,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{r(n({res:i,result:o.result}))}catch(a){s(a)}},o.readAsDataURL(l)})}const Y1={};function Khe(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function m_(t,e,n){const i=Khe(t,e,n.includeQueryParams);if(Y1[i]!=null)return Y1[i];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let l;try{const r=await yO(t,n.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),Xhe(o)));l=wO(r,e)}catch(r){l=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;r&&(s=typeof r=="string"?r:r.message),s&&console.warn(s)}return Y1[i]=l,l}async function Jhe(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):dd(e)}async function Qhe(t,e){if(t.currentSrc){const r=document.createElement("canvas"),s=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,s==null||s.drawImage(t,0,0,r.width,r.height);const o=r.toDataURL();return dd(o)}const n=t.poster,i=h_(n),l=await m_(n,i,e);return dd(l)}async function xhe(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await lh(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function e1e(t,e){return el(t,HTMLCanvasElement)?Jhe(t):el(t,HTMLVideoElement)?Qhe(t,e):el(t,HTMLIFrameElement)?xhe(t):t.cloneNode(!1)}const t1e=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function n1e(t,e,n){var i,l;let r=[];return t1e(t)&&t.assignedNodes?r=Vr(t.assignedNodes()):el(t,HTMLIFrameElement)&&!((i=t.contentDocument)===null||i===void 0)&&i.body?r=Vr(t.contentDocument.body.childNodes):r=Vr(((l=t.shadowRoot)!==null&&l!==void 0?l:t).childNodes),r.length===0||el(t,HTMLVideoElement)||await r.reduce((s,o)=>s.then(()=>lh(o,n)).then(a=>{a&&e.appendChild(a)}),Promise.resolve()),e}function i1e(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):Vr(i).forEach(l=>{let r=i.getPropertyValue(l);l==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),el(t,HTMLIFrameElement)&&l==="display"&&r==="inline"&&(r="block"),l==="d"&&e.getAttribute("d")&&(r=`path(${e.getAttribute("d")})`),n.setProperty(l,r,i.getPropertyPriority(l))})}function l1e(t,e){el(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),el(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function r1e(t,e){if(el(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(l=>t.value===l.getAttribute("value"));i&&i.setAttribute("selected","")}}function s1e(t,e){return el(e,Element)&&(i1e(t,e),qhe(t,e),l1e(t,e),r1e(t,e)),e}async function o1e(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const i={};for(let r=0;re1e(i,e)).then(i=>n1e(t,i,e)).then(i=>s1e(t,i)).then(i=>o1e(i,e))}const TO=/url\((['"]?)([^'"]+?)\1\)/g,a1e=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,u1e=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function f1e(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function c1e(t){const e=[];return t.replace(TO,(n,i,l)=>(e.push(l),n)),e.filter(n=>!Gm(n))}async function d1e(t,e,n,i,l){try{const r=n?Nhe(e,n):e,s=h_(e);let o;if(l){const a=await l(r);o=wO(a,s)}else o=await m_(r,s,i);return t.replace(f1e(e),`$1${o}$3`)}catch{}return t}function h1e(t,{preferredFontFormat:e}){return e?t.replace(u1e,n=>{for(;;){const[i,,l]=a1e.exec(n)||[];if(!l)return"";if(l===e)return`src: ${i};`}}):t}function SO(t){return t.search(TO)!==-1}async function EO(t,e,n){if(!SO(t))return t;const i=h1e(t,n);return c1e(i).reduce((l,r)=>l.then(s=>d1e(s,r,e,n)),Promise.resolve(i))}async function ac(t,e,n){var i;const l=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(t);if(l){const r=await EO(l,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function m1e(t,e){await ac("background",t,e)||await ac("background-image",t,e),await ac("mask",t,e)||await ac("mask-image",t,e)}async function g1e(t,e){const n=el(t,HTMLImageElement);if(!(n&&!Gm(t.src))&&!(el(t,SVGImageElement)&&!Gm(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,l=await m_(i,h_(i),e);await new Promise((r,s)=>{t.onload=r,t.onerror=s;const o=t;o.decode&&(o.decode=r),o.loading==="lazy"&&(o.loading="eager"),n?(t.srcset="",t.src=l):t.href.baseVal=l})}async function _1e(t,e){const n=Vr(t.childNodes).map(i=>OO(i,e));await Promise.all(n).then(()=>t)}async function OO(t,e){el(t,Element)&&(await m1e(t,e),await g1e(t,e),await _1e(t,e))}function p1e(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(l=>{n[l]=i[l]}),t}const y6={};async function T6(t){let e=y6[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},y6[t]=e,e}async function S6(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,l=(n.match(/url\([^)]+\)/g)||[]).map(async r=>{let s=r.replace(i,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),yO(s,e.fetchRequestInit,({result:o})=>(n=n.replace(r,`url(${o})`),[r,o]))});return Promise.all(l).then(()=>n)}function E6(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=t.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=l.exec(i);if(a===null)break;e.push(a[0])}i=i.replace(l,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let a=r.exec(i);if(a===null){if(a=o.exec(i),a===null)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(a[0])}return e}async function b1e(t,e){const n=[],i=[];return t.forEach(l=>{if("cssRules"in l)try{Vr(l.cssRules||[]).forEach((r,s)=>{if(r.type===CSSRule.IMPORT_RULE){let o=s+1;const a=r.href,u=T6(a).then(f=>S6(f,e)).then(f=>E6(f).forEach(c=>{try{l.insertRule(c,c.startsWith("@import")?o+=1:l.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:c,error:d})}})).catch(f=>{console.error("Error loading remote css",f.toString())});i.push(u)}})}catch(r){const s=t.find(o=>o.href==null)||document.styleSheets[0];l.href!=null&&i.push(T6(l.href).then(o=>S6(o,e)).then(o=>E6(o).forEach(a=>{s.insertRule(a,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",r)}}),Promise.all(i).then(()=>(t.forEach(l=>{if("cssRules"in l)try{Vr(l.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${l.href}`,r)}}),n))}function v1e(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>SO(e.style.getPropertyValue("src")))}async function k1e(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=Vr(t.ownerDocument.styleSheets),i=await b1e(n,e);return v1e(i)}async function w1e(t,e){const n=await k1e(t,e);return(await Promise.all(n.map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return EO(i.cssText,l,e)}))).join(` +`)}async function y1e(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await w1e(t,e);if(n){const i=document.createElement("style"),l=document.createTextNode(n);i.appendChild(l),t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}}async function T1e(t,e={}){const{width:n,height:i}=kO(t,e),l=await lh(t,e,!0);return await y1e(l,e),await OO(l,e),p1e(l,e),await Vhe(l,n,i)}async function MO(t,e={}){const{width:n,height:i}=kO(t,e),l=await T1e(t,e),r=await dd(l),s=document.createElement("canvas"),o=s.getContext("2d"),a=e.pixelRatio||Uhe(),u=e.canvasWidth||n,f=e.canvasHeight||i;return s.width=u*a,s.height=f*a,e.skipAutoScale||Fhe(s),s.style.width=`${u}`,s.style.height=`${f}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(r,0,0,s.width,s.height),s}async function S1e(t,e={}){return(await MO(t,e)).toDataURL()}async function E1e(t,e={}){return(await MO(t,e)).toDataURL("image/jpeg",e.quality||1)}class Kr{constructor(e,n){this.model=e,this.services=n,this.init()}init(){}update(){}setModel(e){this.model=e}setServices(e){this.services=e}}const O1e="DONT_STYLE_ME_css_styles_verifier";class ft extends Kr{constructor(e,n){super(e,n),this.chartID=""}static getHTMLElementSize(e){return{width:e.clientWidth,height:e.clientHeight}}static getSVGElementSize(e,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){e.attr||(e=rt(e));const i={width:0,height:0},l=d=>{d&&Object.keys(i).forEach(h=>{if(d[h]){const g=d[h],_=parseFloat(g);g&&_>i[h]&&(""+g).indexOf("%")===-1&&(i[h]=_)}})},r={width:e.attr("width"),height:e.attr("height")},s=e.node();let o,a,u,f;try{typeof s.getBBox=="function"&&(o=s.getBBox(),a={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(u=s.getBoundingClientRect(),f={width:u.width,height:u.height})}catch(d){console.error(d)}let c;if(s instanceof SVGSVGElement&&(c={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(l(r),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(l(c),i.width>0&&i.height>0))return c;if(n.useBBox&&(l(a),i.width>0&&i.height>0))return a;if(n.useBoundingRect&&(l(f),i.width>0&&i.height>0))return f}try{const d={width:ye(e.node(),"width","baseVal","value"),height:ye(e.node(),"height","baseVal","value")};l(d)}catch{l(c),l(a),l(r)}return i}static appendOrSelect(e,n){const i=e.select(`${n}`);if(i.empty()){let l=n.split("#"),r,s;return l.length===2?(r=l[0],l=l[1].split("."),s=l[0]):(l=n.split("."),r=l[0]),e.append(r).attr("id",s).attr("class",l.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(e){return`chart-${this.chartID}-${e}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const e=this.model.getOptions(),n=ye(e,"style","prefix"),i=rt(this.getHolder()).append("div").classed(`${Qi}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",O1e),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const e=this.getHolder(),{width:n,height:i,theme:l}=this.model.getOptions();n!==this.width&&(e.style.width=n,this.width=n),i!==this.height&&(e.style.height=i,this.height=i),rt(this.getHolder()).classed(`${Qi}--chart-holder`,!0).attr("data-carbon-theme",l)}getHolder(){return this.model.get("holder")}exportToJPG(){const e=this,n=this.getHolder(),i=rt(n);i.classed("filled",!0),E1e(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const e=this,n=this.getHolder(),i=rt(n);i.classed("filled",!0),S1e(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.png"),i.classed("filled",!1)}).catch(function(l){console.error("oops, something went wrong!",l)})}toggleFullscreen(){const e=this.getHolder();rt(e).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const e=rt(this.getHolder()),n=e.classed("fullscreen");e.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=ft.getSVGElementSize(rt(this.mainContainer),{useBBox:!0}),n=rt(this.mainContainer).attr("class"),i=rt(this.mainContainer).selectAll(`.${n} > svg`);let l=0;i.nodes().forEach(function(r){l+=Number(ft.getSVGElementSize(rt(r),{useBBox:!0}).height)}),l<=e?rt(this.mainContainer).attr("height",l):rt(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const e=this.getHolder();e&&rt(e).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent($e.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent($e.Chart.MOUSEOUT)})}addResizeListener(){const e=this.getHolder();if(!e)return;let n=e.clientWidth,i=e.clientHeight;const l=Phe(()=>{var r;e&&(Math.abs(n-e.clientWidth)>1||Math.abs(i-e.clientHeight)>1)&&(n=e.clientWidth,i=e.clientHeight,(r=this.services.events)==null||r.dispatchEvent($e.Chart.RESIZE))},12.5);new ResizeObserver(l).observe(e)}}class Fu extends Kr{static appendOrUpdateLinearGradient(e){let n=e.svg.select(`defs linearGradient#${e.id}`);n.empty()&&(n=e.svg.append("defs").append("linearGradient").attr("id",e.id).attr("x1",e.x1).attr("x2",e.x2).attr("y1",e.y1).attr("y2",e.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(e.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(e){return(Math.abs(e[1])*100/Math.abs(e[0]-e[1])).toFixed(2)+"%"}static getStops(e,n){const i=e[0]<0&&e[1]>0;let l=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(l=[{offset:"0%",color:n,opacity:"0.6"},{offset:Fu.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),l}}var M1e={value:function(){}};function CO(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Tc.prototype=CO.prototype={constructor:Tc,on:function(t,e){var n=this._,i=C1e(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=e?t:e)),t}function R1e(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=yu(n),n=n===n?n:0),e!==void 0&&(e=yu(e),e=e===e?e:0),I1e(yu(t),e,n)}function P1e(t,e){return nh(t,e)}function N1e(t,e){var n;return bO(t,function(i,l,r){return n=e(i,l,r),!n}),!!n}function B1e(t,e,n){var i=Pi(t)?xE:N1e;return n&&RE(t,e,n)&&(e=void 0),i(t,f_(e))}class $n{constructor(e,n,i){if(this.type="",this.renderType=vn.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=n,i&&(this.configs=i,this.configs.id)){const l=ye(this.model.getOptions(),"style","prefix");this.id=`${l}--${this.configs.id}`}this.parent||this.setParent(rt(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var n;const i=this.parent;if(this.parent=e,!(i&&i.node()===e.node())&&this.type){const l=ye(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${Qi}--${l}--${this.type}`,!0),i&&i.classed(`${Qi}--${l}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const n=ye(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",l=ft.appendOrSelect(this.parent,`${this.renderType===vn.SVG?"svg":"div"}${i}.${Qi}--${n}--${this.type}`);if(e.withinChartClip){const r=this.model.get("chartClipId");if(r){const s=rt(`#${r}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&l.attr("clip-path",`url(#${r})`)}}return l.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?jt({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const AO=class LO extends $n{constructor(){super(...arguments),this.type="toolbar",this.renderType=vn.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener($e.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener($e.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(ye(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("
        "));const{buttonList:i,overflowMenuItemList:l}=this.getControlConfigs();l&&i.push(this.getOverflowButtonConfig());const r=n.selectAll("div.toolbar-control").data(i,a=>a.id);r.exit().remove();const s=r.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;s.merge(r).classed("disabled",a=>a.shouldBeDisabled()).attr("aria-disabled",a=>a.shouldBeDisabled()).attr("aria-label",a=>a.title).html(a=>` - `}render(e=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=rt(this.services.domUtils.getHolder()),l=ye(n,"style","prefix");this.modal=ft.appendOrSelect(i,`div.${Qi}--${l}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class zO extends $n{constructor(){super(...arguments),this.type="title",this.renderType=vn.HTML}render(e=!1){const n=this.getComponentContainer(),i=ye(this.getOptions(),"title"),l=n.selectAll("p.title").data([i]);if(l.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(l).html(r=>r),l.node()&&l.node().offsetWidthn){e.append("tspan").text("...");const l=ft.appendOrSelect(e,"tspan").node().getComputedTextLength(),r=e.text(),s=this.getSubstringIndex(e.node(),0,r.length-1,n-l);e.html(r.substring(0,s-1)).append("tspan").text("...");const o=this;e.on("mouseover",function(a){o.services.events.dispatchEvent($e.Tooltip.SHOW,{event:a,hoveredElement:e,content:i})}).on("mousemove",function(a){o.services.events.dispatchEvent($e.Tooltip.MOVE,{event:a})}).on("mouseout",function(){o.services.events.dispatchEvent($e.Tooltip.HIDE)})}}getMaxTitleWidth(){return ft.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,n,i,l){const r=Math.floor((i+n)/2);return e.getSubStringLength(0,r)>l?this.getSubstringIndex(e,n,r,l):e.getSubStringLength(0,r)l?r:this.getSubstringIndex(e,r,i,l):r}}class HO extends $n{constructor(){super(...arguments),this.type="legend",this.renderType=vn.HTML}render(e=!1){const n=this.getOptions(),i=ye(n,"legend"),l=ye(i,"alignment"),r=ye(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Ti.items.status,a=s.some(T=>T.status===o),u=ye(i,"order"),f=this.getComponentContainer().classed("center-aligned",l===Il.CENTER).classed("right-aligned",l===Il.RIGHT).classed(r,!0).classed("has-deactivated-items",a).attr("role",oi.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");u&&(s=this.sortDataGroups(s,u));const c=f.selectAll("div.legend-item").data(s,T=>T.name),d=c.enter().append("div").attr("class","legend-item");d.merge(f.selectAll("div.legend-item")).classed("active",function(T){return T.status===Ti.items.status.ACTIVE});const h=ye(this.getOptions(),"legend","clickable");f.classed("clickable",h&&s.length>1);const g=Ti.checkbox.radius,_=d.append("div").classed("checkbox",!0),k=_.merge(c.select("div.checkbox")).attr("role",oi.CHECKBOX).attr("tabindex",h?0:-1).attr("aria-labelledby",(T,M)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${M}-title`)).attr("aria-checked",({status:T})=>T===Ti.items.status.ACTIVE).attr("width",g*2).attr("height",g*2).attr("class",T=>this.model.getColorClassName({classNameTypes:[Oi.BACKGROUND],dataGroupName:T.name,originalClassName:"checkbox"})).style("background",T=>T.status===Ti.items.status.ACTIVE?this.model.getFillColor(T.name)||this.model.getStrokeColor(T.name):null).classed("active",function(T){return T.status===Ti.items.status.ACTIVE});_.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(c.select("p"));const y=ye(n,"legend","additionalItems");if(y&&s.length){const T=this,M=f.selectAll("div.additional-item").data(y);M.exit().remove();const A=M.enter().append("div").merge(M).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(R,N)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${k.size()+N}-title`));A.selectAll("*").remove();let C,D=1;A.append("svg").classed("icon",!0).each(function(R){const N=rt(this);!C||C!=R.type?(C=R.type,D=1):D++,T.addAdditionalItem(N,R,D)}),A.append("p").merge(A.select("p")),this.truncateLegendText()}c.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),h&&d.size()>1&&this.addEventListeners()}sortDataGroups(e,n){if(e.sort((i,l)=>n.indexOf(i.name)-n.indexOf(l.name)),n.lengthu.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a)}else if(n.type===_i.LINE){const s=Ti.line;e.select("line.line").empty()&&e.append("line").classed(`line-${i}`,!0).attr("role",oi.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",l).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===_i.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${i}`,!0).attr("role",oi.IMG).attr("aria-label","area").attr("width",l).attr("height",r).style("fill",i>3&&!n.fill?Ti.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===_i.SIZE){const{iconData:s,fill:o,stroke:a}=Ti.size;e.attr("fill","none").attr("role",oi.IMG).attr("aria-label","size").selectAll("rect").data(s).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a).style("stroke-width",1)}else if(n.type===_i.QUARTILE){const{iconData:s}=Ti.quartile;e.selectAll("rect").attr("role",oi.IMG).attr("aria-label","quartile").data(s).enter().append("rect").attr("class",(o,a)=>`quartile-${a===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===_i.ZOOM){const{iconData:s,color:o}=ye(Ti,"zoom"),a=e.attr("role",oi.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).enter();a.append("g").attr("x",u=>u.x).attr("y",u=>u.y).attr("width",u=>u.width).attr("height",u=>u.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),a.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const e=this.getComponentContainer(),n=ye(this.getOptions(),"legend","truncation"),i=ye(n,"type"),l=ye(n,"threshold"),r=ye(n,"numCharacter"),s=e.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Zl.NONE?s.html(function(o){return o.name.length>l?Uu(o.name,i,r):o.name}):s.html(o=>o.name)}addEventListeners(){const e=this,n=this.getComponentContainer(),i=this.getOptions(),l=ye(i,"legend"),r=ye(l,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){e.services.events.dispatchEvent($e.Legend.ITEM_HOVER,{hoveredElement:rt(this)});const o=rt(this);o.select("div.checkbox").classed("hovered",!0);const a=o.datum();a.name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})}).on("mousemove",function(s){rt(this).datum().name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:s})}).on("click",function(){e.services.events.dispatchEvent($e.Legend.ITEM_CLICK,{clickedElement:rt(this)});const s=rt(this).datum();e.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=rt(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.HIDE),e.services.events.dispatchEvent($e.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&e.services.events.dispatchEvent($e.Legend.ITEM_HOVER,{hoveredElement:rt(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),e.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&e.services.events.dispatchEvent($e.Legend.ITEM_MOUSEOUT,{hoveredElement:rt(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=rt(this),a=o.datum();a.name.length>r.threshold&&e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})})}}class UO extends $n{constructor(e,n,i){super(e,n,i),this.type="chart-clip",this.renderType=vn.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),l=n.getMainYScale(),[r,s]=i.range(),[o,a]=l.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=ft.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const u=ft.appendOrSelect(this.chartClipPath,`rect.${this.type}`);s-r>0&&u.attr("x",r).attr("y",a).attr("width",s-r).attr("height",o-a),this.chartClipPath.merge(u).lower()}}class Kme extends UO{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:n,height:i}=ft.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=ft.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=ft.appendOrSelect(this.chartClipPath,`rect.${this.type}`);l.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(l).lower()}}var Wo,Si;(function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"})(Si||(Si={}));var N6=(Wo={},Wo[Si.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},Wo[Si.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},Wo[Si.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Wo[Si.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Wo),B6=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},rh=function(){function t(e){e===void 0&&(e={}),this.positions=N6,this.positions=Object.assign({},N6,e)}return t.prototype.getRelativeOffset=function(e){for(var n={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent;return n},t.prototype.getAbsoluteOffset=function(e){for(var n=e,i={top:0,left:0};n.offsetParent;){var l=getComputedStyle(n.offsetParent);l.position==="static"&&l.marginLeft&&l.marginTop&&(parseInt(l.marginTop,10)&&(i.top+=parseInt(l.marginTop,10)),parseInt(l.marginLeft,10)&&(i.left+=parseInt(l.marginLeft,10))),n=n.offsetParent}var r=e.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:r.top-s.top+i.top,left:r.left-s.left+i.left}},t.prototype.findRelative=function(e,n,i){var l=this.getRelativeOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findAbsolute=function(e,n,i){var l=this.getAbsoluteOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findPosition=function(e,n,i,l){l===void 0&&(l=this.getAbsoluteOffset.bind(this));var r=l(e),s=e.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},t.prototype.findPositionAt=function(e,n,i){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},n,i)},t.prototype.getPlacementBox=function(e,n){var i=e.offsetHeight+n.top,l=e.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:l}},t.prototype.addOffset=function(e,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},e,{top:e.top+n,left:e.left+i})},t.prototype.setElement=function(e,n){e.style.top=n.top+"px",e.style.left=n.left+"px"},t.prototype.findBestPlacement=function(e,n,i,l,r){var s=this;l===void 0&&(l=this.defaultContainerFunction.bind(this)),r===void 0&&(r=this.findPosition.bind(this));var o=i.map(function(a){var u=r(e,n,a),f=s.getPlacementBox(n,u),c=0,d=0,h=l();f.toph.height&&(c=f.bottom-h.height),f.lefth.width&&(d=f.right-h.width),c&&!d?d=1:d&&!c&&(c=1);var g=n.offsetHeight*n.offsetWidth,_=c*d,k=g-_,y=k/g;return{placement:a,weight:y}});return o.sort(function(a,u){return u.weight-a.weight}),o[0].placement},t.prototype.findBestPlacementAt=function(e,n,i,l){var r=this;l===void 0&&(l=this.defaultContainerFunction.bind(this));var s=function(o,a,u){return r.findPositionAt(e,a,u)};return this.findBestPlacement(null,n,i,l,s)},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:B6.innerHeight,width:B6.innerWidth}},t.prototype.calculatePosition=function(e,n,i,l){return this.positions[l]?this.positions[l](e,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new rh;class FO extends $n{constructor(e,n,i){super(e,n,i),this.type="tooltip",this.renderType=vn.HTML,this.isEventListenerAdded=!1,this.positionService=new rh,this.handleShowTooltip=l=>{const r=l.detail.data||l.detail.items;let s;const o=this.formatItems(this.getItems(l));l.detail.content?s=`

        ${l.detail.content}

        `:s=this.getTooltipHTML(o);const a=ft.appendOrSelect(this.tooltip,"div.content-box");if(ye(this.getOptions(),"tooltip","customHTML"))if(l.detail.content){const u=`

        ${l.detail.content}

        `;a.html(u)}else a.html(this.model.getOptions().tooltip.customHTML(r,s));else a.html(s);a.selectAll(".datapoint-tooltip").each(function(u,f){const c=o[f];o[f]&&o[f].color&&rt(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",c.color)}),this.positionTooltip(l),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener($e.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener($e.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener($e.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener($e.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener($e.Tooltip.MOVE,null),this.services.events.removeEventListener($e.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener($e.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener($e.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const n=this.getOptions(),i=ye(n,"tooltip","truncation","type"),l=ye(n,"tooltip","truncation","threshold"),r=ye(n,"tooltip","truncation","numCharacter");return i!==Zl.NONE?e.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>l&&(s.label=Uu(s.label,i,r)),s.value&&s.value.length>l&&(s.value=Uu(s.value,i,r)),s}):e}getTooltipHTML(e){return'
          '+e.map(n=>`
        • + `}render(e=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=rt(this.services.domUtils.getHolder()),l=ye(n,"style","prefix");this.modal=ft.appendOrSelect(i,`div.${Qi}--${l}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class zO extends $n{constructor(){super(...arguments),this.type="title",this.renderType=vn.HTML}render(e=!1){const n=this.getComponentContainer(),i=ye(this.getOptions(),"title"),l=n.selectAll("p.title").data([i]);if(l.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(l).html(r=>r),l.node()&&l.node().offsetWidthn){e.append("tspan").text("...");const l=ft.appendOrSelect(e,"tspan").node().getComputedTextLength(),r=e.text(),s=this.getSubstringIndex(e.node(),0,r.length-1,n-l);e.html(r.substring(0,s-1)).append("tspan").text("...");const o=this;e.on("mouseover",function(a){o.services.events.dispatchEvent($e.Tooltip.SHOW,{event:a,hoveredElement:e,content:i})}).on("mousemove",function(a){o.services.events.dispatchEvent($e.Tooltip.MOVE,{event:a})}).on("mouseout",function(){o.services.events.dispatchEvent($e.Tooltip.HIDE)})}}getMaxTitleWidth(){return ft.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,n,i,l){const r=Math.floor((i+n)/2);return e.getSubStringLength(0,r)>l?this.getSubstringIndex(e,n,r,l):e.getSubStringLength(0,r)l?r:this.getSubstringIndex(e,r,i,l):r}}class HO extends $n{constructor(){super(...arguments),this.type="legend",this.renderType=vn.HTML}render(e=!1){const n=this.getOptions(),i=ye(n,"legend"),l=ye(i,"alignment"),r=ye(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Ti.items.status,a=s.some(T=>T.status===o),u=ye(i,"order"),f=this.getComponentContainer().classed("center-aligned",l===Il.CENTER).classed("right-aligned",l===Il.RIGHT).classed(r,!0).classed("has-deactivated-items",a).attr("role",oi.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");u&&(s=this.sortDataGroups(s,u));const c=f.selectAll("div.legend-item").data(s,T=>T.name),d=c.enter().append("div").attr("class","legend-item");d.merge(f.selectAll("div.legend-item")).classed("active",function(T){return T.status===Ti.items.status.ACTIVE});const h=ye(this.getOptions(),"legend","clickable");f.classed("clickable",h&&s.length>1);const g=Ti.checkbox.radius,_=d.append("div").classed("checkbox",!0),k=_.merge(c.select("div.checkbox")).attr("role",oi.CHECKBOX).attr("tabindex",h?0:-1).attr("aria-labelledby",(T,M)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${M}-title`)).attr("aria-checked",({status:T})=>T===Ti.items.status.ACTIVE).attr("width",g*2).attr("height",g*2).attr("class",T=>this.model.getColorClassName({classNameTypes:[Oi.BACKGROUND],dataGroupName:T.name,originalClassName:"checkbox"})).style("background",T=>T.status===Ti.items.status.ACTIVE?this.model.getFillColor(T.name)||this.model.getStrokeColor(T.name):null).classed("active",function(T){return T.status===Ti.items.status.ACTIVE});_.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(c.select("p"));const y=ye(n,"legend","additionalItems");if(y&&s.length){const T=this,M=f.selectAll("div.additional-item").data(y);M.exit().remove();const A=M.enter().append("div").merge(M).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(R,N)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${k.size()+N}-title`));A.selectAll("*").remove();let C,D=1;A.append("svg").classed("icon",!0).each(function(R){const N=rt(this);!C||C!=R.type?(C=R.type,D=1):D++,T.addAdditionalItem(N,R,D)}),A.append("p").merge(A.select("p")),this.truncateLegendText()}c.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),h&&d.size()>1&&this.addEventListeners()}sortDataGroups(e,n){if(e.sort((i,l)=>n.indexOf(i.name)-n.indexOf(l.name)),n.lengthu.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a)}else if(n.type===_i.LINE){const s=Ti.line;e.select("line.line").empty()&&e.append("line").classed(`line-${i}`,!0).attr("role",oi.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",l).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===_i.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${i}`,!0).attr("role",oi.IMG).attr("aria-label","area").attr("width",l).attr("height",r).style("fill",i>3&&!n.fill?Ti.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===_i.SIZE){const{iconData:s,fill:o,stroke:a}=Ti.size;e.attr("fill","none").attr("role",oi.IMG).attr("aria-label","size").selectAll("rect").data(s).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a).style("stroke-width",1)}else if(n.type===_i.QUARTILE){const{iconData:s}=Ti.quartile;e.selectAll("rect").attr("role",oi.IMG).attr("aria-label","quartile").data(s).enter().append("rect").attr("class",(o,a)=>`quartile-${a===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===_i.ZOOM){const{iconData:s,color:o}=ye(Ti,"zoom"),a=e.attr("role",oi.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).enter();a.append("g").attr("x",u=>u.x).attr("y",u=>u.y).attr("width",u=>u.width).attr("height",u=>u.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),a.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const e=this.getComponentContainer(),n=ye(this.getOptions(),"legend","truncation"),i=ye(n,"type"),l=ye(n,"threshold"),r=ye(n,"numCharacter"),s=e.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==Zl.NONE?s.html(function(o){return o.name.length>l?Uu(o.name,i,r):o.name}):s.html(o=>o.name)}addEventListeners(){const e=this,n=this.getComponentContainer(),i=this.getOptions(),l=ye(i,"legend"),r=ye(l,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){e.services.events.dispatchEvent($e.Legend.ITEM_HOVER,{hoveredElement:rt(this)});const o=rt(this);o.select("div.checkbox").classed("hovered",!0);const a=o.datum();a.name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})}).on("mousemove",function(s){rt(this).datum().name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:s})}).on("click",function(){e.services.events.dispatchEvent($e.Legend.ITEM_CLICK,{clickedElement:rt(this)});const s=rt(this).datum();e.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=rt(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>r.threshold&&r.type!==Zl.NONE&&e.services.events.dispatchEvent($e.Tooltip.HIDE),e.services.events.dispatchEvent($e.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&e.services.events.dispatchEvent($e.Legend.ITEM_HOVER,{hoveredElement:rt(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),e.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&e.services.events.dispatchEvent($e.Legend.ITEM_MOUSEOUT,{hoveredElement:rt(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=rt(this),a=o.datum();a.name.length>r.threshold&&e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})})}}class UO extends $n{constructor(e,n,i){super(e,n,i),this.type="chart-clip",this.renderType=vn.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),l=n.getMainYScale(),[r,s]=i.range(),[o,a]=l.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=ft.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const u=ft.appendOrSelect(this.chartClipPath,`rect.${this.type}`);s-r>0&&u.attr("x",r).attr("y",a).attr("width",s-r).attr("height",o-a),this.chartClipPath.merge(u).lower()}}class Zme extends UO{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:n,height:i}=ft.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=ft.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=ft.appendOrSelect(this.chartClipPath,`rect.${this.type}`);l.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(l).lower()}}var Wo,Si;(function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"})(Si||(Si={}));var N6=(Wo={},Wo[Si.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},Wo[Si.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},Wo[Si.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Wo[Si.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},Wo),B6=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},rh=function(){function t(e){e===void 0&&(e={}),this.positions=N6,this.positions=Object.assign({},N6,e)}return t.prototype.getRelativeOffset=function(e){for(var n={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent;return n},t.prototype.getAbsoluteOffset=function(e){for(var n=e,i={top:0,left:0};n.offsetParent;){var l=getComputedStyle(n.offsetParent);l.position==="static"&&l.marginLeft&&l.marginTop&&(parseInt(l.marginTop,10)&&(i.top+=parseInt(l.marginTop,10)),parseInt(l.marginLeft,10)&&(i.left+=parseInt(l.marginLeft,10))),n=n.offsetParent}var r=e.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:r.top-s.top+i.top,left:r.left-s.left+i.left}},t.prototype.findRelative=function(e,n,i){var l=this.getRelativeOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findAbsolute=function(e,n,i){var l=this.getAbsoluteOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findPosition=function(e,n,i,l){l===void 0&&(l=this.getAbsoluteOffset.bind(this));var r=l(e),s=e.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},t.prototype.findPositionAt=function(e,n,i){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},n,i)},t.prototype.getPlacementBox=function(e,n){var i=e.offsetHeight+n.top,l=e.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:l}},t.prototype.addOffset=function(e,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},e,{top:e.top+n,left:e.left+i})},t.prototype.setElement=function(e,n){e.style.top=n.top+"px",e.style.left=n.left+"px"},t.prototype.findBestPlacement=function(e,n,i,l,r){var s=this;l===void 0&&(l=this.defaultContainerFunction.bind(this)),r===void 0&&(r=this.findPosition.bind(this));var o=i.map(function(a){var u=r(e,n,a),f=s.getPlacementBox(n,u),c=0,d=0,h=l();f.toph.height&&(c=f.bottom-h.height),f.lefth.width&&(d=f.right-h.width),c&&!d?d=1:d&&!c&&(c=1);var g=n.offsetHeight*n.offsetWidth,_=c*d,k=g-_,y=k/g;return{placement:a,weight:y}});return o.sort(function(a,u){return u.weight-a.weight}),o[0].placement},t.prototype.findBestPlacementAt=function(e,n,i,l){var r=this;l===void 0&&(l=this.defaultContainerFunction.bind(this));var s=function(o,a,u){return r.findPositionAt(e,a,u)};return this.findBestPlacement(null,n,i,l,s)},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:B6.innerHeight,width:B6.innerWidth}},t.prototype.calculatePosition=function(e,n,i,l){return this.positions[l]?this.positions[l](e,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new rh;class FO extends $n{constructor(e,n,i){super(e,n,i),this.type="tooltip",this.renderType=vn.HTML,this.isEventListenerAdded=!1,this.positionService=new rh,this.handleShowTooltip=l=>{const r=l.detail.data||l.detail.items;let s;const o=this.formatItems(this.getItems(l));l.detail.content?s=`

          ${l.detail.content}

          `:s=this.getTooltipHTML(o);const a=ft.appendOrSelect(this.tooltip,"div.content-box");if(ye(this.getOptions(),"tooltip","customHTML"))if(l.detail.content){const u=`

          ${l.detail.content}

          `;a.html(u)}else a.html(this.model.getOptions().tooltip.customHTML(r,s));else a.html(s);a.selectAll(".datapoint-tooltip").each(function(u,f){const c=o[f];o[f]&&o[f].color&&rt(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",c.color)}),this.positionTooltip(l),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener($e.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener($e.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener($e.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener($e.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener($e.Tooltip.MOVE,null),this.services.events.removeEventListener($e.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener($e.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener($e.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const n=this.getOptions(),i=ye(n,"tooltip","truncation","type"),l=ye(n,"tooltip","truncation","threshold"),r=ye(n,"tooltip","truncation","numCharacter");return i!==Zl.NONE?e.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>l&&(s.label=Uu(s.label,i,r)),s.value&&s.value.length>l&&(s.value=Uu(s.value,i,r)),s}):e}getTooltipHTML(e){return'
            '+e.map(n=>`
          • ${n.class||n.color?`
            `:""}
            @@ -163,36 +163,36 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
            ${n.value===void 0||n.value===null?"":`

            ${n.value}

            `}
            -
          • `).join("")+"
          "}valueFormatter(e,n){const i=this.getOptions(),l=ye(i,"tooltip","valueFormatter");if(l)return l(e,n);if(typeof e.getTime=="function")return _a(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return _a(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const n=this.getOptions(),i=ye(n,"tooltip","enabled");if(i){const l=rt(this.services.domUtils.getHolder()),r=ye(n,"style","prefix");this.tooltip=ft.appendOrSelect(l,`div.${Qi}--${r}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),l=this.getOptions(),r=ye(l,"zoomBar","top","enabled");let s=ye(e,"detail","mousePosition");if(!s)s=so(ye(e,"detail","event"),n);else{const d=ye(l,"zoomBar","top","type"),h=cl.height[d];r&&(s[1]+=h+cl.spacerHeight)}const o=n.offsetWidth,a=n.offsetHeight;let u;s[0]/o>.9?u=Si.LEFT:s[0]/o<.1?u=Si.RIGHT:u=this.positionService.findBestPlacementAt({left:s[0],top:s[1]},i,[Si.RIGHT,Si.LEFT,Si.TOP,Si.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:a}));let{horizontalOffset:f}=Pde;u===Si.LEFT&&(f*=-1);const c=this.positionService.findPositionAt({left:s[0]+f,top:s[1]},i,u);this.positionService.setElement(i,c)}}const GO=class Ec extends $n{constructor(){super(...arguments),this.type="grid-brush",this.renderType=vn.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const l=ft.appendOrSelect(n,"svg.chart-grid-backdrop"),r=ft.appendOrSelect(l,`g.${this.type}`),s=ft.appendOrSelect(r,this.selectionSelector),{width:o,height:a}=ft.getSVGElementSize(l,{useAttrs:!0}),{cartesianScales:u}=this.services,f=u.getMainXScaleType(),c=u.getMainXScale(),[d]=c.range();i.attr("transform",`translate(${d},0)`);const h=ft.appendOrSelect(i,this.frontSelectionSelector);if(c&&f===St.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const _=C=>{const D=C[1]-C[0];let R="0,"+D.toString();const N=Math.floor(a/Ec.DASH_LENGTH),G=N*Ec.DASH_LENGTH;for(let B=0;B{const D=C.selection;D===null||D[0]===D[1]||(h.attr("x",parseFloat(s.attr("x"))+parseFloat(l.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),_(D))},y=(C,D)=>{const R=uE().range([0,o]).domain(g);let N=[R.invert(C),R.invert(D)];N[0].valueOf()===N[1].valueOf()&&(N=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==N[0].valueOf()||g[1].valueOf()!==N[1].valueOf())&&this.services.zoom.handleDomainChange(N)};let T;const M=C=>{const D=C.selection;D!==null&&(y(D[0],D[1]),r.call(T.move,null),h.style("display","none"))};a!=0&&o!=0&&(T=ZS().extent([[0,0],[o-1,a]]).on("start brush end",k).on("end.brushed",M),r.call(T));const A=this.services.zoom.getZoomRatio();l.on("click",function(C){if(C.shiftKey){const D=this.services.domUtils.getHolder(),R=so(r.node(),D)[0];let N=R-o*A/2;N<0&&(N=0);let G=R+o*A/2;G>o&&(G=o),y(N,G)}})}}};GO.DASH_LENGTH=4;let Jme=GO;class Qme extends $n{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=vn.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ZS(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener($e.ZoomBar.UPDATE,this.render.bind(this));const e=ye(this.getOptions(),"zoomBar",Qe.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(Qe.TOP),l=this.services.zoom.isZoomBarLocked(Qe.TOP),r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=ye(this.getOptions(),"axes",Qe.BOTTOM,"highlights"),o=cl.height[r],{width:a}=ft.getSVGElementSize(this.parent,{useAttrs:!0});if(a===0)return;let u=0;const f=this.model.get("axesMargins");f&&f.left&&(u=f.left);const c=ft.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(ft.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",cl.spacerHeight).attr("opacity",1).attr("fill","none"),r===or.GRAPH_VIEW?ft.appendOrSelect(c,"rect.zoom-bg").attr("x",u).attr("y",0).attr("width",a-u).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===or.SLIDER_VIEW&&ft.appendOrSelect(c,"rect.zoom-slider-bg").attr("x",u).attr("y",o/2-1).attr("width",a-u).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(c,u,a);return}const{cartesianScales:d}=this.services,h=d.getMainXScale(),g=d.getMainYScale(),_=d.getMainXScaleType();if(h&&_===St.TIME){let k=this.services.zoom.getZoomBarData();if(Tde(k)||k.length===1)return;this.xScale=h.copy(),this.yScale=g.copy();const y=this.services.zoom.getDefaultZoomBarDomain(k);k=this.compensateDataForDefaultDomain(k,y);const T=this.model.get("initialZoomDomain"),M=ye(this.getOptions(),"zoomBar",Qe.TOP,"initialZoomDomain");M&&M[0]&&M[1]&&(M[0]=new Date(M[0]),M[1]=new Date(M[1])),M&&!(T&&T[0].valueOf()===M[0].valueOf()&&T[1].valueOf()===M[1].valueOf())?this.model.set({initialZoomDomain:jt([],M),zoomDomain:M?jt([],M):y},{skipUpdate:!0}):M===null&&T!==null&&this.model.set({initialZoomDomain:null,zoomDomain:jt([],y)},{skipUpdate:!0}),this.xScale.range([u,a]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(xo(k,D=>D.value));const A=this.model.get("zoomDomain");if(r===or.GRAPH_VIEW&&(this.renderZoomBarArea(c,"path.zoom-graph-area-unselected",k,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(c,"path.zoom-graph-area",k,this.clipId),this.renderZoomBarBaseline(c,u,a),s)){const D=s.highlightStartMapsTo,R=s.highlightEndMapsTo,N=s.color,G=s.labelMapsTo;s.data.forEach((B,$)=>{ft.appendOrSelect(c,`rect.highlight-${$}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(B[D])).attr("width",this.xScale(B[R])-this.xScale(B[D])).style("fill",N&&N.scale[B[G]]?N.scale[B[G]]:null).style("fill-opacity",.1).style("stroke",N&&N.scale[B[G]]?N.scale[B[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(A,u,a);const C=ft.appendOrSelect(n,this.brushSelector).call(this.brush);if(A!==void 0)if(A[0].valueOf()===A[1].valueOf())C.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const D=A.map(R=>this.xScale(R));D[1]-D[0]!1),C.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,n,i){const l=o=>{const a=o.selection;a===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):a[0]===a[1]||this.handleBrushedEvent(o,e,this.xScale,a)},r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r];this.brush.extent([[n,0],[i,s]]).on("start brush end",null).on("start brush end",l)}handleBrushedEvent(e,n,i,l){const r=[i.invert(l[0]),i.invert(l[1])];if(this.updateBrushHandle(this.getComponentContainer(),l),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(n===void 0||n[0]!==r[0]||n[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1});let s;e.type==="start"?s=$e.ZoomBar.SELECTION_START:e.type==="brush"?s=$e.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(s=$e.ZoomBar.SELECTION_END,this.services.events.dispatchEvent($e.ZoomDomain.CHANGE,{newDomain:r})),this.services.events.dispatchEvent(s,{selection:l,newDomain:r})}}updateBrushHandle(e,n){const i=this,l=cl.handleWidth,r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r],o=-l/2,a=cl.handleBarWidth,u=r===or.GRAPH_VIEW?cl.handleBarHeight:6,f=-a/2,c=(s-u)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(h){if(h.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(h.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-l)}).attr("y",0).attr("width",l).attr("height",s).attr("cursor","ew-resize").style("display",null);const d=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(h){return"handle-bar handle-bar--"+h.type}),d.attr("x",function(h){if(h.type==="w")return Math.max(n[0]+f,i.maxSelectionRange[0]-o+f);if(h.type==="e")return Math.min(n[1]+f,i.maxSelectionRange[1]+o+f)}).attr("y",c).attr("width",a).attr("height",u).attr("cursor","ew-resize"),r===or.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(e,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(e){const n=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),i=cl.height[n],l=this.getComponentContainer().select("svg.zoom-container");ft.appendOrSelect(l,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",i/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,n,i,l){const{cartesianScales:r}=this.services,s=r.getMainXAxisPosition(),o=r.getMainYAxisPosition(),a=r.getMainXScaleType(),u=r.getMainYScaleType(),f=(y,T,M)=>A=>r.getValueFromScale(y,T,M,A),c=f(this.xScale,a,s),d=f(this.yScale,u,o),h=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),g=cl.height[h],_=$g().x(y=>c(y)).y0(g).y1(y=>g-d(y)),k=ft.appendOrSelect(e,n).datum(i).attr("d",_);l&&k.attr("clip-path",`url(#${l})`)}updateClipPath(e,n,i,l,r,s){const o=ft.appendOrSelect(e,"clipPath").attr("id",n);ft.appendOrSelect(o,"rect").attr("x",i).attr("y",l).attr("width",r).attr("height",s)}compensateDataForDefaultDomain(e,n){if(!e||e.length<2)return;const i=lf(e),l=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])Number(i[i.length-1][l])){const s={};s[l]=n[1],s[r]=0,i.push(s)}return i}renderZoomBarBaseline(e,n,i,l=!1){const r=ye(this.model.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r],o=jg()([[n,s],[i,s]]);ft.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",l).style("stroke",l?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,n,i){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),ft.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),ye(this.getOptions(),"zoomBar",Qe.TOP,"type")===or.GRAPH_VIEW&&this.renderZoomBarBaseline(e,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener($e.ZoomBar.UPDATE,this.render.bind(this))}}class xme extends $n{constructor(e,n){super(e,n),this.type="threshold",this.renderType=vn.SVG,this.positionService=new rh}render(e=!1){const n=ye(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(Qe).includes(u)){const f=n[u];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:u,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-thresholds ${u.axisPosition}`);const s=r.selectAll("g.threshold-group").data(u=>u.thresholds.map(f=>(f.axisPosition=u.axisPosition,f.datum=this.constructDatumObj(u,f),f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getScaleByPosition(u),c=a.services.cartesianScales.getScaleTypeByPosition(u);let d=null,h=null;u===Qe.LEFT||u===Qe.RIGHT?(h=f,d=a.services.cartesianScales.getMainXScale()):(d=f,h=a.services.cartesianScales.getMainYScale());const g=c===St.LABELS,[_,k]=d.range(),[y,T]=h.range(),{cartesianScales:M}=a.services,A=M.getOrientation(),C=B=>M.getDomainValue(B),D=B=>M.getRangeValue(B),[R,N]=na(C,D,A),G=rt(this);u===Qe.TOP||u===Qe.BOTTOM?(G.selectAll("line.threshold-line").transition().call(B=>a.services.transitions.setupTransition({transition:B,name:"threshold-line-update",animate:e})).attr("y1",T).attr("y2",y).attr("x1",({datum:B})=>R(B)+(g?f.step()/2:0)).attr("x2",({datum:B})=>R(B)+(g?f.step()/2:0)).style("stroke",({fillColor:B})=>B),G.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:B})=>-R(B)).attr("width",Math.abs(y-T)).classed("rotate",!0)):(G.selectAll("line.threshold-line").transition().call(B=>a.services.transitions.setupTransition({transition:B,name:"threshold-line-update",animate:e})).attr("x1",_).attr("x2",k).attr("y1",({datum:B})=>N(B)+(g?f.step()/2:0)).attr("y2",({datum:B})=>N(B)+(g?f.step()/2:0)).style("stroke",({fillColor:B})=>B),G.selectAll("rect.threshold-hoverable-area").attr("x",_).attr("y",({datum:B})=>N(B)).attr("width",Math.abs(k-_)).classed("rotate",!1))}),this.services.events.addEventListener($e.Threshold.SHOW,u=>{this.setThresholdLabelPosition(u.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener($e.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:n,axisPosition:i}=e,l=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===St.TIME){const r=[Qe.LEFT,Qe.RIGHT].includes(i),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),a=r?o:s,u=ye(l,"timeScale"),f=Fm(a.ticks(),ye(u,"timeInterval"));return Um(n,0,a.ticks(),f,u)}return n.toLocaleString("en")}appendThresholdLabel(){const e=rt(this.services.domUtils.getHolder()),n=ye(this.getOptions(),"style","prefix");this.label=ft.appendOrSelect(e,`div.${Qi}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:n}){const i=this.services.domUtils.getHolder(),l=so(e,i),r=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${r}`).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:l[0],top:l[1]},s,[Si.RIGHT,Si.LEFT,Si.TOP,Si.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),a=this.positionService.findPositionAt({left:l[0],top:l[1]},s,o);this.positionService.setElement(s,a)}constructDatumObj(e,n){const i={};return e.correspondingDatasets&&(i.group=ye(e,"correspondingDatasets",0)),i[e.mapsTo]=n.value,i}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){rt(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent($e.Threshold.SHOW,{event:n,hoveredElement:rt(this),datum:rt(this).datum()})}).on("mouseout",function(n){rt(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent($e.Threshold.HIDE,{event:n,hoveredElement:rt(this),datum:rt(this).datum()})})}}class ege extends $n{constructor(e,n){super(e,n),this.type="highlight",this.renderType=vn.SVG,this.positionService=new rh,this.highlightStrokeWidth=1}render(e=!1){const n=ye(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(Qe).includes(u)){const f=n[u];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:u,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-highlight ${u.axisPosition}`);const s=r.selectAll("g.highlight-group").data(u=>u.highlight.map(f=>(f.axisPosition=u.axisPosition,f.highlightStartMapsTo=u.highlightStartMapsTo,f.labelMapsTo=u.labelMapsTo,f.color=u.color,f.highlightEndMapsTo=u.highlightEndMapsTo,f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getMainXScale(),c=a.services.cartesianScales.getMainYScale(),[d,h]=f.range(),[g,_]=c.range(),{cartesianScales:k}=a.services,y=k.getOrientation(),T=R=>k.getDomainValue(R),M=R=>k.getRangeValue(R),[A,C]=na(T,M,y),D=rt(this);u===Qe.TOP||u===Qe.BOTTOM?D.selectAll("rect.highlight-bar").transition().call(R=>a.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:e})).attr("y",Math.max(_+a.highlightStrokeWidth,0)).attr("height",Math.max(g-2*a.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:R,...N})=>A(N[R])).attr("width",({highlightStartMapsTo:R,highlightEndMapsTo:N,...G})=>Math.max(A(G[N])-A(G[R]),0)).style("stroke",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null):D.selectAll("rect.highlight-bar").transition().call(R=>a.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:e})).attr("x",d).attr("width",Math.max(h-d,0)).attr("y",({highlightEndMapsTo:R,...N})=>C(N[R])).attr("height",({highlightStartMapsTo:R,highlightEndMapsTo:N,...G})=>Math.max(C(G[R])-C(G[N]),0)).style("stroke",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null)})}}class tge extends FO{getItems(e){if(e.detail.items)return e.detail.items;const{data:n}=e.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:l}=this.services,r=l.getDomainIdentifier(),s=l.isDualAxes(),{groupMapsTo:o}=i.data,a=l.getDomainLabel();let u=l.getRangeLabel();const f=n[0][r];let c;if(n.length===1){const d=n[0],h=l.getRangeIdentifier(d);if(s){const _=l.getRangeAxisPosition({datum:d,groups:[d[o]]});u=l.getScaleLabel(_)}const g=d[h];c=[{label:a,value:f},...Array.isArray(g)&&g.length===2?[{label:"Start",value:g[0]},{label:"End",value:g[1]}]:[{label:u,value:d[h]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(_=>c.push({label:_.label,value:_.value})),c.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Oi.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(c=[{label:a,value:f}],c=c.concat(n.map(d=>{const h=d[l.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(h)&&h.length===2?`${h[0]} - ${h[1]}`:h,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Oi.TOOLTIP],dataGroupName:d[o]})}}).sort((d,h)=>h.value-d.value)),!s&&ye(i,"tooltip","showTotal")===!0)){const d=l.getRangeIdentifier();c.push({label:i_(i,"tooltip.totalLabel")||"Total",value:n.reduce((h,g)=>h+g[d],0),bold:!0})}return c}}class nge extends $n{constructor(){super(...arguments),this.type="grid",this.renderType=vn.SVG}render(e=!0){const n=ye(this.getOptions(),"grid","x","enabled"),i=ye(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(ft.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),i&&(ft.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const n=this.parent,i=this.backdrop.attr("height"),l=this.services.cartesianScales.getMainXScale(),r=kS(l).tickSizeInner(-i).tickSizeOuter(0);if(ye(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),a=ye(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=ye(this.getOptions(),"grid","x","numberOfTicks");r.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}drawYGrid(e){const n=this.parent,i=this.backdrop.attr("width"),l=this.services.cartesianScales.getMainYScale(),r=wS(l).tickSizeInner(-i).tickSizeOuter(0);if(ye(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),a=ye(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=ye(this.getOptions(),"grid","y","numberOfTicks");r.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}getGridlineThreshold(e){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((f,c)=>Number(Nr(f).tx)-Number(Nr(c).tx));let l=-1;if(!i.length)return;i.forEach(f=>{e[0]>=+Nr(f).tx&&l++});const r=l+1{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Br.opacity.unselected:Br.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Br.opacity.selected)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let l=[0,0];const{cartesianScales:r}=this.services,s=r.getOrientation(),o=$g().curve(this.services.curves.getD3Curve()).defined(C=>{const D=r.getRangeIdentifier();return C[D]!=null}),a=this.model.getGroupedData(this.configs.groups),u=ye(i,"bounds"),f=u&&a&&a.length===1;!f&&u&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${a.length}`);let c=0;const d=(C,D)=>{ye(i,"axes",C,"includeZero")===!1&&D[0]>0&&D[1]>0&&(c=D[0])},h=C=>f?r.getBoundedScaledValues(C)[0]:r.getRangeValue(c),g=C=>f?r.getBoundedScaledValues(C)[1]:r.getRangeValue(C);s===tl.VERTICAL?(l=r.getMainYScale().domain(),d(r.getMainYAxisPosition(),l),o.x(C=>r.getDomainValue(C)).y0(C=>h(C)).y1(C=>g(C))):(l=r.getMainXScale().domain(),d(r.getMainXAxisPosition(),l),o.x0(C=>h(C)).x1(C=>g(C)).y(C=>r.getDomainValue(C)));const _=ye(i,"color","gradient","enabled"),k=a&&a.length===1&&_;a.length>1&&_&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(a,C=>C.name),T=rt(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!a.length)return;if(k){const C=T.select(`path.${this.model.getColorClassName({classNameTypes:[Oi.STROKE],dataGroupName:a[0].name})}`).node();let D;if(C)D=getComputedStyle(C,null).getPropertyValue("stroke");else{const R=ye(this.model.getOptions(),"color","scale");if(R!==null){const N=Object.keys(R);D=R[N[0]]}}Fu.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${a[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Fu.getStops(l,D)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const M=this,A=y.enter().append("path");k?A.merge(y).style("fill",C=>`url(#${this.services.domUtils.generateElementIDString(`${C.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:C.name,originalClassName:"area"})).attr("d",C=>{const{data:D}=C;return o(D)}):(A.attr("opacity",0).merge(y).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[Oi.FILL,Oi.STROKE],dataGroupName:C.name,originalClassName:"area"})).style("fill",C=>M.model.getFillColor(C.name)).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"area-update-enter",animate:e})).attr("opacity",f?1:Br.opacity.selected).attr("d",C=>{const{data:D}=C;return o(D)}),f&&A.attr("fill-opacity",Br.opacity.selected).style("stroke",C=>M.model.getStrokeColor(C.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Oc extends $n{constructor(){super(...arguments),this.type="line",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?j1.opacity.unselected:j1.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",j1.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:l}=this.services,r=h=>i.getDomainValue(h),s=h=>i.getRangeValue(h),[o,a]=na(r,s,i.getOrientation()),u=this.getOptions(),f=jg().x(o).y(a).curve(l.getD3Curve()).defined(h=>{const g=i.getRangeIdentifier(h);return h[g]!=null});let c=[];if(this.configs.stacked){const h=Object.keys(u.axes).some(_=>u.axes[_].percentage),{groupMapsTo:g}=u.data;c=this.model.getStackedData({groups:this.configs.groups,percentage:h}).map(_=>{const k=this.services.cartesianScales.getDomainIdentifier(_),y=this.services.cartesianScales.getRangeIdentifier(_);return{name:ye(_,0,g),data:_.map(T=>({[k]:T.data.sharedStackKey,[g]:T[g],[y]:T[1]})),hidden:!H1e(_,T=>T[0]!==T[1])}})}else c=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(c,h=>h.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(c,h=>h.name).attr("class",h=>this.model.getColorClassName({classNameTypes:[Oi.STROKE],dataGroupName:h.name,originalClassName:"line"})).style("stroke",h=>this.model.getStrokeColor(h.name)).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",h=>{const{data:g}=h;return g.map(_=>{const k=this.services.cartesianScales.getRangeIdentifier(_);return _[k]}).join(",")}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"line-update-enter",animate:e})).attr("opacity",h=>h.hidden?0:1).attr("d",h=>{const{data:g}=h;return f(g)})}destroy(){const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const z6=5;function ige(t,e){return t>e-z6&&t({domainValue:this.services.cartesianScales.getDomainValue(k),originalData:k})).filter(k=>ige(k.domainValue,f));if(this.pointsWithinLine&&g.length===this.pointsWithinLine.length&&g.map(k=>k.domainValue).join()===this.pointsWithinLine.map(k=>k.domainValue).join())return this.pointsWithinLine=g,this.services.events.dispatchEvent($e.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=g;const _=this.pointsWithinLine.reduce((k,y)=>{if(k.length===0)return k.push(y),k;const T=k[0].domainValue,M=Math.abs(f-y.domainValue),A=Math.abs(f-T);return M>A||(M0){const k=_.map(A=>A.originalData).filter(A=>{const C=this.services.cartesianScales.getRangeIdentifier(A);return A[C]!=null}),y=_.map(A=>A.domainValue),T=h.filter(A=>{const C=this.services.cartesianScales.getDomainValue(A);return y.includes(C)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!B1e(this.elementsToHighlight,T)&&this.hideRuler(),T.dispatch("mouseover"),this.elementsToHighlight=T,this.services.events.dispatchEvent($e.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(k)}),c.attr("opacity",1);const M=_[0];r==="horizontal"?d.attr("x1",u).attr("x2",a).attr("y1",M.domainValue).attr("y2",M.domainValue):d.attr("y1",u).attr("y2",a).attr("x1",M.domainValue).attr("x2",M.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,n=ft.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent($e.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let l=function(r){const s=so(r,e.parent.node());e.showRuler(r,s)};if(i.length>100){const r=i.length%50*12.5;l=ahe(function(s){const{mousePosition:o}=this;e.showRuler(s,o)},r,n)}this.backdrop.on("mousemove mouseover",l).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=ft.appendOrSelect(e,"svg.chart-grid-backdrop")}}class Tu extends $n{constructor(){super(...arguments),this.type="scatter",this.renderType=vn.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(l=>{var r;return(r=this.services.transitions)==null?void 0:r.setupTransition({transition:l,name:"legend-hover-scatter"})}).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(e.addEventListener($e.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener($e.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(e),l=this.model.get("zoomDomain");return l!==void 0?e.filter(r=>r[i].getTime()>=l[0].getTime()&&r[i].getTime()<=l[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const l=Object.keys(e.axes).some(r=>e.axes[r].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:l})}else{const{cartesianScales:l}=this.services;if(!l)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(r=>{const s=l.getRangeIdentifier(r);return r[s]!==void 0&&r[s]!==null})}return this.filterBasedOnZoomDomain(i)}render(e){if(!(ye(this.getOptions(),"points","enabled")||ye(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");const s=r.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[l]}-${u[s]}`);o.exit().attr("opacity",0).remove();const a=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(a,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const l=i.getOrientation(),[r,s]=na(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),l),[o,a]=na(c=>i.getDomainValue(c),c=>i.getRangeValue(c),l),u=o(e),f=a(e);return s&&r?f<=s.scaleValue&&u>=r.scaleValue:s?f<=s.scaleValue:r?u>=r.scaleValue:!1}styleCircles(e,n){const i=this.getOptions(),{filled:l,fillOpacity:r}=i.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,a=h=>s.getDomainValue(h),u=h=>s.getRangeValue(h),[f,c]=na(a,u,s.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;e.raise().classed("dot",!0).attr("class",h=>{const g=s.getDomainIdentifier(h),_=this.model.getIsFilled(h[o],h[g],h,l)?[Oi.FILL,Oi.STROKE]:[Oi.STROKE];return this.model.getColorClassName({classNameTypes:_,dataGroupName:h[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",h=>this.isDatapointThresholdAnomaly(h)).classed("filled",h=>{const g=s.getDomainIdentifier(h);return this.model.getIsFilled(h[o],h[g],h,l)}).classed("unfilled",h=>{const g=s.getDomainIdentifier(h);return!this.model.getIsFilled(h[o],h[g],h,l)}).transition().call(h=>{var g;return(g=this.services.transitions)==null?void 0:g.setupTransition({transition:h,name:"scatter-update-enter",animate:n})}).attr("cx",f).attr("cy",c).attr("r",i.points.radius).style("fill",h=>{const g=s.getDomainIdentifier(h);if(this.model.getIsFilled(h[o],h[g],h,l))return this.model.getFillColor(h[o],h[g],h)}).style("stroke",h=>{const g=s.getDomainIdentifier(h);return this.model.getStrokeColor(h[o],h[g],h)}).attr("fill-opacity",l?r:1).attr("opacity",d?0:1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",h=>{const g=s.getRangeIdentifier(h);return h[g]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:n}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,l){var r,s;const o=rt(this);o.classed("hovered",!0).attr("class",a=>e.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:a[n],originalClassName:o.attr("class")})).style("fill",a=>{var u;const f=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(a);return e.model.getFillColor(a[n],a[f],a)}).classed("unfilled",!1),(r=e.services.events)==null||r.dispatchEvent($e.Tooltip.SHOW,{event:i,hoveredElement:o,data:[l],additionalItems:e.getTooltipAdditionalItems(l)}),(s=e.services.events)==null||s.dispatchEvent($e.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:l})}).on("mousemove",function(i,l){var r,s;const o=rt(this);(r=e.services.events)==null||r.dispatchEvent($e.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:l}),(s=e.services.events)==null||s.dispatchEvent($e.Tooltip.MOVE,{event:i})}).on("click",function(i,l){var r;(r=e.services.events)==null||r.dispatchEvent($e.Scatter.SCATTER_CLICK,{event:i,element:rt(this),datum:l})}).on("mouseout",function(i,l){var r,s,o;const a=rt(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:u}=e.getOptions().points,f=(r=e.services.cartesianScales)==null?void 0:r.getDomainIdentifier(l),c=e.model.getIsFilled(l[n],l[f],l,u);a.classed("unfilled",!c).style("fill",d=>c||u?e.model.getFillColor(d[n],d[f],d):null)}(s=e.services.events)==null||s.dispatchEvent($e.Scatter.SCATTER_MOUSEOUT,{event:i,element:a,datum:l}),(o=e.services.events)==null||o.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var e;(e=this.parent)==null||e.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener($e.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener($e.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class jO extends $n{constructor(e,n,i){super(e,n,i),this.type="axes",this.renderType=vn.SVG,this.truncation={[Qe.LEFT]:!1,[Qe.RIGHT]:!1,[Qe.TOP]:!1,[Qe.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(e=!0){const{position:n}=this.configs,i=this.getOptions(),l=ye(i,"axes",n,"visible"),r=this.getComponentContainer(),{width:s,height:o}=ft.getSVGElementSize(r,{useAttrs:!0}),a=ft.appendOrSelect(r,`g.axis.${n}`);let u,f;if(n===Qe.BOTTOM||n===Qe.TOP?(u=this.configs.axes[Qe.LEFT]?this.margins.left:0,f=this.configs.axes[Qe.RIGHT]?s-this.margins.right:s):(u=o-this.margins.bottom,f=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const c=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===St.LABELS||this.scaleType===St.LABELS_RATIO?c.rangeRound([u,f]):c.range([u,f]);let d;switch(n){case Qe.LEFT:d=wS;break;case Qe.BOTTOM:d=kS;break;case Qe.RIGHT:d=Fx;break;case Qe.TOP:d=Ux;break}a.attr("aria-label",`${n} axis`);const h=!a.select("g.ticks").empty();let g=ft.appendOrSelect(a,"g.ticks");h||(g.attr("role",`${oi.GRAPHICS_OBJECT} ${oi.GROUP}`),g.attr("aria-label",`${n} ticks`));const _=ft.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),k=ye(i,"axes",n),y=this.scaleType===St.TIME||k.scaleType===St.TIME,T=n===Qe.LEFT||n===Qe.RIGHT,M=this.model.get("zoomDomain");if(M&&y&&!T&&c.domain(M),!l){g.attr("aria-hidden",!0);return}const A=ye(k,"scaleType"),C=ye(i,"data","loading"),D=ye(k,"ticks","number"),R=ye(k,"ticks","values"),N=ye(k,"truncation","type"),G=ye(k,"truncation","threshold"),B=ye(k,"truncation","numCharacter"),$=D!==null,q=ye(i,"timeScale"),V=ft.appendOrSelect(_,"g.tick"),K=ft.appendOrSelect(V,"text").text("0"),x=ft.getSVGElementSize(K.node(),{useBBox:!0}).height;V.remove();const ie=this.scaleType||k.scaleType||St.LINEAR,X=d(c).tickSizeOuter(0);if(c.ticks){let oe;if($?oe=D:(oe=Ts.ticks.number,T&&(oe=this.getNumberOfFittingTicks(o,x,Ts.ticks.verticalSpaceRatio))),c.ticks().length===1&&c.ticks()[0]===0&&(oe=0),X.ticks(oe),y)if(!c.ticks(oe).length)X.tickValues([]);else{const Re=ye(i,"timeScale","addSpaceOnEdges"),qe=ye(i,"axes",n,"domain"),Ce=c.copy();Re&&!qe&&Ce.nice(oe);const Ze=Ce.ticks(oe);Re&&Ze.length>2&&!qe&&(Ze.splice(Ze.length-1,1),Ze.splice(0,1)),X.tickValues(Ze)}}let ce;const ae=ye(k,"ticks","formatter");if(y){const oe=Fm(X.tickValues(),ye(i,"timeScale","timeInterval"));ae===null?ce=(Re,qe)=>Um(Re,qe,X.tickValues(),oe,q):ce=(Re,qe)=>{const Ce=Um(Re,qe,X.tickValues(),oe,q);return ae(Re,qe,Ce)}}else ae===null?ie===St.LINEAR&&(ce=oe=>oe.toLocaleString()):ce=ae;X.tickFormat(ce);const[ee,he]=this.services.cartesianScales.getScaleByPosition(n).domain();let ne;if(R){if(y)R.forEach((oe,Re)=>{oe.getTime===void 0&&(R[Re]=new Date(oe))}),ne=R.filter(oe=>{const Re=oe.getTime();return Re>=new Date(ee).getTime()&&Re<=new Date(he).getTime()});else if(A===St.LABELS){const oe=this.services.cartesianScales.getScaleByPosition(n).domain();ne=R.filter(Re=>oe.includes(Re))}else ne=R.filter(oe=>oe>=ee&&oe<=he);X.tickValues(ne)}switch(n){case Qe.LEFT:g.attr("transform",`translate(${this.margins.left}, 0)`);break;case Qe.BOTTOM:g.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case Qe.RIGHT:g.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case Qe.TOP:g.attr("transform",`translate(0, ${this.margins.top})`);break}const re=this.model.isDataEmpty();if(k.title){const oe=ft.appendOrSelect(a,"text.axis-title").html(re||C?"":k.title),Re=ye(k,"titleOrientation");let qe;switch(n){case Qe.LEFT:Re===gm.RIGHT?oe.attr("transform","rotate(90)").attr("y",0).attr("x",c.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):oe.attr("transform","rotate(-90)").attr("y",0).attr("x",-(c.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case Qe.BOTTOM:oe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case Qe.RIGHT:Re===gm.LEFT?oe.attr("transform","rotate(-90)").attr("y",s).attr("x",-(c.range()[0]/2)).style("text-anchor","middle"):oe.attr("transform","rotate(90)").attr("y",-s).attr("x",c.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case Qe.TOP:qe=ft.getSVGElementSize(oe,{useBBox:!0}).height,oe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${qe/2})`).style("text-anchor","middle");break}}if(y){const oe=Fm(X.tickValues(),ye(i,"timeScale","timeInterval")),Re=q.showDayName,qe=g;e&&(g=g.transition().call(Ce=>this.services.transitions.setupTransition({transition:Ce,name:"axis-update",animate:e}))),g=g.call(X),qe.selectAll(".tick").data(X.tickValues(),c).order().select("text").style("font-weight",(Ce,Ze)=>pO(Ce,Ze,X.tickValues(),oe,Re)?"bold":"normal")}else!e||!h?g=g.call(X):g=g.transition().call(oe=>this.services.transitions.setupTransition({transition:oe,name:"axis-update",animate:e})).call(X);if(_.call(X),n===Qe.BOTTOM||n===Qe.TOP){let oe=!1;const Re=ye(k,"ticks","rotation");if(Re===mc.ALWAYS)oe=!0;else if(Re===mc.NEVER)oe=!1;else if(!Re||Re===mc.AUTO)if(c.step)oe=_.selectAll("g.tick text").nodes().some(qe=>ft.getSVGElementSize(qe,{useBBox:!0}).width>=c.step());else{oe=!1;const qe=_.append("text").text("A"),Ce=ft.getSVGElementSize(qe.node(),{useBBox:!0}).width;let Ze;_.selectAll("g.tick").each(function(){const be=rt(this),Ae=parseFloat(ye(Nr(this),"tx"));Ae!==null&&Ze+be.text().length*Ce*.8>=Ae&&(oe=!0),Ze=Ae}),qe.remove()}oe?($||(X.ticks(this.getNumberOfFittingTicks(s,x,Ts.ticks.horizontalSpaceRatio)),_.call(X),g.call(X)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===Qe.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(C?a.attr("opacity",0):a.attr("opacity",1),g.selectAll("g.tick").attr("aria-label",oe=>oe),_.selectAll("g.tick").attr("aria-label",oe=>oe),N!==Zl.NONE&&A===St.LABELS&&!R){const oe=this.services.cartesianScales.getScaleDomain(n);if(oe.length>0){const Re=r.select(`g.axis.${n} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(Re);const qe=this;a.selectAll("g.tick text").data(oe).text(function(Ce){return Ce.length>G?(qe.truncation[n]=!0,Uu(Ce,N,B)):Ce}),this.getInvisibleAxisRef().selectAll("g.tick text").data(oe).text(function(Ce){return Ce.length>G?Uu(Ce,N,B):Ce}),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(oe)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=ft.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=ye(l,"axes",n),s=ye(r,"scaleType"),o=ye(r,"truncation","threshold"),a=this;i.selectAll("g.tick text").on("mouseover",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOVER,{event:u,element:rt(this),datum:f}),s===St.LABELS&&f.length>o&&a.services.events.dispatchEvent($e.Tooltip.SHOW,{event:u,hoveredElement:rt(this),content:f})}).on("mousemove",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEMOVE,{event:u,element:rt(this),datum:f}),s===St.LABELS&&f.length>o&&a.services.events.dispatchEvent($e.Tooltip.MOVE,{event:u})}).on("click",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_CLICK,{event:u,element:rt(this),datum:f})}).on("mouseout",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOUT,{event:u,element:rt(this),datum:f}),s===St.LABELS&&a.services.events.dispatchEvent($e.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,n,i){const l=Math.floor(e/(n*i));return N1e(l,2,Ts.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;ft.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class lge extends jO{constructor(e,n,i){super(e,n,i)}render(e=!0){super.render(e),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),l=ft.appendOrSelect(i,`g.axis.${n}`),r=this;l.selectAll("g.tick").each(function(s,o){const a=rt(this);a.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const u=a.select("text"),{width:f,height:c}=ft.getSVGElementSize(u,{useBBox:!0}),d=ft.appendOrSelect(a,"rect.axis-holder");let h=0,g=0;switch(n){case Qe.LEFT:h=-f+Number(u.attr("x")),g=-(c/2);break;case Qe.RIGHT:h=Math.abs(Number(u.attr("x"))),g=-(c/2);break;case Qe.TOP:h=-(f/2),g=-c+Number(u.attr("y"))/2,r.truncation[n]&&(h=0,d.attr("transform","rotate(-45)"));break;case Qe.BOTTOM:h=-(f/2),g=c/2-2,r.truncation[n]&&(h=-f,d.attr("transform","rotate(-45)"));break}d.attr("x",h-Ts.hover.rectanglePadding).attr("y",g).attr("width",f+Ts.hover.rectanglePadding*2).attr("height",c).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=ft.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=ye(l,"axes",n),s=ye(r,"scaleType"),o=ye(r,"truncation","threshold"),a=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(u){const f=rt(this).select("text"),c=f.datum();a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOVER,{event:u,element:f,datum:c}),s===St.LABELS&&c.length>o&&a.services.events.dispatchEvent($e.Tooltip.SHOW,{event:u,element:f,datum:c})}).on("mousemove",function(u){const f=rt(this).select("text"),c=f.datum();a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEMOVE,{event:u,element:f,datum:c}),a.services.events.dispatchEvent($e.Tooltip.MOVE,{event:u})}).on("click",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_CLICK,{event:u,element:rt(this).select("text"),datum:rt(this).select("text").datum()})}).on("mouseout",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOUT,{event:u,element:rt(this).select("text"),datum:rt(this).select("text").datum()}),s===St.LABELS&&a.services.events.dispatchEvent($e.Tooltip.HIDE)}).on("focus",function(u){const f={clientX:0,clientY:0};if(u.target){u.target.focus();const c=u.target.getBoundingClientRect();f.clientX=c.x,f.clientY=c.y}a.services.events.dispatchEvent($e.Axis.LABEL_FOCUS,{event:{...u,...f},element:rt(this),datum:rt(this).select("text").datum()})}).on("blur",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_BLUR,{event:u,element:rt(this),datum:rt(this).select("text").datum()})}).on("keydown",function(u){u.key&&u.key==="Escape"&&(a.services.events.dispatchEvent($e.Tooltip.HIDE),a.services.events.dispatchEvent($e.Axis.LABEL_BLUR,{event:u,element:rt(this),datum:rt(this).select("text").datum()})),n===Qe.LEFT||n===Qe.RIGHT?u.key&&u.key==="ArrowUp"?a.goNext(this,u):u.key&&u.key==="ArrowDown"&&a.goPrevious(this,u):u.key&&u.key==="ArrowLeft"?a.goPrevious(this,u):u.key&&u.key==="ArrowRight"&&a.goNext(this,u)})}goNext(e,n){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(e,n){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;ft.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class rge extends $n{constructor(){super(...arguments),this.type="2D-axes",this.renderType=vn.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const n={},i=Object.keys(Qe),l=ye(this.getOptions(),"axes");i.forEach(s=>{l[Qe[s]]&&(n[Qe[s]]=!0)}),this.configs.axes=n,i.forEach(s=>{const o=Qe[s];if(this.configs.axes[o]&&!this.children[o]){const a={position:o,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===wg.DEFAULT?new jO(this.model,this.services,a):new lge(this.model,this.services,a);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[o]=u}}),Object.keys(this.children).forEach(s=>{this.children[s].render(e)});const r={};Object.keys(this.children).forEach(s=>{const o=this.children[s],a=o.configs.position,u=o.getInvisibleAxisRef(),{width:f,height:c}=ft.getSVGElementSize(u,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=ft.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(a===Qe.LEFT||a===Qe.RIGHT)&&(d+=5)),a){case Qe.TOP:r.top=c+d;break;case Qe.BOTTOM:r.bottom=c+d;break;case Qe.LEFT:r.left=f+d;break;case Qe.RIGHT:r.right=f+d;break}}),this.services.events.dispatchEvent($e.Axis.RENDER_COMPLETE),Object.keys(r).some(s=>this.margins[s]!==r[s])&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent($e.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class sge extends $n{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const n=ye(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===$o.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===$o.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===$o.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===$o.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),n===tl.VERTICAL&&this.drawYGrid(e),n===tl.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Jc().domain([0,1]).range(e),this.yScale=Jc().domain([0,1]).range(n)}drawBackdrop(e){const n=this.parent,{width:i,height:l}=ft.getSVGElementSize(n,{useAttrs:!0});this.backdrop=ft.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",l);const r=ft.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(r).attr("x",s).attr("y",o),r.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const n=+this.backdrop.attr("width"),i=ye(this.getOptions(),"grid","x","numberOfTicks"),l=this.xScale.ticks(i).map(o=>o*n),r=ft.appendOrSelect(this.backdrop,"g.x.skeleton"),s=r.selectAll("line").data(l);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),r.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),l=ye(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(l).map(a=>a*n),s=ft.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(r);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",a=>a).attr("y2",a=>a),s.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,n,i=!0){const l=this.parent,{width:r,height:s}=ft.getSVGElementSize(l,{useAttrs:!0}),o=ft.appendOrSelect(l,"svg.chart-skeleton").attr("width",r).attr("height",s),a=n===0?"pie":"donut",u=ye(this.getOptions(),a,"alignment");ft.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",r).attr("height",s).attr("fill","none");const f=bre().innerRadius(n).outerRadius(e).startAngle(0).endAngle(Math.PI*2),c=e+Math.abs(au.radiusOffset),d=e+(Math.min(r,s)-e*2)/2,h=ft.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${c}, ${d})`).attr("d",f).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let g=e+au.xOffset;u===Il.CENTER?g=r/2:u===Il.RIGHT&&(g=r-e-au.xOffset);const _=e+au.yOffset;h.attr("transform",`translate(${g}, ${_})`)}computeOuterRadius(){const{width:e,height:n}=ft.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,n)/2+au.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const n="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:r}=ft.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=r,a=ft.appendOrSelect(l,"defs").lower(),u=ft.appendOrSelect(a,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",s-3*.2*r).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=` +
        • `).join("")+"
        "}valueFormatter(e,n){const i=this.getOptions(),l=ye(i,"tooltip","valueFormatter");if(l)return l(e,n);if(typeof e.getTime=="function")return _a(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return _a(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const n=this.getOptions(),i=ye(n,"tooltip","enabled");if(i){const l=rt(this.services.domUtils.getHolder()),r=ye(n,"style","prefix");this.tooltip=ft.appendOrSelect(l,`div.${Qi}--${r}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),l=this.getOptions(),r=ye(l,"zoomBar","top","enabled");let s=ye(e,"detail","mousePosition");if(!s)s=ro(ye(e,"detail","event"),n);else{const d=ye(l,"zoomBar","top","type"),h=cl.height[d];r&&(s[1]+=h+cl.spacerHeight)}const o=n.offsetWidth,a=n.offsetHeight;let u;s[0]/o>.9?u=Si.LEFT:s[0]/o<.1?u=Si.RIGHT:u=this.positionService.findBestPlacementAt({left:s[0],top:s[1]},i,[Si.RIGHT,Si.LEFT,Si.TOP,Si.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:a}));let{horizontalOffset:f}=Ide;u===Si.LEFT&&(f*=-1);const c=this.positionService.findPositionAt({left:s[0]+f,top:s[1]},i,u);this.positionService.setElement(i,c)}}const GO=class Ec extends $n{constructor(){super(...arguments),this.type="grid-brush",this.renderType=vn.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const l=ft.appendOrSelect(n,"svg.chart-grid-backdrop"),r=ft.appendOrSelect(l,`g.${this.type}`),s=ft.appendOrSelect(r,this.selectionSelector),{width:o,height:a}=ft.getSVGElementSize(l,{useAttrs:!0}),{cartesianScales:u}=this.services,f=u.getMainXScaleType(),c=u.getMainXScale(),[d]=c.range();i.attr("transform",`translate(${d},0)`);const h=ft.appendOrSelect(i,this.frontSelectionSelector);if(c&&f===St.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const _=C=>{const D=C[1]-C[0];let R="0,"+D.toString();const N=Math.floor(a/Ec.DASH_LENGTH),G=N*Ec.DASH_LENGTH;for(let B=0;B{const D=C.selection;D===null||D[0]===D[1]||(h.attr("x",parseFloat(s.attr("x"))+parseFloat(l.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),_(D))},y=(C,D)=>{const R=uE().range([0,o]).domain(g);let N=[R.invert(C),R.invert(D)];N[0].valueOf()===N[1].valueOf()&&(N=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==N[0].valueOf()||g[1].valueOf()!==N[1].valueOf())&&this.services.zoom.handleDomainChange(N)};let T;const M=C=>{const D=C.selection;D!==null&&(y(D[0],D[1]),r.call(T.move,null),h.style("display","none"))};a!=0&&o!=0&&(T=ZS().extent([[0,0],[o-1,a]]).on("start brush end",k).on("end.brushed",M),r.call(T));const A=this.services.zoom.getZoomRatio();l.on("click",function(C){if(C.shiftKey){const D=this.services.domUtils.getHolder(),R=ro(r.node(),D)[0];let N=R-o*A/2;N<0&&(N=0);let G=R+o*A/2;G>o&&(G=o),y(N,G)}})}}};GO.DASH_LENGTH=4;let Xme=GO;class Kme extends $n{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=vn.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=ZS(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener($e.ZoomBar.UPDATE,this.render.bind(this));const e=ye(this.getOptions(),"zoomBar",Qe.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(Qe.TOP),l=this.services.zoom.isZoomBarLocked(Qe.TOP),r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=ye(this.getOptions(),"axes",Qe.BOTTOM,"highlights"),o=cl.height[r],{width:a}=ft.getSVGElementSize(this.parent,{useAttrs:!0});if(a===0)return;let u=0;const f=this.model.get("axesMargins");f&&f.left&&(u=f.left);const c=ft.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(ft.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",cl.spacerHeight).attr("opacity",1).attr("fill","none"),r===or.GRAPH_VIEW?ft.appendOrSelect(c,"rect.zoom-bg").attr("x",u).attr("y",0).attr("width",a-u).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===or.SLIDER_VIEW&&ft.appendOrSelect(c,"rect.zoom-slider-bg").attr("x",u).attr("y",o/2-1).attr("width",a-u).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(c,u,a);return}const{cartesianScales:d}=this.services,h=d.getMainXScale(),g=d.getMainYScale(),_=d.getMainXScaleType();if(h&&_===St.TIME){let k=this.services.zoom.getZoomBarData();if(wde(k)||k.length===1)return;this.xScale=h.copy(),this.yScale=g.copy();const y=this.services.zoom.getDefaultZoomBarDomain(k);k=this.compensateDataForDefaultDomain(k,y);const T=this.model.get("initialZoomDomain"),M=ye(this.getOptions(),"zoomBar",Qe.TOP,"initialZoomDomain");M&&M[0]&&M[1]&&(M[0]=new Date(M[0]),M[1]=new Date(M[1])),M&&!(T&&T[0].valueOf()===M[0].valueOf()&&T[1].valueOf()===M[1].valueOf())?this.model.set({initialZoomDomain:jt([],M),zoomDomain:M?jt([],M):y},{skipUpdate:!0}):M===null&&T!==null&&this.model.set({initialZoomDomain:null,zoomDomain:jt([],y)},{skipUpdate:!0}),this.xScale.range([u,a]).domain(y),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(xo(k,D=>D.value));const A=this.model.get("zoomDomain");if(r===or.GRAPH_VIEW&&(this.renderZoomBarArea(c,"path.zoom-graph-area-unselected",k,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(c,"path.zoom-graph-area",k,this.clipId),this.renderZoomBarBaseline(c,u,a),s)){const D=s.highlightStartMapsTo,R=s.highlightEndMapsTo,N=s.color,G=s.labelMapsTo;s.data.forEach((B,j)=>{ft.appendOrSelect(c,`rect.highlight-${j}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(B[D])).attr("width",this.xScale(B[R])-this.xScale(B[D])).style("fill",N&&N.scale[B[G]]?N.scale[B[G]]:null).style("fill-opacity",.1).style("stroke",N&&N.scale[B[G]]?N.scale[B[G]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(A,u,a);const C=ft.appendOrSelect(n,this.brushSelector).call(this.brush);if(A!==void 0)if(A[0].valueOf()===A[1].valueOf())C.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const D=A.map(R=>this.xScale(R));D[1]-D[0]!1),C.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,n,i){const l=o=>{const a=o.selection;a===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):a[0]===a[1]||this.handleBrushedEvent(o,e,this.xScale,a)},r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r];this.brush.extent([[n,0],[i,s]]).on("start brush end",null).on("start brush end",l)}handleBrushedEvent(e,n,i,l){const r=[i.invert(l[0]),i.invert(l[1])];if(this.updateBrushHandle(this.getComponentContainer(),l),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(n===void 0||n[0]!==r[0]||n[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1});let s;e.type==="start"?s=$e.ZoomBar.SELECTION_START:e.type==="brush"?s=$e.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(s=$e.ZoomBar.SELECTION_END,this.services.events.dispatchEvent($e.ZoomDomain.CHANGE,{newDomain:r})),this.services.events.dispatchEvent(s,{selection:l,newDomain:r})}}updateBrushHandle(e,n){const i=this,l=cl.handleWidth,r=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r],o=-l/2,a=cl.handleBarWidth,u=r===or.GRAPH_VIEW?cl.handleBarHeight:6,f=-a/2,c=(s-u)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(h){if(h.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(h.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-l)}).attr("y",0).attr("width",l).attr("height",s).attr("cursor","ew-resize").style("display",null);const d=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(h){return"handle-bar handle-bar--"+h.type}),d.attr("x",function(h){if(h.type==="w")return Math.max(n[0]+f,i.maxSelectionRange[0]-o+f);if(h.type==="e")return Math.min(n[1]+f,i.maxSelectionRange[1]+o+f)}).attr("y",c).attr("width",a).attr("height",u).attr("cursor","ew-resize"),r===or.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(e,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(e){const n=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),i=cl.height[n],l=this.getComponentContainer().select("svg.zoom-container");ft.appendOrSelect(l,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",i/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,n,i,l){const{cartesianScales:r}=this.services,s=r.getMainXAxisPosition(),o=r.getMainYAxisPosition(),a=r.getMainXScaleType(),u=r.getMainYScaleType(),f=(y,T,M)=>A=>r.getValueFromScale(y,T,M,A),c=f(this.xScale,a,s),d=f(this.yScale,u,o),h=ye(this.getOptions(),"zoomBar",Qe.TOP,"type"),g=cl.height[h],_=$g().x(y=>c(y)).y0(g).y1(y=>g-d(y)),k=ft.appendOrSelect(e,n).datum(i).attr("d",_);l&&k.attr("clip-path",`url(#${l})`)}updateClipPath(e,n,i,l,r,s){const o=ft.appendOrSelect(e,"clipPath").attr("id",n);ft.appendOrSelect(o,"rect").attr("x",i).attr("y",l).attr("width",r).attr("height",s)}compensateDataForDefaultDomain(e,n){if(!e||e.length<2)return;const i=lf(e),l=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])Number(i[i.length-1][l])){const s={};s[l]=n[1],s[r]=0,i.push(s)}return i}renderZoomBarBaseline(e,n,i,l=!1){const r=ye(this.model.getOptions(),"zoomBar",Qe.TOP,"type"),s=cl.height[r],o=jg()([[n,s],[i,s]]);ft.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",l).style("stroke",l?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,n,i){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),ft.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),ye(this.getOptions(),"zoomBar",Qe.TOP,"type")===or.GRAPH_VIEW&&this.renderZoomBarBaseline(e,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener($e.ZoomBar.UPDATE,this.render.bind(this))}}class Jme extends $n{constructor(e,n){super(e,n),this.type="threshold",this.renderType=vn.SVG,this.positionService=new rh}render(e=!1){const n=ye(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(Qe).includes(u)){const f=n[u];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:u,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-thresholds ${u.axisPosition}`);const s=r.selectAll("g.threshold-group").data(u=>u.thresholds.map(f=>(f.axisPosition=u.axisPosition,f.datum=this.constructDatumObj(u,f),f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getScaleByPosition(u),c=a.services.cartesianScales.getScaleTypeByPosition(u);let d=null,h=null;u===Qe.LEFT||u===Qe.RIGHT?(h=f,d=a.services.cartesianScales.getMainXScale()):(d=f,h=a.services.cartesianScales.getMainYScale());const g=c===St.LABELS,[_,k]=d.range(),[y,T]=h.range(),{cartesianScales:M}=a.services,A=M.getOrientation(),C=B=>M.getDomainValue(B),D=B=>M.getRangeValue(B),[R,N]=na(C,D,A),G=rt(this);u===Qe.TOP||u===Qe.BOTTOM?(G.selectAll("line.threshold-line").transition().call(B=>a.services.transitions.setupTransition({transition:B,name:"threshold-line-update",animate:e})).attr("y1",T).attr("y2",y).attr("x1",({datum:B})=>R(B)+(g?f.step()/2:0)).attr("x2",({datum:B})=>R(B)+(g?f.step()/2:0)).style("stroke",({fillColor:B})=>B),G.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:B})=>-R(B)).attr("width",Math.abs(y-T)).classed("rotate",!0)):(G.selectAll("line.threshold-line").transition().call(B=>a.services.transitions.setupTransition({transition:B,name:"threshold-line-update",animate:e})).attr("x1",_).attr("x2",k).attr("y1",({datum:B})=>N(B)+(g?f.step()/2:0)).attr("y2",({datum:B})=>N(B)+(g?f.step()/2:0)).style("stroke",({fillColor:B})=>B),G.selectAll("rect.threshold-hoverable-area").attr("x",_).attr("y",({datum:B})=>N(B)).attr("width",Math.abs(k-_)).classed("rotate",!1))}),this.services.events.addEventListener($e.Threshold.SHOW,u=>{this.setThresholdLabelPosition(u.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener($e.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:n,axisPosition:i}=e,l=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===St.TIME){const r=[Qe.LEFT,Qe.RIGHT].includes(i),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),a=r?o:s,u=ye(l,"timeScale"),f=Fm(a.ticks(),ye(u,"timeInterval"));return Um(n,0,a.ticks(),f,u)}return n.toLocaleString("en")}appendThresholdLabel(){const e=rt(this.services.domUtils.getHolder()),n=ye(this.getOptions(),"style","prefix");this.label=ft.appendOrSelect(e,`div.${Qi}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:n}){const i=this.services.domUtils.getHolder(),l=ro(e,i),r=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${r}`).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:l[0],top:l[1]},s,[Si.RIGHT,Si.LEFT,Si.TOP,Si.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),a=this.positionService.findPositionAt({left:l[0],top:l[1]},s,o);this.positionService.setElement(s,a)}constructDatumObj(e,n){const i={};return e.correspondingDatasets&&(i.group=ye(e,"correspondingDatasets",0)),i[e.mapsTo]=n.value,i}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){rt(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent($e.Threshold.SHOW,{event:n,hoveredElement:rt(this),datum:rt(this).datum()})}).on("mouseout",function(n){rt(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent($e.Threshold.HIDE,{event:n,hoveredElement:rt(this),datum:rt(this).datum()})})}}class Qme extends $n{constructor(e,n){super(e,n),this.type="highlight",this.renderType=vn.SVG,this.positionService=new rh,this.highlightStrokeWidth=1}render(e=!1){const n=ye(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(Qe).includes(u)){const f=n[u];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:u,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-highlight ${u.axisPosition}`);const s=r.selectAll("g.highlight-group").data(u=>u.highlight.map(f=>(f.axisPosition=u.axisPosition,f.highlightStartMapsTo=u.highlightStartMapsTo,f.labelMapsTo=u.labelMapsTo,f.color=u.color,f.highlightEndMapsTo=u.highlightEndMapsTo,f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getMainXScale(),c=a.services.cartesianScales.getMainYScale(),[d,h]=f.range(),[g,_]=c.range(),{cartesianScales:k}=a.services,y=k.getOrientation(),T=R=>k.getDomainValue(R),M=R=>k.getRangeValue(R),[A,C]=na(T,M,y),D=rt(this);u===Qe.TOP||u===Qe.BOTTOM?D.selectAll("rect.highlight-bar").transition().call(R=>a.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:e})).attr("y",Math.max(_+a.highlightStrokeWidth,0)).attr("height",Math.max(g-2*a.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:R,...N})=>A(N[R])).attr("width",({highlightStartMapsTo:R,highlightEndMapsTo:N,...G})=>Math.max(A(G[N])-A(G[R]),0)).style("stroke",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null):D.selectAll("rect.highlight-bar").transition().call(R=>a.services.transitions.setupTransition({transition:R,name:"highlight-bar-update",animate:e})).attr("x",d).attr("width",Math.max(h-d,0)).attr("y",({highlightEndMapsTo:R,...N})=>C(N[R])).attr("height",({highlightStartMapsTo:R,highlightEndMapsTo:N,...G})=>Math.max(C(G[R])-C(G[N]),0)).style("stroke",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:R,labelMapsTo:N,...G})=>R&&R.scale[G[N]]?R.scale[G[N]]:null)})}}class xme extends FO{getItems(e){if(e.detail.items)return e.detail.items;const{data:n}=e.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:l}=this.services,r=l.getDomainIdentifier(),s=l.isDualAxes(),{groupMapsTo:o}=i.data,a=l.getDomainLabel();let u=l.getRangeLabel();const f=n[0][r];let c;if(n.length===1){const d=n[0],h=l.getRangeIdentifier(d);if(s){const _=l.getRangeAxisPosition({datum:d,groups:[d[o]]});u=l.getScaleLabel(_)}const g=d[h];c=[{label:a,value:f},...Array.isArray(g)&&g.length===2?[{label:"Start",value:g[0]},{label:"End",value:g[1]}]:[{label:u,value:d[h]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(_=>c.push({label:_.label,value:_.value})),c.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Oi.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(c=[{label:a,value:f}],c=c.concat(n.map(d=>{const h=d[l.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(h)&&h.length===2?`${h[0]} - ${h[1]}`:h,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Oi.TOOLTIP],dataGroupName:d[o]})}}).sort((d,h)=>h.value-d.value)),!s&&ye(i,"tooltip","showTotal")===!0)){const d=l.getRangeIdentifier();c.push({label:i_(i,"tooltip.totalLabel")||"Total",value:n.reduce((h,g)=>h+g[d],0),bold:!0})}return c}}class ege extends $n{constructor(){super(...arguments),this.type="grid",this.renderType=vn.SVG}render(e=!0){const n=ye(this.getOptions(),"grid","x","enabled"),i=ye(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(ft.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),i&&(ft.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const n=this.parent,i=this.backdrop.attr("height"),l=this.services.cartesianScales.getMainXScale(),r=kS(l).tickSizeInner(-i).tickSizeOuter(0);if(ye(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),a=ye(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=ye(this.getOptions(),"grid","x","numberOfTicks");r.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}drawYGrid(e){const n=this.parent,i=this.backdrop.attr("width"),l=this.services.cartesianScales.getMainYScale(),r=wS(l).tickSizeInner(-i).tickSizeOuter(0);if(ye(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),a=ye(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=ye(this.getOptions(),"grid","y","numberOfTicks");r.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}getGridlineThreshold(e){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((f,c)=>Number(Nr(f).tx)-Number(Nr(c).tx));let l=-1;if(!i.length)return;i.forEach(f=>{e[0]>=+Nr(f).tx&&l++});const r=l+1{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Br.opacity.unselected:Br.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Br.opacity.selected)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let l=[0,0];const{cartesianScales:r}=this.services,s=r.getOrientation(),o=$g().curve(this.services.curves.getD3Curve()).defined(C=>{const D=r.getRangeIdentifier();return C[D]!=null}),a=this.model.getGroupedData(this.configs.groups),u=ye(i,"bounds"),f=u&&a&&a.length===1;!f&&u&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${a.length}`);let c=0;const d=(C,D)=>{ye(i,"axes",C,"includeZero")===!1&&D[0]>0&&D[1]>0&&(c=D[0])},h=C=>f?r.getBoundedScaledValues(C)[0]:r.getRangeValue(c),g=C=>f?r.getBoundedScaledValues(C)[1]:r.getRangeValue(C);s===tl.VERTICAL?(l=r.getMainYScale().domain(),d(r.getMainYAxisPosition(),l),o.x(C=>r.getDomainValue(C)).y0(C=>h(C)).y1(C=>g(C))):(l=r.getMainXScale().domain(),d(r.getMainXAxisPosition(),l),o.x0(C=>h(C)).x1(C=>g(C)).y(C=>r.getDomainValue(C)));const _=ye(i,"color","gradient","enabled"),k=a&&a.length===1&&_;a.length>1&&_&&console.error("Gradients can only be enabled when having 1 single dataset");const y=n.selectAll("path.area").data(a,C=>C.name),T=rt(this.services.domUtils.getMainContainer());if(y.exit().attr("opacity",0).remove(),!a.length)return;if(k){const C=T.select(`path.${this.model.getColorClassName({classNameTypes:[Oi.STROKE],dataGroupName:a[0].name})}`).node();let D;if(C)D=getComputedStyle(C,null).getPropertyValue("stroke");else{const R=ye(this.model.getOptions(),"color","scale");if(R!==null){const N=Object.keys(R);D=R[N[0]]}}Fu.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${a[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Fu.getStops(l,D)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const M=this,A=y.enter().append("path");k?A.merge(y).style("fill",C=>`url(#${this.services.domUtils.generateElementIDString(`${C.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:C.name,originalClassName:"area"})).attr("d",C=>{const{data:D}=C;return o(D)}):(A.attr("opacity",0).merge(y).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[Oi.FILL,Oi.STROKE],dataGroupName:C.name,originalClassName:"area"})).style("fill",C=>M.model.getFillColor(C.name)).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"area-update-enter",animate:e})).attr("opacity",f?1:Br.opacity.selected).attr("d",C=>{const{data:D}=C;return o(D)}),f&&A.attr("fill-opacity",Br.opacity.selected).style("stroke",C=>M.model.getStrokeColor(C.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Oc extends $n{constructor(){super(...arguments),this.type="line",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?j1.opacity.unselected:j1.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",j1.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:l}=this.services,r=h=>i.getDomainValue(h),s=h=>i.getRangeValue(h),[o,a]=na(r,s,i.getOrientation()),u=this.getOptions(),f=jg().x(o).y(a).curve(l.getD3Curve()).defined(h=>{const g=i.getRangeIdentifier(h);return h[g]!=null});let c=[];if(this.configs.stacked){const h=Object.keys(u.axes).some(_=>u.axes[_].percentage),{groupMapsTo:g}=u.data;c=this.model.getStackedData({groups:this.configs.groups,percentage:h}).map(_=>{const k=this.services.cartesianScales.getDomainIdentifier(_),y=this.services.cartesianScales.getRangeIdentifier(_);return{name:ye(_,0,g),data:_.map(T=>({[k]:T.data.sharedStackKey,[g]:T[g],[y]:T[1]})),hidden:!B1e(_,T=>T[0]!==T[1])}})}else c=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(c,h=>h.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(c,h=>h.name).attr("class",h=>this.model.getColorClassName({classNameTypes:[Oi.STROKE],dataGroupName:h.name,originalClassName:"line"})).style("stroke",h=>this.model.getStrokeColor(h.name)).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",h=>{const{data:g}=h;return g.map(_=>{const k=this.services.cartesianScales.getRangeIdentifier(_);return _[k]}).join(",")}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"line-update-enter",animate:e})).attr("opacity",h=>h.hidden?0:1).attr("d",h=>{const{data:g}=h;return f(g)})}destroy(){const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const z6=5;function tge(t,e){return t>e-z6&&t({domainValue:this.services.cartesianScales.getDomainValue(k),originalData:k})).filter(k=>tge(k.domainValue,f));if(this.pointsWithinLine&&g.length===this.pointsWithinLine.length&&g.map(k=>k.domainValue).join()===this.pointsWithinLine.map(k=>k.domainValue).join())return this.pointsWithinLine=g,this.services.events.dispatchEvent($e.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=g;const _=this.pointsWithinLine.reduce((k,y)=>{if(k.length===0)return k.push(y),k;const T=k[0].domainValue,M=Math.abs(f-y.domainValue),A=Math.abs(f-T);return M>A||(M0){const k=_.map(A=>A.originalData).filter(A=>{const C=this.services.cartesianScales.getRangeIdentifier(A);return A[C]!=null}),y=_.map(A=>A.domainValue),T=h.filter(A=>{const C=this.services.cartesianScales.getDomainValue(A);return y.includes(C)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!P1e(this.elementsToHighlight,T)&&this.hideRuler(),T.dispatch("mouseover"),this.elementsToHighlight=T,this.services.events.dispatchEvent($e.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(k)}),c.attr("opacity",1);const M=_[0];r==="horizontal"?d.attr("x1",u).attr("x2",a).attr("y1",M.domainValue).attr("y2",M.domainValue):d.attr("y1",u).attr("y2",a).attr("x1",M.domainValue).attr("x2",M.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,n=ft.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent($e.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let l=function(r){const s=ro(r,e.parent.node());e.showRuler(r,s)};if(i.length>100){const r=i.length%50*12.5;l=she(function(s){const{mousePosition:o}=this;e.showRuler(s,o)},r,n)}this.backdrop.on("mousemove mouseover",l).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=ft.appendOrSelect(e,"svg.chart-grid-backdrop")}}class Tu extends $n{constructor(){super(...arguments),this.type="scatter",this.renderType=vn.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(l=>{var r;return(r=this.services.transitions)==null?void 0:r.setupTransition({transition:l,name:"legend-hover-scatter"})}).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(e.addEventListener($e.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener($e.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(e),l=this.model.get("zoomDomain");return l!==void 0?e.filter(r=>r[i].getTime()>=l[0].getTime()&&r[i].getTime()<=l[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const l=Object.keys(e.axes).some(r=>e.axes[r].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:l})}else{const{cartesianScales:l}=this.services;if(!l)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(r=>{const s=l.getRangeIdentifier(r);return r[s]!==void 0&&r[s]!==null})}return this.filterBasedOnZoomDomain(i)}render(e){if(!(ye(this.getOptions(),"points","enabled")||ye(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");const s=r.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[l]}-${u[s]}`);o.exit().attr("opacity",0).remove();const a=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(a,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const l=i.getOrientation(),[r,s]=na(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),l),[o,a]=na(c=>i.getDomainValue(c),c=>i.getRangeValue(c),l),u=o(e),f=a(e);return s&&r?f<=s.scaleValue&&u>=r.scaleValue:s?f<=s.scaleValue:r?u>=r.scaleValue:!1}styleCircles(e,n){const i=this.getOptions(),{filled:l,fillOpacity:r}=i.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,a=h=>s.getDomainValue(h),u=h=>s.getRangeValue(h),[f,c]=na(a,u,s.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;e.raise().classed("dot",!0).attr("class",h=>{const g=s.getDomainIdentifier(h),_=this.model.getIsFilled(h[o],h[g],h,l)?[Oi.FILL,Oi.STROKE]:[Oi.STROKE];return this.model.getColorClassName({classNameTypes:_,dataGroupName:h[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",h=>this.isDatapointThresholdAnomaly(h)).classed("filled",h=>{const g=s.getDomainIdentifier(h);return this.model.getIsFilled(h[o],h[g],h,l)}).classed("unfilled",h=>{const g=s.getDomainIdentifier(h);return!this.model.getIsFilled(h[o],h[g],h,l)}).transition().call(h=>{var g;return(g=this.services.transitions)==null?void 0:g.setupTransition({transition:h,name:"scatter-update-enter",animate:n})}).attr("cx",f).attr("cy",c).attr("r",i.points.radius).style("fill",h=>{const g=s.getDomainIdentifier(h);if(this.model.getIsFilled(h[o],h[g],h,l))return this.model.getFillColor(h[o],h[g],h)}).style("stroke",h=>{const g=s.getDomainIdentifier(h);return this.model.getStrokeColor(h[o],h[g],h)}).attr("fill-opacity",l?r:1).attr("opacity",d?0:1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",h=>{const g=s.getRangeIdentifier(h);return h[g]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:n}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,l){var r,s;const o=rt(this);o.classed("hovered",!0).attr("class",a=>e.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:a[n],originalClassName:o.attr("class")})).style("fill",a=>{var u;const f=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(a);return e.model.getFillColor(a[n],a[f],a)}).classed("unfilled",!1),(r=e.services.events)==null||r.dispatchEvent($e.Tooltip.SHOW,{event:i,hoveredElement:o,data:[l],additionalItems:e.getTooltipAdditionalItems(l)}),(s=e.services.events)==null||s.dispatchEvent($e.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:l})}).on("mousemove",function(i,l){var r,s;const o=rt(this);(r=e.services.events)==null||r.dispatchEvent($e.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:l}),(s=e.services.events)==null||s.dispatchEvent($e.Tooltip.MOVE,{event:i})}).on("click",function(i,l){var r;(r=e.services.events)==null||r.dispatchEvent($e.Scatter.SCATTER_CLICK,{event:i,element:rt(this),datum:l})}).on("mouseout",function(i,l){var r,s,o;const a=rt(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:u}=e.getOptions().points,f=(r=e.services.cartesianScales)==null?void 0:r.getDomainIdentifier(l),c=e.model.getIsFilled(l[n],l[f],l,u);a.classed("unfilled",!c).style("fill",d=>c||u?e.model.getFillColor(d[n],d[f],d):null)}(s=e.services.events)==null||s.dispatchEvent($e.Scatter.SCATTER_MOUSEOUT,{event:i,element:a,datum:l}),(o=e.services.events)==null||o.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var e;(e=this.parent)==null||e.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener($e.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener($e.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class jO extends $n{constructor(e,n,i){super(e,n,i),this.type="axes",this.renderType=vn.SVG,this.truncation={[Qe.LEFT]:!1,[Qe.RIGHT]:!1,[Qe.TOP]:!1,[Qe.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(e=!0){const{position:n}=this.configs,i=this.getOptions(),l=ye(i,"axes",n,"visible"),r=this.getComponentContainer(),{width:s,height:o}=ft.getSVGElementSize(r,{useAttrs:!0}),a=ft.appendOrSelect(r,`g.axis.${n}`);let u,f;if(n===Qe.BOTTOM||n===Qe.TOP?(u=this.configs.axes[Qe.LEFT]?this.margins.left:0,f=this.configs.axes[Qe.RIGHT]?s-this.margins.right:s):(u=o-this.margins.bottom,f=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const c=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===St.LABELS||this.scaleType===St.LABELS_RATIO?c.rangeRound([u,f]):c.range([u,f]);let d;switch(n){case Qe.LEFT:d=wS;break;case Qe.BOTTOM:d=kS;break;case Qe.RIGHT:d=Hx;break;case Qe.TOP:d=zx;break}a.attr("aria-label",`${n} axis`);const h=!a.select("g.ticks").empty();let g=ft.appendOrSelect(a,"g.ticks");h||(g.attr("role",`${oi.GRAPHICS_OBJECT} ${oi.GROUP}`),g.attr("aria-label",`${n} ticks`));const _=ft.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),k=ye(i,"axes",n),y=this.scaleType===St.TIME||k.scaleType===St.TIME,T=n===Qe.LEFT||n===Qe.RIGHT,M=this.model.get("zoomDomain");if(M&&y&&!T&&c.domain(M),!l){g.attr("aria-hidden",!0);return}const A=ye(k,"scaleType"),C=ye(i,"data","loading"),D=ye(k,"ticks","number"),R=ye(k,"ticks","values"),N=ye(k,"truncation","type"),G=ye(k,"truncation","threshold"),B=ye(k,"truncation","numCharacter"),j=D!==null,q=ye(i,"timeScale"),V=ft.appendOrSelect(_,"g.tick"),K=ft.appendOrSelect(V,"text").text("0"),x=ft.getSVGElementSize(K.node(),{useBBox:!0}).height;V.remove();const ie=this.scaleType||k.scaleType||St.LINEAR,X=d(c).tickSizeOuter(0);if(c.ticks){let oe;if(j?oe=D:(oe=Ts.ticks.number,T&&(oe=this.getNumberOfFittingTicks(o,x,Ts.ticks.verticalSpaceRatio))),c.ticks().length===1&&c.ticks()[0]===0&&(oe=0),X.ticks(oe),y)if(!c.ticks(oe).length)X.tickValues([]);else{const Re=ye(i,"timeScale","addSpaceOnEdges"),qe=ye(i,"axes",n,"domain"),Ce=c.copy();Re&&!qe&&Ce.nice(oe);const Ze=Ce.ticks(oe);Re&&Ze.length>2&&!qe&&(Ze.splice(Ze.length-1,1),Ze.splice(0,1)),X.tickValues(Ze)}}let ce;const ae=ye(k,"ticks","formatter");if(y){const oe=Fm(X.tickValues(),ye(i,"timeScale","timeInterval"));ae===null?ce=(Re,qe)=>Um(Re,qe,X.tickValues(),oe,q):ce=(Re,qe)=>{const Ce=Um(Re,qe,X.tickValues(),oe,q);return ae(Re,qe,Ce)}}else ae===null?ie===St.LINEAR&&(ce=oe=>oe.toLocaleString()):ce=ae;X.tickFormat(ce);const[ee,he]=this.services.cartesianScales.getScaleByPosition(n).domain();let ne;if(R){if(y)R.forEach((oe,Re)=>{oe.getTime===void 0&&(R[Re]=new Date(oe))}),ne=R.filter(oe=>{const Re=oe.getTime();return Re>=new Date(ee).getTime()&&Re<=new Date(he).getTime()});else if(A===St.LABELS){const oe=this.services.cartesianScales.getScaleByPosition(n).domain();ne=R.filter(Re=>oe.includes(Re))}else ne=R.filter(oe=>oe>=ee&&oe<=he);X.tickValues(ne)}switch(n){case Qe.LEFT:g.attr("transform",`translate(${this.margins.left}, 0)`);break;case Qe.BOTTOM:g.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case Qe.RIGHT:g.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case Qe.TOP:g.attr("transform",`translate(0, ${this.margins.top})`);break}const re=this.model.isDataEmpty();if(k.title){const oe=ft.appendOrSelect(a,"text.axis-title").html(re||C?"":k.title),Re=ye(k,"titleOrientation");let qe;switch(n){case Qe.LEFT:Re===gm.RIGHT?oe.attr("transform","rotate(90)").attr("y",0).attr("x",c.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):oe.attr("transform","rotate(-90)").attr("y",0).attr("x",-(c.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case Qe.BOTTOM:oe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case Qe.RIGHT:Re===gm.LEFT?oe.attr("transform","rotate(-90)").attr("y",s).attr("x",-(c.range()[0]/2)).style("text-anchor","middle"):oe.attr("transform","rotate(90)").attr("y",-s).attr("x",c.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case Qe.TOP:qe=ft.getSVGElementSize(oe,{useBBox:!0}).height,oe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${qe/2})`).style("text-anchor","middle");break}}if(y){const oe=Fm(X.tickValues(),ye(i,"timeScale","timeInterval")),Re=q.showDayName,qe=g;e&&(g=g.transition().call(Ce=>this.services.transitions.setupTransition({transition:Ce,name:"axis-update",animate:e}))),g=g.call(X),qe.selectAll(".tick").data(X.tickValues(),c).order().select("text").style("font-weight",(Ce,Ze)=>pO(Ce,Ze,X.tickValues(),oe,Re)?"bold":"normal")}else!e||!h?g=g.call(X):g=g.transition().call(oe=>this.services.transitions.setupTransition({transition:oe,name:"axis-update",animate:e})).call(X);if(_.call(X),n===Qe.BOTTOM||n===Qe.TOP){let oe=!1;const Re=ye(k,"ticks","rotation");if(Re===mc.ALWAYS)oe=!0;else if(Re===mc.NEVER)oe=!1;else if(!Re||Re===mc.AUTO)if(c.step)oe=_.selectAll("g.tick text").nodes().some(qe=>ft.getSVGElementSize(qe,{useBBox:!0}).width>=c.step());else{oe=!1;const qe=_.append("text").text("A"),Ce=ft.getSVGElementSize(qe.node(),{useBBox:!0}).width;let Ze;_.selectAll("g.tick").each(function(){const be=rt(this),Ae=parseFloat(ye(Nr(this),"tx"));Ae!==null&&Ze+be.text().length*Ce*.8>=Ae&&(oe=!0),Ze=Ae}),qe.remove()}oe?(j||(X.ticks(this.getNumberOfFittingTicks(s,x,Ts.ticks.horizontalSpaceRatio)),_.call(X),g.call(X)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===Qe.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(C?a.attr("opacity",0):a.attr("opacity",1),g.selectAll("g.tick").attr("aria-label",oe=>oe),_.selectAll("g.tick").attr("aria-label",oe=>oe),N!==Zl.NONE&&A===St.LABELS&&!R){const oe=this.services.cartesianScales.getScaleDomain(n);if(oe.length>0){const Re=r.select(`g.axis.${n} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(Re);const qe=this;a.selectAll("g.tick text").data(oe).text(function(Ce){return Ce.length>G?(qe.truncation[n]=!0,Uu(Ce,N,B)):Ce}),this.getInvisibleAxisRef().selectAll("g.tick text").data(oe).text(function(Ce){return Ce.length>G?Uu(Ce,N,B):Ce}),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(oe)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=ft.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=ye(l,"axes",n),s=ye(r,"scaleType"),o=ye(r,"truncation","threshold"),a=this;i.selectAll("g.tick text").on("mouseover",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOVER,{event:u,element:rt(this),datum:f}),s===St.LABELS&&f.length>o&&a.services.events.dispatchEvent($e.Tooltip.SHOW,{event:u,hoveredElement:rt(this),content:f})}).on("mousemove",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEMOVE,{event:u,element:rt(this),datum:f}),s===St.LABELS&&f.length>o&&a.services.events.dispatchEvent($e.Tooltip.MOVE,{event:u})}).on("click",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_CLICK,{event:u,element:rt(this),datum:f})}).on("mouseout",function(u,f){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOUT,{event:u,element:rt(this),datum:f}),s===St.LABELS&&a.services.events.dispatchEvent($e.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,n,i){const l=Math.floor(e/(n*i));return R1e(l,2,Ts.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;ft.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class nge extends jO{constructor(e,n,i){super(e,n,i)}render(e=!0){super.render(e),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),l=ft.appendOrSelect(i,`g.axis.${n}`),r=this;l.selectAll("g.tick").each(function(s,o){const a=rt(this);a.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const u=a.select("text"),{width:f,height:c}=ft.getSVGElementSize(u,{useBBox:!0}),d=ft.appendOrSelect(a,"rect.axis-holder");let h=0,g=0;switch(n){case Qe.LEFT:h=-f+Number(u.attr("x")),g=-(c/2);break;case Qe.RIGHT:h=Math.abs(Number(u.attr("x"))),g=-(c/2);break;case Qe.TOP:h=-(f/2),g=-c+Number(u.attr("y"))/2,r.truncation[n]&&(h=0,d.attr("transform","rotate(-45)"));break;case Qe.BOTTOM:h=-(f/2),g=c/2-2,r.truncation[n]&&(h=-f,d.attr("transform","rotate(-45)"));break}d.attr("x",h-Ts.hover.rectanglePadding).attr("y",g).attr("width",f+Ts.hover.rectanglePadding*2).attr("height",c).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=ft.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=ye(l,"axes",n),s=ye(r,"scaleType"),o=ye(r,"truncation","threshold"),a=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(u){const f=rt(this).select("text"),c=f.datum();a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOVER,{event:u,element:f,datum:c}),s===St.LABELS&&c.length>o&&a.services.events.dispatchEvent($e.Tooltip.SHOW,{event:u,element:f,datum:c})}).on("mousemove",function(u){const f=rt(this).select("text"),c=f.datum();a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEMOVE,{event:u,element:f,datum:c}),a.services.events.dispatchEvent($e.Tooltip.MOVE,{event:u})}).on("click",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_CLICK,{event:u,element:rt(this).select("text"),datum:rt(this).select("text").datum()})}).on("mouseout",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_MOUSEOUT,{event:u,element:rt(this).select("text"),datum:rt(this).select("text").datum()}),s===St.LABELS&&a.services.events.dispatchEvent($e.Tooltip.HIDE)}).on("focus",function(u){const f={clientX:0,clientY:0};if(u.target){u.target.focus();const c=u.target.getBoundingClientRect();f.clientX=c.x,f.clientY=c.y}a.services.events.dispatchEvent($e.Axis.LABEL_FOCUS,{event:{...u,...f},element:rt(this),datum:rt(this).select("text").datum()})}).on("blur",function(u){a.services.events.dispatchEvent($e.Axis.LABEL_BLUR,{event:u,element:rt(this),datum:rt(this).select("text").datum()})}).on("keydown",function(u){u.key&&u.key==="Escape"&&(a.services.events.dispatchEvent($e.Tooltip.HIDE),a.services.events.dispatchEvent($e.Axis.LABEL_BLUR,{event:u,element:rt(this),datum:rt(this).select("text").datum()})),n===Qe.LEFT||n===Qe.RIGHT?u.key&&u.key==="ArrowUp"?a.goNext(this,u):u.key&&u.key==="ArrowDown"&&a.goPrevious(this,u):u.key&&u.key==="ArrowLeft"?a.goPrevious(this,u):u.key&&u.key==="ArrowRight"&&a.goNext(this,u)})}goNext(e,n){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(e,n){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;ft.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ige extends $n{constructor(){super(...arguments),this.type="2D-axes",this.renderType=vn.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const n={},i=Object.keys(Qe),l=ye(this.getOptions(),"axes");i.forEach(s=>{l[Qe[s]]&&(n[Qe[s]]=!0)}),this.configs.axes=n,i.forEach(s=>{const o=Qe[s];if(this.configs.axes[o]&&!this.children[o]){const a={position:o,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===wg.DEFAULT?new jO(this.model,this.services,a):new nge(this.model,this.services,a);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[o]=u}}),Object.keys(this.children).forEach(s=>{this.children[s].render(e)});const r={};Object.keys(this.children).forEach(s=>{const o=this.children[s],a=o.configs.position,u=o.getInvisibleAxisRef(),{width:f,height:c}=ft.getSVGElementSize(u,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=ft.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(a===Qe.LEFT||a===Qe.RIGHT)&&(d+=5)),a){case Qe.TOP:r.top=c+d;break;case Qe.BOTTOM:r.bottom=c+d;break;case Qe.LEFT:r.left=f+d;break;case Qe.RIGHT:r.right=f+d;break}}),this.services.events.dispatchEvent($e.Axis.RENDER_COMPLETE),Object.keys(r).some(s=>this.margins[s]!==r[s])&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent($e.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class lge extends $n{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const n=ye(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===$o.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===$o.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===$o.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===$o.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),n===tl.VERTICAL&&this.drawYGrid(e),n===tl.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Jc().domain([0,1]).range(e),this.yScale=Jc().domain([0,1]).range(n)}drawBackdrop(e){const n=this.parent,{width:i,height:l}=ft.getSVGElementSize(n,{useAttrs:!0});this.backdrop=ft.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",l);const r=ft.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(r).attr("x",s).attr("y",o),r.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const n=+this.backdrop.attr("width"),i=ye(this.getOptions(),"grid","x","numberOfTicks"),l=this.xScale.ticks(i).map(o=>o*n),r=ft.appendOrSelect(this.backdrop,"g.x.skeleton"),s=r.selectAll("line").data(l);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),r.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),l=ye(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(l).map(a=>a*n),s=ft.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(r);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",a=>a).attr("y2",a=>a),s.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,n,i=!0){const l=this.parent,{width:r,height:s}=ft.getSVGElementSize(l,{useAttrs:!0}),o=ft.appendOrSelect(l,"svg.chart-skeleton").attr("width",r).attr("height",s),a=n===0?"pie":"donut",u=ye(this.getOptions(),a,"alignment");ft.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",r).attr("height",s).attr("fill","none");const f=_re().innerRadius(n).outerRadius(e).startAngle(0).endAngle(Math.PI*2),c=e+Math.abs(au.radiusOffset),d=e+(Math.min(r,s)-e*2)/2,h=ft.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${c}, ${d})`).attr("d",f).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let g=e+au.xOffset;u===Il.CENTER?g=r/2:u===Il.RIGHT&&(g=r-e-au.xOffset);const _=e+au.yOffset;h.attr("transform",`translate(${g}, ${_})`)}computeOuterRadius(){const{width:e,height:n}=ft.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,n)/2+au.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const n="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:r}=ft.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=r,a=ft.appendOrSelect(l,"defs").lower(),u=ft.appendOrSelect(a,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",s-3*.2*r).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=` - `;u.html(f),c();function c(){u.attr("gradientTransform",`translate(${s-3*.2*r}, 0)`).transition().duration(2e3).delay(1e3).ease(rie).attr("gradientTransform",`translate(${o+3*.2*r}, 0)`).on("end",c)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class oge extends $n{constructor(){super(...arguments),this.type="zero-line",this.renderType=vn.SVG}render(e){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[l,r]=i.domain(),s=l>0&&r<0||l<0&&r>0,o=this.getComponentContainer();if(!s){o.selectAll("line.domain").remove();return}const[a,u]=this.services.cartesianScales.getDomainScale().range();let f=+i(0)+.5;f||(f=i.range()[0]);const c=gO({x0:a,x1:u,y0:f,y1:f},this.services.cartesianScales.getOrientation());ft.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:e})).attr("y1",c.y0).attr("y2",c.y1).attr("x1",c.x0).attr("x2",c.x1)}}class H6 extends WO{formatTooltipData(e){return e.reverse()}}class g_ extends $n{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),l=ft.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const r=ye(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,l*r/n)}return Math.min(e.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(e,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const l=this.services.cartesianScales.getDomainScale();return el(i[1])}return!1}}class age extends g_{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=vn.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:l}=i.data;this.setGroupScale();const r=this.getComponentContainer({withinChartClip:!0}),s=Hu(n.map(f=>{const c=this.services.cartesianScales.getDomainIdentifier(f);return f[c]&&typeof f[c].toString=="function"?f[c].toString():f[c]})),o=r.selectAll("g.bars").data(s,f=>f);o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("bars",!0).attr("role",oi.GROUP).attr("data-name","bars").merge(o);a.transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-group-update-enter",animate:e})).attr("transform",f=>{const c=this.services.cartesianScales.getDomainValue(f)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===tl.VERTICAL?`translate(${c}, 0)`:`translate(0, ${c})`});const u=a.selectAll("path.bar").data(f=>this.getDataCorrespondingToLabel(f),f=>f[l]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-update-enter",animate:e})).attr("class",f=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:f[l],originalClassName:"bar"})).style("fill",f=>this.model.getFillColor(f[l])).attr("d",f=>{const c=this.groupScale(f[l]),d=this.getBarWidth(),h=c,g=c+d,_=this.services.cartesianScales.getRangeAxisPosition({datum:f}),k=this.services.cartesianScales.getValueThroughAxisPosition(_,0),y=this.services.cartesianScales.getRangeValue(f),T=this.services.cartesianScales.getDomainValue(f)-d/2,M=T+d;if(!this.isOutsideZoomedDomain(T,M))return d_({x0:h,x1:g,y0:k,y1:y},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",f=>f.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=rt(this);l.classed("hovered",!0),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){const l=rt(this);e.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:n,element:rt(this),datum:i})}).on("mouseout",function(n,i){const l=rt(this);l.classed("hovered",!1),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*e.length+n}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof e.step=="function")i=e.step();else if(n.length>0){const l=n.find(r=>{var s;return((s=r.data)==null?void 0:s.length)>1});if(l){const r=this.services.cartesianScales.getDomainIdentifier(l.data[0]);i=Math.abs(e(l.data[1][r])-e(l.data[0][r]))}}return i}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),n=ye(e,"bars","width"),i=ye(e,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const l=this.model.getGroupedData(this.configs.groups).length,r=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-r)/l)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Pg().domain(e).rangeRound([0,this.getGroupWidth()])}}class uge extends g_{constructor(){super(...arguments),this.type="simple-bar",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-simple-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getOptions(),{groupMapsTo:i}=n.data,l=this.getComponentContainer({withinChartClip:!0}),r=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=l.selectAll("path.bar").data(r,a=>a[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"bar-update-enter",animate:e})).attr("class",a=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:a[i],originalClassName:"bar"})).style("fill",a=>this.model.getFillColor(a[i])).attr("d",a=>{const u=this.services.cartesianScales.getRangeIdentifier(),f=this.getBarWidth(),c=a[u],d=this.services.cartesianScales.getDomainValue(a)-f/2,h=d+f;let g,_;if(Array.isArray(c)&&c.length===2)g=this.services.cartesianScales.getRangeValue(c[0]),_=this.services.cartesianScales.getRangeValue(c[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),_=this.services.cartesianScales.getRangeValue(a)}const k=Math.abs(_-g);if(k!==0&&k<2&&(c>0&&s===tl.VERTICAL||c<0&&s===tl.HORIZONTAL?_=g-2:_=g+2),!this.isOutsideZoomedDomain(d,h))return d_({x0:d,x1:h,y0:g,y1:_},s)}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",a=>a.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=rt(this);l.classed("hovered",!0),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:n,element:rt(this),datum:i}),e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:n,element:rt(this),datum:i})}).on("mouseout",function(n,i){const l=rt(this);l.classed("hovered",!1),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class fge extends $n{constructor(){super(...arguments),this.type="area-stacked",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,i=this.getOptions(),{groupMapsTo:l}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>ye(r,0,l)!==n.datum().name?Br.opacity.unselected:Br.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Br.opacity.selected)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,l=this.getOptions(),{groupMapsTo:r}=l.data,s=Object.keys(l.axes).some(h=>l.axes[h].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),a=ye(o,0,0),u=this.services.cartesianScales.getDomainAxisPosition({datum:a}),f=this.services.cartesianScales.getRangeAxisPosition({datum:a}),c=this.services.cartesianScales.getScaleByPosition(f),d=n.selectAll("path.area").data(o,h=>ye(h,0,r));this.areaGenerator=$g().x(h=>this.services.cartesianScales.getValueThroughAxisPosition(u,h.data.sharedStackKey)).y0(h=>c(h[0])).y1(h=>c(h[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,h=>ye(h,0,r)).attr("class","area").attr("class",h=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:ye(h,0,r),originalClassName:"area"})).style("fill",h=>i.model.getFillColor(ye(h,0,r))).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",h=>ye(h,0,r)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"area-update-enter",animate:e})).attr("opacity",Br.opacity.selected).attr("d",this.areaGenerator)}}class cge extends g_{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(r,u=>ye(u,0,l));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",oi.GROUP).attr("data-name","bars");const a=n.selectAll("g.bars").selectAll("path.bar").data(u=>u,u=>u.data.sharedStackKey);a.exit().remove(),a.enter().append("path").merge(a).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:u[l],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[l])).attr("d",u=>{const f=u.data.sharedStackKey,c=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(f)-c/2,h=d+c,g=this.services.cartesianScales.getRangeValue(u[0]);let _=this.services.cartesianScales.getRangeValue(u[1]);if(!this.isOutsideZoomedDomain(d,h)){if(Math.abs(_-g)>0&&Math.abs(_-g)>i.bars.dividerSize){const k=u[0]<0&&u[1]<=0;k&&s.length>1?this.services.cartesianScales.getOrientation()===tl.VERTICAL?_+=u[1]===0?2:1:_-=1:k||(this.services.cartesianScales.getOrientation()===tl.VERTICAL?_+=1:_-=1)}return d_({x0:d,x1:h,y0:g,y1:_},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u[1]-u[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(l,r){const s=rt(this);s.classed("hovered",!0),i.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:l,element:s,datum:r});let o=i.model.getDisplayData(i.configs.groups).find(a=>{const u=i.services.cartesianScales.getDomainIdentifier(a),f=i.services.cartesianScales.getRangeIdentifier(a);return a[f]===r.data[r[n]]&&a[u].toString()===r.data.sharedStackKey&&a[n]===r[n]});if(o===void 0){const a=i.services.cartesianScales.getDomainIdentifier(),u=i.services.cartesianScales.getRangeIdentifier();o={[a]:r.data.sharedStackKey,[u]:r.data[r[n]],[n]:r[n]}}i.services.events.dispatchEvent($e.Tooltip.SHOW,{event:l,hoveredElement:s,data:[o]})}).on("mousemove",function(l,r){const s=rt(this);i.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:l,element:s,datum:r}),i.services.events.dispatchEvent($e.Tooltip.MOVE,{event:l})}).on("click",function(l,r){i.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:l,element:rt(this),datum:r})}).on("mouseout",function(l,r){const s=rt(this);s.classed("hovered",!1),i.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:l,element:s,datum:r}),i.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const e=this.getOptions();if(ye(e,"bars","width"))return e.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=ft.getSVGElementSize(this.parent,{useAttrs:!0}).width,l=this.model.getStackKeys().length,r=ye(e,"bars","spacingFactor");return n.step?Math.min(e.bars.maxWidth,n.step()/2):Math.min(e.bars.maxWidth,i*r/l)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class dge extends Tu{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=vn.SVG}render(e){if(!ye(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(f=>i.axes[f].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=n.selectAll("g.dots").data(s,f=>ye(f,0,l));o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("dots",!0).attr("role",oi.GROUP).merge(o).selectAll("circle.dot").data(f=>f);a.exit().attr("opacity",0).remove();const u=a.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(a).datum(f=>{const c=f[l],d=this.services.cartesianScales.getDomainIdentifier(f),h=this.services.cartesianScales.getRangeIdentifier(f);return{[l]:c,[d]:f.data.sharedStackKey,[h]:f[1]}});this.styleCircles(u,e),this.addEventListeners()}getTooltipData(e,n){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(a=>i.axes[a].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=[];return s.forEach((a,u)=>{a.forEach((f,c)=>{const d=f[l],h=f.data.sharedStackKey;let g=f.data[d];const _=f[1],k=this.services.cartesianScales.getDomainIdentifier(f),y=this.services.cartesianScales.getRangeIdentifier(f);g!=null&&e===this.services.cartesianScales.getDomainValue(h)&&n===this.services.cartesianScales.getRangeValue(_)&&(r&&(g=this.model.getStackedData({groups:this.configs.groups})[u][c].data[d]),g!==null&&o.push({[l]:d,[k]:h,[y]:g}))})}),this.model.getDisplayData(this.configs.groups).filter(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a),f=this.services.cartesianScales.getRangeIdentifier(a);return o.find(c=>c[l]==a[l]&&c[u]==a[u]&&c[f]==a[f])!==void 0})}}function $O(t,e){Ft(2,arguments);var n=mn(t),i=ci(e);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function __(t,e){Ft(2,arguments);var n=mn(t),i=ci(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),r=new Date(n.getTime());r.setMonth(n.getMonth()+i+1,0);var s=r.getDate();return l>=s?r:(n.setFullYear(r.getFullYear(),r.getMonth(),l),n)}var hge=36e5;function qO(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*hge)}function U6(t){Ft(1,arguments);var e=mn(t);return e.setHours(0,0,0,0),e}var mge=864e5;function gge(t,e){Ft(2,arguments);var n=U6(t),i=U6(e),l=n.getTime()-Dm(n),r=i.getTime()-Dm(i);return Math.round((l-r)/mge)}var _ge=6e4;function ig(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*_ge)}function lg(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*1e3)}function YO(t,e){Ft(2,arguments);var n=ci(e);return __(t,n*12)}function Su(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=n.getTime()-i.getTime();return l<0?-1:l>0?1:l}var pge=6e4,bge=36e5;function vge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=n.getFullYear()-i.getFullYear(),r=n.getMonth()-i.getMonth();return l*12+r}function kge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e);return n.getFullYear()-i.getFullYear()}function F6(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function wge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=F6(n,i),r=Math.abs(gge(n,i));n.setDate(n.getDate()-l*r);var s=+(F6(n,i)===-l),o=l*(r-s);return o===0?0:o}function p_(t,e){return Ft(2,arguments),mn(t).getTime()-mn(e).getTime()}var G6={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},yge="trunc";function b_(t){return t?G6[t]:G6[yge]}function Tge(t,e,n){Ft(2,arguments);var i=p_(t,e)/bge;return b_(n==null?void 0:n.roundingMethod)(i)}function V6(t,e,n){Ft(2,arguments);var i=p_(t,e)/pge;return b_(n==null?void 0:n.roundingMethod)(i)}function Sge(t){Ft(1,arguments);var e=mn(t);return e.setHours(23,59,59,999),e}function Ege(t){Ft(1,arguments);var e=mn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Oge(t){Ft(1,arguments);var e=mn(t);return Sge(e).getTime()===Ege(e).getTime()}function Mge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=Su(n,i),r=Math.abs(vge(n,i)),s;if(r<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-l*r);var o=Su(n,i)===-l;Oge(mn(t))&&r===1&&Su(t,i)===1&&(o=!1),s=l*(r-Number(o))}return s===0?0:s}function W6(t,e,n){Ft(2,arguments);var i=p_(t,e)/1e3;return b_(n==null?void 0:n.roundingMethod)(i)}function Cge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=Su(n,i),r=Math.abs(kge(n,i));n.setFullYear(1584),i.setFullYear(1584);var s=Su(n,i)===-l,o=l*(r-Number(s));return o===0?0:o}function Age(t,e){Ft(2,arguments);var n=ci(e);return $O(t,-n)}function Lge(t,e){Ft(2,arguments);var n=ci(e);return __(t,-n)}function Dge(t,e){Ft(2,arguments);var n=ci(e);return qO(t,-n)}function j6(t,e){Ft(2,arguments);var n=ci(e);return ig(t,-n)}function $6(t,e){Ft(2,arguments);var n=ci(e);return lg(t,-n)}function Ige(t,e){Ft(2,arguments);var n=ci(e);return YO(t,-n)}function Rge(t){var e=t==null?0:t.length;return e?r_(t,1):[]}class Pge extends Kr{zoomIn(e,n,i){let l,r,s;const o=i||m6;e&&(l=e.x,r=e.y,s=2);const{width:a,height:u}=ft.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${a/2}, ${u/2}) scale(${s}) translate(${-l},${-r})`),this.services.events.dispatchEvent($e.CanvasZoom.CANVAS_ZOOM_IN,{element:rt(e)})}zoomOut(e,n){const i=n||m6;e.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent($e.CanvasZoom.CANVAS_ZOOM_OUT)}}class Nge extends Kr{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(e,n){this.documentFragment.addEventListener(e,n)}removeEventListener(e,n){this.documentFragment.removeEventListener(e,n)}dispatchEvent(e,n){let i;n?i=new CustomEvent(e,{detail:n}):(i=document.createEvent("Event"),i.initEvent(e,!1,!0)),this.documentFragment.dispatchEvent(i)}}class Bge extends Kr{constructor(e,n){super(e,n)}downloadCSV(e,n){const i=document.createElement("a"),l="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([e],{type:l}),n);else if(URL&&"download"in i){const r=URL.createObjectURL(new Blob([e],{type:l}));i.href=r,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(e)}`}downloadImage(e,n){const i=document.createElement("a");i.download=n,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class zge extends Kr{constructor(){super(...arguments),this.pendingTransitions={}}init(){var e;(e=this.services.events)==null||e.addEventListener($e.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:e,name:n,animate:i}){return this.pendingTransitions[e._id]=e,e.on("end interrupt cancel",()=>{delete this.pendingTransitions[e._id]}),this.model.getOptions().animations===!1||i===!1?e.duration(0):e.duration(ye(_6,n,"duration")||_6.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Hge extends Kr{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:e=null}={}){if(this.dualAxes&&e){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,l=ye(n,"axes",this.secondaryDomainAxisPosition),r=e[i];if(l!=null&&l.correspondingDatasets&&l.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:e=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:l}=i.data,r=ye(i,"axes",this.secondaryRangeAxisPosition);let s;if(e!==null?s=e[l]:n&&n.length>0&&(s=n[0]),r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(e){return ye(this.model.getOptions(),"axes",e)}getDomainAxisOptions(){const e=this.getDomainAxisPosition();return this.getAxisOptions(e)}getRangeAxisOptions(){const e=this.getRangeAxisPosition();return this.getAxisOptions(e)}getScaleLabel(e){return this.getAxisOptions(e).title||(e===Qe.BOTTOM||e===Qe.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(Qe).map(e=>Qe[e]).forEach(e=>{this.scales[e]=this.createScale(e)})}findDomainAndRangeAxes(){const e=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(e,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===Qe.LEFT||this.rangeAxisPosition===Qe.RIGHT)&&(this.domainAxisPosition===Qe.BOTTOM||this.domainAxisPosition===Qe.TOP)?this.orientation=tl.VERTICAL:this.orientation=tl.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var e,n,i,l;const r=this.model.getOptions(),s=ye(r,"axes");((e=s[Qe.LEFT])!=null&&e.correspondingDatasets&&s[Qe.RIGHT]||(n=s[Qe.RIGHT])!=null&&n.correspondingDatasets&&s[Qe.LEFT]||(i=s[Qe.TOP])!=null&&i.correspondingDatasets&&s[Qe.BOTTOM]||(l=s[Qe.BOTTOM])!=null&&l.correspondingDatasets&&s[Qe.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(e){const n=ye(this.model.getOptions(),"axes",e,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${e} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[e]===St.LINEAR||this.scaleTypes[e]===St.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[e]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(e){return this.scales[e]}getScaleTypeByPosition(e){return this.scaleTypes[e]}getDomainAxisScaleType(){const e=this.getDomainAxisPosition();return this.getScaleTypeByPosition(e)}getRangeAxisScaleType(){const e=this.getRangeAxisPosition();return this.getScaleTypeByPosition(e)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const e=[Qe.BOTTOM,Qe.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainYAxisPosition(){const e=[Qe.LEFT,Qe.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(e,n,i,l){const r=this.model.getOptions(),s=ye(r,"axes")[i],{mapsTo:o}=s,a=ye(l,o)!==null?l[o]:l;let u;switch(n){case St.LABELS:u=e(a)+e.step()/2;break;case St.TIME:u=e(new Date(a));break;default:u=e(a)}return u}getBoundedScaledValues(e){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:e}),l=this.scales[i],r=this.model.getOptions(),s=ye(r,"axes")[i],{mapsTo:o}=s,a=e[o]!==void 0?e[o]:e;return[l(ye(e,n.upperBoundMapsTo)!==null?e[n.upperBoundMapsTo]:a),l(ye(e,n.lowerBoundMapsTo)!==null?e[n.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(e,n){const i=this.scaleTypes[e],l=this.scales[e];return this.getValueFromScale(l,i,e,n)}getDomainValue(e){const n=this.getDomainAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getRangeValue(e){const n=this.getRangeAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(e){const n=this.model.getOptions();return ye(n,"axes",this.getDomainAxisPosition({datum:e}),"mapsTo")}getRangeIdentifier(e){const n=this.model.getOptions();return ye(n,"axes",this.getRangeAxisPosition({datum:e}),"mapsTo")}extendsDomain(e,n){const i=this.model.getOptions(),l=ye(i,"axes",e);if(l.scaleType===St.TIME){const r=ye(i,"timeScale","addSpaceOnEdges");return Uge(n,r)}else return Fge(n,Ts.paddingRatio,l.scaleType)}findVerticalAxesPositions(){const e=this.model.getOptions(),n=ye(e,"axes"),i=this.isDualAxes();return ye(n,Qe.LEFT)===null&&ye(n,Qe.RIGHT)!==null||ye(n,Qe.RIGHT,"main")===!0||i&&ye(n,Qe.LEFT,"correspondingDatasets")?{primary:Qe.RIGHT,secondary:Qe.LEFT}:{primary:Qe.LEFT,secondary:Qe.RIGHT}}findHorizontalAxesPositions(){const e=this.model.getOptions(),n=ye(e,"axes"),i=this.isDualAxes();return ye(n,Qe.BOTTOM)===null&&ye(n,Qe.TOP)!==null||ye(n,Qe.TOP,"main")===!0||i&&ye(n,Qe.BOTTOM,"correspondingDatasets")?{primary:Qe.TOP,secondary:Qe.BOTTOM}:{primary:Qe.BOTTOM,secondary:Qe.TOP}}findDomainAndRangeAxesPositions(e,n){const i=this.model.getOptions(),l=ye(i,"axes",e.primary),r=ye(i,"axes",n.primary),s=l.scaleType||St.LINEAR,o=r.scaleType||St.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=n.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=n.secondary,a.secondaryRangeAxisPosition=e.secondary,(!(o===St.LABELS||o===St.TIME)&&s===St.LABELS||s===St.TIME)&&(a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=n.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=n.secondary),a}getScaleDomain(e){const n=this.model.getOptions(),i=ye(n,"axes",e),l=ye(n,"bounds"),{includeZero:r}=i,s=ye(i,"scaleType")||St.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:y}=this.model.getBinConfigurations();return[0,Lx(y,T=>T.length)]}else if(i.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),T=this.model.getStackKeys({bins:y});return[T[0].split("-")[0],T[T.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:u,percentage:f,thresholds:c}=i,{reference:d,compareTo:h}=Ts.ratio;if(i.domain)return s===St.LABELS?i.domain:(s===St.TIME&&(i.domain=i.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(e,i.domain));if(f)return[0,100];if(i&&s===St.LABELS)return Hu(o.map(y=>y[u]));let g,_;const k=this.model.getDataGroupNames();if(s===St.LABELS_RATIO)return o.map(y=>`${y[d]}/${y[h]}`);if(s===St.TIME)_=o.map(y=>+new Date(y[u]));else if(l&&n.axes)_=[],o.forEach(y=>{_.push(y[u]),y[l.upperBoundMapsTo]&&_.push(y[l.upperBoundMapsTo]),y[l.lowerBoundMapsTo]&&_.push(y[l.lowerBoundMapsTo])});else if(i.stacked===!0&&k&&e===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,T=this.model.getDataValuesGroupedByKeys({groups:k}),M=o.filter(C=>!k.includes(C[y])),A=[];T.forEach(C=>{const{...D}=C;let R=0,N=0;Object.values(D).forEach(G=>{isNaN(G)||(G<0?N+=G:R+=G)}),A.push([N,R])}),_=[...Rge(A),...M.map(C=>C[u])]}else _=[],o.forEach(y=>{const T=y[u];Array.isArray(T)&&T.length===2?(_.push(T[0]),_.push(T[1])):(a&&_.push(Math.max(y[u],y[a])),_.push(T))});return s!==St.TIME&&s!==St.LOG&&r&&_.push(0),c&&c.length>0&&c.forEach(y=>{const T=ye(y,"value");T!==null&&_.push(T)}),g=xo(_),g=this.extendsDomain(e,g),g}createScale(e){const n=this.model.getOptions(),i=ye(n,"axes",e);if(!i)return null;const l=ye(i,"scaleType")||St.LINEAR;this.scaleTypes[e]=l;let r;return l===St.TIME?r=uE():l===St.LOG?r=tE().base(i.base||10):l===St.LABELS||l===St.LABELS_RATIO?r=Pg():r=Jc(),r.domain(this.getScaleDomain(e)),r}getHighestDomainThreshold(){const e=ye(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getDomainScale(),r=i.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===St.TIME&&(typeof r.value=="string"||r.value.getTime===void 0)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:l(r.value)}}getHighestRangeThreshold(){const e=ye(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getRangeScale(),r=i.sort((s,o)=>o.value-s.value)[0];return{threshold:r,scaleValue:l(r.value)}}}function Uge(t,e){const n=new Date(t[0]),i=new Date(t[1]);return Cge(i,n)>1?[Ige(n,e),YO(i,e)]:Mge(i,n)>1?[Lge(n,e),__(i,e)]:wge(i,n)>1?[Age(n,e),$O(i,e)]:Tge(i,n)>1?[Dge(n,e),qO(i,e)]:V6(i,n)>30?[j6(n,e*30),ig(i,e*30)]:V6(i,n)>1?[j6(n,e),ig(i,e)]:W6(i,n)>15?[$6(n,e*15),lg(i,e*15)]:W6(i,n)>1?[$6(n,e),lg(i,e)]:[n,i]}function Fge([t,e],n,i){const l=(e-t)*n,r=e<=0&&e+l>0?0:e+l;let s=t>=0&&t-l<0?0:t-l;if(i===St.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,r]}class Gge extends Kr{constructor(){super(...arguments),this.curveTypes={curveLinear:Wg,curveLinearClosed:Are,curveBasis:vre,curveBasisClosed:kre,curveBasisOpen:wre,curveBundle:yre,curveCardinal:Tre,curveCardinalClosed:Sre,curveCardinalOpen:Ere,curveCatmullRom:Ore,curveCatmullRomClosed:Mre,curveCatmullRomOpen:Cre,curveMonotoneX:Lre,curveMonotoneY:Dre,curveNatural:Ire,curveStep:Rre,curveStepAfter:Nre,curveStepBefore:Pre}}getD3Curve(){let e="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?e=n:e=n.name),this.curveTypes[e]){let i=this.curveTypes[e];return n&&Object.keys(n).forEach(l=>{i[l]&&(i=i[l](n[l]))}),i}return console.warn(`The curve type '${e}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Vge extends Kr{isZoomBarEnabled(){if(!this.services.cartesianScales||!ye(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const e=this.services.cartesianScales.getMainXAxisPosition(),n=ye(this.model.getOptions(),"axes",e,"scaleType");return e===Qe.BOTTOM&&n===St.TIME}getZoomBarData(){const e=this.model.getZoomBarData();return e&&e.length>1?e:this.model.getDisplayData()}getDefaultZoomBarDomain(e){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=e||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const l=i.getMainXAxisPosition(),r=i.getDomainIdentifier(),s=ye(this.model.getOptions(),"axes",l,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!l)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(l,xo(n,o=>o[r]))}handleDomainChange(e,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:e},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent($e.ZoomDomain.CHANGE,{newDomain:e}))}getZoomRatio(){return ye(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(e,n){var i;const l=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=ye(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&l){const o=r.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),a=e.filter(u=>new Date(u[o])>=l[0]&&new Date(u[o])<=l[1]);if(a.length>0)return a}return e}zoomIn(e=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),l=cl.handleWidth,r=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(i[0]),o=r(i[1]);if(o-s=d&&(c=s+u/2-l/2,d=o-u/2+l/2);const h=[r.invert(c),r.invert(d)];(i[0].valueOf()!==h[0].valueOf()||i[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(e=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const l=i(n[0]),r=i(n[1]),s=i.range(),o=(s[1]-s[0])/2*(e/2),a=Math.max(l-o,s[0]),u=Math.min(r+o,s[1]),f=[i.invert(a),i.invert(u)];(n[0].valueOf()!==f[0].valueOf()||n[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}resetZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(e[0].valueOf()!==n[0].valueOf()||e[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!e||!n)return!1;const i=e[1].valueOf()-e[0].valueOf(),l=n[1].valueOf()-n[0].valueOf(),r=ye(this.model.getOptions(),"zoomBar","minZoomRatio");return i/l{const l=this.services[i];this.services[i]=new l(this.model,this.services)}),this.services.events.addEventListener($e.Model.UPDATE,i=>{const l=!!ye(i,"detail","animate");this.update(l)}),this.model.setData(n.data),this.services.events.addEventListener($e.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(e=!0){if(!this.components)return;Object.keys(this.services).forEach(l=>{this.services[l].update()}),this.components.forEach(l=>l.render(e));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(l=>n[l].end().catch(r=>r));Promise.all(i).then(()=>this.services.events.dispatchEvent($e.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(e=>e.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(e,n){const i=this.model.getOptions(),l=ye(i,"toolbar","enabled"),r={id:"legend",components:[new HO(this.model,this.services)],growth:In.PREFERRED},s=ye(i,"canvasZoom","enabled");s&&s===!0&&e.push(new Kme(this.model,this.services));const o=!!this.model.getOptions().title,a={id:"title",components:[new zO(this.model,this.services)],growth:In.STRETCH},u={id:"toolbar",components:[new DO(this.model,this.services)],growth:In.PREFERRED},f={id:"header",components:[new ia(this.model,this.services,[a,...l?[u]:[]],{direction:fi.ROW,alignItems:Hd.CENTER})],growth:In.PREFERRED},c={id:"graph-frame",components:e,growth:In.STRETCH,renderType:ye(n,"graphFrameRenderType")||vn.SVG},d=ye(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let h=fi.COLUMN;if(d){const y=ye(i,"legend","position");y==="left"?(h=fi.ROW,i.legend.orientation||(i.legend.orientation=Au.VERTICAL)):y==="right"?(h=fi.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=Au.VERTICAL)):y==="bottom"&&(h=fi.COLUMN_REVERSE)}const g={id:"spacer",components:[new hd(this.model,this.services)],growth:In.PREFERRED},_={id:"full-frame",components:[new ia(this.model,this.services,[...d?[r]:[],...d?[g]:[],c],{direction:h})],growth:In.STRETCH},k=[];if(o||l){k.push(f);const y={id:"spacer",components:[new hd(this.model,this.services,l?{size:15}:void 0)],growth:In.PREFERRED};k.push(y)}return k.push(_),[new FO(this.model,this.services),new BO(this.model,this.services),new ia(this.model,this.services,k,{direction:fi.COLUMN})]}}class jge extends Wge{constructor(e,n){super(e,n),this.services=Object.assign(this.services,{cartesianScales:Hge,curves:Gge,zoom:Vge}),this.model=new The(this.services)}getAxisChartComponents(e,n){const i=this.model.getOptions(),l=ye(i,"zoomBar",Qe.TOP,"enabled"),r=ye(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=ye(i,"axes",s,"scaleType"),a=l&&s===Qe.BOTTOM&&o===St.TIME,u=this.services.zoom.isZoomBarLocked(Qe.TOP),f=!!this.model.getOptions().title,c={id:"title",components:[new zO(this.model,this.services)],growth:In.STRETCH},d={id:"toolbar",components:[new DO(this.model,this.services)],growth:In.PREFERRED},h={id:"header",components:[new ia(this.model,this.services,[c,...r?[d]:[]],{direction:fi.ROW,alignItems:Hd.CENTER})],growth:In.PREFERRED},g={id:"legend",components:[new HO(this.model,this.services)],growth:In.PREFERRED};a&&!u&&e.push(new UO(this.model,this.services),new Jme(this.model,this.services)),e.push(new xme(this.model,this.services)),e.push(new ege(this.model,this.services));const _={id:"graph-frame",components:e,growth:In.STRETCH,renderType:vn.SVG},k=ye(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=fi.COLUMN;if(k){const D=ye(this.model.getOptions(),"legend","position");D===ku.LEFT?(y=fi.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Au.VERTICAL)):D===ku.RIGHT?(y=fi.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Au.VERTICAL)):D===ku.BOTTOM&&(y=fi.COLUMN_REVERSE)}const T={id:"spacer",components:[new hd(this.model,this.services)],growth:In.PREFERRED},M={id:"full-frame",components:[new ia(this.model,this.services,[...k?[g]:[],...k?[T]:[],_],{direction:y})],growth:In.STRETCH},A={id:"zoom-bar",components:[new Qme(this.model,this.services)],growth:In.PREFERRED,renderType:vn.SVG},C=[];if(f||r){C.push(h);const D={id:"spacer",components:[new hd(this.model,this.services,r?{size:15}:void 0)],growth:In.PREFERRED};C.push(D)}return a&&C.push(A),C.push(M),[new tge(this.model,this.services),new BO(this.model,this.services),new ia(this.model,this.services,C,{direction:fi.COLUMN})]}}class $ge extends jge{constructor(e,n){super(e,n),this.model.setOptions(uhe(lf(ohe.areaChart),n.options)),this.init(e,n)}getComponents(){const e=[new rge(this.model,this.services),new nge(this.model,this.services),new WO(this.model,this.services),new Oc(this.model,this.services),new VO(this.model,this.services),new Tu(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new sge(this.model,this.services,{skeleton:$o.GRID})];return this.getAxisChartComponents(e)}}ks.LINE+"",ks.SCATTER+"",ks.AREA+"",ks.STACKED_AREA+"",ks.SIMPLE_BAR+"",ks.GROUPED_BAR+"",ks.STACKED_BAR+"";function qge(t){let e,n;return e=new hi({props:{state:"loading",message:t[6]("Loading statistics")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.message=i[6]("Loading statistics")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Yge(t){let e,n;return e=new hi({props:{state:"error",title:t[6]("Stats unavailable"),message:t[2],onRetry:t[12]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Stats unavailable")),l[0]&4&&(r.message=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function q6(t){let e,n;return e=new Rt({props:{type:"red",size:"sm",$$slots:{default:[Zge]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Zge(t){let e=t[6]("Check the logs")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Check the logs")+"")&&Y(n,e)},d(i){i&&E(n)}}}function Xge(t){let e=t[6]("Since GateSentry started")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Since GateSentry started")+"")&&Y(n,e)},d(i){i&&E(n)}}}function Kge(t){let e=t[6]("Since GateSentry started")+"",n,i,l=new Date(t[4].started_at).toLocaleString()+"",r;return{c(){n=j(e),i=j(" · "),r=j(l)},m(s,o){O(s,n,o),O(s,i,o),O(s,r,o)},p(s,o){o[0]&64&&e!==(e=s[6]("Since GateSentry started")+"")&&Y(n,e),o[0]&16&&l!==(l=new Date(s[4].started_at).toLocaleString()+"")&&Y(r,l)},d(s){s&&(E(n),E(i),E(r))}}}function Y6(t){let e,n,i,l=t[6]("Most blocked domains")+"",r,s,o,a,u,f,c,d=t[6]("Most requested domains")+"",h,g,_,k,y,T,M,A=t[6]("Most active devices")+"",C,D,R,N,G,B,$,q=t[6]("Blocks by policy")+"",V,K,x,ie,X,ce,ae,ee=t[6]("Block reasons")+"",he,ne,re,oe,Re,qe,Ce,Ze=t[6]("Traffic breakdown")+"",be,Ae,ve,me,lt,De;const vt=[Qge,Jge],dt=[];function ot(pe,et){var gt;return(gt=pe[0].top_blocked_domains)!=null&>.length?0:1}o=ot(t),a=dt[o]=vt[o](t);const ht=[e_e,xge],Bt=[];function Ot(pe,et){var gt;return(gt=pe[0].top_domains)!=null&>.length?0:1}_=Ot(t),k=Bt[_]=ht[_](t);const Zt=[n_e,t_e],Ve=[];function Nt(pe,et){var gt;return(gt=pe[0].affected_devices)!=null&>.length?0:1}R=Nt(t),N=Ve[R]=Zt[R](t);const Tt=[l_e,i_e],Gt=[];function fn(pe,et){var gt;return(gt=pe[0].blocks_by_policy)!=null&>.length?0:1}x=fn(t),ie=Gt[x]=Tt[x](t);const an=[s_e,r_e],Qt=[];function Ne(pe,et){var gt;return(gt=pe[0].top_reasons)!=null&>.length?0:1}return re=Ne(t),oe=Qt[re]=an[re](t),ve=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Layer")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[14](t[0].by_layer,t[7],t[0].total)}}),lt=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Outcome")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[14](t[0].by_action,t[8],t[0].total)}}),{c(){e=P("div"),n=P("section"),i=P("h3"),r=j(l),s=F(),a.c(),u=F(),f=P("section"),c=P("h3"),h=j(d),g=F(),k.c(),y=F(),T=P("section"),M=P("h3"),C=j(A),D=F(),N.c(),G=F(),B=P("section"),$=P("h3"),V=j(q),K=F(),ie.c(),X=F(),ce=P("section"),ae=P("h3"),he=j(ee),ne=F(),oe.c(),Re=F(),qe=P("section"),Ce=P("h3"),be=j(Ze),Ae=F(),U(ve.$$.fragment),me=F(),U(lt.$$.fragment),I(i,"class","svelte-1ojnyvp"),I(n,"class","panel svelte-1ojnyvp"),I(c,"class","svelte-1ojnyvp"),I(f,"class","panel svelte-1ojnyvp"),I(M,"class","svelte-1ojnyvp"),I(T,"class","panel svelte-1ojnyvp"),I($,"class","svelte-1ojnyvp"),I(B,"class","panel svelte-1ojnyvp"),I(ae,"class","svelte-1ojnyvp"),I(ce,"class","panel svelte-1ojnyvp"),I(Ce,"class","svelte-1ojnyvp"),I(qe,"class","panel svelte-1ojnyvp"),I(e,"class","columns svelte-1ojnyvp")},m(pe,et){O(pe,e,et),w(e,n),w(n,i),w(i,r),w(n,s),dt[o].m(n,null),w(e,u),w(e,f),w(f,c),w(c,h),w(f,g),Bt[_].m(f,null),w(e,y),w(e,T),w(T,M),w(M,C),w(T,D),Ve[R].m(T,null),w(e,G),w(e,B),w(B,$),w($,V),w(B,K),Gt[x].m(B,null),w(e,X),w(e,ce),w(ce,ae),w(ae,he),w(ce,ne),Qt[re].m(ce,null),w(e,Re),w(e,qe),w(qe,Ce),w(Ce,be),w(qe,Ae),z(ve,qe,null),w(qe,me),z(lt,qe,null),De=!0},p(pe,et){(!De||et[0]&64)&&l!==(l=pe[6]("Most blocked domains")+"")&&Y(r,l);let gt=o;o=ot(pe),o===gt?dt[o].p(pe,et):(ue(),v(dt[gt],1,1,()=>{dt[gt]=null}),fe(),a=dt[o],a?a.p(pe,et):(a=dt[o]=vt[o](pe),a.c()),p(a,1),a.m(n,null)),(!De||et[0]&64)&&d!==(d=pe[6]("Most requested domains")+"")&&Y(h,d);let Kt=_;_=Ot(pe),_===Kt?Bt[_].p(pe,et):(ue(),v(Bt[Kt],1,1,()=>{Bt[Kt]=null}),fe(),k=Bt[_],k?k.p(pe,et):(k=Bt[_]=ht[_](pe),k.c()),p(k,1),k.m(f,null)),(!De||et[0]&64)&&A!==(A=pe[6]("Most active devices")+"")&&Y(C,A);let ze=R;R=Nt(pe),R===ze?Ve[R].p(pe,et):(ue(),v(Ve[ze],1,1,()=>{Ve[ze]=null}),fe(),N=Ve[R],N?N.p(pe,et):(N=Ve[R]=Zt[R](pe),N.c()),p(N,1),N.m(T,null)),(!De||et[0]&64)&&q!==(q=pe[6]("Blocks by policy")+"")&&Y(V,q);let kt=x;x=fn(pe),x===kt?Gt[x].p(pe,et):(ue(),v(Gt[kt],1,1,()=>{Gt[kt]=null}),fe(),ie=Gt[x],ie?ie.p(pe,et):(ie=Gt[x]=Tt[x](pe),ie.c()),p(ie,1),ie.m(B,null)),(!De||et[0]&64)&&ee!==(ee=pe[6]("Block reasons")+"")&&Y(he,ee);let Pt=re;re=Ne(pe),re===Pt?Qt[re].p(pe,et):(ue(),v(Qt[Pt],1,1,()=>{Qt[Pt]=null}),fe(),oe=Qt[re],oe?oe.p(pe,et):(oe=Qt[re]=an[re](pe),oe.c()),p(oe,1),oe.m(ce,null)),(!De||et[0]&64)&&Ze!==(Ze=pe[6]("Traffic breakdown")+"")&&Y(be,Ze);const cn={};et[0]&64&&(cn.headers=[{key:"key",value:pe[6]("Layer")},{key:"count",value:pe[6]("Requests")},{key:"share",value:pe[6]("Share")}]),et[0]&1&&(cn.rows=pe[14](pe[0].by_layer,pe[7],pe[0].total)),ve.$set(cn);const qn={};et[0]&64&&(qn.headers=[{key:"key",value:pe[6]("Outcome")},{key:"count",value:pe[6]("Requests")},{key:"share",value:pe[6]("Share")}]),et[0]&1&&(qn.rows=pe[14](pe[0].by_action,pe[8],pe[0].total)),lt.$set(qn)},i(pe){De||(p(a),p(k),p(N),p(ie),p(oe),p(ve.$$.fragment,pe),p(lt.$$.fragment,pe),De=!0)},o(pe){v(a),v(k),v(N),v(ie),v(oe),v(ve.$$.fragment,pe),v(lt.$$.fragment,pe),De=!1},d(pe){pe&&E(e),dt[o].d(),Bt[_].d(),Ve[R].d(),Gt[x].d(),Qt[re].d(),H(ve),H(lt)}}}function Jge(t){let e,n=t[6]("Nothing blocked in this window.")+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("Nothing blocked in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function Qge(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Blocks")}],rows:t[13](t[0].top_blocked_domains,"b")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[13](i[0].top_blocked_domains,"b")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xge(t){let e,n=t[6]("No requests in this window.")+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No requests in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function e_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Requests")}],rows:t[13](t[0].top_domains,"t")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[13](i[0].top_domains,"t")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function t_e(t){let e,n=t[6]("No device activity in this window.")+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No device activity in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function n_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"device",value:t[6]("Device")},{key:"count",value:t[6]("Requests")}],rows:t[0].affected_devices.map(t[18])}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"device",value:i[6]("Device")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[0].affected_devices.map(i[18])),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function i_e(t){let e,n=t[6]("No policy blocks in this window.")+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No policy blocks in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function l_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"name",value:t[6]("Policy")},{key:"count",value:t[6]("Blocks")}],rows:t[0].blocks_by_policy.map(t[19])}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"name",value:i[6]("Policy")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[0].blocks_by_policy.map(i[19])),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function r_e(t){let e,n=t[6]("No recorded reasons in this window.")+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No recorded reasons in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function s_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Reason")},{key:"count",value:t[6]("Decisions")}],rows:t[13](t[0].top_reasons,"r")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Reason")},{key:"count",value:i[6]("Decisions")}]),l[0]&1&&(r.rows=i[13](i[0].top_reasons,"r")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function o_e(t){var es,pr,ts,Ps,Ns,ns,pl,br;let e,n,i,l,r,s,o=t[6]("Requests")+"",a,u,f,c=t[9]((es=t[0])==null?void 0:es.total)+"",d,h,g,_,k=t[6]("Blocked")+"",y,T,M,A=t[9](t[5])+"",C,D,R,N=t[10](t[5],((pr=t[0])==null?void 0:pr.total)||0)+"",G,B,$=t[6]("of requests")+"",q,V,K,x,ie=t[6]("Active clients")+"",X,ce,ae,ee=t[9]((ts=t[0])==null?void 0:ts.unique_clients)+"",he,ne,re,oe,Re=t[6]("Distinct domains")+"",qe,Ce,Ze,be=t[9]((Ps=t[0])==null?void 0:Ps.unique_domains)+"",Ae,ve,me,lt,De=t[6]("Inspection errors")+"",vt,dt,ot,ht=t[9]((Ns=t[0])==null?void 0:Ns.inspection_failures)+"",Bt,Ot,Zt,Ve,Nt,Tt=t[6]("Live proxy traffic")+"",Gt,fn,an,Qt=t[11]((ns=t[4])==null?void 0:ns.total_bytes)+"",Ne,pe,et,gt=t[6]("Down")+"",Kt,ze,kt=t[11]((pl=t[4])==null?void 0:pl.download_bytes)+"",Pt,cn,qn=t[6]("Up")+"",nl,Bl,Be=t[11]((br=t[4])==null?void 0:br.upload_bytes)+"",Et,kn,Xe,wt,Mt,Zn,Bn=t[6]("Requests over time")+"",wn,_r,_l,Jr,ji,gn;const Qr=[Yge,qge],il=[];function Xn(_t,Ut){return _t[2]?0:_t[0]?-1:1}~(e=Xn(t))&&(n=il[e]=Qr[e](t));let xt=t[0]&&t[0].inspection_failures>0&&q6(t);function xr(_t,Ut){var vi;return(vi=_t[4])!=null&&vi.started_at?Kge:Xge}let $i=xr(t),Mn=$i(t),yn=t[0]&&Y6(t);return{c(){n&&n.c(),i=F(),l=P("section"),r=P("div"),s=P("span"),a=j(o),u=F(),f=P("span"),d=j(c),h=F(),g=P("div"),_=P("span"),y=j(k),T=F(),M=P("span"),C=j(A),D=F(),R=P("span"),G=j(N),B=F(),q=j($),V=F(),K=P("div"),x=P("span"),X=j(ie),ce=F(),ae=P("span"),he=j(ee),ne=F(),re=P("div"),oe=P("span"),qe=j(Re),Ce=F(),Ze=P("span"),Ae=j(be),ve=F(),me=P("div"),lt=P("span"),vt=j(De),dt=F(),ot=P("span"),Bt=j(ht),Ot=F(),xt&&xt.c(),Zt=F(),Ve=P("div"),Nt=P("span"),Gt=j(Tt),fn=F(),an=P("span"),Ne=j(Qt),pe=F(),et=P("span"),Kt=j(gt),ze=F(),Pt=j(kt),cn=j(" · "),nl=j(qn),Bl=F(),Et=j(Be),kn=F(),Xe=P("span"),Mn.c(),wt=F(),Mt=P("section"),Zn=P("h3"),wn=j(Bn),_r=F(),_l=P("div"),Jr=F(),yn&&yn.c(),ji=je(),I(s,"class","tile-label svelte-1ojnyvp"),I(f,"class","tile-value svelte-1ojnyvp"),I(r,"class","tile svelte-1ojnyvp"),I(_,"class","tile-label svelte-1ojnyvp"),I(M,"class","tile-value svelte-1ojnyvp"),I(R,"class","tile-foot svelte-1ojnyvp"),I(g,"class","tile svelte-1ojnyvp"),I(x,"class","tile-label svelte-1ojnyvp"),I(ae,"class","tile-value svelte-1ojnyvp"),I(K,"class","tile svelte-1ojnyvp"),I(oe,"class","tile-label svelte-1ojnyvp"),I(Ze,"class","tile-value svelte-1ojnyvp"),I(re,"class","tile svelte-1ojnyvp"),I(lt,"class","tile-label svelte-1ojnyvp"),I(ot,"class","tile-value svelte-1ojnyvp"),I(me,"class","tile svelte-1ojnyvp"),I(Nt,"class","tile-label svelte-1ojnyvp"),I(an,"class","tile-value svelte-1ojnyvp"),I(et,"class","tile-foot svelte-1ojnyvp"),I(Xe,"class","tile-foot svelte-1ojnyvp"),I(Ve,"class","tile traffic-tile svelte-1ojnyvp"),I(l,"class","tiles svelte-1ojnyvp"),I(Zn,"class","svelte-1ojnyvp"),I(_l,"class","chart svelte-1ojnyvp"),I(Mt,"class","panel svelte-1ojnyvp")},m(_t,Ut){~e&&il[e].m(_t,Ut),O(_t,i,Ut),O(_t,l,Ut),w(l,r),w(r,s),w(s,a),w(r,u),w(r,f),w(f,d),w(l,h),w(l,g),w(g,_),w(_,y),w(g,T),w(g,M),w(M,C),w(g,D),w(g,R),w(R,G),w(R,B),w(R,q),w(l,V),w(l,K),w(K,x),w(x,X),w(K,ce),w(K,ae),w(ae,he),w(l,ne),w(l,re),w(re,oe),w(oe,qe),w(re,Ce),w(re,Ze),w(Ze,Ae),w(l,ve),w(l,me),w(me,lt),w(lt,vt),w(me,dt),w(me,ot),w(ot,Bt),w(me,Ot),xt&&xt.m(me,null),w(l,Zt),w(l,Ve),w(Ve,Nt),w(Nt,Gt),w(Ve,fn),w(Ve,an),w(an,Ne),w(Ve,pe),w(Ve,et),w(et,Kt),w(et,ze),w(et,Pt),w(et,cn),w(et,nl),w(et,Bl),w(et,Et),w(Ve,kn),w(Ve,Xe),Mn.m(Xe,null),O(_t,wt,Ut),O(_t,Mt,Ut),w(Mt,Zn),w(Zn,wn),w(Mt,_r),w(Mt,_l),t[17](_l),O(_t,Jr,Ut),yn&&yn.m(_t,Ut),O(_t,ji,Ut),gn=!0},p(_t,Ut){var Bs,is,ni,tr,vr,ls,zs,kr;let vi=e;e=Xn(_t),e===vi?~e&&il[e].p(_t,Ut):(n&&(ue(),v(il[vi],1,1,()=>{il[vi]=null}),fe()),~e?(n=il[e],n?n.p(_t,Ut):(n=il[e]=Qr[e](_t),n.c()),p(n,1),n.m(i.parentNode,i)):n=null),(!gn||Ut[0]&64)&&o!==(o=_t[6]("Requests")+"")&&Y(a,o),(!gn||Ut[0]&1)&&c!==(c=_t[9]((Bs=_t[0])==null?void 0:Bs.total)+"")&&Y(d,c),(!gn||Ut[0]&64)&&k!==(k=_t[6]("Blocked")+"")&&Y(y,k),(!gn||Ut[0]&32)&&A!==(A=_t[9](_t[5])+"")&&Y(C,A),(!gn||Ut[0]&33)&&N!==(N=_t[10](_t[5],((is=_t[0])==null?void 0:is.total)||0)+"")&&Y(G,N),(!gn||Ut[0]&64)&&$!==($=_t[6]("of requests")+"")&&Y(q,$),(!gn||Ut[0]&64)&&ie!==(ie=_t[6]("Active clients")+"")&&Y(X,ie),(!gn||Ut[0]&1)&&ee!==(ee=_t[9]((ni=_t[0])==null?void 0:ni.unique_clients)+"")&&Y(he,ee),(!gn||Ut[0]&64)&&Re!==(Re=_t[6]("Distinct domains")+"")&&Y(qe,Re),(!gn||Ut[0]&1)&&be!==(be=_t[9]((tr=_t[0])==null?void 0:tr.unique_domains)+"")&&Y(Ae,be),(!gn||Ut[0]&64)&&De!==(De=_t[6]("Inspection errors")+"")&&Y(vt,De),(!gn||Ut[0]&1)&&ht!==(ht=_t[9]((vr=_t[0])==null?void 0:vr.inspection_failures)+"")&&Y(Bt,ht),_t[0]&&_t[0].inspection_failures>0?xt?(xt.p(_t,Ut),Ut[0]&1&&p(xt,1)):(xt=q6(_t),xt.c(),p(xt,1),xt.m(me,null)):xt&&(ue(),v(xt,1,1,()=>{xt=null}),fe()),(!gn||Ut[0]&64)&&Tt!==(Tt=_t[6]("Live proxy traffic")+"")&&Y(Gt,Tt),(!gn||Ut[0]&16)&&Qt!==(Qt=_t[11]((ls=_t[4])==null?void 0:ls.total_bytes)+"")&&Y(Ne,Qt),(!gn||Ut[0]&64)&>!==(gt=_t[6]("Down")+"")&&Y(Kt,gt),(!gn||Ut[0]&16)&&kt!==(kt=_t[11]((zs=_t[4])==null?void 0:zs.download_bytes)+"")&&Y(Pt,kt),(!gn||Ut[0]&64)&&qn!==(qn=_t[6]("Up")+"")&&Y(nl,qn),(!gn||Ut[0]&16)&&Be!==(Be=_t[11]((kr=_t[4])==null?void 0:kr.upload_bytes)+"")&&Y(Et,Be),$i===($i=xr(_t))&&Mn?Mn.p(_t,Ut):(Mn.d(1),Mn=$i(_t),Mn&&(Mn.c(),Mn.m(Xe,null))),(!gn||Ut[0]&64)&&Bn!==(Bn=_t[6]("Requests over time")+"")&&Y(wn,Bn),_t[0]?yn?(yn.p(_t,Ut),Ut[0]&1&&p(yn,1)):(yn=Y6(_t),yn.c(),p(yn,1),yn.m(ji.parentNode,ji)):yn&&(ue(),v(yn,1,1,()=>{yn=null}),fe())},i(_t){gn||(p(n),p(xt),p(yn),gn=!0)},o(_t){v(n),v(xt),v(yn),gn=!1},d(_t){_t&&(E(i),E(l),E(wt),E(Mt),E(Jr),E(ji)),~e&&il[e].d(_t),xt&&xt.d(),Mn.d(),t[17](null),yn&&yn.d(_t)}}}function a_e(t){let e=t[6]("Dashboard")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function u_e(t){let e=t[6]("Stats")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Stats")+"")&&Y(n,e)},d(i){i&&E(n)}}}function f_e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[a_e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[u_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&64|s[1]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function c_e(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[f_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function d_e(t){let e,n,i,l;return e=new xp({props:{text:t[6]("24 hours")}}),i=new xp({props:{text:t[6]("7 days")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&64&&(o.text=r[6]("24 hours")),e.$set(o);const a={};s[0]&64&&(a.text=r[6]("7 days")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function h_e(t){let e,n,i;return n=new $R({props:{size:"sm",selectedIndex:t[1],$$slots:{default:[d_e]},$$scope:{ctx:t}}}),n.$on("change",t[16]),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","switcher svelte-1ojnyvp")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&2&&(s.selectedIndex=l[1]),r[0]&64|r[1]&4&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function m_e(t){let e,n;return e=new Nl({props:{title:t[6]("Statistics"),description:t[6]("Review filtering outcomes, client activity, and live proxy traffic."),$$slots:{actions:[h_e],breadcrumb:[c_e],default:[o_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Statistics")),l[0]&64&&(r.description=i[6]("Review filtering outcomes, client activity, and live proxy traffic.")),l[0]&127|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function g_e(t,e,n){let i,l,r;ct(t,Ln,ee=>n(27,l=ee)),ct(t,ti,ee=>n(6,r=ee));const s=[1,7],o={dns:"DNS",explicit_proxy:"Proxy",transparent_proxy:"Transparent proxy",content:"Content inspection"},a={allow:"Allowed",block:"Blocked",inspect:"Inspected",bypass:"Bypassed",error:"Errors",unknown:"Other"};let u=1,f=null,c="",d=null,h,g=null,_=!1,k=!1,y=null,T=null,M=!1,A=!1;const C=ee=>typeof ee=="number"?ee.toLocaleString():"—",D=(ee,he)=>he>0?(ee/he*100).toFixed(1)+"%":"—",R=ee=>{if(typeof ee!="number")return"—";const he=["B","KiB","MiB","GiB","TiB"];let ne=ee,re=0;for(;ne>=1024&&re=100?0:ne>=10?1:2;return`${ne.toFixed(oe)} ${he[re]}`},N=ee=>(ee.timeline||[]).flatMap(he=>{const ne=new Date(he.start*1e3).toISOString();return[{group:"Requests",date:ne,value:he.total},{group:"Blocked",date:ne,value:he.blocked}]}),G=ee=>{const he=N(ee);h&&(d?d.model.setData(he):d=new $ge(h,{data:he,options:{axes:{bottom:{mapsTo:"date",scaleType:St.TIME},left:{mapsTo:"value",scaleType:St.LINEAR}},curve:"curveMonotoneX",height:"320px",toolbar:{enabled:!1},legend:{alignment:Il.LEFT}}}))},B=async()=>{if(_||A)return;_=!0;const ee=u;try{const he=s[ee],ne=await l.api.doCall(`/decisions/summary?days=${he}`);!A&&ee===u&&(n(0,f=ne),n(2,c=""),f&&G(f))}catch{!A&&ee===u&&n(2,c="Unable to load statistics.")}finally{if(_=!1,A)return;k?(k=!1,B()):g=setTimeout(B,3e4)}},$=()=>{if(g&&clearTimeout(g),g=null,_){k=!0;return}B()},q=async()=>{if(!(M||A)){M=!0;try{const ee=await l.api.doCall("/proxy/traffic");A||n(4,y=ee)}catch{}finally{M=!1,A||(T=setTimeout(q,5e3))}}},V=(ee,he)=>(ee||[]).map((ne,re)=>({id:he+re,key:ne.key,count:C(ne.count)})),K=(ee,he,ne)=>Object.entries(ee||{}).sort((re,oe)=>oe[1]-re[1]).map(([re,oe])=>({id:re,key:he[re]||re,count:C(oe),share:D(oe,ne)})),x=ee=>{n(1,u=ee),$()};sn(()=>{B(),q()}),Ls(()=>{A=!0,g&&clearTimeout(g),T&&clearTimeout(T),d&&d.destroy()});const ie=ee=>x(ee.detail);function X(ee){xe[ee?"unshift":"push"](()=>{h=ee,n(3,h)})}const ce=(ee,he)=>({id:"d"+he,device:ee.device||ee.ip,count:C(ee.count)}),ae=ee=>({id:ee.id,name:ee.name,count:C(ee.count)});return t.$$.update=()=>{var ee;t.$$.dirty[0]&1&&n(5,i=((ee=f==null?void 0:f.by_action)==null?void 0:ee.block)||0)},[f,u,c,h,y,i,r,o,a,C,D,R,$,V,K,x,ie,X,ce,ae]}class __e extends Oe{constructor(e){super(),Ee(this,e,g_e,m_e,Se,{},null,[-1,-1])}}function Z6(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("AI status unavailable"),subtitle:t[8]}}),e.$on("close",t[18]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("AI status unavailable")),l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function p_e(t){let e,n,i=t[14](t[2])+"",l,r,s,o,a,u=(t[9].detail||t[11]("No additional status detail."))+"",f,c;return s=new Rt({props:{type:dr(t[9].state),size:"sm",$$slots:{default:[v_e]},$$scope:{ctx:t}}}),{c(){e=P("div"),n=P("strong"),l=j(i),r=F(),U(s.$$.fragment),o=F(),a=P("p"),f=j(u),I(e,"class","status-line svelte-ly8en8"),I(a,"class","svelte-ly8en8")},m(d,h){O(d,e,h),w(e,n),w(n,l),w(e,r),z(s,e,null),O(d,o,h),O(d,a,h),w(a,f),c=!0},p(d,h){(!c||h&4)&&i!==(i=d[14](d[2])+"")&&Y(l,i);const g={};h&512&&(g.type=dr(d[9].state)),h&134218240&&(g.$$scope={dirty:h,ctx:d}),s.$set(g),(!c||h&2560)&&u!==(u=(d[9].detail||d[11]("No additional status detail."))+"")&&Y(f,u)},i(d){c||(p(s.$$.fragment,d),c=!0)},o(d){v(s.$$.fragment,d),c=!1},d(d){d&&(E(e),E(o),E(a)),H(s)}}}function b_e(t){let e,n;return e=new Wi({props:{description:t[11]("Checking provider…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.description=i[11]("Checking provider…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function v_e(t){let e=t[15](t[9].state)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&512&&e!==(e=i[15](i[9].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function k_e(t){let e,n,i=t[11]("AI image filtering is disabled")+"",l,r,s,o=t[11]("No image content is sent to Grok, ChatGPT, or a local LLM.")+"",a;return{c(){e=P("section"),n=P("h3"),l=j(i),r=F(),s=P("p"),a=j(o),I(n,"id","disabled-title"),I(s,"class","svelte-ly8en8"),I(e,"class","disabled-state svelte-ly8en8"),I(e,"aria-labelledby","disabled-title")},m(u,f){O(u,e,f),w(e,n),w(n,l),w(e,r),w(e,s),w(s,a)},p(u,f){f&2048&&i!==(i=u[11]("AI image filtering is disabled")+"")&&Y(l,i),f&2048&&o!==(o=u[11]("No image content is sent to Grok, ChatGPT, or a local LLM.")+"")&&Y(a,o)},i:_e,o:_e,d(u){u&&E(e)}}}function w_e(t){let e,n,i,l,r=t[11]("Local LLM configuration")+"",s,o,a,u=t[11]("Point GateSentry at an Ollama-compatible HTTP API on a network you trust.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[5].state),size:"sm",$$slots:{default:[S_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_local_llm_url",title:t[11]("Local LLM URL"),labelText:t[11]("Local LLM URL"),type:"text",helperText:t[11]("For example, http://127.0.0.1:11434"),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_local_llm_model",title:t[11]("Ollama model"),labelText:t[11]("Ollama model"),type:"text",helperText:t[11]("Leave empty to use the server default, llava."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","local-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","local-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("Local LLM configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Point GateSentry at an Ollama-compatible HTTP API on a network you trust.")+"")&&Y(f,u);const C={};A&32&&(C.type=dr(M[5].state)),A&134217760&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("Local LLM URL")),A&2048&&(D.labelText=M[11]("Local LLM URL")),A&2048&&(D.helperText=M[11]("For example, http://127.0.0.1:11434")),_.$set(D);const R={};A&2048&&(R.title=M[11]("Ollama model")),A&2048&&(R.labelText=M[11]("Ollama model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, llava.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function y_e(t){let e,n,i,l,r=t[11]("ChatGPT configuration")+"",s,o,a,u=t[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[6].state),size:"sm",$$slots:{default:[E_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_openai_api_key",title:t[11]("OpenAI API key"),labelText:t[11]("OpenAI API key"),type:"password",helperText:t[4]?t[11]("A key is saved. Enter a new value only to replace it."):t[11]("Enter an OpenAI API key."),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_openai_model",title:t[11]("ChatGPT model"),labelText:t[11]("ChatGPT model"),type:"text",helperText:t[11]("Leave empty to use the server default, gpt-4o-mini."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","chatgpt-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","chatgpt-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("ChatGPT configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"")&&Y(f,u);const C={};A&64&&(C.type=dr(M[6].state)),A&134217792&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("OpenAI API key")),A&2048&&(D.labelText=M[11]("OpenAI API key")),A&2064&&(D.helperText=M[4]?M[11]("A key is saved. Enter a new value only to replace it."):M[11]("Enter an OpenAI API key.")),_.$set(D);const R={};A&2048&&(R.title=M[11]("ChatGPT model")),A&2048&&(R.labelText=M[11]("ChatGPT model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, gpt-4o-mini.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function T_e(t){let e,n,i,l,r=t[11]("Grok configuration")+"",s,o,a,u=t[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[7].state),size:"sm",$$slots:{default:[O_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_grok_api_key",title:t[11]("Grok API key"),labelText:t[11]("Grok API key"),type:"password",helperText:t[3]?t[11]("A key is saved. Enter a new value only to replace it."):t[11]("Enter an xAI / Grok API key."),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_grok_model",title:t[11]("Grok model"),labelText:t[11]("Grok model"),type:"text",helperText:t[11]("Leave empty to use the server default, grok-4.5."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","grok-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","grok-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("Grok configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"")&&Y(f,u);const C={};A&128&&(C.type=dr(M[7].state)),A&134217856&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("Grok API key")),A&2048&&(D.labelText=M[11]("Grok API key")),A&2056&&(D.helperText=M[3]?M[11]("A key is saved. Enter a new value only to replace it."):M[11]("Enter an xAI / Grok API key.")),_.$set(D);const R={};A&2048&&(R.title=M[11]("Grok model")),A&2048&&(R.labelText=M[11]("Grok model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, grok-4.5.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function S_e(t){let e=t[15](t[5].state)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&32&&e!==(e=i[15](i[5].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function E_e(t){let e=t[15](t[6].state)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&64&&e!==(e=i[15](i[6].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function O_e(t){let e=t[15](t[7].state)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&128&&e!==(e=i[15](i[7].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function M_e(t){let e=t[15](t[10].state)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[15](i[10].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function X6(t){let e,n=t[10].detail+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","status-detail svelte-ly8en8")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&1024&&n!==(n=l[10].detail+"")&&Y(i,n)},d(l){l&&E(e)}}}function C_e(t){let e,n,i,l=t[11]("Optional compatibility path for the original local classifier endpoint. It is separate from the selected provider above.")+"",r,s,o,a,u,f,c;o=new Rt({props:{type:dr(t[10].state),size:"sm",$$slots:{default:[M_e]},$$scope:{ctx:t}}});let d=t[10].detail&&X6(t);return f=new Ql({props:{keyName:"ai_scanner_url",title:t[11]("AI service URL"),labelText:t[11]("AI service URL"),type:"text",helperText:t[11]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run the legacy scanner."),onSaved:t[13]}}),{c(){e=P("div"),n=P("div"),i=P("p"),r=j(l),s=F(),U(o.$$.fragment),a=F(),d&&d.c(),u=F(),U(f.$$.fragment),I(i,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(e,"class","advanced-content svelte-ly8en8")},m(h,g){O(h,e,g),w(e,n),w(n,i),w(i,r),w(n,s),z(o,n,null),w(e,a),d&&d.m(e,null),w(e,u),z(f,e,null),c=!0},p(h,g){(!c||g&2048)&&l!==(l=h[11]("Optional compatibility path for the original local classifier endpoint. It is separate from the selected provider above.")+"")&&Y(r,l);const _={};g&1024&&(_.type=dr(h[10].state)),g&134218752&&(_.$$scope={dirty:g,ctx:h}),o.$set(_),h[10].detail?d?d.p(h,g):(d=X6(h),d.c(),d.m(e,u)):d&&(d.d(1),d=null);const k={};g&2048&&(k.title=h[11]("AI service URL")),g&2048&&(k.labelText=h[11]("AI service URL")),g&2048&&(k.helperText=h[11]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run the legacy scanner.")),f.$set(k)},i(h){c||(p(o.$$.fragment,h),p(f.$$.fragment,h),c=!0)},o(h){v(o.$$.fragment,h),v(f.$$.fragment,h),c=!1},d(h){h&&E(e),H(o),d&&d.d(),H(f)}}}function A_e(t){let e,n;return e=new fg({props:{title:t[11]("Legacy local scanner"),$$slots:{default:[C_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Legacy local scanner")),l&134220800&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function L_e(t){let e,n,i,l,r=t[11]("Provider")+"",s,o,a,u=t[11]("Choose one provider. Selecting a hosted provider sends image content to that service for classification.")+"",f,c,d,h,g,_,k=t[11]("Selected provider status")+"",y,T,M,A,C,D,R,N,G,B,$=t[11]("Advanced")+"",q,V,K,x,ie=t[8]&&Z6(t);d=new Ql({props:{keyName:"ai_image_filtering_mode",title:t[11]("AI image filtering provider"),labelText:t[11]("AI image filtering provider"),type:"radio",helperText:t[11]("HTTPS inspection must be enabled before GateSentry can inspect image bytes."),orientation:"vertical",radioOptions:t[12],onSaved:t[19]}});const X=[b_e,p_e],ce=[];function ae(re,oe){return re[1]&&!re[0]?0:1}M=ae(t),A=ce[M]=X[M](t);const ee=[T_e,y_e,w_e,k_e],he=[];function ne(re,oe){return re[2]==="grok"?0:re[2]==="chatgpt"?1:re[2]==="local"?2:3}return D=ne(t),R=he[D]=ee[D](t),K=new ug({props:{align:"start",$$slots:{default:[A_e]},$$scope:{ctx:t}}}),{c(){ie&&ie.c(),e=F(),n=P("section"),i=P("div"),l=P("h3"),s=j(r),o=F(),a=P("p"),f=j(u),c=F(),U(d.$$.fragment),h=F(),g=P("aside"),_=P("span"),y=j(k),T=F(),A.c(),C=F(),R.c(),N=F(),G=P("section"),B=P("h3"),q=j($),V=F(),U(K.$$.fragment),I(l,"id","provider-title"),I(a,"class","svelte-ly8en8"),I(i,"class","provider-choice svelte-ly8en8"),I(_,"class","eyebrow svelte-ly8en8"),I(_,"id","provider-status-title"),I(g,"class","provider-status svelte-ly8en8"),I(g,"aria-labelledby","provider-status-title"),I(n,"class","provider-panel svelte-ly8en8"),I(n,"aria-labelledby","provider-title"),I(B,"id","advanced-title"),I(B,"class","svelte-ly8en8"),I(G,"class","advanced svelte-ly8en8"),I(G,"aria-labelledby","advanced-title")},m(re,oe){ie&&ie.m(re,oe),O(re,e,oe),O(re,n,oe),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(i,c),z(d,i,null),w(n,h),w(n,g),w(g,_),w(_,y),w(g,T),ce[M].m(g,null),O(re,C,oe),he[D].m(re,oe),O(re,N,oe),O(re,G,oe),w(G,B),w(B,q),w(G,V),z(K,G,null),x=!0},p(re,oe){re[8]?ie?(ie.p(re,oe),oe&256&&p(ie,1)):(ie=Z6(re),ie.c(),p(ie,1),ie.m(e.parentNode,e)):ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()),(!x||oe&2048)&&r!==(r=re[11]("Provider")+"")&&Y(s,r),(!x||oe&2048)&&u!==(u=re[11]("Choose one provider. Selecting a hosted provider sends image content to that service for classification.")+"")&&Y(f,u);const Re={};oe&2048&&(Re.title=re[11]("AI image filtering provider")),oe&2048&&(Re.labelText=re[11]("AI image filtering provider")),oe&2048&&(Re.helperText=re[11]("HTTPS inspection must be enabled before GateSentry can inspect image bytes.")),oe&4&&(Re.onSaved=re[19]),d.$set(Re),(!x||oe&2048)&&k!==(k=re[11]("Selected provider status")+"")&&Y(y,k);let qe=M;M=ae(re),M===qe?ce[M].p(re,oe):(ue(),v(ce[qe],1,1,()=>{ce[qe]=null}),fe(),A=ce[M],A?A.p(re,oe):(A=ce[M]=X[M](re),A.c()),p(A,1),A.m(g,null));let Ce=D;D=ne(re),D===Ce?he[D].p(re,oe):(ue(),v(he[Ce],1,1,()=>{he[Ce]=null}),fe(),R=he[D],R?R.p(re,oe):(R=he[D]=ee[D](re),R.c()),p(R,1),R.m(N.parentNode,N)),(!x||oe&2048)&&$!==($=re[11]("Advanced")+"")&&Y(q,$);const Ze={};oe&134220800&&(Ze.$$scope={dirty:oe,ctx:re}),K.$set(Ze)},i(re){x||(p(ie),p(d.$$.fragment,re),p(A),p(R),p(K.$$.fragment,re),x=!0)},o(re){v(ie),v(d.$$.fragment,re),v(A),v(R),v(K.$$.fragment,re),x=!1},d(re){re&&(E(e),E(n),E(C),E(N),E(G)),ie&&ie.d(re),H(d),ce[M].d(),he[D].d(re),H(K)}}}function D_e(t){let e=t[11]("Dashboard")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function I_e(t){let e=t[11]("AI image filtering")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("AI image filtering")+"")&&Y(n,e)},d(i){i&&E(n)}}}function R_e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[D_e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[I_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&134219776&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&134219776&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function P_e(t){let e;return{c(){e=j("Alpha")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function N_e(t){let e,n,i,l,r;return n=new mr({props:{noTrailingSlash:!0,$$slots:{default:[R_e]},$$scope:{ctx:t}}}),l=new Rt({props:{type:"red",size:"sm",$$slots:{default:[P_e]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","breadcrumb-line svelte-ly8en8")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o&134219776&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o&134217728&&(u.$$scope={dirty:o,ctx:s}),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function B_e(t){let e=(t[1]?t[11]("Checking…"):t[11]("Refresh status"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l&2050&&e!==(e=(i[1]?i[11]("Checking…"):i[11]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function z_e(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[B_e]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.disabled=i[1]),l&134219778&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function H_e(t){let e,n;return e=new Nl({props:{title:t[11]("AI image filtering"),description:t[11]("Optionally classify image content seen through HTTPS inspection. External AI processing is disabled by default; images are sent only to the provider you select."),$$slots:{actions:[z_e],breadcrumb:[N_e],default:[L_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2048&&(r.title=i[11]("AI image filtering")),l&2048&&(r.description=i[11]("Optionally classify image content seen through HTTPS inspection. External AI processing is disabled by default; images are sent only to the provider you select.")),l&134221823&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ZO(t){if(!t||typeof t!="object")return"";const e=t.Value!=null?t.Value:t.value;return String(e||"").trim()}function uc(t){return t&&typeof t=="object"&&t.Configured!=null?!!t.Configured:ZO(t)!==""}function dr(t){switch(t){case"ok":return"green";case"unauthorized":return"magenta";case"unreachable":return"red";case"checking":return"cool-gray";default:return"gray"}}function U_e(t,e,n){let i,l,r,s,o,a,u;ct(t,ti,K=>n(11,a=K)),ct(t,Ln,K=>n(20,u=K));const f=[{value:"disabled",label:a("Disable")},{value:"grok",label:a("Enable Grok")},{value:"chatgpt",label:a("Enable ChatGPT")},{value:"local",label:a("Enable Local LLM")}],c={state:"checking",detail:""},d={state:"not_configured",detail:""};let h=null,g=!1,_="",k="disabled",y=!1,T=!1,M=!1,A=!1;async function C(){const[K,x,ie,X,ce]=await Promise.all([u.api.getSetting("ai_image_filtering_mode"),u.api.getSetting("ai_grok_api_key"),u.api.getSetting("ai_openai_api_key"),u.api.getSetting("ai_local_llm_url"),u.api.getSetting("ai_scanner_url")]);n(2,k=ZO(K)||"disabled"),n(3,y=uc(x)),n(4,T=uc(ie)),n(16,M=uc(X)),n(17,A=uc(ce))}function D(K,x){return Promise.race([K,new Promise((ie,X)=>setTimeout(()=>X(new Error(a("Status check timed out."))),x))])}async function R(){n(1,g=!0),n(8,_="");try{await C();const K=await D(u.api.doCall("/ai/status"),12e3);if(K&&typeof K=="object")n(0,h=K),n(2,k=K.mode||k);else throw new Error(a("The status response was not valid."))}catch(K){n(0,h=null),n(8,_=K instanceof Error&&K.message?K.message:a("AI provider status could not be checked."))}finally{n(1,g=!1)}}function N(K,x,ie,X){const ce=x==null?void 0:x[K];return ce&&typeof ce=="object"&&"state"in ce?ce:X?ie?c:{state:"unreachable",detail:a("Status check did not complete")}:d}function G(K,x,ie,X,ce){const ae=(K==null?void 0:K.mode)||x||"disabled";return ae==="disabled"?{state:"disabled",detail:a("Image filtering is off")}:ae==="grok"?ie:ae==="chatgpt"?X:ae==="local"?ce:d}function B(K){return a(K==="grok"?"Grok":K==="chatgpt"?"ChatGPT":K==="local"?"Local LLM":"Disabled")}function $(K){switch(K){case"ok":return a("Reachable");case"unauthorized":return a("Invalid key");case"unreachable":return a("Unreachable");case"not_configured":return a("Not configured");case"disabled":return a("Disabled");case"checking":return a("Checking…");default:return K}}sn(R);const q=()=>n(8,_=""),V=async K=>{n(2,k=K),await R()};return t.$$.update=()=>{t.$$.dirty&11&&n(7,i=N("grok",h,g,y)),t.$$.dirty&19&&n(6,l=N("chatgpt",h,g,T)),t.$$.dirty&65539&&n(5,r=N("local",h,g,M)),t.$$.dirty&131075&&n(10,s=N("legacy",h,g,A)),t.$$.dirty&229&&n(9,o=G(h,k,i,l,r))},[h,g,k,y,T,r,l,i,_,o,s,a,f,R,B,$,M,A,q,V]}class F_e extends Oe{constructor(e){super(),Ee(this,e,U_e,H_e,Se,{})}}function K6(t){let e,n;return e=new nn({props:{lowContrast:!0,kind:"error",title:t[8]("User not saved"),subtitle:t[5]}}),e.$on("close",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&256&&(r.title=i[8]("User not saved")),l&32&&(r.subtitle=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function G_e(t){let e,n,i,l;return e=new la({props:{id:"proxy-user-access-allow",value:"true",labelText:t[8]("Allow access")}}),i=new la({props:{id:"proxy-user-access-deny",value:"false",labelText:t[8]("Deny access")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&256&&(o.labelText=r[8]("Allow access")),e.$set(o);const a={};s&256&&(a.labelText=r[8]("Deny access")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function V_e(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[5]&&K6(t);function h(M){t[13](M)}let g={id:"proxy-user-name",labelText:t[8]("Username"),helperText:t[1]?t[8]("Usernames cannot be changed."):t[8]("At least 3 characters."),disabled:!!t[1]||t[0],invalid:t[7],invalidText:t[8]("Enter a username with at least 3 characters."),"data-modal-primary-focus":!0};t[2]!==void 0&&(g.value=t[2]),i=new ei({props:g}),xe.push(()=>At(i,"value",h));function _(M){t[14](M)}let k={id:"proxy-user-password",labelText:t[1]?t[8]("New password"):t[8]("Password"),helperText:t[1]?t[8]("Leave blank to keep the current password. New passwords need at least 10 characters."):t[8]("At least 10 characters."),type:"password",disabled:t[0],invalid:t[6],invalidText:t[8]("Enter a password with at least 10 characters.")};t[3]!==void 0&&(k.value=t[3]),s=new ei({props:k}),xe.push(()=>At(s,"value",_));function y(M){t[15](M)}let T={legendText:t[8]("Internet access"),orientation:"vertical",disabled:t[0],$$slots:{default:[G_e]},$$scope:{ctx:t}};return t[4]!==void 0&&(T.selected=t[4]),u=new n5({props:T}),xe.push(()=>At(u,"selected",y)),{c(){e=P("div"),d&&d.c(),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),I(e,"class","user-form svelte-1t7h4x6")},m(M,A){O(M,e,A),d&&d.m(e,null),w(e,n),z(i,e,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),c=!0},p(M,[A]){M[5]?d?(d.p(M,A),A&32&&p(d,1)):(d=K6(M),d.c(),p(d,1),d.m(e,n)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const C={};A&256&&(C.labelText=M[8]("Username")),A&258&&(C.helperText=M[1]?M[8]("Usernames cannot be changed."):M[8]("At least 3 characters.")),A&3&&(C.disabled=!!M[1]||M[0]),A&128&&(C.invalid=M[7]),A&256&&(C.invalidText=M[8]("Enter a username with at least 3 characters.")),!l&&A&4&&(l=!0,C.value=M[2],Ct(()=>l=!1)),i.$set(C);const D={};A&258&&(D.labelText=M[1]?M[8]("New password"):M[8]("Password")),A&258&&(D.helperText=M[1]?M[8]("Leave blank to keep the current password. New passwords need at least 10 characters."):M[8]("At least 10 characters.")),A&1&&(D.disabled=M[0]),A&64&&(D.invalid=M[6]),A&256&&(D.invalidText=M[8]("Enter a password with at least 10 characters.")),!o&&A&8&&(o=!0,D.value=M[3],Ct(()=>o=!1)),s.$set(D);const R={};A&256&&(R.legendText=M[8]("Internet access")),A&1&&(R.disabled=M[0]),A&1048832&&(R.$$scope={dirty:A,ctx:M}),!f&&A&16&&(f=!0,R.selected=M[4],Ct(()=>f=!1)),u.$set(R)},i(M){c||(p(d),p(i.$$.fragment,M),p(s.$$.fragment,M),p(u.$$.fragment,M),c=!0)},o(M){v(d),v(i.$$.fragment,M),v(s.$$.fragment,M),v(u.$$.fragment,M),c=!1},d(M){M&&E(e),d&&d.d(),H(i),H(s),H(u)}}}function W_e(t,e,n){let i,l,r,s,o;ct(t,ti,R=>n(8,s=R)),ct(t,Ln,R=>n(17,o=R));const a=on();let{user:u=null}=e,{saving:f=!1}=e,c,d="",h="",g="false",_=!1,k="";function y(R){return(R==null?void 0:R.error)??(R==null?void 0:R.Error)??s("The user could not be saved.")}async function T(){if(n(11,_=!0),n(5,k=""),!r||f)return;n(0,f=!0);const R=!!u,N=(u==null?void 0:u.username)??d.trim();try{const G={username:N,password:h,allowaccess:g==="true"},B=R?await o.api.updateUser(G):await o.api.createUser(G);if(!(B!=null&&B.ok)){n(5,k=y(B));return}a("saved",{username:N,editing:R}),a(R?"updateuser":"createuser",{username:N})}catch(G){n(5,k=G instanceof Error&&G.message?G.message:s("The user could not be saved."))}finally{n(0,f=!1)}}const M=()=>n(5,k="");function A(R){d=R,n(2,d),n(1,u),n(10,c)}function C(R){h=R,n(3,h),n(1,u),n(10,c)}function D(R){g=R,n(4,g),n(1,u),n(10,c)}return t.$$set=R=>{"user"in R&&n(1,u=R.user),"saving"in R&&n(0,f=R.saving)},t.$$.update=()=>{t.$$.dirty&1026&&u!==c&&(n(10,c=u),n(2,d=(u==null?void 0:u.username)??""),n(3,h=""),n(4,g=u!=null&&u.allowaccess?"true":"false"),n(11,_=!1),n(5,k="")),t.$$.dirty&2052&&n(7,i=_&&d.trim().length<3),t.$$.dirty&2058&&n(6,l=_&&(!u||h.length>0)&&h.length<10),t.$$.dirty&14&&(r=d.trim().length>=3&&(u&&h.length===0||h.length>=10))},[f,u,d,h,g,k,l,i,s,T,c,_,M,A,C,D]}class j_e extends Oe{constructor(e){super(),Ee(this,e,W_e,V_e,Se,{user:1,saving:0,submit:9})}get submit(){return this.$$.ctx[9]}}function J6(t){let e,n;return e=new nn({props:{kind:"error",title:t[11]("Proxy users unavailable"),subtitle:t[2]}}),e.$on("close",t[22]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Proxy users unavailable")),l[0]&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Q6(t){let e,n;return e=new nn({props:{kind:"success",title:t[11]("Proxy users updated"),subtitle:t[3]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Proxy users updated")),l[0]&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $_e(t){let e=t[11]("Refresh")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Refresh")+"")&&Y(n,e)},d(i){i&&E(n)}}}function q_e(t){let e,n;return e=new ml({props:{sortable:!0,size:"compact",headers:t[13],rows:t[10],$$slots:{cell:[t0e,({row:i,cell:l})=>({33:i,34:l}),({row:i,cell:l})=>[0,(i?4:0)|(l?8:0)]]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1024&&(r.rows=i[10]),l[0]&2048|l[1]&28&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Y_e(t){let e,n,i=t[11]("No proxy users yet")+"",l,r,s,o=t[11]("Add a credential before requiring proxy sign-in so clients are not locked out.")+"",a,u,f,c;return f=new bt({props:{size:"small",icon:Rs,$$slots:{default:[n0e]},$$scope:{ctx:t}}}),f.$on("click",t[16]),{c(){e=P("div"),n=P("h4"),l=j(i),r=F(),s=P("p"),a=j(o),u=F(),U(f.$$.fragment),I(s,"class","svelte-1tequ64"),I(e,"class","state-panel empty-state svelte-1tequ64")},m(d,h){O(d,e,h),w(e,n),w(n,l),w(e,r),w(e,s),w(s,a),w(e,u),z(f,e,null),c=!0},p(d,h){(!c||h[0]&2048)&&i!==(i=d[11]("No proxy users yet")+"")&&Y(l,i),(!c||h[0]&2048)&&o!==(o=d[11]("Add a credential before requiring proxy sign-in so clients are not locked out.")+"")&&Y(a,o);const g={};h[0]&2048|h[1]&16&&(g.$$scope={dirty:h,ctx:d}),f.$set(g)},i(d){c||(p(f.$$.fragment,d),c=!0)},o(d){v(f.$$.fragment,d),c=!1},d(d){d&&E(e),H(f)}}}function Z_e(t){let e,n,i;return n=new Wi({props:{description:t[11]("Loading proxy users…")}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","state-panel svelte-1tequ64")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&2048&&(s.description=l[11]("Loading proxy users…")),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function X_e(t){let e=t[34].value+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&8&&e!==(e=i[34].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function K_e(t){let e,n;return e=new Rt({props:{type:t[34].value?"green":"warm-gray",size:"sm",$$slots:{default:[x_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&8&&(r.type=i[34].value?"green":"warm-gray"),l[0]&2048|l[1]&24&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function J_e(t){let e=p3(Number(t[34].value)||0)+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&8&&e!==(e=p3(Number(i[34].value)||0)+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function Q_e(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[11]("User actions"),$$slots:{default:[e0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.iconDescription=i[11]("User actions")),l[0]&2048|l[1]&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function x_e(t){let e=(t[34].value?t[11]("Allowed"):t[11]("Paused"))+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048|l[1]&8&&e!==(e=(i[34].value?i[11]("Allowed"):i[11]("Paused"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function e0e(t){let e,n,i,l,r,s;function o(){return t[24](t[33])}e=new Al({props:{text:t[11]("Edit")}}),e.$on("click",o);function a(){return t[25](t[33])}i=new Al({props:{text:t[33].allowaccess?t[11]("Pause internet access"):t[11]("Allow internet access")}}),i.$on("click",a);function u(){return t[26](t[33])}return r=new Al({props:{danger:!0,text:t[11]("Delete")}}),r.$on("click",u),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,l,c),z(r,f,c),s=!0},p(f,c){t=f;const d={};c[0]&2048&&(d.text=t[11]("Edit")),e.$set(d);const h={};c[0]&2048|c[1]&4&&(h.text=t[33].allowaccess?t[11]("Pause internet access"):t[11]("Allow internet access")),i.$set(h);const g={};c[0]&2048&&(g.text=t[11]("Delete")),r.$set(g)},i(f){s||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(r.$$.fragment,f),s=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(r.$$.fragment,f),s=!1},d(f){f&&(E(n),E(l)),H(e,f),H(i,f),H(r,f)}}}function t0e(t){let e,n,i,l;const r=[Q_e,J_e,K_e,X_e],s=[];function o(a,u){return a[34].key==="actions"?0:a[34].key==="dataconsumed"?1:a[34].key==="allowaccess"?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function n0e(t){let e=t[11]("Add proxy user")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add proxy user")+"")&&Y(n,e)},d(i){i&&E(n)}}}function i0e(t){let e,n,i,l,r,s=t[11]("Proxy authentication")+"",o,a,u,f=t[11]("When required, the proxy challenges every new connection for one of the credentials below. A user's access setting can then allow or pause internet use without deleting the credential.")+"",c,d,h,g,_,k,y,T,M=t[11]("Credentials")+"",A,C,D,R=t[11]("Manage proxy sign-in and each user's immediate internet access.")+"",N,G,B,$,q,V,K,x=t[2]&&J6(t),ie=t[3]&&Q6(t);h=new Ql({props:{keyName:"EnableUsers",type:"radio",title:t[11]("Require proxy sign-in"),labelText:t[11]("Require proxy sign-in"),helperText:t[11]("This applies to proxy traffic only; DNS clients do not send proxy credentials."),orientation:"vertical",radioOptions:t[12]}}),B=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[$_e]},$$scope:{ctx:t}}}),B.$on("click",t[14]);const X=[Z_e,Y_e,q_e],ce=[];function ae(ee,he){return ee[1]&&ee[0].length===0?0:ee[0].length===0?1:2}return q=ae(t),V=ce[q]=X[q](t),{c(){x&&x.c(),e=F(),ie&&ie.c(),n=F(),i=P("section"),l=P("div"),r=P("h3"),o=j(s),a=F(),u=P("p"),c=j(f),d=F(),U(h.$$.fragment),g=F(),_=P("section"),k=P("div"),y=P("div"),T=P("h3"),A=j(M),C=F(),D=P("p"),N=j(R),G=F(),U(B.$$.fragment),$=F(),V.c(),I(r,"id","proxy-enforcement-title"),I(u,"class","svelte-1tequ64"),I(i,"class","panel enforcement svelte-1tequ64"),I(i,"aria-labelledby","proxy-enforcement-title"),I(T,"id","proxy-users-list-title"),I(D,"class","svelte-1tequ64"),I(k,"class","section-head svelte-1tequ64"),I(_,"class","users-panel svelte-1tequ64"),I(_,"aria-labelledby","proxy-users-list-title")},m(ee,he){x&&x.m(ee,he),O(ee,e,he),ie&&ie.m(ee,he),O(ee,n,he),O(ee,i,he),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(i,d),z(h,i,null),O(ee,g,he),O(ee,_,he),w(_,k),w(k,y),w(y,T),w(T,A),w(y,C),w(y,D),w(D,N),w(k,G),z(B,k,null),w(_,$),ce[q].m(_,null),K=!0},p(ee,he){ee[2]?x?(x.p(ee,he),he[0]&4&&p(x,1)):(x=J6(ee),x.c(),p(x,1),x.m(e.parentNode,e)):x&&(ue(),v(x,1,1,()=>{x=null}),fe()),ee[3]?ie?(ie.p(ee,he),he[0]&8&&p(ie,1)):(ie=Q6(ee),ie.c(),p(ie,1),ie.m(n.parentNode,n)):ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()),(!K||he[0]&2048)&&s!==(s=ee[11]("Proxy authentication")+"")&&Y(o,s),(!K||he[0]&2048)&&f!==(f=ee[11]("When required, the proxy challenges every new connection for one of the credentials below. A user's access setting can then allow or pause internet use without deleting the credential.")+"")&&Y(c,f);const ne={};he[0]&2048&&(ne.title=ee[11]("Require proxy sign-in")),he[0]&2048&&(ne.labelText=ee[11]("Require proxy sign-in")),he[0]&2048&&(ne.helperText=ee[11]("This applies to proxy traffic only; DNS clients do not send proxy credentials.")),h.$set(ne),(!K||he[0]&2048)&&M!==(M=ee[11]("Credentials")+"")&&Y(A,M),(!K||he[0]&2048)&&R!==(R=ee[11]("Manage proxy sign-in and each user's immediate internet access.")+"")&&Y(N,R);const re={};he[0]&2&&(re.disabled=ee[1]),he[0]&2048|he[1]&16&&(re.$$scope={dirty:he,ctx:ee}),B.$set(re);let oe=q;q=ae(ee),q===oe?ce[q].p(ee,he):(ue(),v(ce[oe],1,1,()=>{ce[oe]=null}),fe(),V=ce[q],V?V.p(ee,he):(V=ce[q]=X[q](ee),V.c()),p(V,1),V.m(_,null))},i(ee){K||(p(x),p(ie),p(h.$$.fragment,ee),p(B.$$.fragment,ee),p(V),K=!0)},o(ee){v(x),v(ie),v(h.$$.fragment,ee),v(B.$$.fragment,ee),v(V),K=!1},d(ee){ee&&(E(e),E(n),E(i),E(g),E(_)),x&&x.d(ee),ie&&ie.d(ee),H(h),H(B),ce[q].d()}}}function l0e(t){let e=t[11]("Dashboard")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function r0e(t){let e=t[11]("Proxy users")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Proxy users")+"")&&Y(n,e)},d(i){i&&E(n)}}}function s0e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[l0e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[r0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&2048|s[1]&16&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&2048|s[1]&16&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function o0e(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[s0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&16&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function a0e(t){let e=t[11]("Add proxy user")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add proxy user")+"")&&Y(n,e)},d(i){i&&E(n)}}}function u0e(t){let e,n;return e=new bt({props:{size:"small",icon:Rs,$$slots:{default:[a0e]},$$scope:{ctx:t}}}),e.$on("click",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&16&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function f0e(t){let e,n,i;function l(s){t[28](s)}let r={user:t[7]};return t[5]!==void 0&&(r.saving=t[5]),e=new j_e({props:r}),t[27](e),xe.push(()=>At(e,"saving",l)),e.$on("saved",t[18]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o[0]&128&&(a.user=s[7]),!n&&o[0]&32&&(n=!0,a.saving=s[5],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){t[27](null),H(e,s)}}}function c0e(t){var c;let e,n=t[11]("Delete proxy user")+"",i,l,r,s=(((c=t[8])==null?void 0:c.username)??"")+"",o,a,u=t[11]("Their current proxy credentials will stop working.")+"",f;return{c(){e=P("p"),i=j(n),l=F(),r=P("strong"),o=j(s),a=j(`? - `),f=j(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h[0]&2048&&n!==(n=d[11]("Delete proxy user")+"")&&Y(i,n),h[0]&256&&s!==(s=(((g=d[8])==null?void 0:g.username)??"")+"")&&Y(o,s),h[0]&2048&&u!==(u=d[11]("Their current proxy credentials will stop working.")+"")&&Y(f,u)},d(d){d&&E(e)}}}function d0e(t){let e,n,i,l,r,s,o;e=new Nl({props:{title:t[11]("Proxy users"),description:t[11]("Proxy users are sign-in credentials for devices and browsers that connect through the GateSentry proxy. They are separate from administrator accounts used to manage this dashboard."),$$slots:{actions:[u0e],breadcrumb:[o0e],default:[i0e]},$$scope:{ctx:t}}});function a(f){t[29](f)}let u={title:t[7]?t[11]("Edit proxy user"):t[11]("Add proxy user"),label:t[11]("Proxy access"),primaryButtonText:t[5]?t[11]("Saving…"):t[7]?t[11]("Save changes"):t[11]("Create user"),secondaryButtonText:t[11]("Cancel"),primaryButtonDisabled:t[5],shouldSubmitOnEnter:!0,hasForm:!0,preventCloseOnClickOutside:!0,$$slots:{default:[f0e]},$$scope:{ctx:t}};return t[4]!==void 0&&(u.open=t[4]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("close",t[15]),i.$on("submit",t[30]),s=new Uc({props:{open:!!t[8],title:t[11]("Delete proxy user?"),label:t[11]("Confirm deletion"),primaryButtonText:t[9]?t[11]("Deleting…"):t[11]("Delete user"),secondaryButtonText:t[11]("Cancel"),primaryButtonDisabled:t[9],danger:!0,size:"xs",preventCloseOnClickOutside:!0,$$slots:{default:[c0e]},$$scope:{ctx:t}}}),s.$on("close",t[31]),s.$on("submit",t[21]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,c){const d={};c[0]&2048&&(d.title=f[11]("Proxy users")),c[0]&2048&&(d.description=f[11]("Proxy users are sign-in credentials for devices and browsers that connect through the GateSentry proxy. They are separate from administrator accounts used to manage this dashboard.")),c[0]&3087|c[1]&16&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c[0]&2176&&(h.title=f[7]?f[11]("Edit proxy user"):f[11]("Add proxy user")),c[0]&2048&&(h.label=f[11]("Proxy access")),c[0]&2208&&(h.primaryButtonText=f[5]?f[11]("Saving…"):f[7]?f[11]("Save changes"):f[11]("Create user")),c[0]&2048&&(h.secondaryButtonText=f[11]("Cancel")),c[0]&32&&(h.primaryButtonDisabled=f[5]),c[0]&224|c[1]&16&&(h.$$scope={dirty:c,ctx:f}),!l&&c[0]&16&&(l=!0,h.open=f[4],Ct(()=>l=!1)),i.$set(h);const g={};c[0]&256&&(g.open=!!f[8]),c[0]&2048&&(g.title=f[11]("Delete proxy user?")),c[0]&2048&&(g.label=f[11]("Confirm deletion")),c[0]&2560&&(g.primaryButtonText=f[9]?f[11]("Deleting…"):f[11]("Delete user")),c[0]&2048&&(g.secondaryButtonText=f[11]("Cancel")),c[0]&512&&(g.primaryButtonDisabled=f[9]),c[0]&2304|c[1]&16&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}function h0e(t,e,n){let i,l,r;ct(t,ti,ee=>n(11,l=ee)),ct(t,Ln,ee=>n(32,r=ee));const s=[{value:"true",label:l("Require a proxy user")},{value:"false",label:l("Do not require a proxy user")}];let o=[],a=!0,u="",f="",c=!1,d=!1,h=null,g=null,_=null,k=!1;const y=[{key:"user",value:l("Username")},{key:"dataconsumed",value:l("Data consumed")},{key:"allowaccess",value:l("Access")},{key:"actions",value:l("Actions")}];async function T(){n(1,a=!0),n(2,u="");try{const ee=await r.api.getUsers();n(0,o=Array.isArray(ee==null?void 0:ee.users)?ee.users:[])}catch(ee){n(2,u=ee instanceof Error&&ee.message?ee.message:l("Proxy users could not be loaded."))}finally{n(1,a=!1)}}function M(){n(4,c=!1),n(7,g=null),n(5,d=!1)}function A(){n(7,g=null),n(4,c=!0)}function C(ee){n(7,g=o.find(he=>he.username===ee)??null),n(4,c=!0)}async function D(ee){M(),n(3,f=ee.detail.editing?l("Proxy user updated."):l("Proxy user created.")),await T()}async function R(ee,he){n(2,u=""),n(3,f="");try{const ne=await r.api.updateUser({username:ee,password:"",allowaccess:he});if(!(ne!=null&&ne.ok))throw new Error((ne==null?void 0:ne.error)??(ne==null?void 0:ne.Error)??l("Access could not be updated."));n(3,f=l(he?"Internet access enabled.":"Internet access paused.")),await T()}catch(ne){n(2,u=ne instanceof Error&&ne.message?ne.message:l("Access could not be updated."))}}function N(ee){n(8,_=o.find(he=>he.username===ee)??null)}async function G(){if(!_||k)return;n(9,k=!0),n(2,u=""),n(3,f="");const ee=_.username;try{const he=await r.api.deleteUser(ee);if((he==null?void 0:he.ok)===!1)throw new Error((he==null?void 0:he.error)??(he==null?void 0:he.Error)??l("The proxy user could not be deleted."));n(8,_=null),n(3,f=l("Proxy user deleted.")),await T()}catch(he){n(2,u=he instanceof Error&&he.message?he.message:l("The proxy user could not be deleted."))}finally{n(9,k=!1)}}sn(T);const B=()=>n(2,u=""),$=()=>n(3,f=""),q=ee=>C(ee.id),V=ee=>R(ee.id,!ee.allowaccess),K=ee=>N(ee.id);function x(ee){xe[ee?"unshift":"push"](()=>{h=ee,n(6,h)})}function ie(ee){d=ee,n(5,d)}function X(ee){c=ee,n(4,c)}const ce=()=>h==null?void 0:h.submit(),ae=()=>{k||n(8,_=null)};return t.$$.update=()=>{t.$$.dirty[0]&1&&n(10,i=o.map(ee=>({id:ee.username,user:ee.username,dataconsumed:ee.dataconsumed??0,allowaccess:ee.allowaccess})))},[o,a,u,f,c,d,h,g,_,k,i,l,s,y,T,M,A,C,D,R,N,G,B,$,q,V,K,x,ie,X,ce,ae]}class m0e extends Oe{constructor(e){super(),Ee(this,e,h0e,d0e,Se,{},null,[-1,-1])}}function x6(t,e,n){const i=t.slice();return i[7]=e[n],i}function ey(t){let e,n=t[7].description+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","category-note svelte-1orxodp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&1&&n!==(n=l[7].description+"")&&Y(i,n)},d(l){l&&E(e)}}}function ty(t,e){let n,i,l,r,s,o=ny(e[7])+"",a,u,f,c;function d(...g){return e[5](e[7],...g)}l=new FT({props:{labelText:e[7].name,checked:e[1].includes(e[7].id),disabled:e[2]}}),l.$on("check",d);let h=!e[3]&&ey(e);return{key:t,first:null,c(){n=P("div"),i=P("div"),U(l.$$.fragment),r=F(),s=P("span"),a=j(o),u=F(),h&&h.c(),f=F(),I(s,"class","category-count svelte-1orxodp"),I(i,"class","category-line svelte-1orxodp"),I(n,"class","category-item svelte-1orxodp"),this.first=n},m(g,_){O(g,n,_),w(n,i),z(l,i,null),w(i,r),w(i,s),w(s,a),w(n,u),h&&h.m(n,null),w(n,f),c=!0},p(g,_){e=g;const k={};_&1&&(k.labelText=e[7].name),_&3&&(k.checked=e[1].includes(e[7].id)),_&4&&(k.disabled=e[2]),l.$set(k),(!c||_&1)&&o!==(o=ny(e[7])+"")&&Y(a,o),e[3]?h&&(h.d(1),h=null):h?h.p(e,_):(h=ey(e),h.c(),h.m(n,f))},i(g){c||(p(l.$$.fragment,g),c=!0)},o(g){v(l.$$.fragment,g),c=!1},d(g){g&&E(n),H(l),h&&h.d()}}}function g0e(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[7].id;for(let o=0;od!==f))}const u=(f,c)=>a(f.id,c.detail);return t.$$set=f=>{"categories"in f&&n(0,i=f.categories),"selection"in f&&n(1,l=f.selection),"disabled"in f&&n(2,r=f.disabled),"compact"in f&&n(3,s=f.compact)},[i,l,r,s,a,u]}class v_ extends Oe{constructor(e){super(),Ee(this,e,_0e,g0e,Se,{categories:0,selection:1,disabled:2,compact:3})}}function iy(t,e,n){const i=t.slice();return i[10]=e[n],i}function p0e(t){let e;return{c(){e=j("Add")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ly(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[10];for(let o=0;oAt(n,"value",u)),n.$on("keydown",t[7]),r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[p0e]},$$scope:{ctx:t}}}),r.$on("click",t[4]);let c=t[0].length&&ly(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),c&&c.c(),o=je(),I(e,"class","list-entry svelte-2r6im7")},m(d,h){O(d,e,h),z(n,e,null),w(e,l),z(r,e,null),O(d,s,h),c&&c.m(d,h),O(d,o,h),a=!0},p(d,[h]){const g={};h&2&&(g.labelText=d[1]),!i&&h&8&&(i=!0,g.value=d[3],Ct(()=>i=!1)),n.$set(g);const _={};h&8192&&(_.$$scope={dirty:h,ctx:d}),r.$set(_),d[0].length?c?(c.p(d,h),h&1&&p(c,1)):(c=ly(d),c.c(),p(c,1),c.m(o.parentNode,o)):c&&(ue(),v(c,1,1,()=>{c=null}),fe())},i(d){a||(p(n.$$.fragment,d),p(r.$$.fragment,d),p(c),a=!0)},o(d){v(n.$$.fragment,d),v(r.$$.fragment,d),v(c),a=!1},d(d){d&&(E(e),E(s),E(o)),H(n),H(r),c&&c.d(d)}}}function k0e(t){let e=t.trim().toLowerCase();const n=e.indexOf("://");return n>=0&&(e=e.slice(n+3)),e=e.split(/[/?#]/)[0].replace(/:\d+$/,"").replace(/\.$/,""),e}function w0e(t,e,n){let{entries:i=[]}=e,{label:l="Domain"}=e,{tagType:r="outline"}=e;const s=on();let o="";function a(){const h=o.split(/[\s,]+/).map(k0e).filter(Boolean),g=[...i];for(const _ of h)g.includes(_)||g.push(_);n(3,o=""),g.length!==i.length&&s("change",g)}function u(h){s("change",i.filter(g=>g!==h))}function f(h){o=h,n(3,o)}const c=h=>h.key==="Enter"&&a(),d=h=>u(h);return t.$$set=h=>{"entries"in h&&n(0,i=h.entries),"label"in h&&n(1,l=h.label),"tagType"in h&&n(2,r=h.tagType)},[i,l,r,o,a,u,f,c,d]}class k_ extends Oe{constructor(e){super(),Ee(this,e,w0e,v0e,Se,{entries:0,label:1,tagType:2})}}const Ji="default",XO=[{id:"0",text:"Sunday"},{id:"1",text:"Monday"},{id:"2",text:"Tuesday"},{id:"3",text:"Wednesday"},{id:"4",text:"Thursday"},{id:"5",text:"Friday"},{id:"6",text:"Saturday"}],y0e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],rg="custom";function fc(){return{id:"",name:"",description:"",blocked_categories:[],blocked_domains:[],allowed_domains:[],rules:[],safe_search:!1,users:[],priority:0}}function KO(){return{id:"",name:"",enabled:!0,action:"block",target:{all_traffic:!1,domains:[],categories:[]},url_regexes:[],blocked_content_types:[],schedule:null,users:[],domain_draft:"",url_draft:"",content_type_draft:""}}function T0e(t){return t?{timezone:t.timezone||"UTC",weekdays:[...t.weekdays||[]],windows:(t.windows||[]).map(e=>({from:e.from,to:e.to})),...t.preset?{preset:t.preset}:{}}:null}function S0e(t){var e,n,i;return{id:t.id||"",name:t.name||"",enabled:t.enabled!==!1,action:t.action==="allow"?"allow":"block",target:{all_traffic:!!((e=t.target)!=null&&e.all_traffic),domains:[...((n=t.target)==null?void 0:n.domains)||[]],categories:[...((i=t.target)==null?void 0:i.categories)||[]]},url_regexes:[...t.url_regexes||[]],blocked_content_types:[...t.blocked_content_types||[]],schedule:T0e(t.schedule),users:[...t.users||[]],domain_draft:"",url_draft:"",content_type_draft:""}}function fu(t){return{id:t.id||"",name:t.name||"",description:t.description||"",blocked_categories:[...t.blocked_categories||[]],blocked_domains:[...t.blocked_domains||[]],allowed_domains:[...t.allowed_domains||[]],rules:(t.rules||[]).map(S0e),safe_search:!!t.safe_search,users:[...t.users||[]],priority:t.priority||0}}function E0e(t){return{id:t.id,name:t.name.trim(),description:t.description,blocked_categories:t.blocked_categories,blocked_domains:t.blocked_domains,allowed_domains:t.allowed_domains,safe_search:t.safe_search,users:t.users,priority:t.priority,rules:t.rules.map(e=>({id:e.id,name:e.name.trim(),enabled:e.enabled,action:e.action,target:e.target,url_regexes:e.url_regexes,blocked_content_types:e.blocked_content_types,schedule:e.schedule,users:e.users}))}}function O0e(t){return!(t!=null&&t.length)||t.length>=7?"":[...t].sort((e,n)=>e-n).map(e=>y0e[e]).filter(Boolean).join(", ")}function vd(t){if(!t)return"Always";const e=(t.windows||[]).map(i=>i.from+"-"+i.to).join(", "),n=O0e(t.weekdays);return e+(n?" "+n:" every day")}function M0e(t,e){if(t.all_traffic)return"all traffic";const n=[...t.categories.map(e),...t.domains];return n.length?n.length>3?n.slice(0,3).join(", ")+" and "+(n.length-3)+" more":n.join(", "):"nothing yet"}function sy(t,e){let n=(t.action==="allow"?"Allow ":"Block ")+M0e(t.target,e);return t.url_regexes.length&&(n+=" when the URL matches "+t.url_regexes.join(" or ")),t.blocked_content_types.length&&(n+=(t.url_regexes.length?" or the response is ":" when the response is ")+t.blocked_content_types.join(", ")),t.schedule&&(n+=", "+vd(t.schedule)),t.users.length&&(n+=", for "+t.users.join(", ")),n}function oy(t){return t.url_regexes.length>0||t.blocked_content_types.length>0||t.users.length>0}function kd(t){return t.action==="block"&&t.target.all_traffic&&!!t.schedule&&t.url_regexes.length===0&&t.blocked_content_types.length===0&&t.users.length===0}function C0e(t,e){var i;const n=KO();return n.name="Bedtime",n.target.all_traffic=!0,n.schedule={timezone:t,weekdays:e?[...e.weekdays]:[],windows:(i=e==null?void 0:e.windows)!=null&&i.length?e.windows.map(l=>({from:l.from,to:l.to})):[{from:"21:00",to:"07:00"}]},n}function A0e(t){const e=t.rules.filter(kd);return t.users.length>0||t.rules.length>e.length||e.length>1}function ay(t,e){const n=[];if(t.blocked_categories.length){const r=t.blocked_categories.map(e);n.push("Blocks "+(r.length>3?r.slice(0,3).join(", ")+" and "+(r.length-3)+" more":r.join(", ")))}t.blocked_domains.length&&n.push(t.blocked_domains.length+" blocked site"+(t.blocked_domains.length===1?"":"s")),t.allowed_domains.length&&n.push(t.allowed_domains.length+" always-allowed site"+(t.allowed_domains.length===1?"":"s")),t.safe_search&&n.push("Safe search");const i=t.rules.find(r=>r.enabled&&kd(r));i&&n.push("Bedtime "+vd(i.schedule));const l=t.rules.filter(r=>!kd(r)).length;return l&&n.push(l+" custom rule"+(l===1?"":"s")),n.length?n.join(" · "):"Blocks nothing of its own"}function uy(t,e,n){const i=t.slice();return i[62]=e[n],i[63]=e,i[64]=n,i}function fy(t,e,n){const i=t.slice();return i[65]=e[n],i}function cy(t,e,n){const i=t.slice();return i[68]=e[n],i}function dy(t,e,n){const i=t.slice();return i[71]=e[n],i}function L0e(t){let e,n,i,l,r;return l=new k_({props:{label:"Block a domain",entries:t[0].blocked_domains,tagType:"red"}}),l.$on("change",t[30]),{c(){e=P("fieldset"),n=P("legend"),n.textContent="Blocked domains",i=F(),U(l.$$.fragment),I(n,"class","field-label svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(s,o){O(s,e,o),w(e,n),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o[0]&1&&(a.entries=s[0].blocked_domains),l.$set(a)},i(s){r||(p(l.$$.fragment,s),r=!0)},o(s){v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(l)}}}function D0e(t){let e,n,i,l,r,s,o;return l=new k_({props:{label:"Allow a domain",entries:t[0].allowed_domains,tagType:"green"}}),l.$on("change",t[31]),{c(){e=P("fieldset"),n=P("legend"),n.textContent="Always allowed domains",i=F(),U(l.$$.fragment),r=F(),s=P("p"),s.textContent="Always reachable, even if a blocked category lists it.",I(n,"class","field-label svelte-r46cq7"),I(s,"class","field-note svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(a,u){O(a,e,u),w(e,n),w(e,i),z(l,e,null),w(e,r),w(e,s),o=!0},p(a,u){const f={};u[0]&1&&(f.entries=a[0].allowed_domains),l.$set(f)},i(a){o||(p(l.$$.fragment,a),o=!0)},o(a){v(l.$$.fragment,a),o=!1},d(a){a&&E(e),H(l)}}}function I0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[L0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[D0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function R0e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M;function A(N){t[28](N)}let C={labelText:"Name",placeholder:"Kids"};t[0].name!==void 0&&(C.value=t[0].name),l=new ei({props:C}),xe.push(()=>At(l,"value",A)),d=new v_({props:{categories:t[1],selection:t[0].blocked_categories}}),d.$on("change",t[29]),g=new Ac({props:{$$slots:{default:[I0e]},$$scope:{ctx:t}}});function D(N){t[32](N)}let R={labelText:"Safe search",labelA:"Off",labelB:"Google, Bing, DuckDuckGo, and YouTube restricted mode"};return t[0].safe_search!==void 0&&(R.toggled=t[0].safe_search),y=new Ad({props:R}),xe.push(()=>At(y,"toggled",D)),{c(){e=P("p"),e.textContent="Name the policy, choose broad categories, and add site exceptions.",n=F(),i=P("div"),U(l.$$.fragment),s=F(),o=P("fieldset"),a=P("legend"),a.textContent="Blocked categories",u=F(),f=P("p"),f.textContent="Lists of sites that update themselves.",c=F(),U(d.$$.fragment),h=F(),U(g.$$.fragment),_=F(),k=P("div"),U(y.$$.fragment),I(e,"class","section-description svelte-r46cq7"),I(i,"class","name-field svelte-r46cq7"),I(a,"class","field-label svelte-r46cq7"),I(f,"class","field-note svelte-r46cq7"),I(o,"class","field svelte-r46cq7"),I(k,"class","field svelte-r46cq7")},m(N,G){O(N,e,G),O(N,n,G),O(N,i,G),z(l,i,null),O(N,s,G),O(N,o,G),w(o,a),w(o,u),w(o,f),w(o,c),z(d,o,null),O(N,h,G),z(g,N,G),O(N,_,G),O(N,k,G),z(y,k,null),M=!0},p(N,G){const B={};!r&&G[0]&1&&(r=!0,B.value=N[0].name,Ct(()=>r=!1)),l.$set(B);const $={};G[0]&2&&($.categories=N[1]),G[0]&1&&($.selection=N[0].blocked_categories),d.$set($);const q={};G[0]&1|G[2]&4096&&(q.$$scope={dirty:G,ctx:N}),g.$set(q);const V={};!T&&G[0]&1&&(T=!0,V.toggled=N[0].safe_search,Ct(()=>T=!1)),y.$set(V)},i(N){M||(p(l.$$.fragment,N),p(d.$$.fragment,N),p(g.$$.fragment,N),p(y.$$.fragment,N),M=!0)},o(N){v(l.$$.fragment,N),v(d.$$.fragment,N),v(g.$$.fragment,N),v(y.$$.fragment,N),M=!1},d(N){N&&(E(e),E(n),E(i),E(s),E(o),E(h),E(_),E(k)),H(l),H(d),H(g,N),H(y)}}}function hy(t){var g,_;let e,n,i,l,r,s,o,a,u,f=(t[8].schedule.timezone||"UTC")+"",c,d,h;return n=new Lc({props:{size:"sm",labelText:"From",placeholder:"HH:MM",pattern:wd,value:((g=t[8].schedule.windows[0])==null?void 0:g.from)||""}}),n.$on("change",t[34]),l=new Lc({props:{size:"sm",labelText:"Until",placeholder:"HH:MM",pattern:wd,value:((_=t[8].schedule.windows[0])==null?void 0:_.to)||""}}),l.$on("change",t[35]),s=new ju({props:{size:"sm",titleText:"Nights",label:"Every night",items:XO,selectedIds:t[8].schedule.weekdays.map(String)}}),s.$on("select",t[36]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),r=F(),U(s.$$.fragment),o=F(),a=P("p"),u=j("A night lasts until the next morning, in "),c=j(f),d=j("."),I(e,"class","window-row bedtime-row svelte-r46cq7"),I(a,"class","field-note svelte-r46cq7")},m(k,y){O(k,e,y),z(n,e,null),w(e,i),z(l,e,null),w(e,r),z(s,e,null),O(k,o,y),O(k,a,y),w(a,u),w(a,c),w(a,d),h=!0},p(k,y){var C,D;const T={};y[0]&256&&(T.value=((C=k[8].schedule.windows[0])==null?void 0:C.from)||""),n.$set(T);const M={};y[0]&256&&(M.value=((D=k[8].schedule.windows[0])==null?void 0:D.to)||""),l.$set(M);const A={};y[0]&256&&(A.selectedIds=k[8].schedule.weekdays.map(String)),s.$set(A),(!h||y[0]&256)&&f!==(f=(k[8].schedule.timezone||"UTC")+"")&&Y(c,f)},i(k){h||(p(n.$$.fragment,k),p(l.$$.fragment,k),p(s.$$.fragment,k),h=!0)},o(k){v(n.$$.fragment,k),v(l.$$.fragment,k),v(s.$$.fragment,k),h=!1},d(k){k&&(E(e),E(o),E(a)),H(n),H(l),H(s)}}}function P0e(t){var a;let e,n,i,l,r,s;i=new Ad({props:{labelText:"Bedtime",labelA:"Off",labelB:"No internet during these hours",toggled:!!t[8]}}),i.$on("toggle",t[33]);let o=((a=t[8])==null?void 0:a.schedule)&&hy(t);return{c(){e=P("p"),e.textContent="Optionally pause internet access overnight in the gateway time zone.",n=F(),U(i.$$.fragment),l=F(),o&&o.c(),r=je(),I(e,"class","section-description svelte-r46cq7")},m(u,f){O(u,e,f),O(u,n,f),z(i,u,f),O(u,l,f),o&&o.m(u,f),O(u,r,f),s=!0},p(u,f){var d;const c={};f[0]&256&&(c.toggled=!!u[8]),i.$set(c),(d=u[8])!=null&&d.schedule?o?(o.p(u,f),f[0]&256&&p(o,1)):(o=hy(u),o.c(),p(o,1),o.m(r.parentNode,r)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(u){s||(p(i.$$.fragment,u),p(o),s=!0)},o(u){v(i.$$.fragment,u),v(o),s=!1},d(u){u&&(E(e),E(n),E(l),E(r)),H(i,u),o&&o.d(u)}}}function my(t){let e,n,i,l,r;return n=new ju({props:{titleText:"Proxy users on this policy",label:"Only devices assigned to it",items:t[2].map(Ay),selectedIds:t[0].users}}),n.$on("select",t[38]),{c(){e=P("div"),U(n.$$.fragment),i=F(),l=P("p"),l.textContent="A signed-in proxy user gets this policy on any device.",I(l,"class","field-note svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),w(e,l),r=!0},p(s,o){const a={};o[0]&4&&(a.items=s[2].map(Ay)),o[0]&1&&(a.selectedIds=s[0].users),n.$set(a)},i(s){r||(p(n.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),r=!1},d(s){s&&E(e),H(n)}}}function gy(t){let e,n,i,l,r=t[64]+1+"",s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R=My(t[62]),N,G=oy(t[62]),B;function $(ae){t[39](ae,t[62])}let q={size:"sm",labelText:"Enabled",hideLabel:!0};t[62].enabled!==void 0&&(q.toggled=t[62].enabled),u=new Ad({props:q}),xe.push(()=>At(u,"toggled",$));function V(){return t[40](t[64])}d=new bt({props:{size:"small",kind:"ghost",icon:Eq,iconDescription:"Move rule up",disabled:t[64]===0}}),d.$on("click",V);function K(){return t[41](t[64])}g=new bt({props:{size:"small",kind:"ghost",icon:vq,iconDescription:"Move rule down",disabled:t[64]===t[0].rules.length-1}}),g.$on("click",K);function x(){return t[42](t[64])}k=new bt({props:{size:"small",kind:"danger-ghost",$$slots:{default:[N0e]},$$scope:{ctx:t}}}),k.$on("click",x),T=new Ac({props:{$$slots:{default:[G0e]},$$scope:{ctx:t}}});let ie=!t[62].target.all_traffic&&_y(t);C=new Ac({props:{$$slots:{default:[$0e]},$$scope:{ctx:t}}});let X=R&&ky(t),ce=G&&Ey();return{c(){e=P("div"),n=P("div"),i=P("h5"),l=j("Rule "),s=j(r),o=F(),a=P("div"),U(u.$$.fragment),c=F(),U(d.$$.fragment),h=F(),U(g.$$.fragment),_=F(),U(k.$$.fragment),y=F(),U(T.$$.fragment),M=F(),ie&&ie.c(),A=F(),U(C.$$.fragment),D=F(),X&&X.c(),N=F(),ce&&ce.c(),I(i,"class","svelte-r46cq7"),I(a,"class","rule-head-controls svelte-r46cq7"),I(n,"class","rule-head svelte-r46cq7"),I(e,"class","rule svelte-r46cq7")},m(ae,ee){O(ae,e,ee),w(e,n),w(n,i),w(i,l),w(i,s),w(n,o),w(n,a),z(u,a,null),w(a,c),z(d,a,null),w(a,h),z(g,a,null),w(a,_),z(k,a,null),w(e,y),z(T,e,null),w(e,M),ie&&ie.m(e,null),w(e,A),z(C,e,null),w(e,D),X&&X.m(e,null),w(e,N),ce&&ce.m(e,null),B=!0},p(ae,ee){t=ae,(!B||ee[0]&1)&&r!==(r=t[64]+1+"")&&Y(s,r);const he={};!f&&ee[0]&1&&(f=!0,he.toggled=t[62].enabled,Ct(()=>f=!1)),u.$set(he);const ne={};ee[0]&1&&(ne.disabled=t[64]===0),d.$set(ne);const re={};ee[0]&1&&(re.disabled=t[64]===t[0].rules.length-1),g.$set(re);const oe={};ee[2]&4096&&(oe.$$scope={dirty:ee,ctx:t}),k.$set(oe);const Re={};ee[0]&1|ee[2]&4096&&(Re.$$scope={dirty:ee,ctx:t}),T.$set(Re),t[62].target.all_traffic?ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()):ie?(ie.p(t,ee),ee[0]&1&&p(ie,1)):(ie=_y(t),ie.c(),p(ie,1),ie.m(e,A));const qe={};ee[0]&13|ee[2]&4096&&(qe.$$scope={dirty:ee,ctx:t}),C.$set(qe),ee[0]&1&&(R=My(t[62])),R?X?(X.p(t,ee),ee[0]&1&&p(X,1)):(X=ky(t),X.c(),p(X,1),X.m(e,N)):X&&(ue(),v(X,1,1,()=>{X=null}),fe()),ee[0]&1&&(G=oy(t[62])),G?ce||(ce=Ey(),ce.c(),ce.m(e,null)):ce&&(ce.d(1),ce=null)},i(ae){B||(p(u.$$.fragment,ae),p(d.$$.fragment,ae),p(g.$$.fragment,ae),p(k.$$.fragment,ae),p(T.$$.fragment,ae),p(ie),p(C.$$.fragment,ae),p(X),B=!0)},o(ae){v(u.$$.fragment,ae),v(d.$$.fragment,ae),v(g.$$.fragment,ae),v(k.$$.fragment,ae),v(T.$$.fragment,ae),v(ie),v(C.$$.fragment,ae),v(X),B=!1},d(ae){ae&&E(e),H(u),H(d),H(g),H(k),H(T),ie&&ie.d(),H(C),X&&X.d(),ce&&ce.d()}}}function N0e(t){let e;return{c(){e=j("Remove rule")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function B0e(t){let e,n,i;function l(s){t[43](s,t[62])}let r={labelText:"Name",placeholder:"After school"};return t[62].name!==void 0&&(r.value=t[62].name),e=new ei({props:r}),xe.push(()=>At(e,"value",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){t=s;const a={};!n&&o[0]&1&&(n=!0,a.value=t[62].name,Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function z0e(t){let e,n,i,l;return e=new Rn({props:{value:"block",text:"Block"}}),i=new Rn({props:{value:"allow",text:"Allow"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p:_e,i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function H0e(t){let e,n,i;function l(s){t[44](s,t[62])}let r={labelText:"Action",$$slots:{default:[z0e]},$$scope:{ctx:t}};return t[62].action!==void 0&&(r.selected=t[62].action),e=new Wr({props:r}),xe.push(()=>At(e,"selected",l)),e.$on("change",t[14]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){t=s;const a={};o[2]&4096&&(a.$$scope={dirty:o,ctx:t}),!n&&o[0]&1&&(n=!0,a.selected=t[62].action,Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function U0e(t){let e,n,i,l;return e=new Rn({props:{value:"listed",text:"Selected categories and domains"}}),i=new Rn({props:{value:"all",text:"All traffic"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p:_e,i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function F0e(t){let e,n;function i(...l){return t[45](t[62],...l)}return e=new Wr({props:{labelText:"Applies to",selected:t[62].target.all_traffic?"all":"listed",$$slots:{default:[U0e]},$$scope:{ctx:t}}}),e.$on("change",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&1&&(s.selected=t[62].target.all_traffic?"all":"listed"),r[2]&4096&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function G0e(t){let e,n,i,l,r,s;return e=new Gr({props:{sm:4,md:4,lg:5,$$slots:{default:[B0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:5,$$slots:{default:[H0e]},$$scope:{ctx:t}}}),r=new Gr({props:{sm:4,md:8,lg:6,$$slots:{default:[F0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[2]&4096&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[2]&4096&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function _y(t){let e,n,i,l,r;function s(...a){return t[46](t[62],t[63],t[64],...a)}n=new v_({props:{categories:t[1],compact:!0,selection:t[62].target.categories}}),n.$on("change",s);function o(...a){return t[47](t[62],t[63],t[64],...a)}return l=new k_({props:{label:"Domain",entries:t[62].target.domains}}),l.$on("change",o),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","rule-target svelte-r46cq7")},m(a,u){O(a,e,u),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&2&&(f.categories=t[1]),u[0]&1&&(f.selection=t[62].target.categories),n.$set(f);const c={};u[0]&1&&(c.entries=t[62].target.domains),l.$set(c)},i(a){r||(p(n.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(n.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(e),H(n),H(l)}}}function py(t,e){let n,i,l;return i=new Rn({props:{value:e[71].id,text:Cy(e[71])}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&8&&(o.value=e[71].id),s[0]&8&&(o.text=Cy(e[71])),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function V0e(t){let e,n,i=[],l=new Map,r,s,o;e=new Rn({props:{value:"",text:"Always"}});let a=it(t[3]);const u=f=>f[71].id;for(let f=0;f{s=null}),fe())},i(o){l||(p(e.$$.fragment,o),p(s),l=!0)},o(o){v(e.$$.fragment,o),v(s),l=!1},d(o){o&&(E(n),E(i)),H(e,o),s&&s.d(o)}}}function vy(t){let e,n;function i(...l){return t[52](t[62],...l)}return e=new ju({props:{titleText:"Only for proxy users",label:"Everyone on this policy",items:t[2].map(Ly),selectedIds:t[62].users}}),e.$on("select",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&4&&(s.items=t[2].map(Ly)),r[0]&1&&(s.selectedIds=t[62].users),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function j0e(t){let e,n,i=t[2].length&&vy(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,r){l[2].length?i?(i.p(l,r),r[0]&4&&p(i,1)):(i=vy(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function $0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[W0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[j0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&9|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&5|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function ky(t){let e,n,i;return n=new ug({props:{$$slots:{default:[epe]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","rule-conditions svelte-r46cq7")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&1|r[2]&4096&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function q0e(t){let e;return{c(){e=j("Add pattern")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function wy(t){let e,n=[],i=new Map,l,r=it(t[62].url_regexes);const s=o=>o[68];for(let o=0;oAt(n,"value",u)),n.$on("keydown",f);function d(){return t[55](t[62])}r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[q0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].url_regexes.length&&wy(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=je(),I(e,"class","list-entry svelte-r46cq7")},m(g,_){O(g,e,_),z(n,e,null),w(e,l),z(r,e,null),O(g,s,_),h&&h.m(g,_),O(g,o,_),a=!0},p(g,_){t=g;const k={};!i&&_[0]&1&&(i=!0,k.value=t[62].url_draft,Ct(()=>i=!1)),n.$set(k);const y={};_[2]&4096&&(y.$$scope={dirty:_,ctx:t}),r.$set(y),t[62].url_regexes.length?h?(h.p(t,_),_[0]&1&&p(h,1)):(h=wy(t),h.c(),p(h,1),h.m(o.parentNode,o)):h&&(ue(),v(h,1,1,()=>{h=null}),fe())},i(g){a||(p(n.$$.fragment,g),p(r.$$.fragment,g),p(h),a=!0)},o(g){v(n.$$.fragment,g),v(r.$$.fragment,g),v(h),a=!1},d(g){g&&(E(e),E(s),E(o)),H(n),H(r),h&&h.d(g)}}}function X0e(t){let e;return{c(){e=j("Add type")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Ty(t){let e,n=[],i=new Map,l,r=it(t[62].blocked_content_types);const s=o=>o[65];for(let o=0;oAt(n,"value",u)),n.$on("keydown",f);function d(){return t[59](t[62])}r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[X0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].blocked_content_types.length&&Ty(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=je(),I(e,"class","list-entry svelte-r46cq7")},m(g,_){O(g,e,_),z(n,e,null),w(e,l),z(r,e,null),O(g,s,_),h&&h.m(g,_),O(g,o,_),a=!0},p(g,_){t=g;const k={};!i&&_[0]&1&&(i=!0,k.value=t[62].content_type_draft,Ct(()=>i=!1)),n.$set(k);const y={};_[2]&4096&&(y.$$scope={dirty:_,ctx:t}),r.$set(y),t[62].blocked_content_types.length?h?(h.p(t,_),_[0]&1&&p(h,1)):(h=Ty(t),h.c(),p(h,1),h.m(o.parentNode,o)):h&&(ue(),v(h,1,1,()=>{h=null}),fe())},i(g){a||(p(n.$$.fragment,g),p(r.$$.fragment,g),p(h),a=!0)},o(g){v(n.$$.fragment,g),v(r.$$.fragment,g),v(h),a=!1},d(g){g&&(E(e),E(s),E(o)),H(n),H(r),h&&h.d(g)}}}function Q0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[Z0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[J0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function x0e(t){let e,n;return e=new Ac({props:{$$slots:{default:[Q0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1|l[2]&4096&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function epe(t){let e,n;return e=new fg({props:{title:"Block only part of the site",open:t[62].url_regexes.length>0||t[62].blocked_content_types.length>0,$$slots:{default:[x0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1&&(r.open=i[62].url_regexes.length>0||i[62].blocked_content_types.length>0),l[0]&1|l[2]&4096&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Ey(t){let e;return{c(){e=P("p"),e.textContent=`DNS cannot see URLs, response types, or proxy logins, so + `;u.html(f),c();function c(){u.attr("gradientTransform",`translate(${s-3*.2*r}, 0)`).transition().duration(2e3).delay(1e3).ease(iie).attr("gradientTransform",`translate(${o+3*.2*r}, 0)`).on("end",c)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class rge extends $n{constructor(){super(...arguments),this.type="zero-line",this.renderType=vn.SVG}render(e){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[l,r]=i.domain(),s=l>0&&r<0||l<0&&r>0,o=this.getComponentContainer();if(!s){o.selectAll("line.domain").remove();return}const[a,u]=this.services.cartesianScales.getDomainScale().range();let f=+i(0)+.5;f||(f=i.range()[0]);const c=gO({x0:a,x1:u,y0:f,y1:f},this.services.cartesianScales.getOrientation());ft.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:e})).attr("y1",c.y0).attr("y2",c.y1).attr("x1",c.x0).attr("x2",c.x1)}}class H6 extends WO{formatTooltipData(e){return e.reverse()}}class g_ extends $n{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),l=ft.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const r=ye(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,l*r/n)}return Math.min(e.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(e,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const l=this.services.cartesianScales.getDomainScale();return el(i[1])}return!1}}class sge extends g_{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=vn.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:l}=i.data;this.setGroupScale();const r=this.getComponentContainer({withinChartClip:!0}),s=Hu(n.map(f=>{const c=this.services.cartesianScales.getDomainIdentifier(f);return f[c]&&typeof f[c].toString=="function"?f[c].toString():f[c]})),o=r.selectAll("g.bars").data(s,f=>f);o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("bars",!0).attr("role",oi.GROUP).attr("data-name","bars").merge(o);a.transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-group-update-enter",animate:e})).attr("transform",f=>{const c=this.services.cartesianScales.getDomainValue(f)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===tl.VERTICAL?`translate(${c}, 0)`:`translate(0, ${c})`});const u=a.selectAll("path.bar").data(f=>this.getDataCorrespondingToLabel(f),f=>f[l]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-update-enter",animate:e})).attr("class",f=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:f[l],originalClassName:"bar"})).style("fill",f=>this.model.getFillColor(f[l])).attr("d",f=>{const c=this.groupScale(f[l]),d=this.getBarWidth(),h=c,g=c+d,_=this.services.cartesianScales.getRangeAxisPosition({datum:f}),k=this.services.cartesianScales.getValueThroughAxisPosition(_,0),y=this.services.cartesianScales.getRangeValue(f),T=this.services.cartesianScales.getDomainValue(f)-d/2,M=T+d;if(!this.isOutsideZoomedDomain(T,M))return d_({x0:h,x1:g,y0:k,y1:y},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",f=>f.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=rt(this);l.classed("hovered",!0),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){const l=rt(this);e.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:n,element:rt(this),datum:i})}).on("mouseout",function(n,i){const l=rt(this);l.classed("hovered",!1),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*e.length+n}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof e.step=="function")i=e.step();else if(n.length>0){const l=n.find(r=>{var s;return((s=r.data)==null?void 0:s.length)>1});if(l){const r=this.services.cartesianScales.getDomainIdentifier(l.data[0]);i=Math.abs(e(l.data[1][r])-e(l.data[0][r]))}}return i}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),n=ye(e,"bars","width"),i=ye(e,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const l=this.model.getGroupedData(this.configs.groups).length,r=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-r)/l)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Pg().domain(e).rangeRound([0,this.getGroupWidth()])}}class oge extends g_{constructor(){super(...arguments),this.type="simple-bar",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-simple-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getOptions(),{groupMapsTo:i}=n.data,l=this.getComponentContainer({withinChartClip:!0}),r=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=l.selectAll("path.bar").data(r,a=>a[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"bar-update-enter",animate:e})).attr("class",a=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:a[i],originalClassName:"bar"})).style("fill",a=>this.model.getFillColor(a[i])).attr("d",a=>{const u=this.services.cartesianScales.getRangeIdentifier(),f=this.getBarWidth(),c=a[u],d=this.services.cartesianScales.getDomainValue(a)-f/2,h=d+f;let g,_;if(Array.isArray(c)&&c.length===2)g=this.services.cartesianScales.getRangeValue(c[0]),_=this.services.cartesianScales.getRangeValue(c[1]);else{const y=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,y)),_=this.services.cartesianScales.getRangeValue(a)}const k=Math.abs(_-g);if(k!==0&&k<2&&(c>0&&s===tl.VERTICAL||c<0&&s===tl.HORIZONTAL?_=g-2:_=g+2),!this.isOutsideZoomedDomain(d,h))return d_({x0:d,x1:h,y0:g,y1:_},s)}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",a=>a.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=rt(this);l.classed("hovered",!0),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:n,element:rt(this),datum:i}),e.services.events.dispatchEvent($e.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:n,element:rt(this),datum:i})}).on("mouseout",function(n,i){const l=rt(this);l.classed("hovered",!1),e.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class age extends $n{constructor(){super(...arguments),this.type="area-stacked",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,i=this.getOptions(),{groupMapsTo:l}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>ye(r,0,l)!==n.datum().name?Br.opacity.unselected:Br.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Br.opacity.selected)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,l=this.getOptions(),{groupMapsTo:r}=l.data,s=Object.keys(l.axes).some(h=>l.axes[h].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),a=ye(o,0,0),u=this.services.cartesianScales.getDomainAxisPosition({datum:a}),f=this.services.cartesianScales.getRangeAxisPosition({datum:a}),c=this.services.cartesianScales.getScaleByPosition(f),d=n.selectAll("path.area").data(o,h=>ye(h,0,r));this.areaGenerator=$g().x(h=>this.services.cartesianScales.getValueThroughAxisPosition(u,h.data.sharedStackKey)).y0(h=>c(h[0])).y1(h=>c(h[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,h=>ye(h,0,r)).attr("class","area").attr("class",h=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:ye(h,0,r),originalClassName:"area"})).style("fill",h=>i.model.getFillColor(ye(h,0,r))).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",h=>ye(h,0,r)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"area-update-enter",animate:e})).attr("opacity",Br.opacity.selected).attr("d",this.areaGenerator)}}class uge extends g_{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=vn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(r,u=>ye(u,0,l));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",oi.GROUP).attr("data-name","bars");const a=n.selectAll("g.bars").selectAll("path.bar").data(u=>u,u=>u.data.sharedStackKey);a.exit().remove(),a.enter().append("path").merge(a).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Oi.FILL],dataGroupName:u[l],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[l])).attr("d",u=>{const f=u.data.sharedStackKey,c=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(f)-c/2,h=d+c,g=this.services.cartesianScales.getRangeValue(u[0]);let _=this.services.cartesianScales.getRangeValue(u[1]);if(!this.isOutsideZoomedDomain(d,h)){if(Math.abs(_-g)>0&&Math.abs(_-g)>i.bars.dividerSize){const k=u[0]<0&&u[1]<=0;k&&s.length>1?this.services.cartesianScales.getOrientation()===tl.VERTICAL?_+=u[1]===0?2:1:_-=1:k||(this.services.cartesianScales.getOrientation()===tl.VERTICAL?_+=1:_-=1)}return d_({x0:d,x1:h,y0:g,y1:_},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",oi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u[1]-u[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(l,r){const s=rt(this);s.classed("hovered",!0),i.services.events.dispatchEvent($e.Bar.BAR_MOUSEOVER,{event:l,element:s,datum:r});let o=i.model.getDisplayData(i.configs.groups).find(a=>{const u=i.services.cartesianScales.getDomainIdentifier(a),f=i.services.cartesianScales.getRangeIdentifier(a);return a[f]===r.data[r[n]]&&a[u].toString()===r.data.sharedStackKey&&a[n]===r[n]});if(o===void 0){const a=i.services.cartesianScales.getDomainIdentifier(),u=i.services.cartesianScales.getRangeIdentifier();o={[a]:r.data.sharedStackKey,[u]:r.data[r[n]],[n]:r[n]}}i.services.events.dispatchEvent($e.Tooltip.SHOW,{event:l,hoveredElement:s,data:[o]})}).on("mousemove",function(l,r){const s=rt(this);i.services.events.dispatchEvent($e.Bar.BAR_MOUSEMOVE,{event:l,element:s,datum:r}),i.services.events.dispatchEvent($e.Tooltip.MOVE,{event:l})}).on("click",function(l,r){i.services.events.dispatchEvent($e.Bar.BAR_CLICK,{event:l,element:rt(this),datum:r})}).on("mouseout",function(l,r){const s=rt(this);s.classed("hovered",!1),i.services.events.dispatchEvent($e.Bar.BAR_MOUSEOUT,{event:l,element:s,datum:r}),i.services.events.dispatchEvent($e.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const e=this.getOptions();if(ye(e,"bars","width"))return e.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=ft.getSVGElementSize(this.parent,{useAttrs:!0}).width,l=this.model.getStackKeys().length,r=ye(e,"bars","spacingFactor");return n.step?Math.min(e.bars.maxWidth,n.step()/2):Math.min(e.bars.maxWidth,i*r/l)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener($e.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener($e.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class fge extends Tu{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=vn.SVG}render(e){if(!ye(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(f=>i.axes[f].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=n.selectAll("g.dots").data(s,f=>ye(f,0,l));o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("dots",!0).attr("role",oi.GROUP).merge(o).selectAll("circle.dot").data(f=>f);a.exit().attr("opacity",0).remove();const u=a.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(a).datum(f=>{const c=f[l],d=this.services.cartesianScales.getDomainIdentifier(f),h=this.services.cartesianScales.getRangeIdentifier(f);return{[l]:c,[d]:f.data.sharedStackKey,[h]:f[1]}});this.styleCircles(u,e),this.addEventListeners()}getTooltipData(e,n){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(a=>i.axes[a].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=[];return s.forEach((a,u)=>{a.forEach((f,c)=>{const d=f[l],h=f.data.sharedStackKey;let g=f.data[d];const _=f[1],k=this.services.cartesianScales.getDomainIdentifier(f),y=this.services.cartesianScales.getRangeIdentifier(f);g!=null&&e===this.services.cartesianScales.getDomainValue(h)&&n===this.services.cartesianScales.getRangeValue(_)&&(r&&(g=this.model.getStackedData({groups:this.configs.groups})[u][c].data[d]),g!==null&&o.push({[l]:d,[k]:h,[y]:g}))})}),this.model.getDisplayData(this.configs.groups).filter(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a),f=this.services.cartesianScales.getRangeIdentifier(a);return o.find(c=>c[l]==a[l]&&c[u]==a[u]&&c[f]==a[f])!==void 0})}}function $O(t,e){Ft(2,arguments);var n=mn(t),i=ci(e);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function __(t,e){Ft(2,arguments);var n=mn(t),i=ci(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),r=new Date(n.getTime());r.setMonth(n.getMonth()+i+1,0);var s=r.getDate();return l>=s?r:(n.setFullYear(r.getFullYear(),r.getMonth(),l),n)}var cge=36e5;function qO(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*cge)}function U6(t){Ft(1,arguments);var e=mn(t);return e.setHours(0,0,0,0),e}var dge=864e5;function hge(t,e){Ft(2,arguments);var n=U6(t),i=U6(e),l=n.getTime()-Dm(n),r=i.getTime()-Dm(i);return Math.round((l-r)/dge)}var mge=6e4;function ig(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*mge)}function lg(t,e){Ft(2,arguments);var n=ci(e);return Yd(t,n*1e3)}function YO(t,e){Ft(2,arguments);var n=ci(e);return __(t,n*12)}function Su(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=n.getTime()-i.getTime();return l<0?-1:l>0?1:l}var gge=6e4,_ge=36e5;function pge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=n.getFullYear()-i.getFullYear(),r=n.getMonth()-i.getMonth();return l*12+r}function bge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e);return n.getFullYear()-i.getFullYear()}function F6(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function vge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=F6(n,i),r=Math.abs(hge(n,i));n.setDate(n.getDate()-l*r);var s=+(F6(n,i)===-l),o=l*(r-s);return o===0?0:o}function p_(t,e){return Ft(2,arguments),mn(t).getTime()-mn(e).getTime()}var G6={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},kge="trunc";function b_(t){return t?G6[t]:G6[kge]}function wge(t,e,n){Ft(2,arguments);var i=p_(t,e)/_ge;return b_(n==null?void 0:n.roundingMethod)(i)}function V6(t,e,n){Ft(2,arguments);var i=p_(t,e)/gge;return b_(n==null?void 0:n.roundingMethod)(i)}function yge(t){Ft(1,arguments);var e=mn(t);return e.setHours(23,59,59,999),e}function Tge(t){Ft(1,arguments);var e=mn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Sge(t){Ft(1,arguments);var e=mn(t);return yge(e).getTime()===Tge(e).getTime()}function Ege(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=Su(n,i),r=Math.abs(pge(n,i)),s;if(r<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-l*r);var o=Su(n,i)===-l;Sge(mn(t))&&r===1&&Su(t,i)===1&&(o=!1),s=l*(r-Number(o))}return s===0?0:s}function W6(t,e,n){Ft(2,arguments);var i=p_(t,e)/1e3;return b_(n==null?void 0:n.roundingMethod)(i)}function Oge(t,e){Ft(2,arguments);var n=mn(t),i=mn(e),l=Su(n,i),r=Math.abs(bge(n,i));n.setFullYear(1584),i.setFullYear(1584);var s=Su(n,i)===-l,o=l*(r-Number(s));return o===0?0:o}function Mge(t,e){Ft(2,arguments);var n=ci(e);return $O(t,-n)}function Cge(t,e){Ft(2,arguments);var n=ci(e);return __(t,-n)}function Age(t,e){Ft(2,arguments);var n=ci(e);return qO(t,-n)}function j6(t,e){Ft(2,arguments);var n=ci(e);return ig(t,-n)}function $6(t,e){Ft(2,arguments);var n=ci(e);return lg(t,-n)}function Lge(t,e){Ft(2,arguments);var n=ci(e);return YO(t,-n)}function Dge(t){var e=t==null?0:t.length;return e?r_(t,1):[]}class Ige extends Kr{zoomIn(e,n,i){let l,r,s;const o=i||m6;e&&(l=e.x,r=e.y,s=2);const{width:a,height:u}=ft.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${a/2}, ${u/2}) scale(${s}) translate(${-l},${-r})`),this.services.events.dispatchEvent($e.CanvasZoom.CANVAS_ZOOM_IN,{element:rt(e)})}zoomOut(e,n){const i=n||m6;e.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent($e.CanvasZoom.CANVAS_ZOOM_OUT)}}class Rge extends Kr{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(e,n){this.documentFragment.addEventListener(e,n)}removeEventListener(e,n){this.documentFragment.removeEventListener(e,n)}dispatchEvent(e,n){let i;n?i=new CustomEvent(e,{detail:n}):(i=document.createEvent("Event"),i.initEvent(e,!1,!0)),this.documentFragment.dispatchEvent(i)}}class Pge extends Kr{constructor(e,n){super(e,n)}downloadCSV(e,n){const i=document.createElement("a"),l="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([e],{type:l}),n);else if(URL&&"download"in i){const r=URL.createObjectURL(new Blob([e],{type:l}));i.href=r,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(e)}`}downloadImage(e,n){const i=document.createElement("a");i.download=n,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class Nge extends Kr{constructor(){super(...arguments),this.pendingTransitions={}}init(){var e;(e=this.services.events)==null||e.addEventListener($e.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:e,name:n,animate:i}){return this.pendingTransitions[e._id]=e,e.on("end interrupt cancel",()=>{delete this.pendingTransitions[e._id]}),this.model.getOptions().animations===!1||i===!1?e.duration(0):e.duration(ye(_6,n,"duration")||_6.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Bge extends Kr{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:e=null}={}){if(this.dualAxes&&e){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,l=ye(n,"axes",this.secondaryDomainAxisPosition),r=e[i];if(l!=null&&l.correspondingDatasets&&l.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:e=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:l}=i.data,r=ye(i,"axes",this.secondaryRangeAxisPosition);let s;if(e!==null?s=e[l]:n&&n.length>0&&(s=n[0]),r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(e){return ye(this.model.getOptions(),"axes",e)}getDomainAxisOptions(){const e=this.getDomainAxisPosition();return this.getAxisOptions(e)}getRangeAxisOptions(){const e=this.getRangeAxisPosition();return this.getAxisOptions(e)}getScaleLabel(e){return this.getAxisOptions(e).title||(e===Qe.BOTTOM||e===Qe.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(Qe).map(e=>Qe[e]).forEach(e=>{this.scales[e]=this.createScale(e)})}findDomainAndRangeAxes(){const e=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(e,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===Qe.LEFT||this.rangeAxisPosition===Qe.RIGHT)&&(this.domainAxisPosition===Qe.BOTTOM||this.domainAxisPosition===Qe.TOP)?this.orientation=tl.VERTICAL:this.orientation=tl.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var e,n,i,l;const r=this.model.getOptions(),s=ye(r,"axes");((e=s[Qe.LEFT])!=null&&e.correspondingDatasets&&s[Qe.RIGHT]||(n=s[Qe.RIGHT])!=null&&n.correspondingDatasets&&s[Qe.LEFT]||(i=s[Qe.TOP])!=null&&i.correspondingDatasets&&s[Qe.BOTTOM]||(l=s[Qe.BOTTOM])!=null&&l.correspondingDatasets&&s[Qe.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(e){const n=ye(this.model.getOptions(),"axes",e,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${e} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[e]===St.LINEAR||this.scaleTypes[e]===St.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[e]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(e){return this.scales[e]}getScaleTypeByPosition(e){return this.scaleTypes[e]}getDomainAxisScaleType(){const e=this.getDomainAxisPosition();return this.getScaleTypeByPosition(e)}getRangeAxisScaleType(){const e=this.getRangeAxisPosition();return this.getScaleTypeByPosition(e)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const e=[Qe.BOTTOM,Qe.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainYAxisPosition(){const e=[Qe.LEFT,Qe.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(e,n,i,l){const r=this.model.getOptions(),s=ye(r,"axes")[i],{mapsTo:o}=s,a=ye(l,o)!==null?l[o]:l;let u;switch(n){case St.LABELS:u=e(a)+e.step()/2;break;case St.TIME:u=e(new Date(a));break;default:u=e(a)}return u}getBoundedScaledValues(e){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:e}),l=this.scales[i],r=this.model.getOptions(),s=ye(r,"axes")[i],{mapsTo:o}=s,a=e[o]!==void 0?e[o]:e;return[l(ye(e,n.upperBoundMapsTo)!==null?e[n.upperBoundMapsTo]:a),l(ye(e,n.lowerBoundMapsTo)!==null?e[n.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(e,n){const i=this.scaleTypes[e],l=this.scales[e];return this.getValueFromScale(l,i,e,n)}getDomainValue(e){const n=this.getDomainAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getRangeValue(e){const n=this.getRangeAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(e){const n=this.model.getOptions();return ye(n,"axes",this.getDomainAxisPosition({datum:e}),"mapsTo")}getRangeIdentifier(e){const n=this.model.getOptions();return ye(n,"axes",this.getRangeAxisPosition({datum:e}),"mapsTo")}extendsDomain(e,n){const i=this.model.getOptions(),l=ye(i,"axes",e);if(l.scaleType===St.TIME){const r=ye(i,"timeScale","addSpaceOnEdges");return zge(n,r)}else return Hge(n,Ts.paddingRatio,l.scaleType)}findVerticalAxesPositions(){const e=this.model.getOptions(),n=ye(e,"axes"),i=this.isDualAxes();return ye(n,Qe.LEFT)===null&&ye(n,Qe.RIGHT)!==null||ye(n,Qe.RIGHT,"main")===!0||i&&ye(n,Qe.LEFT,"correspondingDatasets")?{primary:Qe.RIGHT,secondary:Qe.LEFT}:{primary:Qe.LEFT,secondary:Qe.RIGHT}}findHorizontalAxesPositions(){const e=this.model.getOptions(),n=ye(e,"axes"),i=this.isDualAxes();return ye(n,Qe.BOTTOM)===null&&ye(n,Qe.TOP)!==null||ye(n,Qe.TOP,"main")===!0||i&&ye(n,Qe.BOTTOM,"correspondingDatasets")?{primary:Qe.TOP,secondary:Qe.BOTTOM}:{primary:Qe.BOTTOM,secondary:Qe.TOP}}findDomainAndRangeAxesPositions(e,n){const i=this.model.getOptions(),l=ye(i,"axes",e.primary),r=ye(i,"axes",n.primary),s=l.scaleType||St.LINEAR,o=r.scaleType||St.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=n.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=n.secondary,a.secondaryRangeAxisPosition=e.secondary,(!(o===St.LABELS||o===St.TIME)&&s===St.LABELS||s===St.TIME)&&(a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=n.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=n.secondary),a}getScaleDomain(e){const n=this.model.getOptions(),i=ye(n,"axes",e),l=ye(n,"bounds"),{includeZero:r}=i,s=ye(i,"scaleType")||St.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:y}=this.model.getBinConfigurations();return[0,Cx(y,T=>T.length)]}else if(i.limitDomainToBins){const{bins:y}=this.model.getBinConfigurations(),T=this.model.getStackKeys({bins:y});return[T[0].split("-")[0],T[T.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:u,percentage:f,thresholds:c}=i,{reference:d,compareTo:h}=Ts.ratio;if(i.domain)return s===St.LABELS?i.domain:(s===St.TIME&&(i.domain=i.domain.map(y=>y.getTime===void 0?new Date(y):y)),this.extendsDomain(e,i.domain));if(f)return[0,100];if(i&&s===St.LABELS)return Hu(o.map(y=>y[u]));let g,_;const k=this.model.getDataGroupNames();if(s===St.LABELS_RATIO)return o.map(y=>`${y[d]}/${y[h]}`);if(s===St.TIME)_=o.map(y=>+new Date(y[u]));else if(l&&n.axes)_=[],o.forEach(y=>{_.push(y[u]),y[l.upperBoundMapsTo]&&_.push(y[l.upperBoundMapsTo]),y[l.lowerBoundMapsTo]&&_.push(y[l.lowerBoundMapsTo])});else if(i.stacked===!0&&k&&e===this.getRangeAxisPosition()){const{groupMapsTo:y}=n.data,T=this.model.getDataValuesGroupedByKeys({groups:k}),M=o.filter(C=>!k.includes(C[y])),A=[];T.forEach(C=>{const{...D}=C;let R=0,N=0;Object.values(D).forEach(G=>{isNaN(G)||(G<0?N+=G:R+=G)}),A.push([N,R])}),_=[...Dge(A),...M.map(C=>C[u])]}else _=[],o.forEach(y=>{const T=y[u];Array.isArray(T)&&T.length===2?(_.push(T[0]),_.push(T[1])):(a&&_.push(Math.max(y[u],y[a])),_.push(T))});return s!==St.TIME&&s!==St.LOG&&r&&_.push(0),c&&c.length>0&&c.forEach(y=>{const T=ye(y,"value");T!==null&&_.push(T)}),g=xo(_),g=this.extendsDomain(e,g),g}createScale(e){const n=this.model.getOptions(),i=ye(n,"axes",e);if(!i)return null;const l=ye(i,"scaleType")||St.LINEAR;this.scaleTypes[e]=l;let r;return l===St.TIME?r=uE():l===St.LOG?r=tE().base(i.base||10):l===St.LABELS||l===St.LABELS_RATIO?r=Pg():r=Jc(),r.domain(this.getScaleDomain(e)),r}getHighestDomainThreshold(){const e=ye(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getDomainScale(),r=i.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===St.TIME&&(typeof r.value=="string"||r.value.getTime===void 0)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:l(r.value)}}getHighestRangeThreshold(){const e=ye(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getRangeScale(),r=i.sort((s,o)=>o.value-s.value)[0];return{threshold:r,scaleValue:l(r.value)}}}function zge(t,e){const n=new Date(t[0]),i=new Date(t[1]);return Oge(i,n)>1?[Lge(n,e),YO(i,e)]:Ege(i,n)>1?[Cge(n,e),__(i,e)]:vge(i,n)>1?[Mge(n,e),$O(i,e)]:wge(i,n)>1?[Age(n,e),qO(i,e)]:V6(i,n)>30?[j6(n,e*30),ig(i,e*30)]:V6(i,n)>1?[j6(n,e),ig(i,e)]:W6(i,n)>15?[$6(n,e*15),lg(i,e*15)]:W6(i,n)>1?[$6(n,e),lg(i,e)]:[n,i]}function Hge([t,e],n,i){const l=(e-t)*n,r=e<=0&&e+l>0?0:e+l;let s=t>=0&&t-l<0?0:t-l;if(i===St.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,r]}class Uge extends Kr{constructor(){super(...arguments),this.curveTypes={curveLinear:Wg,curveLinearClosed:Mre,curveBasis:pre,curveBasisClosed:bre,curveBasisOpen:vre,curveBundle:kre,curveCardinal:wre,curveCardinalClosed:yre,curveCardinalOpen:Tre,curveCatmullRom:Sre,curveCatmullRomClosed:Ere,curveCatmullRomOpen:Ore,curveMonotoneX:Cre,curveMonotoneY:Are,curveNatural:Lre,curveStep:Dre,curveStepAfter:Rre,curveStepBefore:Ire}}getD3Curve(){let e="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?e=n:e=n.name),this.curveTypes[e]){let i=this.curveTypes[e];return n&&Object.keys(n).forEach(l=>{i[l]&&(i=i[l](n[l]))}),i}return console.warn(`The curve type '${e}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Fge extends Kr{isZoomBarEnabled(){if(!this.services.cartesianScales||!ye(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const e=this.services.cartesianScales.getMainXAxisPosition(),n=ye(this.model.getOptions(),"axes",e,"scaleType");return e===Qe.BOTTOM&&n===St.TIME}getZoomBarData(){const e=this.model.getZoomBarData();return e&&e.length>1?e:this.model.getDisplayData()}getDefaultZoomBarDomain(e){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=e||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const l=i.getMainXAxisPosition(),r=i.getDomainIdentifier(),s=ye(this.model.getOptions(),"axes",l,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!l)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(l,xo(n,o=>o[r]))}handleDomainChange(e,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:e},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent($e.ZoomDomain.CHANGE,{newDomain:e}))}getZoomRatio(){return ye(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(e,n){var i;const l=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=ye(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&l){const o=r.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),a=e.filter(u=>new Date(u[o])>=l[0]&&new Date(u[o])<=l[1]);if(a.length>0)return a}return e}zoomIn(e=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),l=cl.handleWidth,r=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(i[0]),o=r(i[1]);if(o-s=d&&(c=s+u/2-l/2,d=o-u/2+l/2);const h=[r.invert(c),r.invert(d)];(i[0].valueOf()!==h[0].valueOf()||i[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(e=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const l=i(n[0]),r=i(n[1]),s=i.range(),o=(s[1]-s[0])/2*(e/2),a=Math.max(l-o,s[0]),u=Math.min(r+o,s[1]),f=[i.invert(a),i.invert(u)];(n[0].valueOf()!==f[0].valueOf()||n[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}resetZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(e[0].valueOf()!==n[0].valueOf()||e[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!e||!n)return!1;const i=e[1].valueOf()-e[0].valueOf(),l=n[1].valueOf()-n[0].valueOf(),r=ye(this.model.getOptions(),"zoomBar","minZoomRatio");return i/l{const l=this.services[i];this.services[i]=new l(this.model,this.services)}),this.services.events.addEventListener($e.Model.UPDATE,i=>{const l=!!ye(i,"detail","animate");this.update(l)}),this.model.setData(n.data),this.services.events.addEventListener($e.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(e=!0){if(!this.components)return;Object.keys(this.services).forEach(l=>{this.services[l].update()}),this.components.forEach(l=>l.render(e));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(l=>n[l].end().catch(r=>r));Promise.all(i).then(()=>this.services.events.dispatchEvent($e.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(e=>e.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(e,n){const i=this.model.getOptions(),l=ye(i,"toolbar","enabled"),r={id:"legend",components:[new HO(this.model,this.services)],growth:In.PREFERRED},s=ye(i,"canvasZoom","enabled");s&&s===!0&&e.push(new Zme(this.model,this.services));const o=!!this.model.getOptions().title,a={id:"title",components:[new zO(this.model,this.services)],growth:In.STRETCH},u={id:"toolbar",components:[new DO(this.model,this.services)],growth:In.PREFERRED},f={id:"header",components:[new ia(this.model,this.services,[a,...l?[u]:[]],{direction:fi.ROW,alignItems:Hd.CENTER})],growth:In.PREFERRED},c={id:"graph-frame",components:e,growth:In.STRETCH,renderType:ye(n,"graphFrameRenderType")||vn.SVG},d=ye(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let h=fi.COLUMN;if(d){const y=ye(i,"legend","position");y==="left"?(h=fi.ROW,i.legend.orientation||(i.legend.orientation=Au.VERTICAL)):y==="right"?(h=fi.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=Au.VERTICAL)):y==="bottom"&&(h=fi.COLUMN_REVERSE)}const g={id:"spacer",components:[new hd(this.model,this.services)],growth:In.PREFERRED},_={id:"full-frame",components:[new ia(this.model,this.services,[...d?[r]:[],...d?[g]:[],c],{direction:h})],growth:In.STRETCH},k=[];if(o||l){k.push(f);const y={id:"spacer",components:[new hd(this.model,this.services,l?{size:15}:void 0)],growth:In.PREFERRED};k.push(y)}return k.push(_),[new FO(this.model,this.services),new BO(this.model,this.services),new ia(this.model,this.services,k,{direction:fi.COLUMN})]}}class Vge extends Gge{constructor(e,n){super(e,n),this.services=Object.assign(this.services,{cartesianScales:Bge,curves:Uge,zoom:Fge}),this.model=new whe(this.services)}getAxisChartComponents(e,n){const i=this.model.getOptions(),l=ye(i,"zoomBar",Qe.TOP,"enabled"),r=ye(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=ye(i,"axes",s,"scaleType"),a=l&&s===Qe.BOTTOM&&o===St.TIME,u=this.services.zoom.isZoomBarLocked(Qe.TOP),f=!!this.model.getOptions().title,c={id:"title",components:[new zO(this.model,this.services)],growth:In.STRETCH},d={id:"toolbar",components:[new DO(this.model,this.services)],growth:In.PREFERRED},h={id:"header",components:[new ia(this.model,this.services,[c,...r?[d]:[]],{direction:fi.ROW,alignItems:Hd.CENTER})],growth:In.PREFERRED},g={id:"legend",components:[new HO(this.model,this.services)],growth:In.PREFERRED};a&&!u&&e.push(new UO(this.model,this.services),new Xme(this.model,this.services)),e.push(new Jme(this.model,this.services)),e.push(new Qme(this.model,this.services));const _={id:"graph-frame",components:e,growth:In.STRETCH,renderType:vn.SVG},k=ye(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let y=fi.COLUMN;if(k){const D=ye(this.model.getOptions(),"legend","position");D===ku.LEFT?(y=fi.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Au.VERTICAL)):D===ku.RIGHT?(y=fi.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=Au.VERTICAL)):D===ku.BOTTOM&&(y=fi.COLUMN_REVERSE)}const T={id:"spacer",components:[new hd(this.model,this.services)],growth:In.PREFERRED},M={id:"full-frame",components:[new ia(this.model,this.services,[...k?[g]:[],...k?[T]:[],_],{direction:y})],growth:In.STRETCH},A={id:"zoom-bar",components:[new Kme(this.model,this.services)],growth:In.PREFERRED,renderType:vn.SVG},C=[];if(f||r){C.push(h);const D={id:"spacer",components:[new hd(this.model,this.services,r?{size:15}:void 0)],growth:In.PREFERRED};C.push(D)}return a&&C.push(A),C.push(M),[new xme(this.model,this.services),new BO(this.model,this.services),new ia(this.model,this.services,C,{direction:fi.COLUMN})]}}class Wge extends Vge{constructor(e,n){super(e,n),this.model.setOptions(ohe(lf(rhe.areaChart),n.options)),this.init(e,n)}getComponents(){const e=[new ige(this.model,this.services),new ege(this.model,this.services),new WO(this.model,this.services),new Oc(this.model,this.services),new VO(this.model,this.services),new Tu(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new lge(this.model,this.services,{skeleton:$o.GRID})];return this.getAxisChartComponents(e)}}ks.LINE+"",ks.SCATTER+"",ks.AREA+"",ks.STACKED_AREA+"",ks.SIMPLE_BAR+"",ks.GROUPED_BAR+"",ks.STACKED_BAR+"";function jge(t){let e,n;return e=new hi({props:{state:"loading",message:t[6]("Loading statistics")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.message=i[6]("Loading statistics")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $ge(t){let e,n;return e=new hi({props:{state:"error",title:t[6]("Stats unavailable"),message:t[2],onRetry:t[12]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Stats unavailable")),l[0]&4&&(r.message=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function q6(t){let e,n;return e=new Rt({props:{type:"red",size:"sm",$$slots:{default:[qge]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qge(t){let e=t[6]("Check the logs")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Check the logs")+"")&&Y(n,e)},d(i){i&&E(n)}}}function Yge(t){let e=t[6]("Since GateSentry started")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Since GateSentry started")+"")&&Y(n,e)},d(i){i&&E(n)}}}function Zge(t){let e=t[6]("Since GateSentry started")+"",n,i,l=new Date(t[4].started_at).toLocaleString()+"",r;return{c(){n=$(e),i=$(" · "),r=$(l)},m(s,o){O(s,n,o),O(s,i,o),O(s,r,o)},p(s,o){o[0]&64&&e!==(e=s[6]("Since GateSentry started")+"")&&Y(n,e),o[0]&16&&l!==(l=new Date(s[4].started_at).toLocaleString()+"")&&Y(r,l)},d(s){s&&(E(n),E(i),E(r))}}}function Y6(t){let e,n,i,l=t[6]("Most blocked domains")+"",r,s,o,a,u,f,c,d=t[6]("Most requested domains")+"",h,g,_,k,y,T,M,A=t[6]("Most active devices")+"",C,D,R,N,G,B,j,q=t[6]("Blocks by policy")+"",V,K,x,ie,X,ce,ae,ee=t[6]("Block reasons")+"",he,ne,re,oe,Re,qe,Ce,Ze=t[6]("Traffic breakdown")+"",be,Ae,ve,me,lt,De;const vt=[Kge,Xge],dt=[];function ot(pe,et){var gt;return(gt=pe[0].top_blocked_domains)!=null&>.length?0:1}o=ot(t),a=dt[o]=vt[o](t);const ht=[Qge,Jge],Bt=[];function Ot(pe,et){var gt;return(gt=pe[0].top_domains)!=null&>.length?0:1}_=Ot(t),k=Bt[_]=ht[_](t);const Zt=[e_e,xge],Ve=[];function Nt(pe,et){var gt;return(gt=pe[0].affected_devices)!=null&>.length?0:1}R=Nt(t),N=Ve[R]=Zt[R](t);const Tt=[n_e,t_e],Gt=[];function fn(pe,et){var gt;return(gt=pe[0].blocks_by_policy)!=null&>.length?0:1}x=fn(t),ie=Gt[x]=Tt[x](t);const an=[l_e,i_e],Qt=[];function Ne(pe,et){var gt;return(gt=pe[0].top_reasons)!=null&>.length?0:1}return re=Ne(t),oe=Qt[re]=an[re](t),ve=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Layer")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[14](t[0].by_layer,t[7],t[0].total)}}),lt=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Outcome")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[14](t[0].by_action,t[8],t[0].total)}}),{c(){e=P("div"),n=P("section"),i=P("h3"),r=$(l),s=F(),a.c(),u=F(),f=P("section"),c=P("h3"),h=$(d),g=F(),k.c(),y=F(),T=P("section"),M=P("h3"),C=$(A),D=F(),N.c(),G=F(),B=P("section"),j=P("h3"),V=$(q),K=F(),ie.c(),X=F(),ce=P("section"),ae=P("h3"),he=$(ee),ne=F(),oe.c(),Re=F(),qe=P("section"),Ce=P("h3"),be=$(Ze),Ae=F(),U(ve.$$.fragment),me=F(),U(lt.$$.fragment),I(i,"class","svelte-1ojnyvp"),I(n,"class","panel svelte-1ojnyvp"),I(c,"class","svelte-1ojnyvp"),I(f,"class","panel svelte-1ojnyvp"),I(M,"class","svelte-1ojnyvp"),I(T,"class","panel svelte-1ojnyvp"),I(j,"class","svelte-1ojnyvp"),I(B,"class","panel svelte-1ojnyvp"),I(ae,"class","svelte-1ojnyvp"),I(ce,"class","panel svelte-1ojnyvp"),I(Ce,"class","svelte-1ojnyvp"),I(qe,"class","panel svelte-1ojnyvp"),I(e,"class","columns svelte-1ojnyvp")},m(pe,et){O(pe,e,et),w(e,n),w(n,i),w(i,r),w(n,s),dt[o].m(n,null),w(e,u),w(e,f),w(f,c),w(c,h),w(f,g),Bt[_].m(f,null),w(e,y),w(e,T),w(T,M),w(M,C),w(T,D),Ve[R].m(T,null),w(e,G),w(e,B),w(B,j),w(j,V),w(B,K),Gt[x].m(B,null),w(e,X),w(e,ce),w(ce,ae),w(ae,he),w(ce,ne),Qt[re].m(ce,null),w(e,Re),w(e,qe),w(qe,Ce),w(Ce,be),w(qe,Ae),z(ve,qe,null),w(qe,me),z(lt,qe,null),De=!0},p(pe,et){(!De||et[0]&64)&&l!==(l=pe[6]("Most blocked domains")+"")&&Y(r,l);let gt=o;o=ot(pe),o===gt?dt[o].p(pe,et):(ue(),v(dt[gt],1,1,()=>{dt[gt]=null}),fe(),a=dt[o],a?a.p(pe,et):(a=dt[o]=vt[o](pe),a.c()),p(a,1),a.m(n,null)),(!De||et[0]&64)&&d!==(d=pe[6]("Most requested domains")+"")&&Y(h,d);let Kt=_;_=Ot(pe),_===Kt?Bt[_].p(pe,et):(ue(),v(Bt[Kt],1,1,()=>{Bt[Kt]=null}),fe(),k=Bt[_],k?k.p(pe,et):(k=Bt[_]=ht[_](pe),k.c()),p(k,1),k.m(f,null)),(!De||et[0]&64)&&A!==(A=pe[6]("Most active devices")+"")&&Y(C,A);let ze=R;R=Nt(pe),R===ze?Ve[R].p(pe,et):(ue(),v(Ve[ze],1,1,()=>{Ve[ze]=null}),fe(),N=Ve[R],N?N.p(pe,et):(N=Ve[R]=Zt[R](pe),N.c()),p(N,1),N.m(T,null)),(!De||et[0]&64)&&q!==(q=pe[6]("Blocks by policy")+"")&&Y(V,q);let kt=x;x=fn(pe),x===kt?Gt[x].p(pe,et):(ue(),v(Gt[kt],1,1,()=>{Gt[kt]=null}),fe(),ie=Gt[x],ie?ie.p(pe,et):(ie=Gt[x]=Tt[x](pe),ie.c()),p(ie,1),ie.m(B,null)),(!De||et[0]&64)&&ee!==(ee=pe[6]("Block reasons")+"")&&Y(he,ee);let Pt=re;re=Ne(pe),re===Pt?Qt[re].p(pe,et):(ue(),v(Qt[Pt],1,1,()=>{Qt[Pt]=null}),fe(),oe=Qt[re],oe?oe.p(pe,et):(oe=Qt[re]=an[re](pe),oe.c()),p(oe,1),oe.m(ce,null)),(!De||et[0]&64)&&Ze!==(Ze=pe[6]("Traffic breakdown")+"")&&Y(be,Ze);const cn={};et[0]&64&&(cn.headers=[{key:"key",value:pe[6]("Layer")},{key:"count",value:pe[6]("Requests")},{key:"share",value:pe[6]("Share")}]),et[0]&1&&(cn.rows=pe[14](pe[0].by_layer,pe[7],pe[0].total)),ve.$set(cn);const qn={};et[0]&64&&(qn.headers=[{key:"key",value:pe[6]("Outcome")},{key:"count",value:pe[6]("Requests")},{key:"share",value:pe[6]("Share")}]),et[0]&1&&(qn.rows=pe[14](pe[0].by_action,pe[8],pe[0].total)),lt.$set(qn)},i(pe){De||(p(a),p(k),p(N),p(ie),p(oe),p(ve.$$.fragment,pe),p(lt.$$.fragment,pe),De=!0)},o(pe){v(a),v(k),v(N),v(ie),v(oe),v(ve.$$.fragment,pe),v(lt.$$.fragment,pe),De=!1},d(pe){pe&&E(e),dt[o].d(),Bt[_].d(),Ve[R].d(),Gt[x].d(),Qt[re].d(),H(ve),H(lt)}}}function Xge(t){let e,n=t[6]("Nothing blocked in this window.")+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("Nothing blocked in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function Kge(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Blocks")}],rows:t[13](t[0].top_blocked_domains,"b")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[13](i[0].top_blocked_domains,"b")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Jge(t){let e,n=t[6]("No requests in this window.")+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No requests in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function Qge(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Requests")}],rows:t[13](t[0].top_domains,"t")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[13](i[0].top_domains,"t")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xge(t){let e,n=t[6]("No device activity in this window.")+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No device activity in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function e_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"device",value:t[6]("Device")},{key:"count",value:t[6]("Requests")}],rows:t[0].affected_devices.map(t[18])}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"device",value:i[6]("Device")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[0].affected_devices.map(i[18])),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function t_e(t){let e,n=t[6]("No policy blocks in this window.")+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No policy blocks in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function n_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"name",value:t[6]("Policy")},{key:"count",value:t[6]("Blocks")}],rows:t[0].blocks_by_policy.map(t[19])}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"name",value:i[6]("Policy")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[0].blocks_by_policy.map(i[19])),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function i_e(t){let e,n=t[6]("No recorded reasons in this window.")+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","helper svelte-1ojnyvp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No recorded reasons in this window.")+"")&&Y(i,n)},i:_e,o:_e,d(l){l&&E(e)}}}function l_e(t){let e,n;return e=new ml({props:{size:"short",headers:[{key:"key",value:t[6]("Reason")},{key:"count",value:t[6]("Decisions")}],rows:t[13](t[0].top_reasons,"r")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Reason")},{key:"count",value:i[6]("Decisions")}]),l[0]&1&&(r.rows=i[13](i[0].top_reasons,"r")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function r_e(t){var es,pr,ts,Rs,Ps,ns,pl,br;let e,n,i,l,r,s,o=t[6]("Requests")+"",a,u,f,c=t[9]((es=t[0])==null?void 0:es.total)+"",d,h,g,_,k=t[6]("Blocked")+"",y,T,M,A=t[9](t[5])+"",C,D,R,N=t[10](t[5],((pr=t[0])==null?void 0:pr.total)||0)+"",G,B,j=t[6]("of requests")+"",q,V,K,x,ie=t[6]("Active clients")+"",X,ce,ae,ee=t[9]((ts=t[0])==null?void 0:ts.unique_clients)+"",he,ne,re,oe,Re=t[6]("Distinct domains")+"",qe,Ce,Ze,be=t[9]((Rs=t[0])==null?void 0:Rs.unique_domains)+"",Ae,ve,me,lt,De=t[6]("Inspection errors")+"",vt,dt,ot,ht=t[9]((Ps=t[0])==null?void 0:Ps.inspection_failures)+"",Bt,Ot,Zt,Ve,Nt,Tt=t[6]("Live proxy traffic")+"",Gt,fn,an,Qt=t[11]((ns=t[4])==null?void 0:ns.total_bytes)+"",Ne,pe,et,gt=t[6]("Down")+"",Kt,ze,kt=t[11]((pl=t[4])==null?void 0:pl.download_bytes)+"",Pt,cn,qn=t[6]("Up")+"",nl,Bl,Be=t[11]((br=t[4])==null?void 0:br.upload_bytes)+"",Et,kn,Xe,wt,Mt,Zn,Bn=t[6]("Requests over time")+"",wn,_r,_l,Jr,ji,gn;const Qr=[$ge,jge],il=[];function Xn(_t,Ut){return _t[2]?0:_t[0]?-1:1}~(e=Xn(t))&&(n=il[e]=Qr[e](t));let xt=t[0]&&t[0].inspection_failures>0&&q6(t);function xr(_t,Ut){var vi;return(vi=_t[4])!=null&&vi.started_at?Zge:Yge}let $i=xr(t),Mn=$i(t),yn=t[0]&&Y6(t);return{c(){n&&n.c(),i=F(),l=P("section"),r=P("div"),s=P("span"),a=$(o),u=F(),f=P("span"),d=$(c),h=F(),g=P("div"),_=P("span"),y=$(k),T=F(),M=P("span"),C=$(A),D=F(),R=P("span"),G=$(N),B=F(),q=$(j),V=F(),K=P("div"),x=P("span"),X=$(ie),ce=F(),ae=P("span"),he=$(ee),ne=F(),re=P("div"),oe=P("span"),qe=$(Re),Ce=F(),Ze=P("span"),Ae=$(be),ve=F(),me=P("div"),lt=P("span"),vt=$(De),dt=F(),ot=P("span"),Bt=$(ht),Ot=F(),xt&&xt.c(),Zt=F(),Ve=P("div"),Nt=P("span"),Gt=$(Tt),fn=F(),an=P("span"),Ne=$(Qt),pe=F(),et=P("span"),Kt=$(gt),ze=F(),Pt=$(kt),cn=$(" · "),nl=$(qn),Bl=F(),Et=$(Be),kn=F(),Xe=P("span"),Mn.c(),wt=F(),Mt=P("section"),Zn=P("h3"),wn=$(Bn),_r=F(),_l=P("div"),Jr=F(),yn&&yn.c(),ji=je(),I(s,"class","tile-label svelte-1ojnyvp"),I(f,"class","tile-value svelte-1ojnyvp"),I(r,"class","tile svelte-1ojnyvp"),I(_,"class","tile-label svelte-1ojnyvp"),I(M,"class","tile-value svelte-1ojnyvp"),I(R,"class","tile-foot svelte-1ojnyvp"),I(g,"class","tile svelte-1ojnyvp"),I(x,"class","tile-label svelte-1ojnyvp"),I(ae,"class","tile-value svelte-1ojnyvp"),I(K,"class","tile svelte-1ojnyvp"),I(oe,"class","tile-label svelte-1ojnyvp"),I(Ze,"class","tile-value svelte-1ojnyvp"),I(re,"class","tile svelte-1ojnyvp"),I(lt,"class","tile-label svelte-1ojnyvp"),I(ot,"class","tile-value svelte-1ojnyvp"),I(me,"class","tile svelte-1ojnyvp"),I(Nt,"class","tile-label svelte-1ojnyvp"),I(an,"class","tile-value svelte-1ojnyvp"),I(et,"class","tile-foot svelte-1ojnyvp"),I(Xe,"class","tile-foot svelte-1ojnyvp"),I(Ve,"class","tile traffic-tile svelte-1ojnyvp"),I(l,"class","tiles svelte-1ojnyvp"),I(Zn,"class","svelte-1ojnyvp"),I(_l,"class","chart svelte-1ojnyvp"),I(Mt,"class","panel svelte-1ojnyvp")},m(_t,Ut){~e&&il[e].m(_t,Ut),O(_t,i,Ut),O(_t,l,Ut),w(l,r),w(r,s),w(s,a),w(r,u),w(r,f),w(f,d),w(l,h),w(l,g),w(g,_),w(_,y),w(g,T),w(g,M),w(M,C),w(g,D),w(g,R),w(R,G),w(R,B),w(R,q),w(l,V),w(l,K),w(K,x),w(x,X),w(K,ce),w(K,ae),w(ae,he),w(l,ne),w(l,re),w(re,oe),w(oe,qe),w(re,Ce),w(re,Ze),w(Ze,Ae),w(l,ve),w(l,me),w(me,lt),w(lt,vt),w(me,dt),w(me,ot),w(ot,Bt),w(me,Ot),xt&&xt.m(me,null),w(l,Zt),w(l,Ve),w(Ve,Nt),w(Nt,Gt),w(Ve,fn),w(Ve,an),w(an,Ne),w(Ve,pe),w(Ve,et),w(et,Kt),w(et,ze),w(et,Pt),w(et,cn),w(et,nl),w(et,Bl),w(et,Et),w(Ve,kn),w(Ve,Xe),Mn.m(Xe,null),O(_t,wt,Ut),O(_t,Mt,Ut),w(Mt,Zn),w(Zn,wn),w(Mt,_r),w(Mt,_l),t[17](_l),O(_t,Jr,Ut),yn&&yn.m(_t,Ut),O(_t,ji,Ut),gn=!0},p(_t,Ut){var Ns,is,ni,tr,vr,ls,Bs,kr;let vi=e;e=Xn(_t),e===vi?~e&&il[e].p(_t,Ut):(n&&(ue(),v(il[vi],1,1,()=>{il[vi]=null}),fe()),~e?(n=il[e],n?n.p(_t,Ut):(n=il[e]=Qr[e](_t),n.c()),p(n,1),n.m(i.parentNode,i)):n=null),(!gn||Ut[0]&64)&&o!==(o=_t[6]("Requests")+"")&&Y(a,o),(!gn||Ut[0]&1)&&c!==(c=_t[9]((Ns=_t[0])==null?void 0:Ns.total)+"")&&Y(d,c),(!gn||Ut[0]&64)&&k!==(k=_t[6]("Blocked")+"")&&Y(y,k),(!gn||Ut[0]&32)&&A!==(A=_t[9](_t[5])+"")&&Y(C,A),(!gn||Ut[0]&33)&&N!==(N=_t[10](_t[5],((is=_t[0])==null?void 0:is.total)||0)+"")&&Y(G,N),(!gn||Ut[0]&64)&&j!==(j=_t[6]("of requests")+"")&&Y(q,j),(!gn||Ut[0]&64)&&ie!==(ie=_t[6]("Active clients")+"")&&Y(X,ie),(!gn||Ut[0]&1)&&ee!==(ee=_t[9]((ni=_t[0])==null?void 0:ni.unique_clients)+"")&&Y(he,ee),(!gn||Ut[0]&64)&&Re!==(Re=_t[6]("Distinct domains")+"")&&Y(qe,Re),(!gn||Ut[0]&1)&&be!==(be=_t[9]((tr=_t[0])==null?void 0:tr.unique_domains)+"")&&Y(Ae,be),(!gn||Ut[0]&64)&&De!==(De=_t[6]("Inspection errors")+"")&&Y(vt,De),(!gn||Ut[0]&1)&&ht!==(ht=_t[9]((vr=_t[0])==null?void 0:vr.inspection_failures)+"")&&Y(Bt,ht),_t[0]&&_t[0].inspection_failures>0?xt?(xt.p(_t,Ut),Ut[0]&1&&p(xt,1)):(xt=q6(_t),xt.c(),p(xt,1),xt.m(me,null)):xt&&(ue(),v(xt,1,1,()=>{xt=null}),fe()),(!gn||Ut[0]&64)&&Tt!==(Tt=_t[6]("Live proxy traffic")+"")&&Y(Gt,Tt),(!gn||Ut[0]&16)&&Qt!==(Qt=_t[11]((ls=_t[4])==null?void 0:ls.total_bytes)+"")&&Y(Ne,Qt),(!gn||Ut[0]&64)&>!==(gt=_t[6]("Down")+"")&&Y(Kt,gt),(!gn||Ut[0]&16)&&kt!==(kt=_t[11]((Bs=_t[4])==null?void 0:Bs.download_bytes)+"")&&Y(Pt,kt),(!gn||Ut[0]&64)&&qn!==(qn=_t[6]("Up")+"")&&Y(nl,qn),(!gn||Ut[0]&16)&&Be!==(Be=_t[11]((kr=_t[4])==null?void 0:kr.upload_bytes)+"")&&Y(Et,Be),$i===($i=xr(_t))&&Mn?Mn.p(_t,Ut):(Mn.d(1),Mn=$i(_t),Mn&&(Mn.c(),Mn.m(Xe,null))),(!gn||Ut[0]&64)&&Bn!==(Bn=_t[6]("Requests over time")+"")&&Y(wn,Bn),_t[0]?yn?(yn.p(_t,Ut),Ut[0]&1&&p(yn,1)):(yn=Y6(_t),yn.c(),p(yn,1),yn.m(ji.parentNode,ji)):yn&&(ue(),v(yn,1,1,()=>{yn=null}),fe())},i(_t){gn||(p(n),p(xt),p(yn),gn=!0)},o(_t){v(n),v(xt),v(yn),gn=!1},d(_t){_t&&(E(i),E(l),E(wt),E(Mt),E(Jr),E(ji)),~e&&il[e].d(_t),xt&&xt.d(),Mn.d(),t[17](null),yn&&yn.d(_t)}}}function s_e(t){let e=t[6]("Dashboard")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function o_e(t){let e=t[6]("Stats")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Stats")+"")&&Y(n,e)},d(i){i&&E(n)}}}function a_e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[s_e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[o_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&64|s[1]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function u_e(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[a_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function f_e(t){let e,n,i,l;return e=new xp({props:{text:t[6]("24 hours")}}),i=new xp({props:{text:t[6]("7 days")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&64&&(o.text=r[6]("24 hours")),e.$set(o);const a={};s[0]&64&&(a.text=r[6]("7 days")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function c_e(t){let e,n,i;return n=new $R({props:{size:"sm",selectedIndex:t[1],$$slots:{default:[f_e]},$$scope:{ctx:t}}}),n.$on("change",t[16]),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","switcher svelte-1ojnyvp")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&2&&(s.selectedIndex=l[1]),r[0]&64|r[1]&4&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function d_e(t){let e,n;return e=new Nl({props:{title:t[6]("Statistics"),description:t[6]("Review filtering outcomes, client activity, and live proxy traffic."),$$slots:{actions:[c_e],breadcrumb:[u_e],default:[r_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Statistics")),l[0]&64&&(r.description=i[6]("Review filtering outcomes, client activity, and live proxy traffic.")),l[0]&127|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function h_e(t,e,n){let i,l,r;ct(t,Ln,ee=>n(27,l=ee)),ct(t,ti,ee=>n(6,r=ee));const s=[1,7],o={dns:"DNS",explicit_proxy:"Proxy",transparent_proxy:"Transparent proxy",content:"Content inspection"},a={allow:"Allowed",block:"Blocked",inspect:"Inspected",bypass:"Bypassed",error:"Errors",unknown:"Other"};let u=1,f=null,c="",d=null,h,g=null,_=!1,k=!1,y=null,T=null,M=!1,A=!1;const C=ee=>typeof ee=="number"?ee.toLocaleString():"—",D=(ee,he)=>he>0?(ee/he*100).toFixed(1)+"%":"—",R=ee=>{if(typeof ee!="number")return"—";const he=["B","KiB","MiB","GiB","TiB"];let ne=ee,re=0;for(;ne>=1024&&re=100?0:ne>=10?1:2;return`${ne.toFixed(oe)} ${he[re]}`},N=ee=>(ee.timeline||[]).flatMap(he=>{const ne=new Date(he.start*1e3).toISOString();return[{group:"Requests",date:ne,value:he.total},{group:"Blocked",date:ne,value:he.blocked}]}),G=ee=>{const he=N(ee);h&&(d?d.model.setData(he):d=new Wge(h,{data:he,options:{axes:{bottom:{mapsTo:"date",scaleType:St.TIME},left:{mapsTo:"value",scaleType:St.LINEAR}},curve:"curveMonotoneX",height:"320px",toolbar:{enabled:!1},legend:{alignment:Il.LEFT}}}))},B=async()=>{if(_||A)return;_=!0;const ee=u;try{const he=s[ee],ne=await l.api.doCall(`/decisions/summary?days=${he}`);!A&&ee===u&&(n(0,f=ne),n(2,c=""),f&&G(f))}catch{!A&&ee===u&&n(2,c="Unable to load statistics.")}finally{if(_=!1,A)return;k?(k=!1,B()):g=setTimeout(B,3e4)}},j=()=>{if(g&&clearTimeout(g),g=null,_){k=!0;return}B()},q=async()=>{if(!(M||A)){M=!0;try{const ee=await l.api.doCall("/proxy/traffic");A||n(4,y=ee)}catch{}finally{M=!1,A||(T=setTimeout(q,5e3))}}},V=(ee,he)=>(ee||[]).map((ne,re)=>({id:he+re,key:ne.key,count:C(ne.count)})),K=(ee,he,ne)=>Object.entries(ee||{}).sort((re,oe)=>oe[1]-re[1]).map(([re,oe])=>({id:re,key:he[re]||re,count:C(oe),share:D(oe,ne)})),x=ee=>{n(1,u=ee),j()};on(()=>{B(),q()}),Ls(()=>{A=!0,g&&clearTimeout(g),T&&clearTimeout(T),d&&d.destroy()});const ie=ee=>x(ee.detail);function X(ee){xe[ee?"unshift":"push"](()=>{h=ee,n(3,h)})}const ce=(ee,he)=>({id:"d"+he,device:ee.device||ee.ip,count:C(ee.count)}),ae=ee=>({id:ee.id,name:ee.name,count:C(ee.count)});return t.$$.update=()=>{var ee;t.$$.dirty[0]&1&&n(5,i=((ee=f==null?void 0:f.by_action)==null?void 0:ee.block)||0)},[f,u,c,h,y,i,r,o,a,C,D,R,j,V,K,x,ie,X,ce,ae]}class m_e extends Oe{constructor(e){super(),Ee(this,e,h_e,d_e,Se,{},null,[-1,-1])}}function Z6(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("AI status unavailable"),subtitle:t[8]}}),e.$on("close",t[18]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("AI status unavailable")),l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function g_e(t){let e,n,i=t[14](t[2])+"",l,r,s,o,a,u=(t[9].detail||t[11]("No additional status detail."))+"",f,c;return s=new Rt({props:{type:dr(t[9].state),size:"sm",$$slots:{default:[p_e]},$$scope:{ctx:t}}}),{c(){e=P("div"),n=P("strong"),l=$(i),r=F(),U(s.$$.fragment),o=F(),a=P("p"),f=$(u),I(e,"class","status-line svelte-ly8en8"),I(a,"class","svelte-ly8en8")},m(d,h){O(d,e,h),w(e,n),w(n,l),w(e,r),z(s,e,null),O(d,o,h),O(d,a,h),w(a,f),c=!0},p(d,h){(!c||h&4)&&i!==(i=d[14](d[2])+"")&&Y(l,i);const g={};h&512&&(g.type=dr(d[9].state)),h&134218240&&(g.$$scope={dirty:h,ctx:d}),s.$set(g),(!c||h&2560)&&u!==(u=(d[9].detail||d[11]("No additional status detail."))+"")&&Y(f,u)},i(d){c||(p(s.$$.fragment,d),c=!0)},o(d){v(s.$$.fragment,d),c=!1},d(d){d&&(E(e),E(o),E(a)),H(s)}}}function __e(t){let e,n;return e=new Wi({props:{description:t[11]("Checking provider…")}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.description=i[11]("Checking provider…")),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function p_e(t){let e=t[15](t[9].state)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&512&&e!==(e=i[15](i[9].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function b_e(t){let e,n,i=t[11]("AI image filtering is disabled")+"",l,r,s,o=t[11]("No image content is sent to Grok, ChatGPT, or a local LLM.")+"",a;return{c(){e=P("section"),n=P("h3"),l=$(i),r=F(),s=P("p"),a=$(o),I(n,"id","disabled-title"),I(s,"class","svelte-ly8en8"),I(e,"class","disabled-state svelte-ly8en8"),I(e,"aria-labelledby","disabled-title")},m(u,f){O(u,e,f),w(e,n),w(n,l),w(e,r),w(e,s),w(s,a)},p(u,f){f&2048&&i!==(i=u[11]("AI image filtering is disabled")+"")&&Y(l,i),f&2048&&o!==(o=u[11]("No image content is sent to Grok, ChatGPT, or a local LLM.")+"")&&Y(a,o)},i:_e,o:_e,d(u){u&&E(e)}}}function v_e(t){let e,n,i,l,r=t[11]("Local LLM configuration")+"",s,o,a,u=t[11]("Point GateSentry at an Ollama-compatible HTTP API on a network you trust.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[5].state),size:"sm",$$slots:{default:[y_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_local_llm_url",title:t[11]("Local LLM URL"),labelText:t[11]("Local LLM URL"),type:"text",helperText:t[11]("For example, http://127.0.0.1:11434"),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_local_llm_model",title:t[11]("Ollama model"),labelText:t[11]("Ollama model"),type:"text",helperText:t[11]("Leave empty to use the server default, llava."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","local-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","local-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("Local LLM configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Point GateSentry at an Ollama-compatible HTTP API on a network you trust.")+"")&&Y(f,u);const C={};A&32&&(C.type=dr(M[5].state)),A&134217760&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("Local LLM URL")),A&2048&&(D.labelText=M[11]("Local LLM URL")),A&2048&&(D.helperText=M[11]("For example, http://127.0.0.1:11434")),_.$set(D);const R={};A&2048&&(R.title=M[11]("Ollama model")),A&2048&&(R.labelText=M[11]("Ollama model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, llava.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function k_e(t){let e,n,i,l,r=t[11]("ChatGPT configuration")+"",s,o,a,u=t[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[6].state),size:"sm",$$slots:{default:[T_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_openai_api_key",title:t[11]("OpenAI API key"),labelText:t[11]("OpenAI API key"),type:"password",helperText:t[4]?t[11]("A key is saved. Enter a new value only to replace it."):t[11]("Enter an OpenAI API key."),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_openai_model",title:t[11]("ChatGPT model"),labelText:t[11]("ChatGPT model"),type:"text",helperText:t[11]("Leave empty to use the server default, gpt-4o-mini."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","chatgpt-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","chatgpt-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("ChatGPT configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"")&&Y(f,u);const C={};A&64&&(C.type=dr(M[6].state)),A&134217792&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("OpenAI API key")),A&2048&&(D.labelText=M[11]("OpenAI API key")),A&2064&&(D.helperText=M[4]?M[11]("A key is saved. Enter a new value only to replace it."):M[11]("Enter an OpenAI API key.")),_.$set(D);const R={};A&2048&&(R.title=M[11]("ChatGPT model")),A&2048&&(R.labelText=M[11]("ChatGPT model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, gpt-4o-mini.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function w_e(t){let e,n,i,l,r=t[11]("Grok configuration")+"",s,o,a,u=t[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"",f,c,d,h,g,_,k,y,T;return d=new Rt({props:{type:dr(t[7].state),size:"sm",$$slots:{default:[S_e]},$$scope:{ctx:t}}}),_=new Ql({props:{keyName:"ai_grok_api_key",title:t[11]("Grok API key"),labelText:t[11]("Grok API key"),type:"password",helperText:t[3]?t[11]("A key is saved. Enter a new value only to replace it."):t[11]("Enter an xAI / Grok API key."),onSaved:t[13]}}),y=new Ql({props:{keyName:"ai_grok_model",title:t[11]("Grok model"),labelText:t[11]("Grok model"),type:"text",helperText:t[11]("Leave empty to use the server default, grok-4.5."),onSaved:t[13]}}),{c(){e=P("section"),n=P("div"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),U(d.$$.fragment),h=F(),g=P("div"),U(_.$$.fragment),k=F(),U(y.$$.fragment),I(l,"id","grok-configuration-title"),I(a,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(g,"class","fields svelte-ly8en8"),I(e,"class","configuration svelte-ly8en8"),I(e,"aria-labelledby","grok-configuration-title")},m(M,A){O(M,e,A),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(n,c),z(d,n,null),w(e,h),w(e,g),z(_,g,null),w(g,k),z(y,g,null),T=!0},p(M,A){(!T||A&2048)&&r!==(r=M[11]("Grok configuration")+"")&&Y(s,r),(!T||A&2048)&&u!==(u=M[11]("Credentials stay stored on this GateSentry server and are not returned to the browser.")+"")&&Y(f,u);const C={};A&128&&(C.type=dr(M[7].state)),A&134217856&&(C.$$scope={dirty:A,ctx:M}),d.$set(C);const D={};A&2048&&(D.title=M[11]("Grok API key")),A&2048&&(D.labelText=M[11]("Grok API key")),A&2056&&(D.helperText=M[3]?M[11]("A key is saved. Enter a new value only to replace it."):M[11]("Enter an xAI / Grok API key.")),_.$set(D);const R={};A&2048&&(R.title=M[11]("Grok model")),A&2048&&(R.labelText=M[11]("Grok model")),A&2048&&(R.helperText=M[11]("Leave empty to use the server default, grok-4.5.")),y.$set(R)},i(M){T||(p(d.$$.fragment,M),p(_.$$.fragment,M),p(y.$$.fragment,M),T=!0)},o(M){v(d.$$.fragment,M),v(_.$$.fragment,M),v(y.$$.fragment,M),T=!1},d(M){M&&E(e),H(d),H(_),H(y)}}}function y_e(t){let e=t[15](t[5].state)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&32&&e!==(e=i[15](i[5].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function T_e(t){let e=t[15](t[6].state)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&64&&e!==(e=i[15](i[6].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function S_e(t){let e=t[15](t[7].state)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&128&&e!==(e=i[15](i[7].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function E_e(t){let e=t[15](t[10].state)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&1024&&e!==(e=i[15](i[10].state)+"")&&Y(n,e)},d(i){i&&E(n)}}}function X6(t){let e,n=t[10].detail+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","status-detail svelte-ly8en8")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&1024&&n!==(n=l[10].detail+"")&&Y(i,n)},d(l){l&&E(e)}}}function O_e(t){let e,n,i,l=t[11]("Optional compatibility path for the original local classifier endpoint. It is separate from the selected provider above.")+"",r,s,o,a,u,f,c;o=new Rt({props:{type:dr(t[10].state),size:"sm",$$slots:{default:[E_e]},$$scope:{ctx:t}}});let d=t[10].detail&&X6(t);return f=new Ql({props:{keyName:"ai_scanner_url",title:t[11]("AI service URL"),labelText:t[11]("AI service URL"),type:"text",helperText:t[11]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run the legacy scanner."),onSaved:t[13]}}),{c(){e=P("div"),n=P("div"),i=P("p"),r=$(l),s=F(),U(o.$$.fragment),a=F(),d&&d.c(),u=F(),U(f.$$.fragment),I(i,"class","svelte-ly8en8"),I(n,"class","section-head svelte-ly8en8"),I(e,"class","advanced-content svelte-ly8en8")},m(h,g){O(h,e,g),w(e,n),w(n,i),w(i,r),w(n,s),z(o,n,null),w(e,a),d&&d.m(e,null),w(e,u),z(f,e,null),c=!0},p(h,g){(!c||g&2048)&&l!==(l=h[11]("Optional compatibility path for the original local classifier endpoint. It is separate from the selected provider above.")+"")&&Y(r,l);const _={};g&1024&&(_.type=dr(h[10].state)),g&134218752&&(_.$$scope={dirty:g,ctx:h}),o.$set(_),h[10].detail?d?d.p(h,g):(d=X6(h),d.c(),d.m(e,u)):d&&(d.d(1),d=null);const k={};g&2048&&(k.title=h[11]("AI service URL")),g&2048&&(k.labelText=h[11]("AI service URL")),g&2048&&(k.helperText=h[11]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run the legacy scanner.")),f.$set(k)},i(h){c||(p(o.$$.fragment,h),p(f.$$.fragment,h),c=!0)},o(h){v(o.$$.fragment,h),v(f.$$.fragment,h),c=!1},d(h){h&&E(e),H(o),d&&d.d(),H(f)}}}function M_e(t){let e,n;return e=new fg({props:{title:t[11]("Legacy local scanner"),$$slots:{default:[O_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2048&&(r.title=i[11]("Legacy local scanner")),l&134220800&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function C_e(t){let e,n,i,l,r=t[11]("Provider")+"",s,o,a,u=t[11]("Choose one provider. Selecting a hosted provider sends image content to that service for classification.")+"",f,c,d,h,g,_,k=t[11]("Selected provider status")+"",y,T,M,A,C,D,R,N,G,B,j=t[11]("Advanced")+"",q,V,K,x,ie=t[8]&&Z6(t);d=new Ql({props:{keyName:"ai_image_filtering_mode",title:t[11]("AI image filtering provider"),labelText:t[11]("AI image filtering provider"),type:"radio",helperText:t[11]("HTTPS inspection must be enabled before GateSentry can inspect image bytes."),orientation:"vertical",radioOptions:t[12],onSaved:t[19]}});const X=[__e,g_e],ce=[];function ae(re,oe){return re[1]&&!re[0]?0:1}M=ae(t),A=ce[M]=X[M](t);const ee=[w_e,k_e,v_e,b_e],he=[];function ne(re,oe){return re[2]==="grok"?0:re[2]==="chatgpt"?1:re[2]==="local"?2:3}return D=ne(t),R=he[D]=ee[D](t),K=new ug({props:{align:"start",$$slots:{default:[M_e]},$$scope:{ctx:t}}}),{c(){ie&&ie.c(),e=F(),n=P("section"),i=P("div"),l=P("h3"),s=$(r),o=F(),a=P("p"),f=$(u),c=F(),U(d.$$.fragment),h=F(),g=P("aside"),_=P("span"),y=$(k),T=F(),A.c(),C=F(),R.c(),N=F(),G=P("section"),B=P("h3"),q=$(j),V=F(),U(K.$$.fragment),I(l,"id","provider-title"),I(a,"class","svelte-ly8en8"),I(i,"class","provider-choice svelte-ly8en8"),I(_,"class","eyebrow svelte-ly8en8"),I(_,"id","provider-status-title"),I(g,"class","provider-status svelte-ly8en8"),I(g,"aria-labelledby","provider-status-title"),I(n,"class","provider-panel svelte-ly8en8"),I(n,"aria-labelledby","provider-title"),I(B,"id","advanced-title"),I(B,"class","svelte-ly8en8"),I(G,"class","advanced svelte-ly8en8"),I(G,"aria-labelledby","advanced-title")},m(re,oe){ie&&ie.m(re,oe),O(re,e,oe),O(re,n,oe),w(n,i),w(i,l),w(l,s),w(i,o),w(i,a),w(a,f),w(i,c),z(d,i,null),w(n,h),w(n,g),w(g,_),w(_,y),w(g,T),ce[M].m(g,null),O(re,C,oe),he[D].m(re,oe),O(re,N,oe),O(re,G,oe),w(G,B),w(B,q),w(G,V),z(K,G,null),x=!0},p(re,oe){re[8]?ie?(ie.p(re,oe),oe&256&&p(ie,1)):(ie=Z6(re),ie.c(),p(ie,1),ie.m(e.parentNode,e)):ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()),(!x||oe&2048)&&r!==(r=re[11]("Provider")+"")&&Y(s,r),(!x||oe&2048)&&u!==(u=re[11]("Choose one provider. Selecting a hosted provider sends image content to that service for classification.")+"")&&Y(f,u);const Re={};oe&2048&&(Re.title=re[11]("AI image filtering provider")),oe&2048&&(Re.labelText=re[11]("AI image filtering provider")),oe&2048&&(Re.helperText=re[11]("HTTPS inspection must be enabled before GateSentry can inspect image bytes.")),oe&4&&(Re.onSaved=re[19]),d.$set(Re),(!x||oe&2048)&&k!==(k=re[11]("Selected provider status")+"")&&Y(y,k);let qe=M;M=ae(re),M===qe?ce[M].p(re,oe):(ue(),v(ce[qe],1,1,()=>{ce[qe]=null}),fe(),A=ce[M],A?A.p(re,oe):(A=ce[M]=X[M](re),A.c()),p(A,1),A.m(g,null));let Ce=D;D=ne(re),D===Ce?he[D].p(re,oe):(ue(),v(he[Ce],1,1,()=>{he[Ce]=null}),fe(),R=he[D],R?R.p(re,oe):(R=he[D]=ee[D](re),R.c()),p(R,1),R.m(N.parentNode,N)),(!x||oe&2048)&&j!==(j=re[11]("Advanced")+"")&&Y(q,j);const Ze={};oe&134220800&&(Ze.$$scope={dirty:oe,ctx:re}),K.$set(Ze)},i(re){x||(p(ie),p(d.$$.fragment,re),p(A),p(R),p(K.$$.fragment,re),x=!0)},o(re){v(ie),v(d.$$.fragment,re),v(A),v(R),v(K.$$.fragment,re),x=!1},d(re){re&&(E(e),E(n),E(C),E(N),E(G)),ie&&ie.d(re),H(d),ce[M].d(),he[D].d(re),H(K)}}}function A_e(t){let e=t[11]("Dashboard")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function L_e(t){let e=t[11]("AI image filtering")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2048&&e!==(e=i[11]("AI image filtering")+"")&&Y(n,e)},d(i){i&&E(n)}}}function D_e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[A_e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[L_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&134219776&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&134219776&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function I_e(t){let e;return{c(){e=$("Alpha")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function R_e(t){let e,n,i,l,r;return n=new mr({props:{noTrailingSlash:!0,$$slots:{default:[D_e]},$$scope:{ctx:t}}}),l=new Rt({props:{type:"red",size:"sm",$$slots:{default:[I_e]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","breadcrumb-line svelte-ly8en8")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o&134219776&&(a.$$scope={dirty:o,ctx:s}),n.$set(a);const u={};o&134217728&&(u.$$scope={dirty:o,ctx:s}),l.$set(u)},i(s){r||(p(n.$$.fragment,s),p(l.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(n),H(l)}}}function P_e(t){let e=(t[1]?t[11]("Checking…"):t[11]("Refresh status"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l&2050&&e!==(e=(i[1]?i[11]("Checking…"):i[11]("Refresh status"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function N_e(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[P_e]},$$scope:{ctx:t}}}),e.$on("click",t[13]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.disabled=i[1]),l&134219778&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function B_e(t){let e,n;return e=new Nl({props:{title:t[11]("AI image filtering"),description:t[11]("Optionally classify image content seen through HTTPS inspection. External AI processing is disabled by default; images are sent only to the provider you select."),$$slots:{actions:[N_e],breadcrumb:[R_e],default:[C_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2048&&(r.title=i[11]("AI image filtering")),l&2048&&(r.description=i[11]("Optionally classify image content seen through HTTPS inspection. External AI processing is disabled by default; images are sent only to the provider you select.")),l&134221823&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ZO(t){if(!t||typeof t!="object")return"";const e=t.Value!=null?t.Value:t.value;return String(e||"").trim()}function uc(t){return t&&typeof t=="object"&&t.Configured!=null?!!t.Configured:ZO(t)!==""}function dr(t){switch(t){case"ok":return"green";case"unauthorized":return"magenta";case"unreachable":return"red";case"checking":return"cool-gray";default:return"gray"}}function z_e(t,e,n){let i,l,r,s,o,a,u;ct(t,ti,K=>n(11,a=K)),ct(t,Ln,K=>n(20,u=K));const f=[{value:"disabled",label:a("Disable")},{value:"grok",label:a("Enable Grok")},{value:"chatgpt",label:a("Enable ChatGPT")},{value:"local",label:a("Enable Local LLM")}],c={state:"checking",detail:""},d={state:"not_configured",detail:""};let h=null,g=!1,_="",k="disabled",y=!1,T=!1,M=!1,A=!1;async function C(){const[K,x,ie,X,ce]=await Promise.all([u.api.getSetting("ai_image_filtering_mode"),u.api.getSetting("ai_grok_api_key"),u.api.getSetting("ai_openai_api_key"),u.api.getSetting("ai_local_llm_url"),u.api.getSetting("ai_scanner_url")]);n(2,k=ZO(K)||"disabled"),n(3,y=uc(x)),n(4,T=uc(ie)),n(16,M=uc(X)),n(17,A=uc(ce))}function D(K,x){return Promise.race([K,new Promise((ie,X)=>setTimeout(()=>X(new Error(a("Status check timed out."))),x))])}async function R(){n(1,g=!0),n(8,_="");try{await C();const K=await D(u.api.doCall("/ai/status"),12e3);if(K&&typeof K=="object")n(0,h=K),n(2,k=K.mode||k);else throw new Error(a("The status response was not valid."))}catch(K){n(0,h=null),n(8,_=K instanceof Error&&K.message?K.message:a("AI provider status could not be checked."))}finally{n(1,g=!1)}}function N(K,x,ie,X){const ce=x==null?void 0:x[K];return ce&&typeof ce=="object"&&"state"in ce?ce:X?ie?c:{state:"unreachable",detail:a("Status check did not complete")}:d}function G(K,x,ie,X,ce){const ae=(K==null?void 0:K.mode)||x||"disabled";return ae==="disabled"?{state:"disabled",detail:a("Image filtering is off")}:ae==="grok"?ie:ae==="chatgpt"?X:ae==="local"?ce:d}function B(K){return a(K==="grok"?"Grok":K==="chatgpt"?"ChatGPT":K==="local"?"Local LLM":"Disabled")}function j(K){switch(K){case"ok":return a("Reachable");case"unauthorized":return a("Invalid key");case"unreachable":return a("Unreachable");case"not_configured":return a("Not configured");case"disabled":return a("Disabled");case"checking":return a("Checking…");default:return K}}on(R);const q=()=>n(8,_=""),V=async K=>{n(2,k=K),await R()};return t.$$.update=()=>{t.$$.dirty&11&&n(7,i=N("grok",h,g,y)),t.$$.dirty&19&&n(6,l=N("chatgpt",h,g,T)),t.$$.dirty&65539&&n(5,r=N("local",h,g,M)),t.$$.dirty&131075&&n(10,s=N("legacy",h,g,A)),t.$$.dirty&229&&n(9,o=G(h,k,i,l,r))},[h,g,k,y,T,r,l,i,_,o,s,a,f,R,B,j,M,A,q,V]}class H_e extends Oe{constructor(e){super(),Ee(this,e,z_e,B_e,Se,{})}}function K6(t){let e,n;return e=new ln({props:{lowContrast:!0,kind:"error",title:t[8]("User not saved"),subtitle:t[5]}}),e.$on("close",t[12]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&256&&(r.title=i[8]("User not saved")),l&32&&(r.subtitle=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function U_e(t){let e,n,i,l;return e=new la({props:{id:"proxy-user-access-allow",value:"true",labelText:t[8]("Allow access")}}),i=new la({props:{id:"proxy-user-access-deny",value:"false",labelText:t[8]("Deny access")}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&256&&(o.labelText=r[8]("Allow access")),e.$set(o);const a={};s&256&&(a.labelText=r[8]("Deny access")),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function F_e(t){let e,n,i,l,r,s,o,a,u,f,c,d=t[5]&&K6(t);function h(M){t[13](M)}let g={id:"proxy-user-name",labelText:t[8]("Username"),helperText:t[1]?t[8]("Usernames cannot be changed."):t[8]("At least 3 characters."),disabled:!!t[1]||t[0],invalid:t[7],invalidText:t[8]("Enter a username with at least 3 characters."),"data-modal-primary-focus":!0};t[2]!==void 0&&(g.value=t[2]),i=new ei({props:g}),xe.push(()=>At(i,"value",h));function _(M){t[14](M)}let k={id:"proxy-user-password",labelText:t[1]?t[8]("New password"):t[8]("Password"),helperText:t[1]?t[8]("Leave blank to keep the current password. New passwords need at least 10 characters."):t[8]("At least 10 characters."),type:"password",disabled:t[0],invalid:t[6],invalidText:t[8]("Enter a password with at least 10 characters.")};t[3]!==void 0&&(k.value=t[3]),s=new ei({props:k}),xe.push(()=>At(s,"value",_));function y(M){t[15](M)}let T={legendText:t[8]("Internet access"),orientation:"vertical",disabled:t[0],$$slots:{default:[U_e]},$$scope:{ctx:t}};return t[4]!==void 0&&(T.selected=t[4]),u=new n5({props:T}),xe.push(()=>At(u,"selected",y)),{c(){e=P("div"),d&&d.c(),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),I(e,"class","user-form svelte-1t7h4x6")},m(M,A){O(M,e,A),d&&d.m(e,null),w(e,n),z(i,e,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),c=!0},p(M,[A]){M[5]?d?(d.p(M,A),A&32&&p(d,1)):(d=K6(M),d.c(),p(d,1),d.m(e,n)):d&&(ue(),v(d,1,1,()=>{d=null}),fe());const C={};A&256&&(C.labelText=M[8]("Username")),A&258&&(C.helperText=M[1]?M[8]("Usernames cannot be changed."):M[8]("At least 3 characters.")),A&3&&(C.disabled=!!M[1]||M[0]),A&128&&(C.invalid=M[7]),A&256&&(C.invalidText=M[8]("Enter a username with at least 3 characters.")),!l&&A&4&&(l=!0,C.value=M[2],Ct(()=>l=!1)),i.$set(C);const D={};A&258&&(D.labelText=M[1]?M[8]("New password"):M[8]("Password")),A&258&&(D.helperText=M[1]?M[8]("Leave blank to keep the current password. New passwords need at least 10 characters."):M[8]("At least 10 characters.")),A&1&&(D.disabled=M[0]),A&64&&(D.invalid=M[6]),A&256&&(D.invalidText=M[8]("Enter a password with at least 10 characters.")),!o&&A&8&&(o=!0,D.value=M[3],Ct(()=>o=!1)),s.$set(D);const R={};A&256&&(R.legendText=M[8]("Internet access")),A&1&&(R.disabled=M[0]),A&1048832&&(R.$$scope={dirty:A,ctx:M}),!f&&A&16&&(f=!0,R.selected=M[4],Ct(()=>f=!1)),u.$set(R)},i(M){c||(p(d),p(i.$$.fragment,M),p(s.$$.fragment,M),p(u.$$.fragment,M),c=!0)},o(M){v(d),v(i.$$.fragment,M),v(s.$$.fragment,M),v(u.$$.fragment,M),c=!1},d(M){M&&E(e),d&&d.d(),H(i),H(s),H(u)}}}function G_e(t,e,n){let i,l,r,s,o;ct(t,ti,R=>n(8,s=R)),ct(t,Ln,R=>n(17,o=R));const a=nn();let{user:u=null}=e,{saving:f=!1}=e,c,d="",h="",g="false",_=!1,k="";function y(R){return(R==null?void 0:R.error)??(R==null?void 0:R.Error)??s("The user could not be saved.")}async function T(){if(n(11,_=!0),n(5,k=""),!r||f)return;n(0,f=!0);const R=!!u,N=(u==null?void 0:u.username)??d.trim();try{const G={username:N,password:h,allowaccess:g==="true"},B=R?await o.api.updateUser(G):await o.api.createUser(G);if(!(B!=null&&B.ok)){n(5,k=y(B));return}a("saved",{username:N,editing:R}),a(R?"updateuser":"createuser",{username:N})}catch(G){n(5,k=G instanceof Error&&G.message?G.message:s("The user could not be saved."))}finally{n(0,f=!1)}}const M=()=>n(5,k="");function A(R){d=R,n(2,d),n(1,u),n(10,c)}function C(R){h=R,n(3,h),n(1,u),n(10,c)}function D(R){g=R,n(4,g),n(1,u),n(10,c)}return t.$$set=R=>{"user"in R&&n(1,u=R.user),"saving"in R&&n(0,f=R.saving)},t.$$.update=()=>{t.$$.dirty&1026&&u!==c&&(n(10,c=u),n(2,d=(u==null?void 0:u.username)??""),n(3,h=""),n(4,g=u!=null&&u.allowaccess?"true":"false"),n(11,_=!1),n(5,k="")),t.$$.dirty&2052&&n(7,i=_&&d.trim().length<3),t.$$.dirty&2058&&n(6,l=_&&(!u||h.length>0)&&h.length<10),t.$$.dirty&14&&(r=d.trim().length>=3&&(u&&h.length===0||h.length>=10))},[f,u,d,h,g,k,l,i,s,T,c,_,M,A,C,D]}class V_e extends Oe{constructor(e){super(),Ee(this,e,G_e,F_e,Se,{user:1,saving:0,submit:9})}get submit(){return this.$$.ctx[9]}}function J6(t){let e,n;return e=new ln({props:{kind:"error",title:t[11]("Proxy users unavailable"),subtitle:t[2]}}),e.$on("close",t[22]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Proxy users unavailable")),l[0]&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Q6(t){let e,n;return e=new ln({props:{kind:"success",title:t[11]("Proxy users updated"),subtitle:t[3]}}),e.$on("close",t[23]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.title=i[11]("Proxy users updated")),l[0]&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function W_e(t){let e=t[11]("Refresh")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Refresh")+"")&&Y(n,e)},d(i){i&&E(n)}}}function j_e(t){let e,n;return e=new ml({props:{sortable:!0,size:"compact",headers:t[13],rows:t[10],$$slots:{cell:[x_e,({row:i,cell:l})=>({33:i,34:l}),({row:i,cell:l})=>[0,(i?4:0)|(l?8:0)]]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1024&&(r.rows=i[10]),l[0]&2048|l[1]&28&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $_e(t){let e,n,i=t[11]("No proxy users yet")+"",l,r,s,o=t[11]("Add a credential before requiring proxy sign-in so clients are not locked out.")+"",a,u,f,c;return f=new bt({props:{size:"small",icon:ho,$$slots:{default:[e0e]},$$scope:{ctx:t}}}),f.$on("click",t[16]),{c(){e=P("div"),n=P("h4"),l=$(i),r=F(),s=P("p"),a=$(o),u=F(),U(f.$$.fragment),I(s,"class","svelte-1tequ64"),I(e,"class","state-panel empty-state svelte-1tequ64")},m(d,h){O(d,e,h),w(e,n),w(n,l),w(e,r),w(e,s),w(s,a),w(e,u),z(f,e,null),c=!0},p(d,h){(!c||h[0]&2048)&&i!==(i=d[11]("No proxy users yet")+"")&&Y(l,i),(!c||h[0]&2048)&&o!==(o=d[11]("Add a credential before requiring proxy sign-in so clients are not locked out.")+"")&&Y(a,o);const g={};h[0]&2048|h[1]&16&&(g.$$scope={dirty:h,ctx:d}),f.$set(g)},i(d){c||(p(f.$$.fragment,d),c=!0)},o(d){v(f.$$.fragment,d),c=!1},d(d){d&&E(e),H(f)}}}function q_e(t){let e,n,i;return n=new Wi({props:{description:t[11]("Loading proxy users…")}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","state-panel svelte-1tequ64")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&2048&&(s.description=l[11]("Loading proxy users…")),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function Y_e(t){let e=t[34].value+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&8&&e!==(e=i[34].value+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function Z_e(t){let e,n;return e=new Rt({props:{type:t[34].value?"green":"warm-gray",size:"sm",$$slots:{default:[J_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&8&&(r.type=i[34].value?"green":"warm-gray"),l[0]&2048|l[1]&24&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function X_e(t){let e=p3(Number(t[34].value)||0)+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[1]&8&&e!==(e=p3(Number(i[34].value)||0)+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function K_e(t){let e,n;return e=new Wu({props:{flipped:!0,iconDescription:t[11]("User actions"),$$slots:{default:[Q_e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.iconDescription=i[11]("User actions")),l[0]&2048|l[1]&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function J_e(t){let e=(t[34].value?t[11]("Allowed"):t[11]("Paused"))+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048|l[1]&8&&e!==(e=(i[34].value?i[11]("Allowed"):i[11]("Paused"))+"")&&Y(n,e)},d(i){i&&E(n)}}}function Q_e(t){let e,n,i,l,r,s;function o(){return t[24](t[33])}e=new Al({props:{text:t[11]("Edit")}}),e.$on("click",o);function a(){return t[25](t[33])}i=new Al({props:{text:t[33].allowaccess?t[11]("Pause internet access"):t[11]("Allow internet access")}}),i.$on("click",a);function u(){return t[26](t[33])}return r=new Al({props:{danger:!0,text:t[11]("Delete")}}),r.$on("click",u),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,l,c),z(r,f,c),s=!0},p(f,c){t=f;const d={};c[0]&2048&&(d.text=t[11]("Edit")),e.$set(d);const h={};c[0]&2048|c[1]&4&&(h.text=t[33].allowaccess?t[11]("Pause internet access"):t[11]("Allow internet access")),i.$set(h);const g={};c[0]&2048&&(g.text=t[11]("Delete")),r.$set(g)},i(f){s||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(r.$$.fragment,f),s=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(r.$$.fragment,f),s=!1},d(f){f&&(E(n),E(l)),H(e,f),H(i,f),H(r,f)}}}function x_e(t){let e,n,i,l;const r=[K_e,X_e,Z_e,Y_e],s=[];function o(a,u){return a[34].key==="actions"?0:a[34].key==="dataconsumed"?1:a[34].key==="allowaccess"?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function e0e(t){let e=t[11]("Add proxy user")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add proxy user")+"")&&Y(n,e)},d(i){i&&E(n)}}}function t0e(t){let e,n,i,l,r,s=t[11]("Proxy authentication")+"",o,a,u,f=t[11]("When required, the proxy challenges every new connection for one of the credentials below. A user's access setting can then allow or pause internet use without deleting the credential.")+"",c,d,h,g,_,k,y,T,M=t[11]("Credentials")+"",A,C,D,R=t[11]("Manage proxy sign-in and each user's immediate internet access.")+"",N,G,B,j,q,V,K,x=t[2]&&J6(t),ie=t[3]&&Q6(t);h=new Ql({props:{keyName:"EnableUsers",type:"radio",title:t[11]("Require proxy sign-in"),labelText:t[11]("Require proxy sign-in"),helperText:t[11]("This applies to proxy traffic only; DNS clients do not send proxy credentials."),orientation:"vertical",radioOptions:t[12]}}),B=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[W_e]},$$scope:{ctx:t}}}),B.$on("click",t[14]);const X=[q_e,$_e,j_e],ce=[];function ae(ee,he){return ee[1]&&ee[0].length===0?0:ee[0].length===0?1:2}return q=ae(t),V=ce[q]=X[q](t),{c(){x&&x.c(),e=F(),ie&&ie.c(),n=F(),i=P("section"),l=P("div"),r=P("h3"),o=$(s),a=F(),u=P("p"),c=$(f),d=F(),U(h.$$.fragment),g=F(),_=P("section"),k=P("div"),y=P("div"),T=P("h3"),A=$(M),C=F(),D=P("p"),N=$(R),G=F(),U(B.$$.fragment),j=F(),V.c(),I(r,"id","proxy-enforcement-title"),I(u,"class","svelte-1tequ64"),I(i,"class","panel enforcement svelte-1tequ64"),I(i,"aria-labelledby","proxy-enforcement-title"),I(T,"id","proxy-users-list-title"),I(D,"class","svelte-1tequ64"),I(k,"class","section-head svelte-1tequ64"),I(_,"class","users-panel svelte-1tequ64"),I(_,"aria-labelledby","proxy-users-list-title")},m(ee,he){x&&x.m(ee,he),O(ee,e,he),ie&&ie.m(ee,he),O(ee,n,he),O(ee,i,he),w(i,l),w(l,r),w(r,o),w(l,a),w(l,u),w(u,c),w(i,d),z(h,i,null),O(ee,g,he),O(ee,_,he),w(_,k),w(k,y),w(y,T),w(T,A),w(y,C),w(y,D),w(D,N),w(k,G),z(B,k,null),w(_,j),ce[q].m(_,null),K=!0},p(ee,he){ee[2]?x?(x.p(ee,he),he[0]&4&&p(x,1)):(x=J6(ee),x.c(),p(x,1),x.m(e.parentNode,e)):x&&(ue(),v(x,1,1,()=>{x=null}),fe()),ee[3]?ie?(ie.p(ee,he),he[0]&8&&p(ie,1)):(ie=Q6(ee),ie.c(),p(ie,1),ie.m(n.parentNode,n)):ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()),(!K||he[0]&2048)&&s!==(s=ee[11]("Proxy authentication")+"")&&Y(o,s),(!K||he[0]&2048)&&f!==(f=ee[11]("When required, the proxy challenges every new connection for one of the credentials below. A user's access setting can then allow or pause internet use without deleting the credential.")+"")&&Y(c,f);const ne={};he[0]&2048&&(ne.title=ee[11]("Require proxy sign-in")),he[0]&2048&&(ne.labelText=ee[11]("Require proxy sign-in")),he[0]&2048&&(ne.helperText=ee[11]("This applies to proxy traffic only; DNS clients do not send proxy credentials.")),h.$set(ne),(!K||he[0]&2048)&&M!==(M=ee[11]("Credentials")+"")&&Y(A,M),(!K||he[0]&2048)&&R!==(R=ee[11]("Manage proxy sign-in and each user's immediate internet access.")+"")&&Y(N,R);const re={};he[0]&2&&(re.disabled=ee[1]),he[0]&2048|he[1]&16&&(re.$$scope={dirty:he,ctx:ee}),B.$set(re);let oe=q;q=ae(ee),q===oe?ce[q].p(ee,he):(ue(),v(ce[oe],1,1,()=>{ce[oe]=null}),fe(),V=ce[q],V?V.p(ee,he):(V=ce[q]=X[q](ee),V.c()),p(V,1),V.m(_,null))},i(ee){K||(p(x),p(ie),p(h.$$.fragment,ee),p(B.$$.fragment,ee),p(V),K=!0)},o(ee){v(x),v(ie),v(h.$$.fragment,ee),v(B.$$.fragment,ee),v(V),K=!1},d(ee){ee&&(E(e),E(n),E(i),E(g),E(_)),x&&x.d(ee),ie&&ie.d(ee),H(h),H(B),ce[q].d()}}}function n0e(t){let e=t[11]("Dashboard")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Dashboard")+"")&&Y(n,e)},d(i){i&&E(n)}}}function i0e(t){let e=t[11]("Proxy users")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Proxy users")+"")&&Y(n,e)},d(i){i&&E(n)}}}function l0e(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[n0e]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[i0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&2048|s[1]&16&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&2048|s[1]&16&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function r0e(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[l0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&16&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function s0e(t){let e=t[11]("Add proxy user")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2048&&e!==(e=i[11]("Add proxy user")+"")&&Y(n,e)},d(i){i&&E(n)}}}function o0e(t){let e,n;return e=new bt({props:{size:"small",icon:ho,$$slots:{default:[s0e]},$$scope:{ctx:t}}}),e.$on("click",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048|l[1]&16&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function a0e(t){let e,n,i;function l(s){t[28](s)}let r={user:t[7]};return t[5]!==void 0&&(r.saving=t[5]),e=new V_e({props:r}),t[27](e),xe.push(()=>At(e,"saving",l)),e.$on("saved",t[18]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o[0]&128&&(a.user=s[7]),!n&&o[0]&32&&(n=!0,a.saving=s[5],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){t[27](null),H(e,s)}}}function u0e(t){var c;let e,n=t[11]("Delete proxy user")+"",i,l,r,s=(((c=t[8])==null?void 0:c.username)??"")+"",o,a,u=t[11]("Their current proxy credentials will stop working.")+"",f;return{c(){e=P("p"),i=$(n),l=F(),r=P("strong"),o=$(s),a=$(`? + `),f=$(u)},m(d,h){O(d,e,h),w(e,i),w(e,l),w(e,r),w(r,o),w(e,a),w(e,f)},p(d,h){var g;h[0]&2048&&n!==(n=d[11]("Delete proxy user")+"")&&Y(i,n),h[0]&256&&s!==(s=(((g=d[8])==null?void 0:g.username)??"")+"")&&Y(o,s),h[0]&2048&&u!==(u=d[11]("Their current proxy credentials will stop working.")+"")&&Y(f,u)},d(d){d&&E(e)}}}function f0e(t){let e,n,i,l,r,s,o;e=new Nl({props:{title:t[11]("Proxy users"),description:t[11]("Proxy users are sign-in credentials for devices and browsers that connect through the GateSentry proxy. They are separate from administrator accounts used to manage this dashboard."),$$slots:{actions:[o0e],breadcrumb:[r0e],default:[t0e]},$$scope:{ctx:t}}});function a(f){t[29](f)}let u={title:t[7]?t[11]("Edit proxy user"):t[11]("Add proxy user"),label:t[11]("Proxy access"),primaryButtonText:t[5]?t[11]("Saving…"):t[7]?t[11]("Save changes"):t[11]("Create user"),secondaryButtonText:t[11]("Cancel"),primaryButtonDisabled:t[5],shouldSubmitOnEnter:!0,hasForm:!0,preventCloseOnClickOutside:!0,$$slots:{default:[a0e]},$$scope:{ctx:t}};return t[4]!==void 0&&(u.open=t[4]),i=new Uc({props:u}),xe.push(()=>At(i,"open",a)),i.$on("close",t[15]),i.$on("submit",t[30]),s=new Uc({props:{open:!!t[8],title:t[11]("Delete proxy user?"),label:t[11]("Confirm deletion"),primaryButtonText:t[9]?t[11]("Deleting…"):t[11]("Delete user"),secondaryButtonText:t[11]("Cancel"),primaryButtonDisabled:t[9],danger:!0,size:"xs",preventCloseOnClickOutside:!0,$$slots:{default:[u0e]},$$scope:{ctx:t}}}),s.$on("close",t[31]),s.$on("submit",t[21]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),r=F(),U(s.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,r,c),z(s,f,c),o=!0},p(f,c){const d={};c[0]&2048&&(d.title=f[11]("Proxy users")),c[0]&2048&&(d.description=f[11]("Proxy users are sign-in credentials for devices and browsers that connect through the GateSentry proxy. They are separate from administrator accounts used to manage this dashboard.")),c[0]&3087|c[1]&16&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);const h={};c[0]&2176&&(h.title=f[7]?f[11]("Edit proxy user"):f[11]("Add proxy user")),c[0]&2048&&(h.label=f[11]("Proxy access")),c[0]&2208&&(h.primaryButtonText=f[5]?f[11]("Saving…"):f[7]?f[11]("Save changes"):f[11]("Create user")),c[0]&2048&&(h.secondaryButtonText=f[11]("Cancel")),c[0]&32&&(h.primaryButtonDisabled=f[5]),c[0]&224|c[1]&16&&(h.$$scope={dirty:c,ctx:f}),!l&&c[0]&16&&(l=!0,h.open=f[4],Ct(()=>l=!1)),i.$set(h);const g={};c[0]&256&&(g.open=!!f[8]),c[0]&2048&&(g.title=f[11]("Delete proxy user?")),c[0]&2048&&(g.label=f[11]("Confirm deletion")),c[0]&2560&&(g.primaryButtonText=f[9]?f[11]("Deleting…"):f[11]("Delete user")),c[0]&2048&&(g.secondaryButtonText=f[11]("Cancel")),c[0]&512&&(g.primaryButtonDisabled=f[9]),c[0]&2304|c[1]&16&&(g.$$scope={dirty:c,ctx:f}),s.$set(g)},i(f){o||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(s.$$.fragment,f),o=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(s.$$.fragment,f),o=!1},d(f){f&&(E(n),E(r)),H(e,f),H(i,f),H(s,f)}}}function c0e(t,e,n){let i,l,r;ct(t,ti,ee=>n(11,l=ee)),ct(t,Ln,ee=>n(32,r=ee));const s=[{value:"true",label:l("Require a proxy user")},{value:"false",label:l("Do not require a proxy user")}];let o=[],a=!0,u="",f="",c=!1,d=!1,h=null,g=null,_=null,k=!1;const y=[{key:"user",value:l("Username")},{key:"dataconsumed",value:l("Data consumed")},{key:"allowaccess",value:l("Access")},{key:"actions",value:l("Actions")}];async function T(){n(1,a=!0),n(2,u="");try{const ee=await r.api.getUsers();n(0,o=Array.isArray(ee==null?void 0:ee.users)?ee.users:[])}catch(ee){n(2,u=ee instanceof Error&&ee.message?ee.message:l("Proxy users could not be loaded."))}finally{n(1,a=!1)}}function M(){n(4,c=!1),n(7,g=null),n(5,d=!1)}function A(){n(7,g=null),n(4,c=!0)}function C(ee){n(7,g=o.find(he=>he.username===ee)??null),n(4,c=!0)}async function D(ee){M(),n(3,f=ee.detail.editing?l("Proxy user updated."):l("Proxy user created.")),await T()}async function R(ee,he){n(2,u=""),n(3,f="");try{const ne=await r.api.updateUser({username:ee,password:"",allowaccess:he});if(!(ne!=null&&ne.ok))throw new Error((ne==null?void 0:ne.error)??(ne==null?void 0:ne.Error)??l("Access could not be updated."));n(3,f=l(he?"Internet access enabled.":"Internet access paused.")),await T()}catch(ne){n(2,u=ne instanceof Error&&ne.message?ne.message:l("Access could not be updated."))}}function N(ee){n(8,_=o.find(he=>he.username===ee)??null)}async function G(){if(!_||k)return;n(9,k=!0),n(2,u=""),n(3,f="");const ee=_.username;try{const he=await r.api.deleteUser(ee);if((he==null?void 0:he.ok)===!1)throw new Error((he==null?void 0:he.error)??(he==null?void 0:he.Error)??l("The proxy user could not be deleted."));n(8,_=null),n(3,f=l("Proxy user deleted.")),await T()}catch(he){n(2,u=he instanceof Error&&he.message?he.message:l("The proxy user could not be deleted."))}finally{n(9,k=!1)}}on(T);const B=()=>n(2,u=""),j=()=>n(3,f=""),q=ee=>C(ee.id),V=ee=>R(ee.id,!ee.allowaccess),K=ee=>N(ee.id);function x(ee){xe[ee?"unshift":"push"](()=>{h=ee,n(6,h)})}function ie(ee){d=ee,n(5,d)}function X(ee){c=ee,n(4,c)}const ce=()=>h==null?void 0:h.submit(),ae=()=>{k||n(8,_=null)};return t.$$.update=()=>{t.$$.dirty[0]&1&&n(10,i=o.map(ee=>({id:ee.username,user:ee.username,dataconsumed:ee.dataconsumed??0,allowaccess:ee.allowaccess})))},[o,a,u,f,c,d,h,g,_,k,i,l,s,y,T,M,A,C,D,R,N,G,B,j,q,V,K,x,ie,X,ce,ae]}class d0e extends Oe{constructor(e){super(),Ee(this,e,c0e,f0e,Se,{},null,[-1,-1])}}function x6(t,e,n){const i=t.slice();return i[7]=e[n],i}function ey(t){let e,n=t[7].description+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","category-note svelte-1orxodp")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r&1&&n!==(n=l[7].description+"")&&Y(i,n)},d(l){l&&E(e)}}}function ty(t,e){let n,i,l,r,s,o=ny(e[7])+"",a,u,f,c;function d(...g){return e[5](e[7],...g)}l=new FT({props:{labelText:e[7].name,checked:e[1].includes(e[7].id),disabled:e[2]}}),l.$on("check",d);let h=!e[3]&&ey(e);return{key:t,first:null,c(){n=P("div"),i=P("div"),U(l.$$.fragment),r=F(),s=P("span"),a=$(o),u=F(),h&&h.c(),f=F(),I(s,"class","category-count svelte-1orxodp"),I(i,"class","category-line svelte-1orxodp"),I(n,"class","category-item svelte-1orxodp"),this.first=n},m(g,_){O(g,n,_),w(n,i),z(l,i,null),w(i,r),w(i,s),w(s,a),w(n,u),h&&h.m(n,null),w(n,f),c=!0},p(g,_){e=g;const k={};_&1&&(k.labelText=e[7].name),_&3&&(k.checked=e[1].includes(e[7].id)),_&4&&(k.disabled=e[2]),l.$set(k),(!c||_&1)&&o!==(o=ny(e[7])+"")&&Y(a,o),e[3]?h&&(h.d(1),h=null):h?h.p(e,_):(h=ey(e),h.c(),h.m(n,f))},i(g){c||(p(l.$$.fragment,g),c=!0)},o(g){v(l.$$.fragment,g),c=!1},d(g){g&&E(n),H(l),h&&h.d()}}}function h0e(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[7].id;for(let o=0;od!==f))}const u=(f,c)=>a(f.id,c.detail);return t.$$set=f=>{"categories"in f&&n(0,i=f.categories),"selection"in f&&n(1,l=f.selection),"disabled"in f&&n(2,r=f.disabled),"compact"in f&&n(3,s=f.compact)},[i,l,r,s,a,u]}class v_ extends Oe{constructor(e){super(),Ee(this,e,m0e,h0e,Se,{categories:0,selection:1,disabled:2,compact:3})}}function iy(t,e,n){const i=t.slice();return i[10]=e[n],i}function g0e(t){let e;return{c(){e=$("Add")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ly(t){let e,n=[],i=new Map,l,r=it(t[0]);const s=o=>o[10];for(let o=0;oAt(n,"value",u)),n.$on("keydown",t[7]),r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[g0e]},$$scope:{ctx:t}}}),r.$on("click",t[4]);let c=t[0].length&&ly(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),c&&c.c(),o=je(),I(e,"class","list-entry svelte-2r6im7")},m(d,h){O(d,e,h),z(n,e,null),w(e,l),z(r,e,null),O(d,s,h),c&&c.m(d,h),O(d,o,h),a=!0},p(d,[h]){const g={};h&2&&(g.labelText=d[1]),!i&&h&8&&(i=!0,g.value=d[3],Ct(()=>i=!1)),n.$set(g);const _={};h&8192&&(_.$$scope={dirty:h,ctx:d}),r.$set(_),d[0].length?c?(c.p(d,h),h&1&&p(c,1)):(c=ly(d),c.c(),p(c,1),c.m(o.parentNode,o)):c&&(ue(),v(c,1,1,()=>{c=null}),fe())},i(d){a||(p(n.$$.fragment,d),p(r.$$.fragment,d),p(c),a=!0)},o(d){v(n.$$.fragment,d),v(r.$$.fragment,d),v(c),a=!1},d(d){d&&(E(e),E(s),E(o)),H(n),H(r),c&&c.d(d)}}}function b0e(t){let e=t.trim().toLowerCase();const n=e.indexOf("://");return n>=0&&(e=e.slice(n+3)),e=e.split(/[/?#]/)[0].replace(/:\d+$/,"").replace(/\.$/,""),e}function v0e(t,e,n){let{entries:i=[]}=e,{label:l="Domain"}=e,{tagType:r="outline"}=e;const s=nn();let o="";function a(){const h=o.split(/[\s,]+/).map(b0e).filter(Boolean),g=[...i];for(const _ of h)g.includes(_)||g.push(_);n(3,o=""),g.length!==i.length&&s("change",g)}function u(h){s("change",i.filter(g=>g!==h))}function f(h){o=h,n(3,o)}const c=h=>h.key==="Enter"&&a(),d=h=>u(h);return t.$$set=h=>{"entries"in h&&n(0,i=h.entries),"label"in h&&n(1,l=h.label),"tagType"in h&&n(2,r=h.tagType)},[i,l,r,o,a,u,f,c,d]}class k_ extends Oe{constructor(e){super(),Ee(this,e,v0e,p0e,Se,{entries:0,label:1,tagType:2})}}const Ji="default",XO=[{id:"0",text:"Sunday"},{id:"1",text:"Monday"},{id:"2",text:"Tuesday"},{id:"3",text:"Wednesday"},{id:"4",text:"Thursday"},{id:"5",text:"Friday"},{id:"6",text:"Saturday"}],k0e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],rg="custom";function fc(){return{id:"",name:"",description:"",blocked_categories:[],blocked_domains:[],allowed_domains:[],rules:[],safe_search:!1,users:[],priority:0}}function KO(){return{id:"",name:"",enabled:!0,action:"block",target:{all_traffic:!1,domains:[],categories:[]},url_regexes:[],blocked_content_types:[],schedule:null,users:[],domain_draft:"",url_draft:"",content_type_draft:""}}function w0e(t){return t?{timezone:t.timezone||"UTC",weekdays:[...t.weekdays||[]],windows:(t.windows||[]).map(e=>({from:e.from,to:e.to})),...t.preset?{preset:t.preset}:{}}:null}function y0e(t){var e,n,i;return{id:t.id||"",name:t.name||"",enabled:t.enabled!==!1,action:t.action==="allow"?"allow":"block",target:{all_traffic:!!((e=t.target)!=null&&e.all_traffic),domains:[...((n=t.target)==null?void 0:n.domains)||[]],categories:[...((i=t.target)==null?void 0:i.categories)||[]]},url_regexes:[...t.url_regexes||[]],blocked_content_types:[...t.blocked_content_types||[]],schedule:w0e(t.schedule),users:[...t.users||[]],domain_draft:"",url_draft:"",content_type_draft:""}}function fu(t){return{id:t.id||"",name:t.name||"",description:t.description||"",blocked_categories:[...t.blocked_categories||[]],blocked_domains:[...t.blocked_domains||[]],allowed_domains:[...t.allowed_domains||[]],rules:(t.rules||[]).map(y0e),safe_search:!!t.safe_search,users:[...t.users||[]],priority:t.priority||0}}function T0e(t){return{id:t.id,name:t.name.trim(),description:t.description,blocked_categories:t.blocked_categories,blocked_domains:t.blocked_domains,allowed_domains:t.allowed_domains,safe_search:t.safe_search,users:t.users,priority:t.priority,rules:t.rules.map(e=>({id:e.id,name:e.name.trim(),enabled:e.enabled,action:e.action,target:e.target,url_regexes:e.url_regexes,blocked_content_types:e.blocked_content_types,schedule:e.schedule,users:e.users}))}}function S0e(t){return!(t!=null&&t.length)||t.length>=7?"":[...t].sort((e,n)=>e-n).map(e=>k0e[e]).filter(Boolean).join(", ")}function vd(t){if(!t)return"Always";const e=(t.windows||[]).map(i=>i.from+"-"+i.to).join(", "),n=S0e(t.weekdays);return e+(n?" "+n:" every day")}function E0e(t,e){if(t.all_traffic)return"all traffic";const n=[...t.categories.map(e),...t.domains];return n.length?n.length>3?n.slice(0,3).join(", ")+" and "+(n.length-3)+" more":n.join(", "):"nothing yet"}function sy(t,e){let n=(t.action==="allow"?"Allow ":"Block ")+E0e(t.target,e);return t.url_regexes.length&&(n+=" when the URL matches "+t.url_regexes.join(" or ")),t.blocked_content_types.length&&(n+=(t.url_regexes.length?" or the response is ":" when the response is ")+t.blocked_content_types.join(", ")),t.schedule&&(n+=", "+vd(t.schedule)),t.users.length&&(n+=", for "+t.users.join(", ")),n}function oy(t){return t.url_regexes.length>0||t.blocked_content_types.length>0||t.users.length>0}function kd(t){return t.action==="block"&&t.target.all_traffic&&!!t.schedule&&t.url_regexes.length===0&&t.blocked_content_types.length===0&&t.users.length===0}function O0e(t,e){var i;const n=KO();return n.name="Bedtime",n.target.all_traffic=!0,n.schedule={timezone:t,weekdays:e?[...e.weekdays]:[],windows:(i=e==null?void 0:e.windows)!=null&&i.length?e.windows.map(l=>({from:l.from,to:l.to})):[{from:"21:00",to:"07:00"}]},n}function M0e(t){const e=t.rules.filter(kd);return t.users.length>0||t.rules.length>e.length||e.length>1}function ay(t,e){const n=[];if(t.blocked_categories.length){const r=t.blocked_categories.map(e);n.push("Blocks "+(r.length>3?r.slice(0,3).join(", ")+" and "+(r.length-3)+" more":r.join(", ")))}t.blocked_domains.length&&n.push(t.blocked_domains.length+" blocked site"+(t.blocked_domains.length===1?"":"s")),t.allowed_domains.length&&n.push(t.allowed_domains.length+" always-allowed site"+(t.allowed_domains.length===1?"":"s")),t.safe_search&&n.push("Safe search");const i=t.rules.find(r=>r.enabled&&kd(r));i&&n.push("Bedtime "+vd(i.schedule));const l=t.rules.filter(r=>!kd(r)).length;return l&&n.push(l+" custom rule"+(l===1?"":"s")),n.length?n.join(" · "):"Blocks nothing of its own"}function uy(t,e,n){const i=t.slice();return i[62]=e[n],i[63]=e,i[64]=n,i}function fy(t,e,n){const i=t.slice();return i[65]=e[n],i}function cy(t,e,n){const i=t.slice();return i[68]=e[n],i}function dy(t,e,n){const i=t.slice();return i[71]=e[n],i}function C0e(t){let e,n,i,l,r;return l=new k_({props:{label:"Block a domain",entries:t[0].blocked_domains,tagType:"red"}}),l.$on("change",t[30]),{c(){e=P("fieldset"),n=P("legend"),n.textContent="Blocked domains",i=F(),U(l.$$.fragment),I(n,"class","field-label svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(s,o){O(s,e,o),w(e,n),w(e,i),z(l,e,null),r=!0},p(s,o){const a={};o[0]&1&&(a.entries=s[0].blocked_domains),l.$set(a)},i(s){r||(p(l.$$.fragment,s),r=!0)},o(s){v(l.$$.fragment,s),r=!1},d(s){s&&E(e),H(l)}}}function A0e(t){let e,n,i,l,r,s,o;return l=new k_({props:{label:"Allow a domain",entries:t[0].allowed_domains,tagType:"green"}}),l.$on("change",t[31]),{c(){e=P("fieldset"),n=P("legend"),n.textContent="Always allowed domains",i=F(),U(l.$$.fragment),r=F(),s=P("p"),s.textContent="Always reachable, even if a blocked category lists it.",I(n,"class","field-label svelte-r46cq7"),I(s,"class","field-note svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(a,u){O(a,e,u),w(e,n),w(e,i),z(l,e,null),w(e,r),w(e,s),o=!0},p(a,u){const f={};u[0]&1&&(f.entries=a[0].allowed_domains),l.$set(f)},i(a){o||(p(l.$$.fragment,a),o=!0)},o(a){v(l.$$.fragment,a),o=!1},d(a){a&&E(e),H(l)}}}function L0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[C0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[A0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function D0e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M;function A(N){t[28](N)}let C={labelText:"Name",placeholder:"Kids"};t[0].name!==void 0&&(C.value=t[0].name),l=new ei({props:C}),xe.push(()=>At(l,"value",A)),d=new v_({props:{categories:t[1],selection:t[0].blocked_categories}}),d.$on("change",t[29]),g=new Ac({props:{$$slots:{default:[L0e]},$$scope:{ctx:t}}});function D(N){t[32](N)}let R={labelText:"Safe search",labelA:"Off",labelB:"Google, Bing, DuckDuckGo, and YouTube restricted mode"};return t[0].safe_search!==void 0&&(R.toggled=t[0].safe_search),y=new Ad({props:R}),xe.push(()=>At(y,"toggled",D)),{c(){e=P("p"),e.textContent="Name the policy, choose broad categories, and add site exceptions.",n=F(),i=P("div"),U(l.$$.fragment),s=F(),o=P("fieldset"),a=P("legend"),a.textContent="Blocked categories",u=F(),f=P("p"),f.textContent="Lists of sites that update themselves.",c=F(),U(d.$$.fragment),h=F(),U(g.$$.fragment),_=F(),k=P("div"),U(y.$$.fragment),I(e,"class","section-description svelte-r46cq7"),I(i,"class","name-field svelte-r46cq7"),I(a,"class","field-label svelte-r46cq7"),I(f,"class","field-note svelte-r46cq7"),I(o,"class","field svelte-r46cq7"),I(k,"class","field svelte-r46cq7")},m(N,G){O(N,e,G),O(N,n,G),O(N,i,G),z(l,i,null),O(N,s,G),O(N,o,G),w(o,a),w(o,u),w(o,f),w(o,c),z(d,o,null),O(N,h,G),z(g,N,G),O(N,_,G),O(N,k,G),z(y,k,null),M=!0},p(N,G){const B={};!r&&G[0]&1&&(r=!0,B.value=N[0].name,Ct(()=>r=!1)),l.$set(B);const j={};G[0]&2&&(j.categories=N[1]),G[0]&1&&(j.selection=N[0].blocked_categories),d.$set(j);const q={};G[0]&1|G[2]&4096&&(q.$$scope={dirty:G,ctx:N}),g.$set(q);const V={};!T&&G[0]&1&&(T=!0,V.toggled=N[0].safe_search,Ct(()=>T=!1)),y.$set(V)},i(N){M||(p(l.$$.fragment,N),p(d.$$.fragment,N),p(g.$$.fragment,N),p(y.$$.fragment,N),M=!0)},o(N){v(l.$$.fragment,N),v(d.$$.fragment,N),v(g.$$.fragment,N),v(y.$$.fragment,N),M=!1},d(N){N&&(E(e),E(n),E(i),E(s),E(o),E(h),E(_),E(k)),H(l),H(d),H(g,N),H(y)}}}function hy(t){var g,_;let e,n,i,l,r,s,o,a,u,f=(t[8].schedule.timezone||"UTC")+"",c,d,h;return n=new Lc({props:{size:"sm",labelText:"From",placeholder:"HH:MM",pattern:wd,value:((g=t[8].schedule.windows[0])==null?void 0:g.from)||""}}),n.$on("change",t[34]),l=new Lc({props:{size:"sm",labelText:"Until",placeholder:"HH:MM",pattern:wd,value:((_=t[8].schedule.windows[0])==null?void 0:_.to)||""}}),l.$on("change",t[35]),s=new ju({props:{size:"sm",titleText:"Nights",label:"Every night",items:XO,selectedIds:t[8].schedule.weekdays.map(String)}}),s.$on("select",t[36]),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),r=F(),U(s.$$.fragment),o=F(),a=P("p"),u=$("A night lasts until the next morning, in "),c=$(f),d=$("."),I(e,"class","window-row bedtime-row svelte-r46cq7"),I(a,"class","field-note svelte-r46cq7")},m(k,y){O(k,e,y),z(n,e,null),w(e,i),z(l,e,null),w(e,r),z(s,e,null),O(k,o,y),O(k,a,y),w(a,u),w(a,c),w(a,d),h=!0},p(k,y){var C,D;const T={};y[0]&256&&(T.value=((C=k[8].schedule.windows[0])==null?void 0:C.from)||""),n.$set(T);const M={};y[0]&256&&(M.value=((D=k[8].schedule.windows[0])==null?void 0:D.to)||""),l.$set(M);const A={};y[0]&256&&(A.selectedIds=k[8].schedule.weekdays.map(String)),s.$set(A),(!h||y[0]&256)&&f!==(f=(k[8].schedule.timezone||"UTC")+"")&&Y(c,f)},i(k){h||(p(n.$$.fragment,k),p(l.$$.fragment,k),p(s.$$.fragment,k),h=!0)},o(k){v(n.$$.fragment,k),v(l.$$.fragment,k),v(s.$$.fragment,k),h=!1},d(k){k&&(E(e),E(o),E(a)),H(n),H(l),H(s)}}}function I0e(t){var a;let e,n,i,l,r,s;i=new Ad({props:{labelText:"Bedtime",labelA:"Off",labelB:"No internet during these hours",toggled:!!t[8]}}),i.$on("toggle",t[33]);let o=((a=t[8])==null?void 0:a.schedule)&&hy(t);return{c(){e=P("p"),e.textContent="Optionally pause internet access overnight in the gateway time zone.",n=F(),U(i.$$.fragment),l=F(),o&&o.c(),r=je(),I(e,"class","section-description svelte-r46cq7")},m(u,f){O(u,e,f),O(u,n,f),z(i,u,f),O(u,l,f),o&&o.m(u,f),O(u,r,f),s=!0},p(u,f){var d;const c={};f[0]&256&&(c.toggled=!!u[8]),i.$set(c),(d=u[8])!=null&&d.schedule?o?(o.p(u,f),f[0]&256&&p(o,1)):(o=hy(u),o.c(),p(o,1),o.m(r.parentNode,r)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(u){s||(p(i.$$.fragment,u),p(o),s=!0)},o(u){v(i.$$.fragment,u),v(o),s=!1},d(u){u&&(E(e),E(n),E(l),E(r)),H(i,u),o&&o.d(u)}}}function my(t){let e,n,i,l,r;return n=new ju({props:{titleText:"Proxy users on this policy",label:"Only devices assigned to it",items:t[2].map(Ay),selectedIds:t[0].users}}),n.$on("select",t[38]),{c(){e=P("div"),U(n.$$.fragment),i=F(),l=P("p"),l.textContent="A signed-in proxy user gets this policy on any device.",I(l,"class","field-note svelte-r46cq7"),I(e,"class","field svelte-r46cq7")},m(s,o){O(s,e,o),z(n,e,null),w(e,i),w(e,l),r=!0},p(s,o){const a={};o[0]&4&&(a.items=s[2].map(Ay)),o[0]&1&&(a.selectedIds=s[0].users),n.$set(a)},i(s){r||(p(n.$$.fragment,s),r=!0)},o(s){v(n.$$.fragment,s),r=!1},d(s){s&&E(e),H(n)}}}function gy(t){let e,n,i,l,r=t[64]+1+"",s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R=My(t[62]),N,G=oy(t[62]),B;function j(ae){t[39](ae,t[62])}let q={size:"sm",labelText:"Enabled",hideLabel:!0};t[62].enabled!==void 0&&(q.toggled=t[62].enabled),u=new Ad({props:q}),xe.push(()=>At(u,"toggled",j));function V(){return t[40](t[64])}d=new bt({props:{size:"small",kind:"ghost",icon:Eq,iconDescription:"Move rule up",disabled:t[64]===0}}),d.$on("click",V);function K(){return t[41](t[64])}g=new bt({props:{size:"small",kind:"ghost",icon:vq,iconDescription:"Move rule down",disabled:t[64]===t[0].rules.length-1}}),g.$on("click",K);function x(){return t[42](t[64])}k=new bt({props:{size:"small",kind:"danger-ghost",$$slots:{default:[R0e]},$$scope:{ctx:t}}}),k.$on("click",x),T=new Ac({props:{$$slots:{default:[U0e]},$$scope:{ctx:t}}});let ie=!t[62].target.all_traffic&&_y(t);C=new Ac({props:{$$slots:{default:[W0e]},$$scope:{ctx:t}}});let X=R&&ky(t),ce=G&&Ey();return{c(){e=P("div"),n=P("div"),i=P("h5"),l=$("Rule "),s=$(r),o=F(),a=P("div"),U(u.$$.fragment),c=F(),U(d.$$.fragment),h=F(),U(g.$$.fragment),_=F(),U(k.$$.fragment),y=F(),U(T.$$.fragment),M=F(),ie&&ie.c(),A=F(),U(C.$$.fragment),D=F(),X&&X.c(),N=F(),ce&&ce.c(),I(i,"class","svelte-r46cq7"),I(a,"class","rule-head-controls svelte-r46cq7"),I(n,"class","rule-head svelte-r46cq7"),I(e,"class","rule svelte-r46cq7")},m(ae,ee){O(ae,e,ee),w(e,n),w(n,i),w(i,l),w(i,s),w(n,o),w(n,a),z(u,a,null),w(a,c),z(d,a,null),w(a,h),z(g,a,null),w(a,_),z(k,a,null),w(e,y),z(T,e,null),w(e,M),ie&&ie.m(e,null),w(e,A),z(C,e,null),w(e,D),X&&X.m(e,null),w(e,N),ce&&ce.m(e,null),B=!0},p(ae,ee){t=ae,(!B||ee[0]&1)&&r!==(r=t[64]+1+"")&&Y(s,r);const he={};!f&&ee[0]&1&&(f=!0,he.toggled=t[62].enabled,Ct(()=>f=!1)),u.$set(he);const ne={};ee[0]&1&&(ne.disabled=t[64]===0),d.$set(ne);const re={};ee[0]&1&&(re.disabled=t[64]===t[0].rules.length-1),g.$set(re);const oe={};ee[2]&4096&&(oe.$$scope={dirty:ee,ctx:t}),k.$set(oe);const Re={};ee[0]&1|ee[2]&4096&&(Re.$$scope={dirty:ee,ctx:t}),T.$set(Re),t[62].target.all_traffic?ie&&(ue(),v(ie,1,1,()=>{ie=null}),fe()):ie?(ie.p(t,ee),ee[0]&1&&p(ie,1)):(ie=_y(t),ie.c(),p(ie,1),ie.m(e,A));const qe={};ee[0]&13|ee[2]&4096&&(qe.$$scope={dirty:ee,ctx:t}),C.$set(qe),ee[0]&1&&(R=My(t[62])),R?X?(X.p(t,ee),ee[0]&1&&p(X,1)):(X=ky(t),X.c(),p(X,1),X.m(e,N)):X&&(ue(),v(X,1,1,()=>{X=null}),fe()),ee[0]&1&&(G=oy(t[62])),G?ce||(ce=Ey(),ce.c(),ce.m(e,null)):ce&&(ce.d(1),ce=null)},i(ae){B||(p(u.$$.fragment,ae),p(d.$$.fragment,ae),p(g.$$.fragment,ae),p(k.$$.fragment,ae),p(T.$$.fragment,ae),p(ie),p(C.$$.fragment,ae),p(X),B=!0)},o(ae){v(u.$$.fragment,ae),v(d.$$.fragment,ae),v(g.$$.fragment,ae),v(k.$$.fragment,ae),v(T.$$.fragment,ae),v(ie),v(C.$$.fragment,ae),v(X),B=!1},d(ae){ae&&E(e),H(u),H(d),H(g),H(k),H(T),ie&&ie.d(),H(C),X&&X.d(),ce&&ce.d()}}}function R0e(t){let e;return{c(){e=$("Remove rule")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function P0e(t){let e,n,i;function l(s){t[43](s,t[62])}let r={labelText:"Name",placeholder:"After school"};return t[62].name!==void 0&&(r.value=t[62].name),e=new ei({props:r}),xe.push(()=>At(e,"value",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){t=s;const a={};!n&&o[0]&1&&(n=!0,a.value=t[62].name,Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function N0e(t){let e,n,i,l;return e=new Rn({props:{value:"block",text:"Block"}}),i=new Rn({props:{value:"allow",text:"Allow"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p:_e,i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function B0e(t){let e,n,i;function l(s){t[44](s,t[62])}let r={labelText:"Action",$$slots:{default:[N0e]},$$scope:{ctx:t}};return t[62].action!==void 0&&(r.selected=t[62].action),e=new Wr({props:r}),xe.push(()=>At(e,"selected",l)),e.$on("change",t[14]),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){t=s;const a={};o[2]&4096&&(a.$$scope={dirty:o,ctx:t}),!n&&o[0]&1&&(n=!0,a.selected=t[62].action,Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function z0e(t){let e,n,i,l;return e=new Rn({props:{value:"listed",text:"Selected categories and domains"}}),i=new Rn({props:{value:"all",text:"All traffic"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p:_e,i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function H0e(t){let e,n;function i(...l){return t[45](t[62],...l)}return e=new Wr({props:{labelText:"Applies to",selected:t[62].target.all_traffic?"all":"listed",$$slots:{default:[z0e]},$$scope:{ctx:t}}}),e.$on("change",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&1&&(s.selected=t[62].target.all_traffic?"all":"listed"),r[2]&4096&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function U0e(t){let e,n,i,l,r,s;return e=new Gr({props:{sm:4,md:4,lg:5,$$slots:{default:[P0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:5,$$slots:{default:[B0e]},$$scope:{ctx:t}}}),r=new Gr({props:{sm:4,md:8,lg:6,$$slots:{default:[H0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[2]&4096&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[2]&4096&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function _y(t){let e,n,i,l,r;function s(...a){return t[46](t[62],t[63],t[64],...a)}n=new v_({props:{categories:t[1],compact:!0,selection:t[62].target.categories}}),n.$on("change",s);function o(...a){return t[47](t[62],t[63],t[64],...a)}return l=new k_({props:{label:"Domain",entries:t[62].target.domains}}),l.$on("change",o),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","rule-target svelte-r46cq7")},m(a,u){O(a,e,u),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&2&&(f.categories=t[1]),u[0]&1&&(f.selection=t[62].target.categories),n.$set(f);const c={};u[0]&1&&(c.entries=t[62].target.domains),l.$set(c)},i(a){r||(p(n.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(n.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(e),H(n),H(l)}}}function py(t,e){let n,i,l;return i=new Rn({props:{value:e[71].id,text:Cy(e[71])}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&8&&(o.value=e[71].id),s[0]&8&&(o.text=Cy(e[71])),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function F0e(t){let e,n,i=[],l=new Map,r,s,o;e=new Rn({props:{value:"",text:"Always"}});let a=it(t[3]);const u=f=>f[71].id;for(let f=0;f{s=null}),fe())},i(o){l||(p(e.$$.fragment,o),p(s),l=!0)},o(o){v(e.$$.fragment,o),v(s),l=!1},d(o){o&&(E(n),E(i)),H(e,o),s&&s.d(o)}}}function vy(t){let e,n;function i(...l){return t[52](t[62],...l)}return e=new ju({props:{titleText:"Only for proxy users",label:"Everyone on this policy",items:t[2].map(Ly),selectedIds:t[62].users}}),e.$on("select",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&4&&(s.items=t[2].map(Ly)),r[0]&1&&(s.selectedIds=t[62].users),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function V0e(t){let e,n,i=t[2].length&&vy(t);return{c(){i&&i.c(),e=je()},m(l,r){i&&i.m(l,r),O(l,e,r),n=!0},p(l,r){l[2].length?i?(i.p(l,r),r[0]&4&&p(i,1)):(i=vy(l),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(l){n||(p(i),n=!0)},o(l){v(i),n=!1},d(l){l&&E(e),i&&i.d(l)}}}function W0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[G0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[V0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&9|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&5|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function ky(t){let e,n,i;return n=new ug({props:{$$slots:{default:[Q0e]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","rule-conditions svelte-r46cq7")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&1|r[2]&4096&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function j0e(t){let e;return{c(){e=$("Add pattern")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function wy(t){let e,n=[],i=new Map,l,r=it(t[62].url_regexes);const s=o=>o[68];for(let o=0;oAt(n,"value",u)),n.$on("keydown",f);function d(){return t[55](t[62])}r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[j0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].url_regexes.length&&wy(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=je(),I(e,"class","list-entry svelte-r46cq7")},m(g,_){O(g,e,_),z(n,e,null),w(e,l),z(r,e,null),O(g,s,_),h&&h.m(g,_),O(g,o,_),a=!0},p(g,_){t=g;const k={};!i&&_[0]&1&&(i=!0,k.value=t[62].url_draft,Ct(()=>i=!1)),n.$set(k);const y={};_[2]&4096&&(y.$$scope={dirty:_,ctx:t}),r.$set(y),t[62].url_regexes.length?h?(h.p(t,_),_[0]&1&&p(h,1)):(h=wy(t),h.c(),p(h,1),h.m(o.parentNode,o)):h&&(ue(),v(h,1,1,()=>{h=null}),fe())},i(g){a||(p(n.$$.fragment,g),p(r.$$.fragment,g),p(h),a=!0)},o(g){v(n.$$.fragment,g),v(r.$$.fragment,g),v(h),a=!1},d(g){g&&(E(e),E(s),E(o)),H(n),H(r),h&&h.d(g)}}}function Y0e(t){let e;return{c(){e=$("Add type")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Ty(t){let e,n=[],i=new Map,l,r=it(t[62].blocked_content_types);const s=o=>o[65];for(let o=0;oAt(n,"value",u)),n.$on("keydown",f);function d(){return t[59](t[62])}r=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[Y0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].blocked_content_types.length&&Ty(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=je(),I(e,"class","list-entry svelte-r46cq7")},m(g,_){O(g,e,_),z(n,e,null),w(e,l),z(r,e,null),O(g,s,_),h&&h.m(g,_),O(g,o,_),a=!0},p(g,_){t=g;const k={};!i&&_[0]&1&&(i=!0,k.value=t[62].content_type_draft,Ct(()=>i=!1)),n.$set(k);const y={};_[2]&4096&&(y.$$scope={dirty:_,ctx:t}),r.$set(y),t[62].blocked_content_types.length?h?(h.p(t,_),_[0]&1&&p(h,1)):(h=Ty(t),h.c(),p(h,1),h.m(o.parentNode,o)):h&&(ue(),v(h,1,1,()=>{h=null}),fe())},i(g){a||(p(n.$$.fragment,g),p(r.$$.fragment,g),p(h),a=!0)},o(g){v(n.$$.fragment,g),v(r.$$.fragment,g),v(h),a=!1},d(g){g&&(E(e),E(s),E(o)),H(n),H(r),h&&h.d(g)}}}function K0e(t){let e,n,i,l;return e=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[q0e]},$$scope:{ctx:t}}}),i=new Gr({props:{sm:4,md:4,lg:8,$$slots:{default:[X0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function J0e(t){let e,n;return e=new Ac({props:{$$slots:{default:[K0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1|l[2]&4096&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Q0e(t){let e,n;return e=new fg({props:{title:"Block only part of the site",open:t[62].url_regexes.length>0||t[62].blocked_content_types.length>0,$$slots:{default:[J0e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1&&(r.open=i[62].url_regexes.length>0||i[62].blocked_content_types.length>0),l[0]&1|l[2]&4096&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Ey(t){let e;return{c(){e=P("p"),e.textContent=`DNS cannot see URLs, response types, or proxy logins, so this rule is enforced by the proxy only. Devices that - use GateSentry for DNS alone are not affected by it.`,I(e,"class","field-note proxy-note svelte-r46cq7")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Oy(t,e){let n,i,l,r=e[64]!==e[7]&&gy(e);return{key:t,first:null,c(){n=je(),r&&r.c(),i=je(),this.first=n},m(s,o){O(s,n,o),r&&r.m(s,o),O(s,i,o),l=!0},p(s,o){e=s,e[64]!==e[7]?r?(r.p(e,o),o[0]&129&&p(r,1)):(r=gy(e),r.c(),p(r,1),r.m(i.parentNode,i)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){l||(p(r),l=!0)},o(s){v(r),l=!1},d(s){s&&(E(n),E(i)),r&&r.d(s)}}}function tpe(t){let e;return{c(){e=j("Add rule")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function npe(t){let e,n,i,l,r,s,o,a,u,f,c,d=[],h=new Map,g,_,k;function y(D){t[37](D)}let T={labelText:"Description",rows:2};t[0].description!==void 0&&(T.value=t[0].description),i=new l5({props:T}),xe.push(()=>At(i,"value",y));let M=!t[9]&&t[2].length&&my(t),A=it(t[0].rules);const C=D=>D[64];for(let D=0;D{r=null}),fe())},i(s){l||(p(r),l=!0)},o(s){v(r),l=!1},d(s){s&&(E(n),E(i)),r&&r.d(s)}}}function x0e(t){let e;return{c(){e=$("Add rule")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function epe(t){let e,n,i,l,r,s,o,a,u,f,c,d=[],h=new Map,g,_,k;function y(D){t[37](D)}let T={labelText:"Description",rows:2};t[0].description!==void 0&&(T.value=t[0].description),i=new l5({props:T}),xe.push(()=>At(i,"value",y));let M=!t[9]&&t[2].length&&my(t),A=it(t[0].rules);const C=D=>D[64];for(let D=0;Dl=!1)),i.$set(N),!D[9]&&D[2].length?M?(M.p(D,R),R[0]&516&&p(M,1)):(M=my(D),M.c(),p(M,1),M.m(e,s)):M&&(ue(),v(M,1,1,()=>{M=null}),fe()),R[0]&67059855&&(A=it(D[0].rules),ue(),d=Pn(d,R,C,1,D,A,h,o,Fn,Oy,g,uy),fe());const G={};R[2]&4096&&(G.$$scope={dirty:R,ctx:D}),_.$set(G)},i(D){if(!k){p(i.$$.fragment,D),p(M);for(let R=0;R({id:t,text:t}),Ly=t=>({id:t,text:t});function ape(t,e,n){let i,l,r,{draft:s}=e,{categories:o=[]}=e,{users:a=[]}=e,{schedulePresets:u=[]}=e,{timezone:f="UTC"}=e,{saving:c=!1}=e,{onSave:d=()=>{}}=e,{onCancel:h=()=>{}}=e;const g=A0e(s);function _(Ne){if(Ne&&!r){const pe=u.find(et=>et.id==="bedtime");n(0,s.rules=[C0e(f,pe),...s.rules],s)}else!Ne&&r&&A(l)}function k(Ne,pe){r!=null&&r.schedule&&(n(8,r.schedule.windows[0][Ne]=pe.target.value,r),n(8,r.schedule.preset=void 0,r),T())}function y(Ne){r!=null&&r.schedule&&(n(8,r.schedule.weekdays=Ne.map(Number).sort((pe,et)=>pe-et),r),n(8,r.schedule.preset=void 0,r),T())}function T(){n(0,s.rules=[...s.rules],s)}function M(){n(0,s.rules=[...s.rules,KO()],s)}function A(Ne){n(0,s.rules=s.rules.filter((pe,et)=>et!==Ne),s)}function C(Ne,pe){const et=Ne+pe;if(et<0||et>=s.rules.length)return;const gt=[...s.rules];[gt[Ne],gt[et]]=[gt[et],gt[Ne]],n(0,s.rules=gt,s)}function D(Ne,pe){Ne.target.all_traffic=pe.target.value==="all",T()}function R(Ne,pe,et,gt=!1){let Kt=Ne[et].trim();gt&&(Kt=Kt.toLowerCase()),!(!Kt||Ne[pe].includes(Kt))&&(Ne[pe]=[...Ne[pe],Kt],Ne[et]="",T())}function N(Ne,pe,et){Ne[pe]=Ne[pe].filter(gt=>gt!==et),T()}function G(Ne,pe){Ne.users=pe.map(String),T()}function B(Ne,pe){Ne.schedule&&(Ne.schedule.weekdays=pe.map(Number).sort((et,gt)=>et-gt),T())}function $(Ne){return Ne.schedule?Ne.schedule.preset||rg:""}function q(Ne,pe){var gt,Kt,ze;if(!pe){Ne.schedule=null,T();return}if(pe===rg){const kt=((Kt=(gt=Ne.schedule)==null?void 0:gt.windows)==null?void 0:Kt[0])||{from:"20:00",to:"07:00"};Ne.schedule={timezone:f,weekdays:(ze=Ne.schedule)!=null&&ze.weekdays?[...Ne.schedule.weekdays]:[],windows:[{from:kt.from,to:kt.to}]},T();return}const et=u.find(kt=>kt.id===pe);et&&(Ne.schedule={timezone:f,weekdays:[...et.weekdays],windows:et.windows.map(kt=>({from:kt.from,to:kt.to})),preset:et.id},T())}function V(Ne,pe){q(Ne,pe.target.value)}function K(Ne,pe,et){var gt,Kt;(Kt=(gt=Ne.schedule)==null?void 0:gt.windows)!=null&&Kt.length&&(Ne.schedule.windows[0][pe]=et.target.value,T())}function x(Ne){n(0,s.users=Ne.map(String),s)}function ie(Ne){t.$$.not_equal(s.name,Ne)&&(s.name=Ne,n(0,s))}const X=Ne=>n(0,s.blocked_categories=Ne.detail,s),ce=Ne=>n(0,s.blocked_domains=Ne.detail,s),ae=Ne=>n(0,s.allowed_domains=Ne.detail,s);function ee(Ne){t.$$.not_equal(s.safe_search,Ne)&&(s.safe_search=Ne,n(0,s))}const he=Ne=>_(Ne.detail.toggled),ne=Ne=>k("from",Ne),re=Ne=>k("to",Ne),oe=Ne=>y(Ne.detail.selectedIds);function Re(Ne){t.$$.not_equal(s.description,Ne)&&(s.description=Ne,n(0,s))}const qe=Ne=>x(Ne.detail.selectedIds);function Ce(Ne,pe){t.$$.not_equal(pe.enabled,Ne)&&(pe.enabled=Ne,n(0,s))}const Ze=Ne=>C(Ne,-1),be=Ne=>C(Ne,1),Ae=Ne=>A(Ne);function ve(Ne,pe){t.$$.not_equal(pe.name,Ne)&&(pe.name=Ne,n(0,s))}function me(Ne,pe){t.$$.not_equal(pe.action,Ne)&&(pe.action=Ne,n(0,s))}const lt=(Ne,pe)=>D(Ne,pe),De=(Ne,pe,et,gt)=>{n(0,pe[et].target.categories=gt.detail,s),T()},vt=(Ne,pe,et,gt)=>{n(0,pe[et].target.domains=gt.detail,s),T()},dt=(Ne,pe)=>V(Ne,pe),ot=(Ne,pe)=>K(Ne,"from",pe),ht=(Ne,pe)=>K(Ne,"to",pe),Bt=(Ne,pe)=>B(Ne,pe.detail.selectedIds),Ot=(Ne,pe)=>G(Ne,pe.detail.selectedIds);function Zt(Ne,pe){t.$$.not_equal(pe.url_draft,Ne)&&(pe.url_draft=Ne,n(0,s))}const Ve=(Ne,pe)=>pe.key==="Enter"&&R(Ne,"url_regexes","url_draft"),Nt=Ne=>R(Ne,"url_regexes","url_draft"),Tt=(Ne,pe)=>N(Ne,"url_regexes",pe);function Gt(Ne,pe){t.$$.not_equal(pe.content_type_draft,Ne)&&(pe.content_type_draft=Ne,n(0,s))}const fn=(Ne,pe)=>pe.key==="Enter"&&R(Ne,"blocked_content_types","content_type_draft",!0),an=Ne=>R(Ne,"blocked_content_types","content_type_draft",!0),Qt=(Ne,pe)=>N(Ne,"blocked_content_types",pe);return t.$$set=Ne=>{"draft"in Ne&&n(0,s=Ne.draft),"categories"in Ne&&n(1,o=Ne.categories),"users"in Ne&&n(2,a=Ne.users),"schedulePresets"in Ne&&n(3,u=Ne.schedulePresets),"timezone"in Ne&&n(27,f=Ne.timezone),"saving"in Ne&&n(4,c=Ne.saving),"onSave"in Ne&&n(5,d=Ne.onSave),"onCancel"in Ne&&n(6,h=Ne.onCancel)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(9,i=s.id===Ji),t.$$.dirty[0]&1&&n(7,l=s.rules.findIndex(kd)),t.$$.dirty[0]&129&&n(8,r=l>=0?s.rules[l]:null)},[s,o,a,u,c,d,h,l,r,i,g,_,k,y,T,M,A,C,D,R,N,G,B,$,V,K,x,f,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae,ve,me,lt,De,vt,dt,ot,ht,Bt,Ot,Zt,Ve,Nt,Tt,Gt,fn,an,Qt]}class JO extends Oe{constructor(e){super(),Ee(this,e,ape,ope,Se,{draft:0,categories:1,users:2,schedulePresets:3,timezone:27,saving:4,onSave:5,onCancel:6},null,[-1,-1,-1])}}const{Boolean:yd}=Sd;function Dy(t,e,n){const i=t.slice();return i[78]=e[n],i}function Iy(t,e,n){const i=t.slice();return i[81]=e[n],i}function Ry(t,e,n){const i=t.slice();return i[84]=e[n],i}function Py(t,e,n){const i=t.slice();return i[87]=e[n],i}function Ny(t,e,n){const i=t.slice();return i[90]=e[n],i}function By(t,e,n){const i=t.slice();return i[93]=e[n],i}function zy(t,e,n){const i=t.slice();return i[93]=e[n],i}function Hy(t,e,n){const i=t.slice();return i[98]=e[n],i}function Uy(t,e,n){const i=t.slice();return i[101]=e[n],i}function Fy(t,e,n){const i=t.slice();return i[98]=e[n],i}function Gy(t){let e,n;return e=new nn({props:{kind:"error",title:"Error",subtitle:t[11]}}),e.$on("close",t[46]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Vy(t){let e,n;return e=new nn({props:{kind:"success",title:"Done",subtitle:t[12]}}),e.$on("close",t[47]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&4096&&(r.subtitle=i[12]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function upe(t){let e,n,i;function l(s){t[61](s)}let r={"aria-label":"Policy tools",$$slots:{content:[Xpe],default:[cpe]},$$scope:{ctx:t}};return t[13]!==void 0&&(r.selected=t[13]),e=new mg({props:r}),xe.push(()=>At(e,"selected",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o[0]&134072063|o[3]&8192&&(a.$$scope={dirty:o,ctx:s}),!n&&o[0]&8192&&(n=!0,a.selected=s[13],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function fpe(t){let e,n;return e=new Wi({props:{description:"Loading policies..."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function cpe(t){let e,n,i,l,r,s;return e=new ql({props:{label:"Policies"}}),i=new ql({props:{label:"Test a site"}}),r=new ql({props:{label:"Gateway defaults"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p:_e,i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function dpe(t){let e;return{c(){e=j("Create policy")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Wy(t){let e,n,i,l,r,s,o,a,u=[],f=new Map,c,d,h;r=new bt({props:{size:"small",kind:"ghost",$$slots:{default:[hpe]},$$scope:{ctx:t}}}),r.$on("click",t[30]);let g=t[2].length&&jy(t),_=it(t[1]);const k=y=>y[101].id;for(let y=0;y<_.length;y+=1){let T=Uy(t,_,y),M=k(T);f.set(M,u[y]=Xy(M,T))}return d=new ya({props:{$$slots:{default:[vpe]},$$scope:{ctx:t}}}),{c(){e=P("div"),n=P("div"),i=P("div"),i.innerHTML='

        Create a policy

        Start with a tested baseline or build one from scratch.

        ',l=F(),U(r.$$.fragment),s=F(),g&&g.c(),o=F(),a=P("div");for(let y=0;y{g=null}),fe()),T[0]&514|T[1]&3073&&(_=it(y[1]),ue(),u=Pn(u,T,k,1,y,_,f,a,Fn,Xy,c,Uy),fe());const A={};T[3]&8192&&(A.$$scope={dirty:T,ctx:y}),d.$set(A)},i(y){if(!h){p(r.$$.fragment,y),p(g);for(let T=0;T<_.length;T+=1)p(u[T]);p(d.$$.fragment,y),h=!0}},o(y){v(r.$$.fragment,y),v(g);for(let T=0;Tv(r[a],1,1,()=>{r[a]=null});let o=t[101].categories.length>3&&Yy(t);return{c(){e=P("div");for(let a=0;a3?o?(o.p(a,u),u[0]&2&&p(o,1)):(o=Yy(a),o.c(),p(o,1),o.m(e,null)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(a){if(!i){for(let u=0;u{g=null}),fe()),(R=t[101].limitations)!=null&&R.length?_?_.p(t,A):(_=Zy(t),_.c(),_.m(e,c)):_&&(_.d(1),_=null);const C={};A[0]&2&&(C.kind=t[42](t[101])?"ghost":"secondary"),A[0]&514&&(C.disabled=t[9]||!t[101].available||t[42](t[101])),A[0]&2|A[3]&8192&&(C.$$scope={dirty:A,ctx:t}),d.$set(C)},i(M){h||(p(g),p(d.$$.fragment,M),h=!0)},o(M){v(g),v(d.$$.fragment,M),h=!1},d(M){M&&E(e),g&&g.d(),_&&_.d(),H(d)}}}function Xy(t,e){let n,i,l;return i=new ya({props:{$$slots:{default:[ppe]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&514|s[3]&8192&&(o.$$scope={dirty:s,ctx:e}),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function bpe(t){let e;return{c(){e=j("Start blank")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function vpe(t){let e,n,i,l,r,s,o;return s=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[bpe]},$$scope:{ctx:t}}}),s.$on("click",t[28]),{c(){e=P("div"),n=P("h4"),n.textContent="Blank policy",i=F(),l=P("p"),l.textContent=`Choose every category, domain, schedule, and advanced rule - yourself.`,r=F(),U(s.$$.fragment),I(n,"class","svelte-1stwbl3"),I(l,"class","tile-description svelte-1stwbl3"),I(e,"class","template-tile blank-template svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(e,l),w(e,r),z(s,e,null),o=!0},p(a,u){const f={};u[3]&8192&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&E(e),H(s)}}}function Ky(t){let e,n,i;return n=new ya({props:{$$slots:{default:[kpe]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","group-slot editor-slot svelte-1stwbl3")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&33512|r[3]&8192&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function kpe(t){let e,n,i,l;return i=new JO({props:{draft:t[15],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[36],onCancel:t[30]}}),{c(){e=P("h4"),e.textContent="New policy",n=F(),U(i.$$.fragment),I(e,"class","svelte-1stwbl3")},m(r,s){O(r,e,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&32768&&(o.draft=r[15]),s[0]&8&&(o.categories=r[3]),s[0]&64&&(o.users=r[6]),s[0]&32&&(o.schedulePresets=r[5]),s[0]&128&&(o.timezone=r[7]),s[0]&512&&(o.saving=r[9]),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&(E(e),E(n)),H(i,r)}}}function wpe(t){let e,n,i,l,r=t[84].name+"",s,o,a,u,f=(t[26][t[84].id]||[]).length+"",c,d,h=(t[26][t[84].id]||[]).length===1?"":"s",g,_=t[84].users.length?" · "+t[84].users.length+" proxy user"+(t[84].users.length===1?"":"s"):"",k,y,T,M=ay(t[84],t[31])+"",A,C,D,R,N=t[24][t[84].id]?"Hide details":"View details",G,B,$,q,V,K,x,ie,X=(t[26][t[84].id]||[]).length+"",ce,ae,ee,he,ne,re=t[84].id!==Ji&&t[33](t[84].id).length,oe,Re,qe,Ce,Ze,be,Ae,ve=t[84].id===Ji&&Jy(t);function me(Nt,Tt){if(Nt[84].id===Ji)return Epe;if(!(Nt[26][Nt[84].id]||[]).length&&!Nt[84].users.length)return Spe}let lt=me(t),De=lt&<(t);function vt(){return t[49](t[84])}let dt=t[24][t[84].id]&&Qy(t);const ot=[Lpe,Ape],ht=[];function Bt(Nt,Tt){return(Nt[26][Nt[84].id]||[]).length?0:1}ee=Bt(t),he=ht[ee]=ot[ee](t);let Ot=re&&u8(t);function Zt(){return t[54](t[84])}qe=new bt({props:{size:"small",kind:"ghost",disabled:t[9],$$slots:{default:[Bpe]},$$scope:{ctx:t}}}),qe.$on("click",Zt);let Ve=t[84].id!==Ji&&f8(t);return{c(){e=P("div"),n=P("div"),i=P("div"),l=P("h4"),s=j(r),o=F(),ve&&ve.c(),a=F(),u=P("span"),c=j(f),d=j(" device"),g=j(h),k=j(_),y=F(),T=P("p"),A=j(M),C=F(),De&&De.c(),D=F(),R=P("button"),G=j(N),B=F(),dt&&dt.c(),$=F(),q=P("div"),V=P("div"),K=P("h5"),K.textContent="Assigned devices",x=F(),ie=P("span"),ce=j(X),ae=F(),he.c(),ne=F(),Ot&&Ot.c(),oe=F(),Re=P("div"),U(qe.$$.fragment),Ce=F(),Ve&&Ve.c(),I(l,"class","svelte-1stwbl3"),I(u,"class","device-count svelte-1stwbl3"),I(i,"class","group-title svelte-1stwbl3"),I(T,"class","summary-line svelte-1stwbl3"),I(R,"type","button"),I(R,"class","link-button svelte-1stwbl3"),I(K,"class","svelte-1stwbl3"),I(ie,"class","device-count svelte-1stwbl3"),I(V,"class","assignment-heading svelte-1stwbl3"),I(q,"class","assignment-panel svelte-1stwbl3"),I(n,"class","group-summary svelte-1stwbl3"),I(Re,"class","group-actions svelte-1stwbl3"),I(e,"class","group-row svelte-1stwbl3")},m(Nt,Tt){O(Nt,e,Tt),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),ve&&ve.m(i,null),w(i,a),w(i,u),w(u,c),w(u,d),w(u,g),w(u,k),w(n,y),w(n,T),w(T,A),w(n,C),De&&De.m(n,null),w(n,D),w(n,R),w(R,G),w(n,B),dt&&dt.m(n,null),w(n,$),w(n,q),w(q,V),w(V,K),w(V,x),w(V,ie),w(ie,ce),w(q,ae),ht[ee].m(q,null),w(q,ne),Ot&&Ot.m(q,null),w(e,oe),w(e,Re),z(qe,Re,null),w(Re,Ce),Ve&&Ve.m(Re,null),Ze=!0,be||(Ae=J(R,"click",vt),be=!0)},p(Nt,Tt){t=Nt,(!Ze||Tt[0]&1)&&r!==(r=t[84].name+"")&&Y(s,r),t[84].id===Ji?ve?Tt[0]&1&&p(ve,1):(ve=Jy(t),ve.c(),p(ve,1),ve.m(i,a)):ve&&(ue(),v(ve,1,1,()=>{ve=null}),fe()),(!Ze||Tt[0]&67108865)&&f!==(f=(t[26][t[84].id]||[]).length+"")&&Y(c,f),(!Ze||Tt[0]&67108865)&&h!==(h=(t[26][t[84].id]||[]).length===1?"":"s")&&Y(g,h),(!Ze||Tt[0]&1)&&_!==(_=t[84].users.length?" · "+t[84].users.length+" proxy user"+(t[84].users.length===1?"":"s"):"")&&Y(k,_),(!Ze||Tt[0]&1)&&M!==(M=ay(t[84],t[31])+"")&&Y(A,M),lt!==(lt=me(t))&&(De&&De.d(1),De=lt&<(t),De&&(De.c(),De.m(n,D))),(!Ze||Tt[0]&16777217)&&N!==(N=t[24][t[84].id]?"Hide details":"View details")&&Y(G,N),t[24][t[84].id]?dt?(dt.p(t,Tt),Tt[0]&16777217&&p(dt,1)):(dt=Qy(t),dt.c(),p(dt,1),dt.m(n,$)):dt&&(ue(),v(dt,1,1,()=>{dt=null}),fe()),(!Ze||Tt[0]&67108865)&&X!==(X=(t[26][t[84].id]||[]).length+"")&&Y(ce,X);let Gt=ee;ee=Bt(t),ee===Gt?ht[ee].p(t,Tt):(ue(),v(ht[Gt],1,1,()=>{ht[Gt]=null}),fe(),he=ht[ee],he?he.p(t,Tt):(he=ht[ee]=ot[ee](t),he.c()),p(he,1),he.m(q,ne)),Tt[0]&1&&(re=t[84].id!==Ji&&t[33](t[84].id).length),re?Ot?(Ot.p(t,Tt),Tt[0]&1&&p(Ot,1)):(Ot=u8(t),Ot.c(),p(Ot,1),Ot.m(q,null)):Ot&&(ue(),v(Ot,1,1,()=>{Ot=null}),fe());const fn={};Tt[0]&512&&(fn.disabled=t[9]),Tt[3]&8192&&(fn.$$scope={dirty:Tt,ctx:t}),qe.$set(fn),t[84].id!==Ji?Ve?(Ve.p(t,Tt),Tt[0]&1&&p(Ve,1)):(Ve=f8(t),Ve.c(),p(Ve,1),Ve.m(Re,null)):Ve&&(ue(),v(Ve,1,1,()=>{Ve=null}),fe())},i(Nt){Ze||(p(ve),p(dt),p(he),p(Ot),p(qe.$$.fragment,Nt),p(Ve),Ze=!0)},o(Nt){v(ve),v(dt),v(he),v(Ot),v(qe.$$.fragment,Nt),v(Ve),Ze=!1},d(Nt){Nt&&E(e),ve&&ve.d(),De&&De.d(),dt&&dt.d(),ht[ee].d(),Ot&&Ot.d(),H(qe),Ve&&Ve.d(),be=!1,Ae()}}}function ype(t){let e,n,i=t[84].name+"",l,r,s,o;return s=new JO({props:{draft:t[15],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[36],onCancel:t[30]}}),{c(){e=P("h4"),n=j("Edit "),l=j(i),r=F(),U(s.$$.fragment),I(e,"class","svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,l),O(a,r,u),z(s,a,u),o=!0},p(a,u){(!o||u[0]&1)&&i!==(i=a[84].name+"")&&Y(l,i);const f={};u[0]&32768&&(f.draft=a[15]),u[0]&8&&(f.categories=a[3]),u[0]&64&&(f.users=a[6]),u[0]&32&&(f.schedulePresets=a[5]),u[0]&128&&(f.timezone=a[7]),u[0]&512&&(f.saving=a[9]),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&(E(e),E(r)),H(s,a)}}}function Jy(t){let e,n;return e=new Rt({props:{size:"sm",type:"blue",$$slots:{default:[Tpe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Tpe(t){let e;return{c(){e=j("default")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Spe(t){let e;return{c(){e=P("p"),e.textContent="No devices use this policy yet.",I(e,"class","muted svelte-1stwbl3")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Epe(t){let e;return{c(){e=P("p"),e.textContent=`New and unassigned devices use this policy - automatically.`,I(e,"class","muted svelte-1stwbl3")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Qy(t){let e,n,i,l,r,s,o=t[84].description&&xy(t),a=(t[84].blocked_categories.length||t[84].blocked_domains.length)&&e8(t),u=t[84].allowed_domains.length&&i8(t),f=t[84].rules.length&&r8(t),c=t[84].users.length&&o8(t);return{c(){e=P("div"),o&&o.c(),n=F(),a&&a.c(),i=F(),u&&u.c(),l=F(),f&&f.c(),r=F(),c&&c.c(),I(e,"class","policy-details svelte-1stwbl3")},m(d,h){O(d,e,h),o&&o.m(e,null),w(e,n),a&&a.m(e,null),w(e,i),u&&u.m(e,null),w(e,l),f&&f.m(e,null),w(e,r),c&&c.m(e,null),s=!0},p(d,h){d[84].description?o?o.p(d,h):(o=xy(d),o.c(),o.m(e,n)):o&&(o.d(1),o=null),d[84].blocked_categories.length||d[84].blocked_domains.length?a?(a.p(d,h),h[0]&1&&p(a,1)):(a=e8(d),a.c(),p(a,1),a.m(e,i)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),d[84].allowed_domains.length?u?(u.p(d,h),h[0]&1&&p(u,1)):(u=i8(d),u.c(),p(u,1),u.m(e,l)):u&&(ue(),v(u,1,1,()=>{u=null}),fe()),d[84].rules.length?f?f.p(d,h):(f=r8(d),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d[84].users.length?c?c.p(d,h):(c=o8(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i(d){s||(p(a),p(u),s=!0)},o(d){v(a),v(u),s=!1},d(d){d&&E(e),o&&o.d(),a&&a.d(),u&&u.d(),f&&f.d(),c&&c.d()}}}function xy(t){let e,n=t[84].description+"",i;return{c(){e=P("p"),i=j(n),I(e,"class","svelte-1stwbl3")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&1&&n!==(n=l[84].description+"")&&Y(i,n)},d(l){l&&E(e)}}}function e8(t){let e,n,i,l,r,s=it(t[84].blocked_categories),o=[];for(let d=0;dv(o[d],1,1,()=>{o[d]=null});let u=it(t[84].blocked_domains),f=[];for(let d=0;dv(f[d],1,1,()=>{f[d]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Blocks",i=F();for(let d=0;dv(s[a],1,1,()=>{s[a]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Always allows",i=F();for(let a=0;as[90].id;for(let s=0;so[87];for(let o=0;o{a[d]=null}),fe(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),p(l,1),l.m(r.parentNode,r))},i(f){s||(p(l),s=!0)},o(f){v(l),s=!1},d(f){f&&(E(n),E(r)),a[i].d(f)}}}function u8(t){let e,n,i,l,r;function s(...a){return t[52](t[84],...a)}n=new ju({props:{size:"sm",titleText:"Add devices",label:"Select devices",items:t[33](t[84].id).map(t[51]),selectedIds:t[16][t[84].id]||[]}}),n.$on("select",s);function o(){return t[53](t[84])}return l=new bt({props:{size:"small",kind:"tertiary",disabled:t[9]||!(t[16][t[84].id]||[]).length,$$slots:{default:[Npe]},$$scope:{ctx:t}}}),l.$on("click",o),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","assign-row svelte-1stwbl3")},m(a,u){O(a,e,u),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&1&&(f.items=t[33](t[84].id).map(t[51])),u[0]&65537&&(f.selectedIds=t[16][t[84].id]||[]),n.$set(f);const c={};u[0]&66049&&(c.disabled=t[9]||!(t[16][t[84].id]||[]).length),u[3]&8192&&(c.$$scope={dirty:u,ctx:t}),l.$set(c)},i(a){r||(p(n.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(n.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(e),H(n),H(l)}}}function Npe(t){let e;return{c(){e=j("Assign selected")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Bpe(t){let e;return{c(){e=j("Edit")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function f8(t){let e,n;function i(){return t[55](t[84])}return e=new bt({props:{size:"small",kind:"danger-ghost",disabled:t[9],$$slots:{default:[zpe]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&512&&(s.disabled=t[9]),r[3]&8192&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function zpe(t){let e;return{c(){e=j("Delete")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Hpe(t){let e,n,i,l;const r=[ype,wpe],s=[];function o(a,u){return a[14]===a[84].id?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function c8(t,e){let n,i,l,r;return i=new ya({props:{$$slots:{default:[Hpe]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=P("div"),U(i.$$.fragment),l=F(),I(n,"class","group-slot svelte-1stwbl3"),this.first=n},m(s,o){O(s,n,o),z(i,n,null),w(n,l),r=!0},p(s,o){e=s;const a={};o[0]&84001513|o[3]&8192&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(s){r||(p(i.$$.fragment,s),r=!0)},o(s){v(i.$$.fragment,s),r=!1},d(s){s&&E(n),H(i)}}}function Upe(t){let e,n,i,l,r,s,o,a,u,f=[],c=new Map,d;r=new bt({props:{size:"small",disabled:t[9],$$slots:{default:[dpe]},$$scope:{ctx:t}}}),r.$on("click",t[27]);let h=t[14]==="choose"&&Wy(t),g=t[14]==="new"&&Ky(t),_=it(t[0]);const k=y=>y[84].id;for(let y=0;y<_.length;y+=1){let T=Ry(t,_,y),M=k(T);c.set(M,f[y]=c8(M,T))}return{c(){e=P("section"),n=P("div"),i=P("div"),i.innerHTML=`

        Policies

        Every device follows one policy. Unassigned devices use the - default policy.

        `,l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=F(),g&&g.c(),a=F(),u=P("div");for(let y=0;y{h=null}),fe()),y[14]==="new"?g?(g.p(y,T),T[0]&16384&&p(g,1)):(g=Ky(y),g.c(),p(g,1),g.m(e,a)):g&&(ue(),v(g,1,1,()=>{g=null}),fe()),T[0]&1694614249|T[1]&191&&(_=it(y[0]),ue(),f=Pn(f,T,k,1,y,_,c,u,Fn,c8,null,Ry),fe())},i(y){if(!d){p(r.$$.fragment,y),p(h),p(g);for(let T=0;T<_.length;T+=1)p(f[T]);d=!0}},o(y){v(r.$$.fragment,y),v(h),v(g);for(let T=0;Tu[81].id;for(let u=0;uAt(n,"selected",y));function M(B){t[57](B)}let A={size:"sm",labelText:"Domain or URL",placeholder:"youtube.com/shorts/abc"};t[19]!==void 0&&(A.value=t[19]),r=new ei({props:A}),xe.push(()=>At(r,"value",M)),r.$on("keydown",t[58]);function C(B){t[59](B)}let D={size:"sm",labelText:"Path",$$slots:{default:[Gpe]},$$scope:{ctx:t}};t[20]!==void 0&&(D.selected=t[20]),a=new Wr({props:D}),xe.push(()=>At(a,"selected",C)),c=new bt({props:{size:"small",disabled:t[21]||!t[19].trim(),$$slots:{default:[Vpe]},$$scope:{ctx:t}}}),c.$on("click",t[43]);let R=t[21]&&h8(),N=t[23]&&m8(t),G=t[22]&&g8(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),o=F(),U(a.$$.fragment),f=F(),U(c.$$.fragment),d=F(),R&&R.c(),h=F(),N&&N.c(),g=F(),G&&G.c(),_=je(),I(e,"class","test-row svelte-1stwbl3")},m(B,$){O(B,e,$),z(n,e,null),w(e,l),z(r,e,null),w(e,o),z(a,e,null),w(e,f),z(c,e,null),O(B,d,$),R&&R.m(B,$),O(B,h,$),N&&N.m(B,$),O(B,g,$),G&&G.m(B,$),O(B,_,$),k=!0},p(B,$){const q={};$[0]&33554432|$[3]&8192&&(q.$$scope={dirty:$,ctx:B}),!i&&$[0]&262144&&(i=!0,q.selected=B[18],Ct(()=>i=!1)),n.$set(q);const V={};!s&&$[0]&524288&&(s=!0,V.value=B[19],Ct(()=>s=!1)),r.$set(V);const K={};$[3]&8192&&(K.$$scope={dirty:$,ctx:B}),!u&&$[0]&1048576&&(u=!0,K.selected=B[20],Ct(()=>u=!1)),a.$set(K);const x={};$[0]&2621440&&(x.disabled=B[21]||!B[19].trim()),$[3]&8192&&(x.$$scope={dirty:$,ctx:B}),c.$set(x),B[21]?R?$[0]&2097152&&p(R,1):(R=h8(),R.c(),p(R,1),R.m(h.parentNode,h)):R&&(ue(),v(R,1,1,()=>{R=null}),fe()),B[23]?N?N.p(B,$):(N=m8(B),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),B[22]?G?(G.p(B,$),$[0]&4194304&&p(G,1)):(G=g8(B),G.c(),p(G,1),G.m(_.parentNode,_)):G&&(ue(),v(G,1,1,()=>{G=null}),fe())},i(B){k||(p(n.$$.fragment,B),p(r.$$.fragment,B),p(a.$$.fragment,B),p(c.$$.fragment,B),p(R),p(G),k=!0)},o(B){v(n.$$.fragment,B),v(r.$$.fragment,B),v(a.$$.fragment,B),v(c.$$.fragment,B),v(R),v(G),k=!1},d(B){B&&(E(e),E(d),E(h),E(g),E(_)),H(n),H(r),H(a),H(c),R&&R.d(B),N&&N.d(B),G&&G.d(B)}}}function $pe(t){let e,n,i,l,r,s,o;return s=new ya({props:{$$slots:{default:[jpe]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("h3"),n.textContent="Test a site",i=F(),l=P("p"),l.textContent=`Check whether a site is blocked for a device right now and which - setting decides it. Nothing is changed.`,r=F(),U(s.$$.fragment),I(n,"id","test-heading"),I(n,"class","svelte-1stwbl3"),I(l,"class","section-intro svelte-1stwbl3"),I(e,"class","section tab-section svelte-1stwbl3"),I(e,"aria-labelledby","test-heading")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(e,l),w(e,r),z(s,e,null),o=!0},p(a,u){const f={};u[0]&50069504|u[3]&8192&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&E(e),H(s)}}}function qpe(t){let e;return{c(){e=j("Save categories")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Ype(t){let e,n;return e=new v_({props:{categories:t[3],selection:t[4],disabled:t[10]}}),e.$on("change",t[60]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.categories=i[3]),l[0]&16&&(r.selection=i[4]),l[0]&1024&&(r.disabled=i[10]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Zpe(t){let e,n,i,l,r,s,o,a;return r=new bt({props:{size:"small",disabled:t[10],$$slots:{default:[qpe]},$$scope:{ctx:t}}}),r.$on("click",t[37]),o=new ya({props:{$$slots:{default:[Ype]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("div"),i=P("div"),i.innerHTML=`

        Gateway defaults

        These categories are blocked for every device on every policy. A - policy's always-allowed domains can still exempt a site.

        `,l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),I(n,"class","section-heading svelte-1stwbl3"),I(e,"class","section tab-section svelte-1stwbl3"),I(e,"aria-labelledby","defaults-heading")},m(u,f){O(u,e,f),w(e,n),w(n,i),w(n,l),z(r,n,null),w(e,s),z(o,e,null),a=!0},p(u,f){const c={};f[0]&1024&&(c.disabled=u[10]),f[3]&8192&&(c.$$scope={dirty:f,ctx:u}),r.$set(c);const d={};f[0]&1048|f[3]&8192&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&E(e),H(r),H(o)}}}function Xpe(t){let e,n,i,l,r,s;return e=new Yl({props:{$$slots:{default:[Upe]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[$pe]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[Zpe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&84001519|a[3]&8192&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&50069504|a[3]&8192&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1048|a[3]&8192&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Kpe(t){var o;let e,n,i,l=((o=t[17])==null?void 0:o.name)+"",r,s;return{c(){e=P("p"),n=j("Delete "),i=P("strong"),r=j(l),s=j(`? Devices assigned to it will - move to the default policy.`),I(e,"class","svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(i,r),w(e,s)},p(a,u){var f;u[0]&131072&&l!==(l=((f=a[17])==null?void 0:f.name)+"")&&Y(r,l)},d(a){a&&E(e)}}}function Jpe(t){let e,n,i,l,r,s;return e=new Od({props:{title:"Delete policy?",label:"This action cannot be undone"}}),i=new Md({props:{$$slots:{default:[Kpe]},$$scope:{ctx:t}}}),r=new Cd({props:{danger:!0,primaryButtonText:t[9]?"Deleting...":"Delete policy",primaryButtonDisabled:t[9],secondaryButtonText:"Cancel"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&131072|a[3]&8192&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a[0]&512&&(f.primaryButtonText=o[9]?"Deleting...":"Delete policy"),a[0]&512&&(f.primaryButtonDisabled=o[9]),r.$set(f)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Qpe(t){let e,n,i,l,r,s,o,a=t[11]&&Gy(t),u=t[12]&&Vy(t);const f=[fpe,upe],c=[];function d(h,g){return h[8]?0:1}return i=d(t),l=c[i]=f[i](t),s=new Ed({props:{open:!!t[17],danger:!0,size:"sm",preventCloseOnClickOutside:!0,$$slots:{default:[Jpe]},$$scope:{ctx:t}}}),s.$on("close",t[39]),s.$on("submit",t[40]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),l.c(),r=F(),U(s.$$.fragment)},m(h,g){a&&a.m(h,g),O(h,e,g),u&&u.m(h,g),O(h,n,g),c[i].m(h,g),O(h,r,g),z(s,h,g),o=!0},p(h,g){h[11]?a?(a.p(h,g),g[0]&2048&&p(a,1)):(a=Gy(h),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),h[12]?u?(u.p(h,g),g[0]&4096&&p(u,1)):(u=Vy(h),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());let _=i;i=d(h),i===_?c[i].p(h,g):(ue(),v(c[_],1,1,()=>{c[_]=null}),fe(),l=c[i],l?l.p(h,g):(l=c[i]=f[i](h),l.c()),p(l,1),l.m(r.parentNode,r));const k={};g[0]&131072&&(k.open=!!h[17]),g[0]&131584|g[3]&8192&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){o||(p(a),p(u),p(l),p(s.$$.fragment,h),o=!0)},o(h){v(a),v(u),v(l),v(s.$$.fragment,h),o=!1},d(h){h&&(E(e),E(n),E(r)),a&&a.d(h),u&&u.d(h),c[i].d(h),H(s,h)}}}function xpe(){return localStorage.getItem("jwt")||""}function xs(t=!1){const e={Authorization:"Bearer "+xpe()};return t&&(e["Content-Type"]="application/json"),e}async function eo(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}async function Pr(t){const e=await fetch(t,{headers:xs()});if(!e.ok)throw new Error(await eo(e));return e.json()}function Ko(t){const e=t.display_name||(t.hostnames||[])[0]||t.ipv4||t.id;return t.ipv4&&e!==t.ipv4?e+" ("+t.ipv4+")":e}function Td(t){const e=t.active;return e.action==="block"||e.url_blocked?{text:"Blocked",type:"red"}:e.action==="allow"?{text:"Allowed by policy",type:"green"}:{text:"Not blocked by policy",type:"gray"}}function ebe(t,e,n){let i,l;const r=Un()+"/api/policy/templates",s=Un()+"/api/policy/groups",o=Un()+"/api/policy/categories",a=Un()+"/api/policy/assignments",u=Un()+"/api/policy/preview",f=Un()+"/api/devices",c=Un()+"/api/policy/schedule-presets",d=Un()+"/api/users",h=Un()+"/api/settings/timezone";let g=[],_=[],k=[],y=[],T=[],M=[],A=[],C=[],D=[],R="UTC",N=!0,G=!1,B=!1,$="",q="",V=0,K="",x=fc(),ie={},X=null,ce="",ae="",ee="dns",he=!1,ne=null,re="";async function oe(){try{n(5,C=(await Pr(c)).presets||[])}catch{n(5,C=[])}try{n(6,D=((await Pr(d)).users||[]).map(Xe=>Xe.username).filter(Boolean))}catch{n(6,D=[])}try{const Xe=await Pr(h);Xe.Value&&n(7,R=Xe.Value)}catch{}}async function Re(){n(8,N=!0),n(11,$="");try{const[Xe,wt,Mt,Zn,Bn]=await Promise.all([Pr(r),Pr(s),Pr(o),Pr(a),Pr(f),oe()]);n(1,g=Xe.templates||[]),n(2,_=Xe.shared_limitations||[]),n(0,k=(wt.groups||[]).map(fu)),n(3,y=Mt.categories||[]),n(44,T=Zn.assignments||[]),n(45,M=Bn.devices||[]),n(4,A=y.filter(wn=>wn.enabled).map(wn=>wn.id))}catch(Xe){n(11,$=Xe.message)}finally{n(8,N=!1)}}async function qe(){n(44,T=(await Pr(a)).assignments||[])}function Ce(){n(14,K="choose"),n(15,x=fc())}function Ze(){n(14,K="new"),n(15,x=fc())}function be(Xe){n(14,K=Xe.id),n(15,x=fu(Xe))}function Ae(){n(14,K=""),n(15,x=fc())}function ve(Xe){const wt=y.find(Mt=>Mt.id===Xe);return wt?wt.name:Xe}function me(Xe,wt){var Bn;const Mt={[Ji]:[]},Zn=new Set;for(const wn of Xe)(Mt[Bn=wn.group_id]||(Mt[Bn]=[])).push(wn.device_id),Zn.add(wn.device_id);for(const wn of wt)Zn.has(wn.id)||Mt[Ji].push(wn.id);return Mt}function lt(Xe){const wt=M.find(Mt=>Mt.id===Xe);return wt?Ko(wt):Xe}function De(Xe){const wt=new Set(i[Xe]||[]);return l.filter(Mt=>!wt.has(Mt.id))}async function vt(Xe,wt){const Mt=await fetch(f+"/"+Xe+"/assignment",{method:"PUT",headers:xs(!0),body:JSON.stringify({group_id:wt===Ji?"":wt})});if(!Mt.ok)throw new Error(await eo(Mt))}async function dt(Xe,wt){if(Xe){n(9,G=!0),n(11,$=""),n(12,q="");try{await vt(Xe,wt),await qe(),n(12,q=lt(Xe)+" now uses "+ht(wt)+".")}catch(Mt){n(11,$=Mt.message)}finally{n(9,G=!1)}}}async function ot(Xe){const wt=ie[Xe]||[];if(wt.length){n(9,G=!0),n(11,$=""),n(12,q="");try{for(const Mt of wt)await vt(Mt,Xe);await qe(),n(16,ie[Xe]=[],ie),n(16,ie={...ie}),n(12,q=wt.length+" device"+(wt.length===1?"":"s")+" now use "+ht(Xe)+".")}catch(Mt){n(11,$=Mt.message)}finally{n(9,G=!1)}}}function ht(Xe){var wt;return((wt=k.find(Mt=>Mt.id===Xe))==null?void 0:wt.name)||Xe}async function Bt(){if(!x.name.trim()){n(11,$="A policy needs a name.");return}n(9,G=!0),n(11,$=""),n(12,q="");try{const Xe=K==="new",wt=Xe?s:s+"/"+K,Mt=await fetch(wt,{method:Xe?"POST":"PUT",headers:xs(!0),body:JSON.stringify(E0e(x))});if(!Mt.ok)throw new Error(await eo(Mt));const Zn=fu((await Mt.json()).group);Xe?n(0,k=[...k,Zn]):n(0,k=k.map(Bn=>Bn.id===Zn.id?Zn:Bn)),n(12,q="Policy saved. It applies to new DNS lookups within a minute."),Ae()}catch(Xe){n(11,$=Xe.message)}finally{n(9,G=!1)}}async function Ot(){n(10,B=!0),n(11,$=""),n(12,q="");try{const Xe=await fetch(o,{method:"PUT",headers:xs(!0),body:JSON.stringify({categories:A})});if(!Xe.ok)throw new Error(await eo(Xe));const wt=await Xe.json();n(3,y=wt.categories||[]),n(4,A=y.filter(Mt=>Mt.enabled).map(Mt=>Mt.id)),n(12,q=wt.refresh_scheduled?"Categories saved. The gateway is downloading the feeds now, so refresh in a moment to see the new counts.":"Categories saved. A download was already running, so the counts update when it finishes.")}catch(Xe){n(11,$=Xe.message)}finally{n(10,B=!1)}}function Zt(Xe){n(17,X=Xe)}function Ve(){G||n(17,X=null)}async function Nt(){if(!X)return;const Xe=X;n(9,G=!0),n(11,$="");try{const wt=await fetch(s+"/"+Xe.id,{method:"DELETE",headers:xs()});if(!wt.ok)throw new Error(await eo(wt));n(0,k=k.filter(Mt=>Mt.id!==Xe.id)),n(17,X=null),await qe(),n(12,q="Policy deleted; its devices now use the default policy.")}catch(wt){n(11,$=wt.message)}finally{n(9,G=!1)}}async function Tt(Xe){n(9,G=!0),n(11,$=""),n(12,q="");try{const wt=await fetch(r+"/"+Xe.id+"/apply",{method:"POST",headers:xs()});if(!wt.ok)throw new Error(await eo(wt));const Mt=await wt.json();n(0,k=[...k,fu(Mt.group)]),n(14,K=Mt.group.id),n(15,x=fu(Mt.group)),n(12,q=Xe.name+" was added. Review it, then save any changes.")}catch(wt){n(11,$=wt.message)}finally{n(9,G=!1)}}function Gt(Xe){return k.some(wt=>wt.id===Xe.group_id)}async function fn(){const Xe=ae.trim();if(!Xe)return;n(21,he=!0),n(23,re=""),n(22,ne=null);const wt=M.find(wn=>wn.id===ce),Mt=Xe.includes("/"),Zn=Mt&&!Xe.includes("://")?"https://"+Xe:Xe,Bn={client_ip:(wt==null?void 0:wt.ipv4)||"",protocol:ee};Mt?Bn.url=Zn:Bn.domain=Xe;try{const wn=await fetch(u,{method:"POST",headers:xs(!0),body:JSON.stringify(Bn)});if(!wn.ok)throw new Error(await eo(wn));n(22,ne=await wn.json())}catch(wn){n(23,re=wn.message)}finally{n(21,he=!1)}}let an={};sn(Re);const Qt=()=>n(11,$=""),Ne=()=>n(12,q=""),pe=Xe=>Tt(Xe),et=Xe=>n(24,an[Xe.id]=!an[Xe.id],an),gt=Xe=>dt(Xe,Ji),Kt=Xe=>({id:Xe.id,text:Ko(Xe)}),ze=(Xe,wt)=>{n(16,ie[Xe.id]=wt.detail.selectedIds.map(String),ie),n(16,ie={...ie})},kt=Xe=>ot(Xe.id),Pt=Xe=>be(Xe),cn=Xe=>Zt(Xe);function qn(Xe){ce=Xe,n(18,ce)}function nl(Xe){ae=Xe,n(19,ae)}const Bl=Xe=>Xe.key==="Enter"&&fn();function Be(Xe){ee=Xe,n(20,ee)}const Et=Xe=>n(4,A=Xe.detail);function kn(Xe){V=Xe,n(13,V)}return t.$$.update=()=>{t.$$.dirty[1]&24576&&n(26,i=me(T,M)),t.$$.dirty[1]&16384&&n(25,l=[...M].sort((Xe,wt)=>Ko(Xe).localeCompare(Ko(wt)))),t.$$.dirty[0]&1&&k.filter(Xe=>Xe.id!==Ji).length},[k,g,_,y,A,C,D,R,N,G,B,$,q,V,K,x,ie,X,ce,ae,ee,he,ne,re,an,l,i,Ce,Ze,be,Ae,ve,lt,De,dt,ot,Bt,Ot,Zt,Ve,Nt,Tt,Gt,fn,T,M,Qt,Ne,pe,et,gt,Kt,ze,kt,Pt,cn,qn,nl,Bl,Be,Et,kn]}class tbe extends Oe{constructor(e){super(),Ee(this,e,ebe,Qpe,Se,{},null,[-1,-1,-1,-1])}}function nbe(t){let e,n;return e=new tbe({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ibe(t){let e;return{c(){e=j("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function lbe(t){let e;return{c(){e=j("Policies")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function rbe(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[ibe]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[lbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function sbe(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[rbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function obe(t){let e,n;return e=new Nl({props:{title:"Policies",description:"Choose protection for each device, test a decision, or adjust the gateway-wide baseline.",$$slots:{breadcrumb:[sbe],default:[nbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class abe extends Oe{constructor(e){super(),Ee(this,e,null,obe,Se,{})}}const{Boolean:vo}=Sd;function w8(t,e,n){const i=t.slice();return i[63]=e[n],i}function y8(t,e,n){const i=t.slice();return i[66]=e[n],i}function T8(t,e,n){const i=t.slice();return i[69]=e[n],i}function S8(t,e,n){const i=t.slice();return i[72]=e[n],i}function E8(t,e,n){const i=t.slice();return i[75]=e[n],i}function O8(t,e,n){const i=t.slice();return i[75]=e[n],i}function M8(t,e,n){const i=t.slice();return i[80]=e[n],i}function C8(t,e,n){const i=t.slice();return i[80]=e[n],i}function A8(t,e,n){const i=t.slice();return i[80]=e[n],i}function L8(t,e,n){const i=t.slice();return i[66]=e[n],i}function D8(t,e,n){const i=t.slice();return i[89]=e[n],i}function I8(t,e,n){const i=t.slice();return i[92]=e[n],i}function R8(t){let e,n;return e=new nn({props:{kind:"error",title:"Unable to save device labels",subtitle:t[6]}}),e.$on("close",t[40]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ube(t){let e,n,i,l,r,s,o,a;return e=new ql({props:{label:"Overview"}}),i=new ql({props:{label:"Policy"}}),r=new ql({props:{label:"Connections"}}),o=new ql({props:{label:"Identity & activity"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p:_e,i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function fbe(t){var i;let e=(i=t[0])!=null&&i.online?"Online":"Offline",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(s=l[0])!=null&&s.online?"Online":"Offline")&&Y(n,e)},d(l){l&&E(n)}}}function cbe(t){let e,n,i,l,r,s,o,a,u,f;function c(y){t[41](y)}let d={labelText:"Display name",placeholder:"e.g., Vivienne's iPad"};t[2]!==void 0&&(d.value=t[2]),n=new ei({props:d}),xe.push(()=>At(n,"value",c));function h(y){t[42](y)}let g={labelText:"Owner",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., Vivienne, Dad"};t[3]!==void 0&&(g.value=t[3]),r=new ei({props:g}),xe.push(()=>At(r,"value",h));function _(y){t[43](y)}let k={labelText:"Category",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., kids, adults, iot"};return t[4]!==void 0&&(k.value=t[4]),a=new ei({props:k}),xe.push(()=>At(a,"value",_)),{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),o=F(),U(a.$$.fragment),I(e,"class","field-grid svelte-cnehxk")},m(y,T){O(y,e,T),z(n,e,null),w(e,l),z(r,e,null),w(e,o),z(a,e,null),f=!0},p(y,T){const M={};!i&&T[0]&4&&(i=!0,M.value=y[2],Ct(()=>i=!1)),n.$set(M);const A={};!s&&T[0]&8&&(s=!0,A.value=y[3],Ct(()=>s=!1)),r.$set(A);const C={};!u&&T[0]&16&&(u=!0,C.value=y[4],Ct(()=>u=!1)),a.$set(C)},i(y){f||(p(n.$$.fragment,y),p(r.$$.fragment,y),p(a.$$.fragment,y),f=!0)},o(y){v(n.$$.fragment,y),v(r.$$.fragment,y),v(a.$$.fragment,y),f=!1},d(y){y&&E(e),H(n),H(r),H(a)}}}function dbe(t){let e;return{c(){e=j("Discovery")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function hbe(t){let e;return{c(){e=j("Observed value")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function mbe(t){let e,n,i,l;return e=new qt({props:{head:!0,$$slots:{default:[dbe]},$$scope:{ctx:t}}}),i=new qt({props:{head:!0,$$slots:{default:[hbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function gbe(t){let e,n;return e=new si({props:{head:!0,$$slots:{default:[mbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _be(t){let e;return{c(){e=j("Primary source")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function pbe(t){var i;let e=(((i=t[0])==null?void 0:i.source)||"Unknown")+"",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.source)||"Unknown")+"")&&Y(n,e)},d(l){l&&E(n)}}}function bbe(t){let e,n;return e=new Rt({props:{size:"sm",type:"outline",$$slots:{default:[pbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1|l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function vbe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[_be]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[bbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function kbe(t){let e;return{c(){e=j("First seen")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function wbe(t){var i;let e=Cs((i=t[0])==null?void 0:i.first_seen)+"",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Cs((s=l[0])==null?void 0:s.first_seen)+"")&&Y(n,e)},d(l){l&&E(n)}}}function ybe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[kbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[wbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Tbe(t){let e;return{c(){e=j("Last seen")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Sbe(t){var i;let e=Cs((i=t[0])==null?void 0:i.last_seen)+"",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Cs((s=l[0])==null?void 0:s.last_seen)+"")&&Y(n,e)},d(l){l&&E(n)}}}function Ebe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[Tbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[Sbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Obe(t){let e,n,i,l,r,s;return e=new si({props:{$$slots:{default:[vbe]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[ybe]},$$scope:{ctx:t}}}),r=new si({props:{$$slots:{default:[Ebe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[3]&4&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[3]&4&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[3]&4&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Mbe(t){let e,n,i,l;return e=new i5({props:{$$slots:{default:[gbe]},$$scope:{ctx:t}}}),i=new qu({props:{$$slots:{default:[Obe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Cbe(t){var h;let e,n,i,l,r,s,o,a,u,f,c,d;return r=new Rt({props:{size:"sm",type:(h=t[0])!=null&&h.online?"green":"warm-gray",$$slots:{default:[fbe]},$$scope:{ctx:t}}}),u=new dc({props:{legendText:"Naming and metadata",$$slots:{default:[cbe]},$$scope:{ctx:t}}}),c=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[Mbe]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("div"),i=P("h3"),i.textContent="Overview",l=F(),U(r.$$.fragment),s=F(),o=P("p"),o.textContent=`Add labels that make this device easier to recognize. These fields - are descriptive and do not select protection.`,a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),I(i,"id","device-overview-title"),I(i,"class","svelte-cnehxk"),I(n,"class","section-heading svelte-cnehxk"),I(o,"class","section-note svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-overview-title")},m(g,_){O(g,e,_),w(e,n),w(n,i),w(n,l),z(r,n,null),w(e,s),w(e,o),w(e,a),z(u,e,null),w(e,f),z(c,e,null),d=!0},p(g,_){var M;const k={};_[0]&1&&(k.type=(M=g[0])!=null&&M.online?"green":"warm-gray"),_[0]&1|_[3]&4&&(k.$$scope={dirty:_,ctx:g}),r.$set(k);const y={};_[0]&28|_[3]&4&&(y.$$scope={dirty:_,ctx:g}),u.$set(y);const T={};_[0]&1|_[3]&4&&(T.$$scope={dirty:_,ctx:g}),c.$set(T)},i(g){d||(p(r.$$.fragment,g),p(u.$$.fragment,g),p(c.$$.fragment,g),d=!0)},o(g){v(r.$$.fragment,g),v(u.$$.fragment,g),v(c.$$.fragment,g),d=!1},d(g){g&&E(e),H(r),H(u),H(c)}}}function P8(t){let e,n;return e=new nn({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:"Unable to save policy",subtitle:t[14]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16384&&(r.subtitle=i[14]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function N8(t){let e,n;return e=new nn({props:{kind:"success",lowContrast:!0,hideCloseButton:!0,title:"Policy saved",subtitle:"The selected policy now applies to this device identity."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function B8(t,e){let n,i,l;return i=new Rn({props:{value:e[92].id,text:e[92].name||e[92].id}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&2048&&(o.value=e[92].id),s[0]&2048&&(o.text=e[92].name||e[92].id),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function Abe(t){let e,n,i=[],l=new Map,r,s;e=new Rn({props:{value:"",text:"Default policy"}});let o=it(t[11].filter(kT));const a=u=>u[92].id;for(let u=0;uAt(f,"selected",D)),h=new bt({props:{kind:"primary",size:"field",disabled:t[13],$$slots:{default:[Lbe]},$$scope:{ctx:t}}}),h.$on("click",t[35]);const N=[Rbe,Ibe,Dbe],G=[];function B($,q){return $[9]&&!$[8]?0:$[10]&&!$[8]?1:$[8]?2:-1}return~(y=B(t))&&(T=G[y]=N[y](t)),{c(){e=P("section"),n=P("h3"),n.textContent="Policy",i=F(),l=P("p"),l.textContent=`A device without a policy of its own uses the default policy. - Owner and category are metadata and never change filtering.`,r=F(),A&&A.c(),s=F(),C&&C.c(),o=F(),a=P("div"),u=P("div"),U(f.$$.fragment),d=F(),U(h.$$.fragment),g=F(),_=P("h4"),_.textContent="Effective protection",k=F(),T&&T.c(),I(n,"id","device-policy-title"),I(n,"class","svelte-cnehxk"),I(l,"class","section-note svelte-cnehxk"),I(u,"class","action-field svelte-cnehxk"),I(a,"class","action-row svelte-cnehxk"),I(_,"class","svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-policy-title")},m($,q){O($,e,q),w(e,n),w(e,i),w(e,l),w(e,r),A&&A.m(e,null),w(e,s),C&&C.m(e,null),w(e,o),w(e,a),w(a,u),z(f,u,null),w(a,d),z(h,a,null),w(e,g),w(e,_),w(e,k),~y&&G[y].m(e,null),M=!0},p($,q){$[14]?A?(A.p($,q),q[0]&16384&&p(A,1)):(A=P8($),A.c(),p(A,1),A.m(e,s)):A&&(ue(),v(A,1,1,()=>{A=null}),fe()),$[15]?C?q[0]&32768&&p(C,1):(C=N8(),C.c(),p(C,1),C.m(e,o)):C&&(ue(),v(C,1,1,()=>{C=null}),fe());const V={};q[0]&8192&&(V.disabled=$[13]),q[0]&2048|q[3]&4&&(V.$$scope={dirty:q,ctx:$}),!c&&q[0]&4096&&(c=!0,V.selected=$[12],Ct(()=>c=!1)),f.$set(V);const K={};q[0]&8192&&(K.disabled=$[13]),q[0]&8192|q[3]&4&&(K.$$scope={dirty:q,ctx:$}),h.$set(K);let x=y;y=B($),y===x?~y&&G[y].p($,q):(T&&(ue(),v(G[x],1,1,()=>{G[x]=null}),fe()),~y?(T=G[y],T?T.p($,q):(T=G[y]=N[y]($),T.c()),p(T,1),T.m(e,null)):T=null)},i($){M||(p(A),p(C),p(f.$$.fragment,$),p(h.$$.fragment,$),p(T),M=!0)},o($){v(A),v(C),v(f.$$.fragment,$),v(h.$$.fragment,$),v(T),M=!1},d($){$&&E(e),A&&A.d(),C&&C.d(),H(f),H(h),~y&&G[y].d()}}}function F8(t){let e,n;return e=new nn({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:"Tailscale action failed",subtitle:t[23]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8388608&&(r.subtitle=i[23]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function G8(t){let e,n;return e=new nn({props:{kind:"success",lowContrast:!0,hideCloseButton:!0,title:"Tailscale links updated",subtitle:t[24]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16777216&&(r.subtitle=i[24]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Bbe(t){var _;let e,n,i,l,r,s,o,a,u,f=t[16]&&V8(t);const c=[Ube,Hbe],d=[];function h(k,y){return k[17].length?0:1}l=h(t),r=d[l]=c[l](t);let g=((_=t[16])==null?void 0:_.state)==="connected"&&Y8(t);return a=new bt({props:{kind:"tertiary",size:"small",disabled:t[22]||t[20],$$slots:{default:[Zbe]},$$scope:{ctx:t}}}),a.$on("click",t[30]),{c(){f&&f.c(),e=F(),n=P("h4"),n.textContent="Linked peers",i=F(),r.c(),s=F(),g&&g.c(),o=F(),U(a.$$.fragment),I(n,"class","svelte-cnehxk")},m(k,y){f&&f.m(k,y),O(k,e,y),O(k,n,y),O(k,i,y),d[l].m(k,y),O(k,s,y),g&&g.m(k,y),O(k,o,y),z(a,k,y),u=!0},p(k,y){var A;k[16]?f?(f.p(k,y),y[0]&65536&&p(f,1)):(f=V8(k),f.c(),p(f,1),f.m(e.parentNode,e)):f&&(ue(),v(f,1,1,()=>{f=null}),fe());let T=l;l=h(k),l===T?d[l].p(k,y):(ue(),v(d[T],1,1,()=>{d[T]=null}),fe(),r=d[l],r?r.p(k,y):(r=d[l]=c[l](k),r.c()),p(r,1),r.m(s.parentNode,s)),((A=k[16])==null?void 0:A.state)==="connected"?g?(g.p(k,y),y[0]&65536&&p(g,1)):(g=Y8(k),g.c(),p(g,1),g.m(o.parentNode,o)):g&&(ue(),v(g,1,1,()=>{g=null}),fe());const M={};y[0]&5242880&&(M.disabled=k[22]||k[20]),y[3]&4&&(M.$$scope={dirty:y,ctx:k}),a.$set(M)},i(k){u||(p(f),p(r),p(g),p(a.$$.fragment,k),u=!0)},o(k){v(f),v(r),v(g),v(a.$$.fragment,k),u=!1},d(k){k&&(E(e),E(n),E(i),E(s),E(o)),f&&f.d(k),d[l].d(k),g&&g.d(k),H(a,k)}}}function zbe(t){let e,n;return e=new Wi({props:{description:"Loading Tailscale peers…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function V8(t){let e,n;return e=new nn({props:{lowContrast:!0,hideCloseButton:!0,kind:mT(t[16].state),title:gT(t[16].state),subtitle:t[16].message||t[16].backend_state}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.kind=mT(i[16].state)),l[0]&65536&&(r.title=gT(i[16].state)),l[0]&65536&&(r.subtitle=i[16].message||i[16].backend_state),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Hbe(t){let e;return{c(){e=P("p"),e.textContent="No Tailscale peers are linked to this device.",I(e,"class","section-note svelte-cnehxk")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function Ube(t){let e,n=[],i=new Map,l,r=it(t[17]);const s=o=>o[80].node_id;for(let o=0;ov(s[a],1,1,()=>{s[a]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Informational WoL MAC:",i=F();for(let a=0;a{q=null}),fe())},i(x){G||(p(u.$$.fragment,x),p(c.$$.fragment,x),p(q),G=!0)},o(x){v(u.$$.fragment,x),v(c.$$.fragment,x),v(q),G=!1},d(x){x&&E(n),H(u),H(c),$&&$.d(),q&&q.d()}}}function Y8(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;function g(M){t[46](M)}let _={labelText:"Tailscale peer",helperText:"Choose an unlinked peer, then confirm the link.",disabled:t[22]||t[20],$$slots:{default:[Wbe]},$$scope:{ctx:t}};t[19]!==void 0&&(_.selected=t[19]),r=new Wr({props:_}),xe.push(()=>At(r,"selected",g)),a=new bt({props:{kind:"primary",size:"field",disabled:t[22]||!t[19],$$slots:{default:[jbe]},$$scope:{ctx:t}}}),a.$on("click",t[31]);const k=[qbe,$be],y=[];function T(M,A){return M[18].length?0:M[21]?1:-1}return~(f=T(t))&&(c=y[f]=k[f](t)),{c(){e=P("h4"),e.textContent="Link a peer",n=F(),i=P("div"),l=P("div"),U(r.$$.fragment),o=F(),U(a.$$.fragment),u=F(),c&&c.c(),d=je(),I(e,"class","svelte-cnehxk"),I(l,"class","action-field svelte-cnehxk"),I(i,"class","action-row svelte-cnehxk")},m(M,A){O(M,e,A),O(M,n,A),O(M,i,A),w(i,l),z(r,l,null),w(i,o),z(a,i,null),O(M,u,A),~f&&y[f].m(M,A),O(M,d,A),h=!0},p(M,A){const C={};A[0]&5242880&&(C.disabled=M[22]||M[20]),A[0]&262144|A[3]&4&&(C.$$scope={dirty:A,ctx:M}),!s&&A[0]&524288&&(s=!0,C.selected=M[19],Ct(()=>s=!1)),r.$set(C);const D={};A[0]&4718592&&(D.disabled=M[22]||!M[19]),A[0]&4194304|A[3]&4&&(D.$$scope={dirty:A,ctx:M}),a.$set(D);let R=f;f=T(M),f===R?~f&&y[f].p(M,A):(c&&(ue(),v(y[R],1,1,()=>{y[R]=null}),fe()),~f?(c=y[f],c?c.p(M,A):(c=y[f]=k[f](M),c.c()),p(c,1),c.m(d.parentNode,d)):c=null)},i(M){h||(p(r.$$.fragment,M),p(a.$$.fragment,M),p(c),h=!0)},o(M){v(r.$$.fragment,M),v(a.$$.fragment,M),v(c),h=!1},d(M){M&&(E(e),E(n),E(i),E(u),E(d)),H(r),H(a),~f&&y[f].d(M)}}}function Z8(t,e){let n,i,l;return i=new Rn({props:{value:e[80].node_id,text:`${Ms(e[80])}${e[80].online?" (online)":" (offline)"}`}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&262144&&(o.value=e[80].node_id),s[0]&262144&&(o.text=`${Ms(e[80])}${e[80].online?" (online)":" (offline)"}`),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function Wbe(t){let e,n,i=[],l=new Map,r,s;e=new Rn({props:{value:"",text:"Choose a peer"}});let o=it(t[18]);const a=u=>u[80].node_id;for(let u=0;uo[80].node_id;for(let o=0;ol=!1)),i.$set(N),!D[9]&&D[2].length?M?(M.p(D,R),R[0]&516&&p(M,1)):(M=my(D),M.c(),p(M,1),M.m(e,s)):M&&(ue(),v(M,1,1,()=>{M=null}),fe()),R[0]&67059855&&(A=it(D[0].rules),ue(),d=Pn(d,R,C,1,D,A,h,o,Fn,Oy,g,uy),fe());const G={};R[2]&4096&&(G.$$scope={dirty:R,ctx:D}),_.$set(G)},i(D){if(!k){p(i.$$.fragment,D),p(M);for(let R=0;R({id:t,text:t}),Ly=t=>({id:t,text:t});function spe(t,e,n){let i,l,r,{draft:s}=e,{categories:o=[]}=e,{users:a=[]}=e,{schedulePresets:u=[]}=e,{timezone:f="UTC"}=e,{saving:c=!1}=e,{onSave:d=()=>{}}=e,{onCancel:h=()=>{}}=e;const g=M0e(s);function _(Ne){if(Ne&&!r){const pe=u.find(et=>et.id==="bedtime");n(0,s.rules=[O0e(f,pe),...s.rules],s)}else!Ne&&r&&A(l)}function k(Ne,pe){r!=null&&r.schedule&&(n(8,r.schedule.windows[0][Ne]=pe.target.value,r),n(8,r.schedule.preset=void 0,r),T())}function y(Ne){r!=null&&r.schedule&&(n(8,r.schedule.weekdays=Ne.map(Number).sort((pe,et)=>pe-et),r),n(8,r.schedule.preset=void 0,r),T())}function T(){n(0,s.rules=[...s.rules],s)}function M(){n(0,s.rules=[...s.rules,KO()],s)}function A(Ne){n(0,s.rules=s.rules.filter((pe,et)=>et!==Ne),s)}function C(Ne,pe){const et=Ne+pe;if(et<0||et>=s.rules.length)return;const gt=[...s.rules];[gt[Ne],gt[et]]=[gt[et],gt[Ne]],n(0,s.rules=gt,s)}function D(Ne,pe){Ne.target.all_traffic=pe.target.value==="all",T()}function R(Ne,pe,et,gt=!1){let Kt=Ne[et].trim();gt&&(Kt=Kt.toLowerCase()),!(!Kt||Ne[pe].includes(Kt))&&(Ne[pe]=[...Ne[pe],Kt],Ne[et]="",T())}function N(Ne,pe,et){Ne[pe]=Ne[pe].filter(gt=>gt!==et),T()}function G(Ne,pe){Ne.users=pe.map(String),T()}function B(Ne,pe){Ne.schedule&&(Ne.schedule.weekdays=pe.map(Number).sort((et,gt)=>et-gt),T())}function j(Ne){return Ne.schedule?Ne.schedule.preset||rg:""}function q(Ne,pe){var gt,Kt,ze;if(!pe){Ne.schedule=null,T();return}if(pe===rg){const kt=((Kt=(gt=Ne.schedule)==null?void 0:gt.windows)==null?void 0:Kt[0])||{from:"20:00",to:"07:00"};Ne.schedule={timezone:f,weekdays:(ze=Ne.schedule)!=null&&ze.weekdays?[...Ne.schedule.weekdays]:[],windows:[{from:kt.from,to:kt.to}]},T();return}const et=u.find(kt=>kt.id===pe);et&&(Ne.schedule={timezone:f,weekdays:[...et.weekdays],windows:et.windows.map(kt=>({from:kt.from,to:kt.to})),preset:et.id},T())}function V(Ne,pe){q(Ne,pe.target.value)}function K(Ne,pe,et){var gt,Kt;(Kt=(gt=Ne.schedule)==null?void 0:gt.windows)!=null&&Kt.length&&(Ne.schedule.windows[0][pe]=et.target.value,T())}function x(Ne){n(0,s.users=Ne.map(String),s)}function ie(Ne){t.$$.not_equal(s.name,Ne)&&(s.name=Ne,n(0,s))}const X=Ne=>n(0,s.blocked_categories=Ne.detail,s),ce=Ne=>n(0,s.blocked_domains=Ne.detail,s),ae=Ne=>n(0,s.allowed_domains=Ne.detail,s);function ee(Ne){t.$$.not_equal(s.safe_search,Ne)&&(s.safe_search=Ne,n(0,s))}const he=Ne=>_(Ne.detail.toggled),ne=Ne=>k("from",Ne),re=Ne=>k("to",Ne),oe=Ne=>y(Ne.detail.selectedIds);function Re(Ne){t.$$.not_equal(s.description,Ne)&&(s.description=Ne,n(0,s))}const qe=Ne=>x(Ne.detail.selectedIds);function Ce(Ne,pe){t.$$.not_equal(pe.enabled,Ne)&&(pe.enabled=Ne,n(0,s))}const Ze=Ne=>C(Ne,-1),be=Ne=>C(Ne,1),Ae=Ne=>A(Ne);function ve(Ne,pe){t.$$.not_equal(pe.name,Ne)&&(pe.name=Ne,n(0,s))}function me(Ne,pe){t.$$.not_equal(pe.action,Ne)&&(pe.action=Ne,n(0,s))}const lt=(Ne,pe)=>D(Ne,pe),De=(Ne,pe,et,gt)=>{n(0,pe[et].target.categories=gt.detail,s),T()},vt=(Ne,pe,et,gt)=>{n(0,pe[et].target.domains=gt.detail,s),T()},dt=(Ne,pe)=>V(Ne,pe),ot=(Ne,pe)=>K(Ne,"from",pe),ht=(Ne,pe)=>K(Ne,"to",pe),Bt=(Ne,pe)=>B(Ne,pe.detail.selectedIds),Ot=(Ne,pe)=>G(Ne,pe.detail.selectedIds);function Zt(Ne,pe){t.$$.not_equal(pe.url_draft,Ne)&&(pe.url_draft=Ne,n(0,s))}const Ve=(Ne,pe)=>pe.key==="Enter"&&R(Ne,"url_regexes","url_draft"),Nt=Ne=>R(Ne,"url_regexes","url_draft"),Tt=(Ne,pe)=>N(Ne,"url_regexes",pe);function Gt(Ne,pe){t.$$.not_equal(pe.content_type_draft,Ne)&&(pe.content_type_draft=Ne,n(0,s))}const fn=(Ne,pe)=>pe.key==="Enter"&&R(Ne,"blocked_content_types","content_type_draft",!0),an=Ne=>R(Ne,"blocked_content_types","content_type_draft",!0),Qt=(Ne,pe)=>N(Ne,"blocked_content_types",pe);return t.$$set=Ne=>{"draft"in Ne&&n(0,s=Ne.draft),"categories"in Ne&&n(1,o=Ne.categories),"users"in Ne&&n(2,a=Ne.users),"schedulePresets"in Ne&&n(3,u=Ne.schedulePresets),"timezone"in Ne&&n(27,f=Ne.timezone),"saving"in Ne&&n(4,c=Ne.saving),"onSave"in Ne&&n(5,d=Ne.onSave),"onCancel"in Ne&&n(6,h=Ne.onCancel)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(9,i=s.id===Ji),t.$$.dirty[0]&1&&n(7,l=s.rules.findIndex(kd)),t.$$.dirty[0]&129&&n(8,r=l>=0?s.rules[l]:null)},[s,o,a,u,c,d,h,l,r,i,g,_,k,y,T,M,A,C,D,R,N,G,B,j,V,K,x,f,ie,X,ce,ae,ee,he,ne,re,oe,Re,qe,Ce,Ze,be,Ae,ve,me,lt,De,vt,dt,ot,ht,Bt,Ot,Zt,Ve,Nt,Tt,Gt,fn,an,Qt]}class JO extends Oe{constructor(e){super(),Ee(this,e,spe,rpe,Se,{draft:0,categories:1,users:2,schedulePresets:3,timezone:27,saving:4,onSave:5,onCancel:6},null,[-1,-1,-1])}}const{Boolean:yd}=Sd;function Dy(t,e,n){const i=t.slice();return i[78]=e[n],i}function Iy(t,e,n){const i=t.slice();return i[81]=e[n],i}function Ry(t,e,n){const i=t.slice();return i[84]=e[n],i}function Py(t,e,n){const i=t.slice();return i[87]=e[n],i}function Ny(t,e,n){const i=t.slice();return i[90]=e[n],i}function By(t,e,n){const i=t.slice();return i[93]=e[n],i}function zy(t,e,n){const i=t.slice();return i[93]=e[n],i}function Hy(t,e,n){const i=t.slice();return i[98]=e[n],i}function Uy(t,e,n){const i=t.slice();return i[101]=e[n],i}function Fy(t,e,n){const i=t.slice();return i[98]=e[n],i}function Gy(t){let e,n;return e=new ln({props:{kind:"error",title:"Error",subtitle:t[11]}}),e.$on("close",t[46]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Vy(t){let e,n;return e=new ln({props:{kind:"success",title:"Done",subtitle:t[12]}}),e.$on("close",t[47]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&4096&&(r.subtitle=i[12]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ope(t){let e,n,i;function l(s){t[61](s)}let r={"aria-label":"Policy tools",$$slots:{content:[Ype],default:[upe]},$$scope:{ctx:t}};return t[13]!==void 0&&(r.selected=t[13]),e=new mg({props:r}),xe.push(()=>At(e,"selected",l)),{c(){U(e.$$.fragment)},m(s,o){z(e,s,o),i=!0},p(s,o){const a={};o[0]&134072063|o[3]&8192&&(a.$$scope={dirty:o,ctx:s}),!n&&o[0]&8192&&(n=!0,a.selected=s[13],Ct(()=>n=!1)),e.$set(a)},i(s){i||(p(e.$$.fragment,s),i=!0)},o(s){v(e.$$.fragment,s),i=!1},d(s){H(e,s)}}}function ape(t){let e,n;return e=new Wi({props:{description:"Loading policies..."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function upe(t){let e,n,i,l,r,s;return e=new ql({props:{label:"Policies"}}),i=new ql({props:{label:"Test a site"}}),r=new ql({props:{label:"Gateway defaults"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p:_e,i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function fpe(t){let e;return{c(){e=$("Create policy")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Wy(t){let e,n,i,l,r,s,o,a,u=[],f=new Map,c,d,h;r=new bt({props:{size:"small",kind:"ghost",$$slots:{default:[cpe]},$$scope:{ctx:t}}}),r.$on("click",t[30]);let g=t[2].length&&jy(t),_=it(t[1]);const k=y=>y[101].id;for(let y=0;y<_.length;y+=1){let T=Uy(t,_,y),M=k(T);f.set(M,u[y]=Xy(M,T))}return d=new ya({props:{$$slots:{default:[ppe]},$$scope:{ctx:t}}}),{c(){e=P("div"),n=P("div"),i=P("div"),i.innerHTML='

        Create a policy

        Start with a tested baseline or build one from scratch.

        ',l=F(),U(r.$$.fragment),s=F(),g&&g.c(),o=F(),a=P("div");for(let y=0;y{g=null}),fe()),T[0]&514|T[1]&3073&&(_=it(y[1]),ue(),u=Pn(u,T,k,1,y,_,f,a,Fn,Xy,c,Uy),fe());const A={};T[3]&8192&&(A.$$scope={dirty:T,ctx:y}),d.$set(A)},i(y){if(!h){p(r.$$.fragment,y),p(g);for(let T=0;T<_.length;T+=1)p(u[T]);p(d.$$.fragment,y),h=!0}},o(y){v(r.$$.fragment,y),v(g);for(let T=0;Tv(r[a],1,1,()=>{r[a]=null});let o=t[101].categories.length>3&&Yy(t);return{c(){e=P("div");for(let a=0;a3?o?(o.p(a,u),u[0]&2&&p(o,1)):(o=Yy(a),o.c(),p(o,1),o.m(e,null)):o&&(ue(),v(o,1,1,()=>{o=null}),fe())},i(a){if(!i){for(let u=0;u{g=null}),fe()),(R=t[101].limitations)!=null&&R.length?_?_.p(t,A):(_=Zy(t),_.c(),_.m(e,c)):_&&(_.d(1),_=null);const C={};A[0]&2&&(C.kind=t[42](t[101])?"ghost":"secondary"),A[0]&514&&(C.disabled=t[9]||!t[101].available||t[42](t[101])),A[0]&2|A[3]&8192&&(C.$$scope={dirty:A,ctx:t}),d.$set(C)},i(M){h||(p(g),p(d.$$.fragment,M),h=!0)},o(M){v(g),v(d.$$.fragment,M),h=!1},d(M){M&&E(e),g&&g.d(),_&&_.d(),H(d)}}}function Xy(t,e){let n,i,l;return i=new ya({props:{$$slots:{default:[gpe]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&514|s[3]&8192&&(o.$$scope={dirty:s,ctx:e}),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function _pe(t){let e;return{c(){e=$("Start blank")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ppe(t){let e,n,i,l,r,s,o;return s=new bt({props:{size:"small",kind:"tertiary",$$slots:{default:[_pe]},$$scope:{ctx:t}}}),s.$on("click",t[28]),{c(){e=P("div"),n=P("h4"),n.textContent="Blank policy",i=F(),l=P("p"),l.textContent=`Choose every category, domain, schedule, and advanced rule + yourself.`,r=F(),U(s.$$.fragment),I(n,"class","svelte-1stwbl3"),I(l,"class","tile-description svelte-1stwbl3"),I(e,"class","template-tile blank-template svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(e,l),w(e,r),z(s,e,null),o=!0},p(a,u){const f={};u[3]&8192&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&E(e),H(s)}}}function Ky(t){let e,n,i;return n=new ya({props:{$$slots:{default:[bpe]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),I(e,"class","group-slot editor-slot svelte-1stwbl3")},m(l,r){O(l,e,r),z(n,e,null),i=!0},p(l,r){const s={};r[0]&33512|r[3]&8192&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(p(n.$$.fragment,l),i=!0)},o(l){v(n.$$.fragment,l),i=!1},d(l){l&&E(e),H(n)}}}function bpe(t){let e,n,i,l;return i=new JO({props:{draft:t[15],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[36],onCancel:t[30]}}),{c(){e=P("h4"),e.textContent="New policy",n=F(),U(i.$$.fragment),I(e,"class","svelte-1stwbl3")},m(r,s){O(r,e,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&32768&&(o.draft=r[15]),s[0]&8&&(o.categories=r[3]),s[0]&64&&(o.users=r[6]),s[0]&32&&(o.schedulePresets=r[5]),s[0]&128&&(o.timezone=r[7]),s[0]&512&&(o.saving=r[9]),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&(E(e),E(n)),H(i,r)}}}function vpe(t){let e,n,i,l,r=t[84].name+"",s,o,a,u,f=(t[26][t[84].id]||[]).length+"",c,d,h=(t[26][t[84].id]||[]).length===1?"":"s",g,_=t[84].users.length?" · "+t[84].users.length+" proxy user"+(t[84].users.length===1?"":"s"):"",k,y,T,M=ay(t[84],t[31])+"",A,C,D,R,N=t[24][t[84].id]?"Hide details":"View details",G,B,j,q,V,K,x,ie,X=(t[26][t[84].id]||[]).length+"",ce,ae,ee,he,ne,re=t[84].id!==Ji&&t[33](t[84].id).length,oe,Re,qe,Ce,Ze,be,Ae,ve=t[84].id===Ji&&Jy(t);function me(Nt,Tt){if(Nt[84].id===Ji)return Tpe;if(!(Nt[26][Nt[84].id]||[]).length&&!Nt[84].users.length)return ype}let lt=me(t),De=lt&<(t);function vt(){return t[49](t[84])}let dt=t[24][t[84].id]&&Qy(t);const ot=[Cpe,Mpe],ht=[];function Bt(Nt,Tt){return(Nt[26][Nt[84].id]||[]).length?0:1}ee=Bt(t),he=ht[ee]=ot[ee](t);let Ot=re&&u8(t);function Zt(){return t[54](t[84])}qe=new bt({props:{size:"small",kind:"ghost",disabled:t[9],$$slots:{default:[Ppe]},$$scope:{ctx:t}}}),qe.$on("click",Zt);let Ve=t[84].id!==Ji&&f8(t);return{c(){e=P("div"),n=P("div"),i=P("div"),l=P("h4"),s=$(r),o=F(),ve&&ve.c(),a=F(),u=P("span"),c=$(f),d=$(" device"),g=$(h),k=$(_),y=F(),T=P("p"),A=$(M),C=F(),De&&De.c(),D=F(),R=P("button"),G=$(N),B=F(),dt&&dt.c(),j=F(),q=P("div"),V=P("div"),K=P("h5"),K.textContent="Assigned devices",x=F(),ie=P("span"),ce=$(X),ae=F(),he.c(),ne=F(),Ot&&Ot.c(),oe=F(),Re=P("div"),U(qe.$$.fragment),Ce=F(),Ve&&Ve.c(),I(l,"class","svelte-1stwbl3"),I(u,"class","device-count svelte-1stwbl3"),I(i,"class","group-title svelte-1stwbl3"),I(T,"class","summary-line svelte-1stwbl3"),I(R,"type","button"),I(R,"class","link-button svelte-1stwbl3"),I(K,"class","svelte-1stwbl3"),I(ie,"class","device-count svelte-1stwbl3"),I(V,"class","assignment-heading svelte-1stwbl3"),I(q,"class","assignment-panel svelte-1stwbl3"),I(n,"class","group-summary svelte-1stwbl3"),I(Re,"class","group-actions svelte-1stwbl3"),I(e,"class","group-row svelte-1stwbl3")},m(Nt,Tt){O(Nt,e,Tt),w(e,n),w(n,i),w(i,l),w(l,s),w(i,o),ve&&ve.m(i,null),w(i,a),w(i,u),w(u,c),w(u,d),w(u,g),w(u,k),w(n,y),w(n,T),w(T,A),w(n,C),De&&De.m(n,null),w(n,D),w(n,R),w(R,G),w(n,B),dt&&dt.m(n,null),w(n,j),w(n,q),w(q,V),w(V,K),w(V,x),w(V,ie),w(ie,ce),w(q,ae),ht[ee].m(q,null),w(q,ne),Ot&&Ot.m(q,null),w(e,oe),w(e,Re),z(qe,Re,null),w(Re,Ce),Ve&&Ve.m(Re,null),Ze=!0,be||(Ae=J(R,"click",vt),be=!0)},p(Nt,Tt){t=Nt,(!Ze||Tt[0]&1)&&r!==(r=t[84].name+"")&&Y(s,r),t[84].id===Ji?ve?Tt[0]&1&&p(ve,1):(ve=Jy(t),ve.c(),p(ve,1),ve.m(i,a)):ve&&(ue(),v(ve,1,1,()=>{ve=null}),fe()),(!Ze||Tt[0]&67108865)&&f!==(f=(t[26][t[84].id]||[]).length+"")&&Y(c,f),(!Ze||Tt[0]&67108865)&&h!==(h=(t[26][t[84].id]||[]).length===1?"":"s")&&Y(g,h),(!Ze||Tt[0]&1)&&_!==(_=t[84].users.length?" · "+t[84].users.length+" proxy user"+(t[84].users.length===1?"":"s"):"")&&Y(k,_),(!Ze||Tt[0]&1)&&M!==(M=ay(t[84],t[31])+"")&&Y(A,M),lt!==(lt=me(t))&&(De&&De.d(1),De=lt&<(t),De&&(De.c(),De.m(n,D))),(!Ze||Tt[0]&16777217)&&N!==(N=t[24][t[84].id]?"Hide details":"View details")&&Y(G,N),t[24][t[84].id]?dt?(dt.p(t,Tt),Tt[0]&16777217&&p(dt,1)):(dt=Qy(t),dt.c(),p(dt,1),dt.m(n,j)):dt&&(ue(),v(dt,1,1,()=>{dt=null}),fe()),(!Ze||Tt[0]&67108865)&&X!==(X=(t[26][t[84].id]||[]).length+"")&&Y(ce,X);let Gt=ee;ee=Bt(t),ee===Gt?ht[ee].p(t,Tt):(ue(),v(ht[Gt],1,1,()=>{ht[Gt]=null}),fe(),he=ht[ee],he?he.p(t,Tt):(he=ht[ee]=ot[ee](t),he.c()),p(he,1),he.m(q,ne)),Tt[0]&1&&(re=t[84].id!==Ji&&t[33](t[84].id).length),re?Ot?(Ot.p(t,Tt),Tt[0]&1&&p(Ot,1)):(Ot=u8(t),Ot.c(),p(Ot,1),Ot.m(q,null)):Ot&&(ue(),v(Ot,1,1,()=>{Ot=null}),fe());const fn={};Tt[0]&512&&(fn.disabled=t[9]),Tt[3]&8192&&(fn.$$scope={dirty:Tt,ctx:t}),qe.$set(fn),t[84].id!==Ji?Ve?(Ve.p(t,Tt),Tt[0]&1&&p(Ve,1)):(Ve=f8(t),Ve.c(),p(Ve,1),Ve.m(Re,null)):Ve&&(ue(),v(Ve,1,1,()=>{Ve=null}),fe())},i(Nt){Ze||(p(ve),p(dt),p(he),p(Ot),p(qe.$$.fragment,Nt),p(Ve),Ze=!0)},o(Nt){v(ve),v(dt),v(he),v(Ot),v(qe.$$.fragment,Nt),v(Ve),Ze=!1},d(Nt){Nt&&E(e),ve&&ve.d(),De&&De.d(),dt&&dt.d(),ht[ee].d(),Ot&&Ot.d(),H(qe),Ve&&Ve.d(),be=!1,Ae()}}}function kpe(t){let e,n,i=t[84].name+"",l,r,s,o;return s=new JO({props:{draft:t[15],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[36],onCancel:t[30]}}),{c(){e=P("h4"),n=$("Edit "),l=$(i),r=F(),U(s.$$.fragment),I(e,"class","svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,l),O(a,r,u),z(s,a,u),o=!0},p(a,u){(!o||u[0]&1)&&i!==(i=a[84].name+"")&&Y(l,i);const f={};u[0]&32768&&(f.draft=a[15]),u[0]&8&&(f.categories=a[3]),u[0]&64&&(f.users=a[6]),u[0]&32&&(f.schedulePresets=a[5]),u[0]&128&&(f.timezone=a[7]),u[0]&512&&(f.saving=a[9]),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&(E(e),E(r)),H(s,a)}}}function Jy(t){let e,n;return e=new Rt({props:{size:"sm",type:"blue",$$slots:{default:[wpe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function wpe(t){let e;return{c(){e=$("default")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ype(t){let e;return{c(){e=P("p"),e.textContent="No devices use this policy yet.",I(e,"class","muted svelte-1stwbl3")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Tpe(t){let e;return{c(){e=P("p"),e.textContent=`New and unassigned devices use this policy + automatically.`,I(e,"class","muted svelte-1stwbl3")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Qy(t){let e,n,i,l,r,s,o=t[84].description&&xy(t),a=(t[84].blocked_categories.length||t[84].blocked_domains.length)&&e8(t),u=t[84].allowed_domains.length&&i8(t),f=t[84].rules.length&&r8(t),c=t[84].users.length&&o8(t);return{c(){e=P("div"),o&&o.c(),n=F(),a&&a.c(),i=F(),u&&u.c(),l=F(),f&&f.c(),r=F(),c&&c.c(),I(e,"class","policy-details svelte-1stwbl3")},m(d,h){O(d,e,h),o&&o.m(e,null),w(e,n),a&&a.m(e,null),w(e,i),u&&u.m(e,null),w(e,l),f&&f.m(e,null),w(e,r),c&&c.m(e,null),s=!0},p(d,h){d[84].description?o?o.p(d,h):(o=xy(d),o.c(),o.m(e,n)):o&&(o.d(1),o=null),d[84].blocked_categories.length||d[84].blocked_domains.length?a?(a.p(d,h),h[0]&1&&p(a,1)):(a=e8(d),a.c(),p(a,1),a.m(e,i)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),d[84].allowed_domains.length?u?(u.p(d,h),h[0]&1&&p(u,1)):(u=i8(d),u.c(),p(u,1),u.m(e,l)):u&&(ue(),v(u,1,1,()=>{u=null}),fe()),d[84].rules.length?f?f.p(d,h):(f=r8(d),f.c(),f.m(e,r)):f&&(f.d(1),f=null),d[84].users.length?c?c.p(d,h):(c=o8(d),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i(d){s||(p(a),p(u),s=!0)},o(d){v(a),v(u),s=!1},d(d){d&&E(e),o&&o.d(),a&&a.d(),u&&u.d(),f&&f.d(),c&&c.d()}}}function xy(t){let e,n=t[84].description+"",i;return{c(){e=P("p"),i=$(n),I(e,"class","svelte-1stwbl3")},m(l,r){O(l,e,r),w(e,i)},p(l,r){r[0]&1&&n!==(n=l[84].description+"")&&Y(i,n)},d(l){l&&E(e)}}}function e8(t){let e,n,i,l,r,s=it(t[84].blocked_categories),o=[];for(let d=0;dv(o[d],1,1,()=>{o[d]=null});let u=it(t[84].blocked_domains),f=[];for(let d=0;dv(f[d],1,1,()=>{f[d]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Blocks",i=F();for(let d=0;dv(s[a],1,1,()=>{s[a]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Always allows",i=F();for(let a=0;as[90].id;for(let s=0;so[87];for(let o=0;o{a[d]=null}),fe(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),p(l,1),l.m(r.parentNode,r))},i(f){s||(p(l),s=!0)},o(f){v(l),s=!1},d(f){f&&(E(n),E(r)),a[i].d(f)}}}function u8(t){let e,n,i,l,r;function s(...a){return t[52](t[84],...a)}n=new ju({props:{size:"sm",titleText:"Add devices",label:"Select devices",items:t[33](t[84].id).map(t[51]),selectedIds:t[16][t[84].id]||[]}}),n.$on("select",s);function o(){return t[53](t[84])}return l=new bt({props:{size:"small",kind:"tertiary",disabled:t[9]||!(t[16][t[84].id]||[]).length,$$slots:{default:[Rpe]},$$scope:{ctx:t}}}),l.$on("click",o),{c(){e=P("div"),U(n.$$.fragment),i=F(),U(l.$$.fragment),I(e,"class","assign-row svelte-1stwbl3")},m(a,u){O(a,e,u),z(n,e,null),w(e,i),z(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&1&&(f.items=t[33](t[84].id).map(t[51])),u[0]&65537&&(f.selectedIds=t[16][t[84].id]||[]),n.$set(f);const c={};u[0]&66049&&(c.disabled=t[9]||!(t[16][t[84].id]||[]).length),u[3]&8192&&(c.$$scope={dirty:u,ctx:t}),l.$set(c)},i(a){r||(p(n.$$.fragment,a),p(l.$$.fragment,a),r=!0)},o(a){v(n.$$.fragment,a),v(l.$$.fragment,a),r=!1},d(a){a&&E(e),H(n),H(l)}}}function Rpe(t){let e;return{c(){e=$("Assign selected")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Ppe(t){let e;return{c(){e=$("Edit")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function f8(t){let e,n;function i(){return t[55](t[84])}return e=new bt({props:{size:"small",kind:"danger-ghost",disabled:t[9],$$slots:{default:[Npe]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){U(e.$$.fragment)},m(l,r){z(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&512&&(s.disabled=t[9]),r[3]&8192&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(p(e.$$.fragment,l),n=!0)},o(l){v(e.$$.fragment,l),n=!1},d(l){H(e,l)}}}function Npe(t){let e;return{c(){e=$("Delete")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Bpe(t){let e,n,i,l;const r=[kpe,vpe],s=[];function o(a,u){return a[14]===a[84].id?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function c8(t,e){let n,i,l,r;return i=new ya({props:{$$slots:{default:[Bpe]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=P("div"),U(i.$$.fragment),l=F(),I(n,"class","group-slot svelte-1stwbl3"),this.first=n},m(s,o){O(s,n,o),z(i,n,null),w(n,l),r=!0},p(s,o){e=s;const a={};o[0]&84001513|o[3]&8192&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(s){r||(p(i.$$.fragment,s),r=!0)},o(s){v(i.$$.fragment,s),r=!1},d(s){s&&E(n),H(i)}}}function zpe(t){let e,n,i,l,r,s,o,a,u,f=[],c=new Map,d;r=new bt({props:{size:"small",disabled:t[9],$$slots:{default:[fpe]},$$scope:{ctx:t}}}),r.$on("click",t[27]);let h=t[14]==="choose"&&Wy(t),g=t[14]==="new"&&Ky(t),_=it(t[0]);const k=y=>y[84].id;for(let y=0;y<_.length;y+=1){let T=Ry(t,_,y),M=k(T);c.set(M,f[y]=c8(M,T))}return{c(){e=P("section"),n=P("div"),i=P("div"),i.innerHTML=`

        Policies

        Every device follows one policy. Unassigned devices use the + default policy.

        `,l=F(),U(r.$$.fragment),s=F(),h&&h.c(),o=F(),g&&g.c(),a=F(),u=P("div");for(let y=0;y{h=null}),fe()),y[14]==="new"?g?(g.p(y,T),T[0]&16384&&p(g,1)):(g=Ky(y),g.c(),p(g,1),g.m(e,a)):g&&(ue(),v(g,1,1,()=>{g=null}),fe()),T[0]&1694614249|T[1]&191&&(_=it(y[0]),ue(),f=Pn(f,T,k,1,y,_,c,u,Fn,c8,null,Ry),fe())},i(y){if(!d){p(r.$$.fragment,y),p(h),p(g);for(let T=0;T<_.length;T+=1)p(f[T]);d=!0}},o(y){v(r.$$.fragment,y),v(h),v(g);for(let T=0;Tu[81].id;for(let u=0;uAt(n,"selected",y));function M(B){t[57](B)}let A={size:"sm",labelText:"Domain or URL",placeholder:"youtube.com/shorts/abc"};t[19]!==void 0&&(A.value=t[19]),r=new ei({props:A}),xe.push(()=>At(r,"value",M)),r.$on("keydown",t[58]);function C(B){t[59](B)}let D={size:"sm",labelText:"Path",$$slots:{default:[Upe]},$$scope:{ctx:t}};t[20]!==void 0&&(D.selected=t[20]),a=new Wr({props:D}),xe.push(()=>At(a,"selected",C)),c=new bt({props:{size:"small",disabled:t[21]||!t[19].trim(),$$slots:{default:[Fpe]},$$scope:{ctx:t}}}),c.$on("click",t[43]);let R=t[21]&&h8(),N=t[23]&&m8(t),G=t[22]&&g8(t);return{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),o=F(),U(a.$$.fragment),f=F(),U(c.$$.fragment),d=F(),R&&R.c(),h=F(),N&&N.c(),g=F(),G&&G.c(),_=je(),I(e,"class","test-row svelte-1stwbl3")},m(B,j){O(B,e,j),z(n,e,null),w(e,l),z(r,e,null),w(e,o),z(a,e,null),w(e,f),z(c,e,null),O(B,d,j),R&&R.m(B,j),O(B,h,j),N&&N.m(B,j),O(B,g,j),G&&G.m(B,j),O(B,_,j),k=!0},p(B,j){const q={};j[0]&33554432|j[3]&8192&&(q.$$scope={dirty:j,ctx:B}),!i&&j[0]&262144&&(i=!0,q.selected=B[18],Ct(()=>i=!1)),n.$set(q);const V={};!s&&j[0]&524288&&(s=!0,V.value=B[19],Ct(()=>s=!1)),r.$set(V);const K={};j[3]&8192&&(K.$$scope={dirty:j,ctx:B}),!u&&j[0]&1048576&&(u=!0,K.selected=B[20],Ct(()=>u=!1)),a.$set(K);const x={};j[0]&2621440&&(x.disabled=B[21]||!B[19].trim()),j[3]&8192&&(x.$$scope={dirty:j,ctx:B}),c.$set(x),B[21]?R?j[0]&2097152&&p(R,1):(R=h8(),R.c(),p(R,1),R.m(h.parentNode,h)):R&&(ue(),v(R,1,1,()=>{R=null}),fe()),B[23]?N?N.p(B,j):(N=m8(B),N.c(),N.m(g.parentNode,g)):N&&(N.d(1),N=null),B[22]?G?(G.p(B,j),j[0]&4194304&&p(G,1)):(G=g8(B),G.c(),p(G,1),G.m(_.parentNode,_)):G&&(ue(),v(G,1,1,()=>{G=null}),fe())},i(B){k||(p(n.$$.fragment,B),p(r.$$.fragment,B),p(a.$$.fragment,B),p(c.$$.fragment,B),p(R),p(G),k=!0)},o(B){v(n.$$.fragment,B),v(r.$$.fragment,B),v(a.$$.fragment,B),v(c.$$.fragment,B),v(R),v(G),k=!1},d(B){B&&(E(e),E(d),E(h),E(g),E(_)),H(n),H(r),H(a),H(c),R&&R.d(B),N&&N.d(B),G&&G.d(B)}}}function Wpe(t){let e,n,i,l,r,s,o;return s=new ya({props:{$$slots:{default:[Vpe]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("h3"),n.textContent="Test a site",i=F(),l=P("p"),l.textContent=`Check whether a site is blocked for a device right now and which + setting decides it. Nothing is changed.`,r=F(),U(s.$$.fragment),I(n,"id","test-heading"),I(n,"class","svelte-1stwbl3"),I(l,"class","section-intro svelte-1stwbl3"),I(e,"class","section tab-section svelte-1stwbl3"),I(e,"aria-labelledby","test-heading")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(e,l),w(e,r),z(s,e,null),o=!0},p(a,u){const f={};u[0]&50069504|u[3]&8192&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){o||(p(s.$$.fragment,a),o=!0)},o(a){v(s.$$.fragment,a),o=!1},d(a){a&&E(e),H(s)}}}function jpe(t){let e;return{c(){e=$("Save categories")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function $pe(t){let e,n;return e=new v_({props:{categories:t[3],selection:t[4],disabled:t[10]}}),e.$on("change",t[60]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.categories=i[3]),l[0]&16&&(r.selection=i[4]),l[0]&1024&&(r.disabled=i[10]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qpe(t){let e,n,i,l,r,s,o,a;return r=new bt({props:{size:"small",disabled:t[10],$$slots:{default:[jpe]},$$scope:{ctx:t}}}),r.$on("click",t[37]),o=new ya({props:{$$slots:{default:[$pe]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("div"),i=P("div"),i.innerHTML=`

        Gateway defaults

        These categories are blocked for every device on every policy. A + policy's always-allowed domains can still exempt a site.

        `,l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),I(n,"class","section-heading svelte-1stwbl3"),I(e,"class","section tab-section svelte-1stwbl3"),I(e,"aria-labelledby","defaults-heading")},m(u,f){O(u,e,f),w(e,n),w(n,i),w(n,l),z(r,n,null),w(e,s),z(o,e,null),a=!0},p(u,f){const c={};f[0]&1024&&(c.disabled=u[10]),f[3]&8192&&(c.$$scope={dirty:f,ctx:u}),r.$set(c);const d={};f[0]&1048|f[3]&8192&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&E(e),H(r),H(o)}}}function Ype(t){let e,n,i,l,r,s;return e=new Yl({props:{$$slots:{default:[zpe]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[Wpe]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[qpe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&84001519|a[3]&8192&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&50069504|a[3]&8192&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1048|a[3]&8192&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Zpe(t){var o;let e,n,i,l=((o=t[17])==null?void 0:o.name)+"",r,s;return{c(){e=P("p"),n=$("Delete "),i=P("strong"),r=$(l),s=$(`? Devices assigned to it will + move to the default policy.`),I(e,"class","svelte-1stwbl3")},m(a,u){O(a,e,u),w(e,n),w(e,i),w(i,r),w(e,s)},p(a,u){var f;u[0]&131072&&l!==(l=((f=a[17])==null?void 0:f.name)+"")&&Y(r,l)},d(a){a&&E(e)}}}function Xpe(t){let e,n,i,l,r,s;return e=new Od({props:{title:"Delete policy?",label:"This action cannot be undone"}}),i=new Md({props:{$$slots:{default:[Zpe]},$$scope:{ctx:t}}}),r=new Cd({props:{danger:!0,primaryButtonText:t[9]?"Deleting...":"Delete policy",primaryButtonDisabled:t[9],secondaryButtonText:"Cancel"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&131072|a[3]&8192&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a[0]&512&&(f.primaryButtonText=o[9]?"Deleting...":"Delete policy"),a[0]&512&&(f.primaryButtonDisabled=o[9]),r.$set(f)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Kpe(t){let e,n,i,l,r,s,o,a=t[11]&&Gy(t),u=t[12]&&Vy(t);const f=[ape,ope],c=[];function d(h,g){return h[8]?0:1}return i=d(t),l=c[i]=f[i](t),s=new Ed({props:{open:!!t[17],danger:!0,size:"sm",preventCloseOnClickOutside:!0,$$slots:{default:[Xpe]},$$scope:{ctx:t}}}),s.$on("close",t[39]),s.$on("submit",t[40]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),l.c(),r=F(),U(s.$$.fragment)},m(h,g){a&&a.m(h,g),O(h,e,g),u&&u.m(h,g),O(h,n,g),c[i].m(h,g),O(h,r,g),z(s,h,g),o=!0},p(h,g){h[11]?a?(a.p(h,g),g[0]&2048&&p(a,1)):(a=Gy(h),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),h[12]?u?(u.p(h,g),g[0]&4096&&p(u,1)):(u=Vy(h),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());let _=i;i=d(h),i===_?c[i].p(h,g):(ue(),v(c[_],1,1,()=>{c[_]=null}),fe(),l=c[i],l?l.p(h,g):(l=c[i]=f[i](h),l.c()),p(l,1),l.m(r.parentNode,r));const k={};g[0]&131072&&(k.open=!!h[17]),g[0]&131584|g[3]&8192&&(k.$$scope={dirty:g,ctx:h}),s.$set(k)},i(h){o||(p(a),p(u),p(l),p(s.$$.fragment,h),o=!0)},o(h){v(a),v(u),v(l),v(s.$$.fragment,h),o=!1},d(h){h&&(E(e),E(n),E(r)),a&&a.d(h),u&&u.d(h),c[i].d(h),H(s,h)}}}function Jpe(){return localStorage.getItem("jwt")||""}function Qs(t=!1){const e={Authorization:"Bearer "+Jpe()};return t&&(e["Content-Type"]="application/json"),e}async function xs(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}async function Pr(t){const e=await fetch(t,{headers:Qs()});if(!e.ok)throw new Error(await xs(e));return e.json()}function Ko(t){const e=t.display_name||(t.hostnames||[])[0]||t.ipv4||t.id;return t.ipv4&&e!==t.ipv4?e+" ("+t.ipv4+")":e}function Td(t){const e=t.active;return e.action==="block"||e.url_blocked?{text:"Blocked",type:"red"}:e.action==="allow"?{text:"Allowed by policy",type:"green"}:{text:"Not blocked by policy",type:"gray"}}function Qpe(t,e,n){let i,l;const r=Un()+"/api/policy/templates",s=Un()+"/api/policy/groups",o=Un()+"/api/policy/categories",a=Un()+"/api/policy/assignments",u=Un()+"/api/policy/preview",f=Un()+"/api/devices",c=Un()+"/api/policy/schedule-presets",d=Un()+"/api/users",h=Un()+"/api/settings/timezone";let g=[],_=[],k=[],y=[],T=[],M=[],A=[],C=[],D=[],R="UTC",N=!0,G=!1,B=!1,j="",q="",V=0,K="",x=fc(),ie={},X=null,ce="",ae="",ee="dns",he=!1,ne=null,re="";async function oe(){try{n(5,C=(await Pr(c)).presets||[])}catch{n(5,C=[])}try{n(6,D=((await Pr(d)).users||[]).map(Xe=>Xe.username).filter(Boolean))}catch{n(6,D=[])}try{const Xe=await Pr(h);Xe.Value&&n(7,R=Xe.Value)}catch{}}async function Re(){n(8,N=!0),n(11,j="");try{const[Xe,wt,Mt,Zn,Bn]=await Promise.all([Pr(r),Pr(s),Pr(o),Pr(a),Pr(f),oe()]);n(1,g=Xe.templates||[]),n(2,_=Xe.shared_limitations||[]),n(0,k=(wt.groups||[]).map(fu)),n(3,y=Mt.categories||[]),n(44,T=Zn.assignments||[]),n(45,M=Bn.devices||[]),n(4,A=y.filter(wn=>wn.enabled).map(wn=>wn.id))}catch(Xe){n(11,j=Xe.message)}finally{n(8,N=!1)}}async function qe(){n(44,T=(await Pr(a)).assignments||[])}function Ce(){n(14,K="choose"),n(15,x=fc())}function Ze(){n(14,K="new"),n(15,x=fc())}function be(Xe){n(14,K=Xe.id),n(15,x=fu(Xe))}function Ae(){n(14,K=""),n(15,x=fc())}function ve(Xe){const wt=y.find(Mt=>Mt.id===Xe);return wt?wt.name:Xe}function me(Xe,wt){var Bn;const Mt={[Ji]:[]},Zn=new Set;for(const wn of Xe)(Mt[Bn=wn.group_id]||(Mt[Bn]=[])).push(wn.device_id),Zn.add(wn.device_id);for(const wn of wt)Zn.has(wn.id)||Mt[Ji].push(wn.id);return Mt}function lt(Xe){const wt=M.find(Mt=>Mt.id===Xe);return wt?Ko(wt):Xe}function De(Xe){const wt=new Set(i[Xe]||[]);return l.filter(Mt=>!wt.has(Mt.id))}async function vt(Xe,wt){const Mt=await fetch(f+"/"+Xe+"/assignment",{method:"PUT",headers:Qs(!0),body:JSON.stringify({group_id:wt===Ji?"":wt})});if(!Mt.ok)throw new Error(await xs(Mt))}async function dt(Xe,wt){if(Xe){n(9,G=!0),n(11,j=""),n(12,q="");try{await vt(Xe,wt),await qe(),n(12,q=lt(Xe)+" now uses "+ht(wt)+".")}catch(Mt){n(11,j=Mt.message)}finally{n(9,G=!1)}}}async function ot(Xe){const wt=ie[Xe]||[];if(wt.length){n(9,G=!0),n(11,j=""),n(12,q="");try{for(const Mt of wt)await vt(Mt,Xe);await qe(),n(16,ie[Xe]=[],ie),n(16,ie={...ie}),n(12,q=wt.length+" device"+(wt.length===1?"":"s")+" now use "+ht(Xe)+".")}catch(Mt){n(11,j=Mt.message)}finally{n(9,G=!1)}}}function ht(Xe){var wt;return((wt=k.find(Mt=>Mt.id===Xe))==null?void 0:wt.name)||Xe}async function Bt(){if(!x.name.trim()){n(11,j="A policy needs a name.");return}n(9,G=!0),n(11,j=""),n(12,q="");try{const Xe=K==="new",wt=Xe?s:s+"/"+K,Mt=await fetch(wt,{method:Xe?"POST":"PUT",headers:Qs(!0),body:JSON.stringify(T0e(x))});if(!Mt.ok)throw new Error(await xs(Mt));const Zn=fu((await Mt.json()).group);Xe?n(0,k=[...k,Zn]):n(0,k=k.map(Bn=>Bn.id===Zn.id?Zn:Bn)),n(12,q="Policy saved. It applies to new DNS lookups within a minute."),Ae()}catch(Xe){n(11,j=Xe.message)}finally{n(9,G=!1)}}async function Ot(){n(10,B=!0),n(11,j=""),n(12,q="");try{const Xe=await fetch(o,{method:"PUT",headers:Qs(!0),body:JSON.stringify({categories:A})});if(!Xe.ok)throw new Error(await xs(Xe));const wt=await Xe.json();n(3,y=wt.categories||[]),n(4,A=y.filter(Mt=>Mt.enabled).map(Mt=>Mt.id)),n(12,q=wt.refresh_scheduled?"Categories saved. The gateway is downloading the feeds now, so refresh in a moment to see the new counts.":"Categories saved. A download was already running, so the counts update when it finishes.")}catch(Xe){n(11,j=Xe.message)}finally{n(10,B=!1)}}function Zt(Xe){n(17,X=Xe)}function Ve(){G||n(17,X=null)}async function Nt(){if(!X)return;const Xe=X;n(9,G=!0),n(11,j="");try{const wt=await fetch(s+"/"+Xe.id,{method:"DELETE",headers:Qs()});if(!wt.ok)throw new Error(await xs(wt));n(0,k=k.filter(Mt=>Mt.id!==Xe.id)),n(17,X=null),await qe(),n(12,q="Policy deleted; its devices now use the default policy.")}catch(wt){n(11,j=wt.message)}finally{n(9,G=!1)}}async function Tt(Xe){n(9,G=!0),n(11,j=""),n(12,q="");try{const wt=await fetch(r+"/"+Xe.id+"/apply",{method:"POST",headers:Qs()});if(!wt.ok)throw new Error(await xs(wt));const Mt=await wt.json();n(0,k=[...k,fu(Mt.group)]),n(14,K=Mt.group.id),n(15,x=fu(Mt.group)),n(12,q=Xe.name+" was added. Review it, then save any changes.")}catch(wt){n(11,j=wt.message)}finally{n(9,G=!1)}}function Gt(Xe){return k.some(wt=>wt.id===Xe.group_id)}async function fn(){const Xe=ae.trim();if(!Xe)return;n(21,he=!0),n(23,re=""),n(22,ne=null);const wt=M.find(wn=>wn.id===ce),Mt=Xe.includes("/"),Zn=Mt&&!Xe.includes("://")?"https://"+Xe:Xe,Bn={client_ip:(wt==null?void 0:wt.ipv4)||"",protocol:ee};Mt?Bn.url=Zn:Bn.domain=Xe;try{const wn=await fetch(u,{method:"POST",headers:Qs(!0),body:JSON.stringify(Bn)});if(!wn.ok)throw new Error(await xs(wn));n(22,ne=await wn.json())}catch(wn){n(23,re=wn.message)}finally{n(21,he=!1)}}let an={};on(Re);const Qt=()=>n(11,j=""),Ne=()=>n(12,q=""),pe=Xe=>Tt(Xe),et=Xe=>n(24,an[Xe.id]=!an[Xe.id],an),gt=Xe=>dt(Xe,Ji),Kt=Xe=>({id:Xe.id,text:Ko(Xe)}),ze=(Xe,wt)=>{n(16,ie[Xe.id]=wt.detail.selectedIds.map(String),ie),n(16,ie={...ie})},kt=Xe=>ot(Xe.id),Pt=Xe=>be(Xe),cn=Xe=>Zt(Xe);function qn(Xe){ce=Xe,n(18,ce)}function nl(Xe){ae=Xe,n(19,ae)}const Bl=Xe=>Xe.key==="Enter"&&fn();function Be(Xe){ee=Xe,n(20,ee)}const Et=Xe=>n(4,A=Xe.detail);function kn(Xe){V=Xe,n(13,V)}return t.$$.update=()=>{t.$$.dirty[1]&24576&&n(26,i=me(T,M)),t.$$.dirty[1]&16384&&n(25,l=[...M].sort((Xe,wt)=>Ko(Xe).localeCompare(Ko(wt)))),t.$$.dirty[0]&1&&k.filter(Xe=>Xe.id!==Ji).length},[k,g,_,y,A,C,D,R,N,G,B,j,q,V,K,x,ie,X,ce,ae,ee,he,ne,re,an,l,i,Ce,Ze,be,Ae,ve,lt,De,dt,ot,Bt,Ot,Zt,Ve,Nt,Tt,Gt,fn,T,M,Qt,Ne,pe,et,gt,Kt,ze,kt,Pt,cn,qn,nl,Bl,Be,Et,kn]}class xpe extends Oe{constructor(e){super(),Ee(this,e,Qpe,Kpe,Se,{},null,[-1,-1,-1,-1])}}function ebe(t){let e,n;return e=new xpe({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tbe(t){let e;return{c(){e=$("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function nbe(t){let e;return{c(){e=$("Policies")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ibe(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[tbe]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[nbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function lbe(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[ibe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rbe(t){let e,n;return e=new Nl({props:{title:"Policies",description:"Choose protection for each device, test a decision, or adjust the gateway-wide baseline.",$$slots:{breadcrumb:[lbe],default:[ebe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class sbe extends Oe{constructor(e){super(),Ee(this,e,null,rbe,Se,{})}}const{Boolean:vo}=Sd;function w8(t,e,n){const i=t.slice();return i[63]=e[n],i}function y8(t,e,n){const i=t.slice();return i[66]=e[n],i}function T8(t,e,n){const i=t.slice();return i[69]=e[n],i}function S8(t,e,n){const i=t.slice();return i[72]=e[n],i}function E8(t,e,n){const i=t.slice();return i[75]=e[n],i}function O8(t,e,n){const i=t.slice();return i[75]=e[n],i}function M8(t,e,n){const i=t.slice();return i[80]=e[n],i}function C8(t,e,n){const i=t.slice();return i[80]=e[n],i}function A8(t,e,n){const i=t.slice();return i[80]=e[n],i}function L8(t,e,n){const i=t.slice();return i[66]=e[n],i}function D8(t,e,n){const i=t.slice();return i[89]=e[n],i}function I8(t,e,n){const i=t.slice();return i[92]=e[n],i}function R8(t){let e,n;return e=new ln({props:{kind:"error",title:"Unable to save device labels",subtitle:t[6]}}),e.$on("close",t[40]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function obe(t){let e,n,i,l,r,s,o,a;return e=new ql({props:{label:"Overview"}}),i=new ql({props:{label:"Policy"}}),r=new ql({props:{label:"Connections"}}),o=new ql({props:{label:"Identity & activity"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p:_e,i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function abe(t){var i;let e=(i=t[0])!=null&&i.online?"Online":"Offline",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(s=l[0])!=null&&s.online?"Online":"Offline")&&Y(n,e)},d(l){l&&E(n)}}}function ube(t){let e,n,i,l,r,s,o,a,u,f;function c(y){t[41](y)}let d={labelText:"Display name",placeholder:"e.g., Vivienne's iPad"};t[2]!==void 0&&(d.value=t[2]),n=new ei({props:d}),xe.push(()=>At(n,"value",c));function h(y){t[42](y)}let g={labelText:"Owner",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., Vivienne, Dad"};t[3]!==void 0&&(g.value=t[3]),r=new ei({props:g}),xe.push(()=>At(r,"value",h));function _(y){t[43](y)}let k={labelText:"Category",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., kids, adults, iot"};return t[4]!==void 0&&(k.value=t[4]),a=new ei({props:k}),xe.push(()=>At(a,"value",_)),{c(){e=P("div"),U(n.$$.fragment),l=F(),U(r.$$.fragment),o=F(),U(a.$$.fragment),I(e,"class","field-grid svelte-cnehxk")},m(y,T){O(y,e,T),z(n,e,null),w(e,l),z(r,e,null),w(e,o),z(a,e,null),f=!0},p(y,T){const M={};!i&&T[0]&4&&(i=!0,M.value=y[2],Ct(()=>i=!1)),n.$set(M);const A={};!s&&T[0]&8&&(s=!0,A.value=y[3],Ct(()=>s=!1)),r.$set(A);const C={};!u&&T[0]&16&&(u=!0,C.value=y[4],Ct(()=>u=!1)),a.$set(C)},i(y){f||(p(n.$$.fragment,y),p(r.$$.fragment,y),p(a.$$.fragment,y),f=!0)},o(y){v(n.$$.fragment,y),v(r.$$.fragment,y),v(a.$$.fragment,y),f=!1},d(y){y&&E(e),H(n),H(r),H(a)}}}function fbe(t){let e;return{c(){e=$("Discovery")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function cbe(t){let e;return{c(){e=$("Observed value")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function dbe(t){let e,n,i,l;return e=new qt({props:{head:!0,$$slots:{default:[fbe]},$$scope:{ctx:t}}}),i=new qt({props:{head:!0,$$slots:{default:[cbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function hbe(t){let e,n;return e=new si({props:{head:!0,$$slots:{default:[dbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mbe(t){let e;return{c(){e=$("Primary source")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function gbe(t){var i;let e=(((i=t[0])==null?void 0:i.source)||"Unknown")+"",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.source)||"Unknown")+"")&&Y(n,e)},d(l){l&&E(n)}}}function _be(t){let e,n;return e=new Rt({props:{size:"sm",type:"outline",$$slots:{default:[gbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&1|l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function pbe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[mbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[_be]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function bbe(t){let e;return{c(){e=$("First seen")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function vbe(t){var i;let e=Cs((i=t[0])==null?void 0:i.first_seen)+"",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Cs((s=l[0])==null?void 0:s.first_seen)+"")&&Y(n,e)},d(l){l&&E(n)}}}function kbe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[bbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[vbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function wbe(t){let e;return{c(){e=$("Last seen")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function ybe(t){var i;let e=Cs((i=t[0])==null?void 0:i.last_seen)+"",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Cs((s=l[0])==null?void 0:s.last_seen)+"")&&Y(n,e)},d(l){l&&E(n)}}}function Tbe(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[wbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[ybe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Sbe(t){let e,n,i,l,r,s;return e=new si({props:{$$slots:{default:[pbe]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[kbe]},$$scope:{ctx:t}}}),r=new si({props:{$$slots:{default:[Tbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(o,a){z(e,o,a),O(o,n,a),z(i,o,a),O(o,l,a),z(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[3]&4&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[3]&4&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[3]&4&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(p(e.$$.fragment,o),p(i.$$.fragment,o),p(r.$$.fragment,o),s=!0)},o(o){v(e.$$.fragment,o),v(i.$$.fragment,o),v(r.$$.fragment,o),s=!1},d(o){o&&(E(n),E(l)),H(e,o),H(i,o),H(r,o)}}}function Ebe(t){let e,n,i,l;return e=new i5({props:{$$slots:{default:[hbe]},$$scope:{ctx:t}}}),i=new qu({props:{$$slots:{default:[Sbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Obe(t){var h;let e,n,i,l,r,s,o,a,u,f,c,d;return r=new Rt({props:{size:"sm",type:(h=t[0])!=null&&h.online?"green":"warm-gray",$$slots:{default:[abe]},$$scope:{ctx:t}}}),u=new dc({props:{legendText:"Naming and metadata",$$slots:{default:[ube]},$$scope:{ctx:t}}}),c=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[Ebe]},$$scope:{ctx:t}}}),{c(){e=P("section"),n=P("div"),i=P("h3"),i.textContent="Overview",l=F(),U(r.$$.fragment),s=F(),o=P("p"),o.textContent=`Add labels that make this device easier to recognize. These fields + are descriptive and do not select protection.`,a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),I(i,"id","device-overview-title"),I(i,"class","svelte-cnehxk"),I(n,"class","section-heading svelte-cnehxk"),I(o,"class","section-note svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-overview-title")},m(g,_){O(g,e,_),w(e,n),w(n,i),w(n,l),z(r,n,null),w(e,s),w(e,o),w(e,a),z(u,e,null),w(e,f),z(c,e,null),d=!0},p(g,_){var M;const k={};_[0]&1&&(k.type=(M=g[0])!=null&&M.online?"green":"warm-gray"),_[0]&1|_[3]&4&&(k.$$scope={dirty:_,ctx:g}),r.$set(k);const y={};_[0]&28|_[3]&4&&(y.$$scope={dirty:_,ctx:g}),u.$set(y);const T={};_[0]&1|_[3]&4&&(T.$$scope={dirty:_,ctx:g}),c.$set(T)},i(g){d||(p(r.$$.fragment,g),p(u.$$.fragment,g),p(c.$$.fragment,g),d=!0)},o(g){v(r.$$.fragment,g),v(u.$$.fragment,g),v(c.$$.fragment,g),d=!1},d(g){g&&E(e),H(r),H(u),H(c)}}}function P8(t){let e,n;return e=new ln({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:"Unable to save policy",subtitle:t[14]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16384&&(r.subtitle=i[14]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function N8(t){let e,n;return e=new ln({props:{kind:"success",lowContrast:!0,hideCloseButton:!0,title:"Policy saved",subtitle:"The selected policy now applies to this device identity."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function B8(t,e){let n,i,l;return i=new Rn({props:{value:e[92].id,text:e[92].name||e[92].id}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&2048&&(o.value=e[92].id),s[0]&2048&&(o.text=e[92].name||e[92].id),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function Mbe(t){let e,n,i=[],l=new Map,r,s;e=new Rn({props:{value:"",text:"Default policy"}});let o=it(t[11].filter(kT));const a=u=>u[92].id;for(let u=0;uAt(f,"selected",D)),h=new bt({props:{kind:"primary",size:"field",disabled:t[13],$$slots:{default:[Cbe]},$$scope:{ctx:t}}}),h.$on("click",t[35]);const N=[Dbe,Lbe,Abe],G=[];function B(j,q){return j[9]&&!j[8]?0:j[10]&&!j[8]?1:j[8]?2:-1}return~(y=B(t))&&(T=G[y]=N[y](t)),{c(){e=P("section"),n=P("h3"),n.textContent="Policy",i=F(),l=P("p"),l.textContent=`A device without a policy of its own uses the default policy. + Owner and category are metadata and never change filtering.`,r=F(),A&&A.c(),s=F(),C&&C.c(),o=F(),a=P("div"),u=P("div"),U(f.$$.fragment),d=F(),U(h.$$.fragment),g=F(),_=P("h4"),_.textContent="Effective protection",k=F(),T&&T.c(),I(n,"id","device-policy-title"),I(n,"class","svelte-cnehxk"),I(l,"class","section-note svelte-cnehxk"),I(u,"class","action-field svelte-cnehxk"),I(a,"class","action-row svelte-cnehxk"),I(_,"class","svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-policy-title")},m(j,q){O(j,e,q),w(e,n),w(e,i),w(e,l),w(e,r),A&&A.m(e,null),w(e,s),C&&C.m(e,null),w(e,o),w(e,a),w(a,u),z(f,u,null),w(a,d),z(h,a,null),w(e,g),w(e,_),w(e,k),~y&&G[y].m(e,null),M=!0},p(j,q){j[14]?A?(A.p(j,q),q[0]&16384&&p(A,1)):(A=P8(j),A.c(),p(A,1),A.m(e,s)):A&&(ue(),v(A,1,1,()=>{A=null}),fe()),j[15]?C?q[0]&32768&&p(C,1):(C=N8(),C.c(),p(C,1),C.m(e,o)):C&&(ue(),v(C,1,1,()=>{C=null}),fe());const V={};q[0]&8192&&(V.disabled=j[13]),q[0]&2048|q[3]&4&&(V.$$scope={dirty:q,ctx:j}),!c&&q[0]&4096&&(c=!0,V.selected=j[12],Ct(()=>c=!1)),f.$set(V);const K={};q[0]&8192&&(K.disabled=j[13]),q[0]&8192|q[3]&4&&(K.$$scope={dirty:q,ctx:j}),h.$set(K);let x=y;y=B(j),y===x?~y&&G[y].p(j,q):(T&&(ue(),v(G[x],1,1,()=>{G[x]=null}),fe()),~y?(T=G[y],T?T.p(j,q):(T=G[y]=N[y](j),T.c()),p(T,1),T.m(e,null)):T=null)},i(j){M||(p(A),p(C),p(f.$$.fragment,j),p(h.$$.fragment,j),p(T),M=!0)},o(j){v(A),v(C),v(f.$$.fragment,j),v(h.$$.fragment,j),v(T),M=!1},d(j){j&&E(e),A&&A.d(),C&&C.d(),H(f),H(h),~y&&G[y].d()}}}function F8(t){let e,n;return e=new ln({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:"Tailscale action failed",subtitle:t[23]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8388608&&(r.subtitle=i[23]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function G8(t){let e,n;return e=new ln({props:{kind:"success",lowContrast:!0,hideCloseButton:!0,title:"Tailscale links updated",subtitle:t[24]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16777216&&(r.subtitle=i[24]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Pbe(t){var _;let e,n,i,l,r,s,o,a,u,f=t[16]&&V8(t);const c=[zbe,Bbe],d=[];function h(k,y){return k[17].length?0:1}l=h(t),r=d[l]=c[l](t);let g=((_=t[16])==null?void 0:_.state)==="connected"&&Y8(t);return a=new bt({props:{kind:"tertiary",size:"small",disabled:t[22]||t[20],$$slots:{default:[qbe]},$$scope:{ctx:t}}}),a.$on("click",t[30]),{c(){f&&f.c(),e=F(),n=P("h4"),n.textContent="Linked peers",i=F(),r.c(),s=F(),g&&g.c(),o=F(),U(a.$$.fragment),I(n,"class","svelte-cnehxk")},m(k,y){f&&f.m(k,y),O(k,e,y),O(k,n,y),O(k,i,y),d[l].m(k,y),O(k,s,y),g&&g.m(k,y),O(k,o,y),z(a,k,y),u=!0},p(k,y){var A;k[16]?f?(f.p(k,y),y[0]&65536&&p(f,1)):(f=V8(k),f.c(),p(f,1),f.m(e.parentNode,e)):f&&(ue(),v(f,1,1,()=>{f=null}),fe());let T=l;l=h(k),l===T?d[l].p(k,y):(ue(),v(d[T],1,1,()=>{d[T]=null}),fe(),r=d[l],r?r.p(k,y):(r=d[l]=c[l](k),r.c()),p(r,1),r.m(s.parentNode,s)),((A=k[16])==null?void 0:A.state)==="connected"?g?(g.p(k,y),y[0]&65536&&p(g,1)):(g=Y8(k),g.c(),p(g,1),g.m(o.parentNode,o)):g&&(ue(),v(g,1,1,()=>{g=null}),fe());const M={};y[0]&5242880&&(M.disabled=k[22]||k[20]),y[3]&4&&(M.$$scope={dirty:y,ctx:k}),a.$set(M)},i(k){u||(p(f),p(r),p(g),p(a.$$.fragment,k),u=!0)},o(k){v(f),v(r),v(g),v(a.$$.fragment,k),u=!1},d(k){k&&(E(e),E(n),E(i),E(s),E(o)),f&&f.d(k),d[l].d(k),g&&g.d(k),H(a,k)}}}function Nbe(t){let e,n;return e=new Wi({props:{description:"Loading Tailscale peers…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function V8(t){let e,n;return e=new ln({props:{lowContrast:!0,hideCloseButton:!0,kind:mT(t[16].state),title:gT(t[16].state),subtitle:t[16].message||t[16].backend_state}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.kind=mT(i[16].state)),l[0]&65536&&(r.title=gT(i[16].state)),l[0]&65536&&(r.subtitle=i[16].message||i[16].backend_state),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Bbe(t){let e;return{c(){e=P("p"),e.textContent="No Tailscale peers are linked to this device.",I(e,"class","section-note svelte-cnehxk")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function zbe(t){let e,n=[],i=new Map,l,r=it(t[17]);const s=o=>o[80].node_id;for(let o=0;ov(s[a],1,1,()=>{s[a]=null});return{c(){e=P("div"),n=P("span"),n.textContent="Informational WoL MAC:",i=F();for(let a=0;a{q=null}),fe())},i(x){G||(p(u.$$.fragment,x),p(c.$$.fragment,x),p(q),G=!0)},o(x){v(u.$$.fragment,x),v(c.$$.fragment,x),v(q),G=!1},d(x){x&&E(n),H(u),H(c),j&&j.d(),q&&q.d()}}}function Y8(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;function g(M){t[46](M)}let _={labelText:"Tailscale peer",helperText:"Choose an unlinked peer, then confirm the link.",disabled:t[22]||t[20],$$slots:{default:[Gbe]},$$scope:{ctx:t}};t[19]!==void 0&&(_.selected=t[19]),r=new Wr({props:_}),xe.push(()=>At(r,"selected",g)),a=new bt({props:{kind:"primary",size:"field",disabled:t[22]||!t[19],$$slots:{default:[Vbe]},$$scope:{ctx:t}}}),a.$on("click",t[31]);const k=[jbe,Wbe],y=[];function T(M,A){return M[18].length?0:M[21]?1:-1}return~(f=T(t))&&(c=y[f]=k[f](t)),{c(){e=P("h4"),e.textContent="Link a peer",n=F(),i=P("div"),l=P("div"),U(r.$$.fragment),o=F(),U(a.$$.fragment),u=F(),c&&c.c(),d=je(),I(e,"class","svelte-cnehxk"),I(l,"class","action-field svelte-cnehxk"),I(i,"class","action-row svelte-cnehxk")},m(M,A){O(M,e,A),O(M,n,A),O(M,i,A),w(i,l),z(r,l,null),w(i,o),z(a,i,null),O(M,u,A),~f&&y[f].m(M,A),O(M,d,A),h=!0},p(M,A){const C={};A[0]&5242880&&(C.disabled=M[22]||M[20]),A[0]&262144|A[3]&4&&(C.$$scope={dirty:A,ctx:M}),!s&&A[0]&524288&&(s=!0,C.selected=M[19],Ct(()=>s=!1)),r.$set(C);const D={};A[0]&4718592&&(D.disabled=M[22]||!M[19]),A[0]&4194304|A[3]&4&&(D.$$scope={dirty:A,ctx:M}),a.$set(D);let R=f;f=T(M),f===R?~f&&y[f].p(M,A):(c&&(ue(),v(y[R],1,1,()=>{y[R]=null}),fe()),~f?(c=y[f],c?c.p(M,A):(c=y[f]=k[f](M),c.c()),p(c,1),c.m(d.parentNode,d)):c=null)},i(M){h||(p(r.$$.fragment,M),p(a.$$.fragment,M),p(c),h=!0)},o(M){v(r.$$.fragment,M),v(a.$$.fragment,M),v(c),h=!1},d(M){M&&(E(e),E(n),E(i),E(u),E(d)),H(r),H(a),~f&&y[f].d(M)}}}function Z8(t,e){let n,i,l;return i=new Rn({props:{value:e[80].node_id,text:`${Ms(e[80])}${e[80].online?" (online)":" (offline)"}`}}),{key:t,first:null,c(){n=je(),U(i.$$.fragment),this.first=n},m(r,s){O(r,n,s),z(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&262144&&(o.value=e[80].node_id),s[0]&262144&&(o.text=`${Ms(e[80])}${e[80].online?" (online)":" (offline)"}`),i.$set(o)},i(r){l||(p(i.$$.fragment,r),l=!0)},o(r){v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(i,r)}}}function Gbe(t){let e,n,i=[],l=new Map,r,s;e=new Rn({props:{value:"",text:"Choose a peer"}});let o=it(t[18]);const a=u=>u[80].node_id;for(let u=0;uo[80].node_id;for(let o=0;o{h=null}),fe()),T[24]?g?(g.p(T,M),M[0]&16777216&&p(g,1)):(g=G8(T),g.c(),p(g,1),g.m(e,u)):g&&(ue(),v(g,1,1,()=>{g=null}),fe());let A=f;f=y(T),f===A?k[f].p(T,M):(ue(),v(k[A],1,1,()=>{k[A]=null}),fe(),c=k[f],c?c.p(T,M):(c=k[f]=_[f](T),c.c()),p(c,1),c.m(e,null))},i(T){d||(p(h),p(g),p(c),d=!0)},o(T){v(h),v(g),v(c),d=!1},d(T){T&&E(e),h&&h.d(),g&&g.d(),k[f].d()}}}function Kbe(t){let e;return{c(){e=j("Property")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Jbe(t){let e;return{c(){e=j("Observed value")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Qbe(t){let e,n,i,l;return e=new qt({props:{head:!0,$$slots:{default:[Kbe]},$$scope:{ctx:t}}}),i=new qt({props:{head:!0,$$slots:{default:[Jbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function xbe(t){let e,n;return e=new si({props:{head:!0,$$slots:{default:[Qbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function e2e(t){let e;return{c(){e=j("Policy identity")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function t2e(t){let e;return{c(){e=j("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function n2e(t){let e,n,i=(t[8].identity.explanation||"")+"",l,r;return e=new Rt({props:{size:"sm",type:"blue",$$slots:{default:[i2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),l=j(i)},m(s,o){z(e,s,o),O(s,n,o),O(s,l,o),r=!0},p(s,o){const a={};o[0]&256|o[3]&4&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),(!r||o[0]&256)&&i!==(i=(s[8].identity.explanation||"")+"")&&Y(l,i)},i(s){r||(p(e.$$.fragment,s),r=!0)},o(s){v(e.$$.fragment,s),r=!1},d(s){s&&(E(n),E(l)),H(e,s)}}}function i2e(t){let e=t[8].identity.source+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&256&&e!==(e=i[8].identity.source+"")&&Y(n,e)},d(i){i&&E(n)}}}function l2e(t){let e,n,i,l;const r=[n2e,t2e],s=[];function o(a,u){var f;return(f=a[8])!=null&&f.identity?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function r2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[e2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[l2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&256|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function s2e(t){let e;return{c(){e=j("DNS name")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function o2e(t){var i;let e=(((i=t[0])==null?void 0:i.dns_name)||"—")+"",n;return{c(){n=j(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.dns_name)||"—")+"")&&Y(n,e)},d(l){l&&E(n)}}}function a2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[s2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[o2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function u2e(t){let e;return{c(){e=j("IPv4")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function x8(t){let e,n,i,l,r=t[75].shared_address&&eT(t),s=t[75].stale_observation&&tT(t),o=!t[75].dns_resolves_device&&nT(t);return{c(){r&&r.c(),e=F(),s&&s.c(),n=F(),o&&o.c(),i=je()},m(a,u){r&&r.m(a,u),O(a,e,u),s&&s.m(a,u),O(a,n,u),o&&o.m(a,u),O(a,i,u),l=!0},p(a,u){a[75].shared_address?r?u[0]&256&&p(r,1):(r=eT(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[75].stale_observation?s?u[0]&256&&p(s,1):(s=tT(a),s.c(),p(s,1),s.m(n.parentNode,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[75].dns_resolves_device?o&&(ue(),v(o,1,1,()=>{o=null}),fe()):o?u[0]&256&&p(o,1):(o=nT(a),o.c(),p(o,1),o.m(i.parentNode,i))},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&(E(e),E(n),E(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function eT(t){let e,n;return e=new Rt({props:{size:"sm",type:"magenta",$$slots:{default:[f2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function f2e(t){let e;return{c(){e=j("shared address")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function tT(t){let e,n;return e=new Rt({props:{size:"sm",type:"warm-gray",$$slots:{default:[c2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function c2e(t){let e;return{c(){e=j("stale observation")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function nT(t){let e,n;return e=new Rt({props:{size:"sm",type:"red",$$slots:{default:[d2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function d2e(t){let e;return{c(){e=j("DNS does not resolve to this device")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iT(t){var l;let e,n,i=t[75].ip===((l=t[0])==null?void 0:l.ipv4)&&x8(t);return{c(){i&&i.c(),e=je()},m(r,s){i&&i.m(r,s),O(r,e,s),n=!0},p(r,s){var o;r[75].ip===((o=r[0])==null?void 0:o.ipv4)?i?(i.p(r,s),s[0]&257&&p(i,1)):(i=x8(r),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(r){n||(p(i),n=!0)},o(r){v(i),n=!1},d(r){r&&E(e),i&&i.d(r)}}}function h2e(t){var u,f;let e=(((u=t[0])==null?void 0:u.ipv4)||"—")+"",n,i,l,r,s=it(((f=t[8])==null?void 0:f.addresses)||[]),o=[];for(let c=0;cv(o[c],1,1,()=>{o[c]=null});return{c(){n=j(e),i=F();for(let c=0;c{l=null}),fe()),s[75].stale_observation?r?o[0]&256&&p(r,1):(r=sT(s),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function rT(t){let e,n;return e=new Rt({props:{size:"sm",type:"magenta",$$slots:{default:[_2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _2e(t){let e;return{c(){e=j("shared address")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function sT(t){let e,n;return e=new Rt({props:{size:"sm",type:"warm-gray",$$slots:{default:[p2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function p2e(t){let e;return{c(){e=j("stale observation")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function oT(t){var l,r;let e,n,i=t[75].ip===((l=t[0])==null?void 0:l.ipv6)&&((r=t[0])==null?void 0:r.ipv6)&&lT(t);return{c(){i&&i.c(),e=je()},m(s,o){i&&i.m(s,o),O(s,e,o),n=!0},p(s,o){var a,u;s[75].ip===((a=s[0])==null?void 0:a.ipv6)&&((u=s[0])!=null&&u.ipv6)?i?(i.p(s,o),o[0]&257&&p(i,1)):(i=lT(s),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(s){n||(p(i),n=!0)},o(s){v(i),n=!1},d(s){s&&E(e),i&&i.d(s)}}}function b2e(t){var f,c;let e,n=(((f=t[0])==null?void 0:f.ipv6)||"—")+"",i,l,r,s,o=it(((c=t[8])==null?void 0:c.addresses)||[]),a=[];for(let d=0;dv(a[d],1,1,()=>{a[d]=null});return{c(){e=P("span"),i=j(n),l=F();for(let d=0;dv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function E2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[k2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[S2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function O2e(t){let e;return{c(){e=j("mDNS names")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function M2e(t){let e;return{c(){e=j("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function C2e(t){let e,n,i=it(t[0].mdns_names),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function D2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[O2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[L2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function I2e(t){let e;return{c(){e=j("MAC addresses")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function R2e(t){let e;return{c(){e=j("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function P2e(t){let e,n,i=it(t[0].macs),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function z2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[I2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[B2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function H2e(t){let e;return{c(){e=j("Device ID")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function U2e(t){var l;let e,n=(((l=t[0])==null?void 0:l.id)||"—")+"",i;return{c(){e=P("code"),i=j(n),I(e,"class","break-value svelte-cnehxk")},m(r,s){O(r,e,s),w(e,i)},p(r,s){var o;s[0]&1&&n!==(n=(((o=r[0])==null?void 0:o.id)||"—")+"")&&Y(i,n)},d(r){r&&E(e)}}}function F2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[H2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[U2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function G2e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k;return e=new si({props:{$$slots:{default:[r2e]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[a2e]},$$scope:{ctx:t}}}),r=new si({props:{$$slots:{default:[m2e]},$$scope:{ctx:t}}}),o=new si({props:{$$slots:{default:[v2e]},$$scope:{ctx:t}}}),u=new si({props:{$$slots:{default:[E2e]},$$scope:{ctx:t}}}),c=new si({props:{$$slots:{default:[D2e]},$$scope:{ctx:t}}}),h=new si({props:{$$slots:{default:[z2e]},$$scope:{ctx:t}}}),_=new si({props:{$$slots:{default:[F2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),d=F(),U(h.$$.fragment),g=F(),U(_.$$.fragment)},m(y,T){z(e,y,T),O(y,n,T),z(i,y,T),O(y,l,T),z(r,y,T),O(y,s,T),z(o,y,T),O(y,a,T),z(u,y,T),O(y,f,T),z(c,y,T),O(y,d,T),z(h,y,T),O(y,g,T),z(_,y,T),k=!0},p(y,T){const M={};T[0]&256|T[3]&4&&(M.$$scope={dirty:T,ctx:y}),e.$set(M);const A={};T[0]&1|T[3]&4&&(A.$$scope={dirty:T,ctx:y}),i.$set(A);const C={};T[0]&257|T[3]&4&&(C.$$scope={dirty:T,ctx:y}),r.$set(C);const D={};T[0]&257|T[3]&4&&(D.$$scope={dirty:T,ctx:y}),o.$set(D);const R={};T[0]&1|T[3]&4&&(R.$$scope={dirty:T,ctx:y}),u.$set(R);const N={};T[0]&1|T[3]&4&&(N.$$scope={dirty:T,ctx:y}),c.$set(N);const G={};T[0]&1|T[3]&4&&(G.$$scope={dirty:T,ctx:y}),h.$set(G);const B={};T[0]&1|T[3]&4&&(B.$$scope={dirty:T,ctx:y}),_.$set(B)},i(y){k||(p(e.$$.fragment,y),p(i.$$.fragment,y),p(r.$$.fragment,y),p(o.$$.fragment,y),p(u.$$.fragment,y),p(c.$$.fragment,y),p(h.$$.fragment,y),p(_.$$.fragment,y),k=!0)},o(y){v(e.$$.fragment,y),v(i.$$.fragment,y),v(r.$$.fragment,y),v(o.$$.fragment,y),v(u.$$.fragment,y),v(c.$$.fragment,y),v(h.$$.fragment,y),v(_.$$.fragment,y),k=!1},d(y){y&&(E(n),E(l),E(s),E(a),E(f),E(d),E(g)),H(e,y),H(i,y),H(r,y),H(o,y),H(u,y),H(c,y),H(h,y),H(_,y)}}}function V2e(t){let e,n,i,l;return e=new i5({props:{$$slots:{default:[xbe]},$$scope:{ctx:t}}}),i=new qu({props:{$$slots:{default:[G2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&257|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function W2e(t){let e,n,i=it(t[26]),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){e=P("ul");for(let s=0;s{M=null}),fe()),(!T||C[0]&67108864)&&f!==(f=A[63].url+"")&&Y(c,f),(!T||C[0]&67108864)&&_!==(_=A[63].ip+"")&&Y(k,_)},i(A){T||(p(s.$$.fragment,A),p(M),T=!0)},o(A){v(s.$$.fragment,A),v(M),T=!1},d(A){A&&E(e),H(s),M&&M.d()}}}function hT(t){let e,n,i;return{c(){e=P("p"),n=j("Live refresh unavailable: "),i=j(t[28]),I(e,"class","refresh-error svelte-cnehxk")},m(l,r){O(l,e,r),w(e,n),w(e,i)},p(l,r){r[0]&268435456&&Y(i,l[28])},d(l){l&&E(e)}}}function Z2e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k;o=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[V2e]},$$scope:{ctx:t}}});const y=[$2e,j2e,W2e],T=[];function M(C,D){return C[27]&&!C[29]?0:C[26].length===0?1:2}c=M(t),d=T[c]=y[c](t);let A=t[28]&&hT(t);return{c(){e=P("section"),n=P("h3"),n.textContent="Identity & activity",i=F(),l=P("p"),l.textContent=`These observed identifiers explain how GateSentry recognizes this + used to match or link devices.`,o=F(),h&&h.c(),a=F(),g&&g.c(),u=F(),c.c(),I(n,"id","device-connections-title"),I(n,"class","svelte-cnehxk"),I(l,"class","section-note svelte-cnehxk"),I(s,"class","section-note svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-connections-title")},m(T,M){O(T,e,M),w(e,n),w(e,i),w(e,l),w(e,r),w(e,s),w(e,o),h&&h.m(e,null),w(e,a),g&&g.m(e,null),w(e,u),k[f].m(e,null),d=!0},p(T,M){T[23]?h?(h.p(T,M),M[0]&8388608&&p(h,1)):(h=F8(T),h.c(),p(h,1),h.m(e,a)):h&&(ue(),v(h,1,1,()=>{h=null}),fe()),T[24]?g?(g.p(T,M),M[0]&16777216&&p(g,1)):(g=G8(T),g.c(),p(g,1),g.m(e,u)):g&&(ue(),v(g,1,1,()=>{g=null}),fe());let A=f;f=y(T),f===A?k[f].p(T,M):(ue(),v(k[A],1,1,()=>{k[A]=null}),fe(),c=k[f],c?c.p(T,M):(c=k[f]=_[f](T),c.c()),p(c,1),c.m(e,null))},i(T){d||(p(h),p(g),p(c),d=!0)},o(T){v(h),v(g),v(c),d=!1},d(T){T&&E(e),h&&h.d(),g&&g.d(),k[f].d()}}}function Zbe(t){let e;return{c(){e=$("Property")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Xbe(t){let e;return{c(){e=$("Observed value")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Kbe(t){let e,n,i,l;return e=new qt({props:{head:!0,$$slots:{default:[Zbe]},$$scope:{ctx:t}}}),i=new qt({props:{head:!0,$$slots:{default:[Xbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Jbe(t){let e,n;return e=new si({props:{head:!0,$$slots:{default:[Kbe]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[3]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Qbe(t){let e;return{c(){e=$("Policy identity")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function xbe(t){let e;return{c(){e=$("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function e2e(t){let e,n,i=(t[8].identity.explanation||"")+"",l,r;return e=new Rt({props:{size:"sm",type:"blue",$$slots:{default:[t2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),l=$(i)},m(s,o){z(e,s,o),O(s,n,o),O(s,l,o),r=!0},p(s,o){const a={};o[0]&256|o[3]&4&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),(!r||o[0]&256)&&i!==(i=(s[8].identity.explanation||"")+"")&&Y(l,i)},i(s){r||(p(e.$$.fragment,s),r=!0)},o(s){v(e.$$.fragment,s),r=!1},d(s){s&&(E(n),E(l)),H(e,s)}}}function t2e(t){let e=t[8].identity.source+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&256&&e!==(e=i[8].identity.source+"")&&Y(n,e)},d(i){i&&E(n)}}}function n2e(t){let e,n,i,l;const r=[e2e,xbe],s=[];function o(a,u){var f;return(f=a[8])!=null&&f.identity?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function i2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[Qbe]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[n2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&256|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function l2e(t){let e;return{c(){e=$("DNS name")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function r2e(t){var i;let e=(((i=t[0])==null?void 0:i.dns_name)||"—")+"",n;return{c(){n=$(e)},m(l,r){O(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.dns_name)||"—")+"")&&Y(n,e)},d(l){l&&E(n)}}}function s2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[l2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[r2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function o2e(t){let e;return{c(){e=$("IPv4")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function x8(t){let e,n,i,l,r=t[75].shared_address&&eT(t),s=t[75].stale_observation&&tT(t),o=!t[75].dns_resolves_device&&nT(t);return{c(){r&&r.c(),e=F(),s&&s.c(),n=F(),o&&o.c(),i=je()},m(a,u){r&&r.m(a,u),O(a,e,u),s&&s.m(a,u),O(a,n,u),o&&o.m(a,u),O(a,i,u),l=!0},p(a,u){a[75].shared_address?r?u[0]&256&&p(r,1):(r=eT(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe()),a[75].stale_observation?s?u[0]&256&&p(s,1):(s=tT(a),s.c(),p(s,1),s.m(n.parentNode,n)):s&&(ue(),v(s,1,1,()=>{s=null}),fe()),a[75].dns_resolves_device?o&&(ue(),v(o,1,1,()=>{o=null}),fe()):o?u[0]&256&&p(o,1):(o=nT(a),o.c(),p(o,1),o.m(i.parentNode,i))},i(a){l||(p(r),p(s),p(o),l=!0)},o(a){v(r),v(s),v(o),l=!1},d(a){a&&(E(e),E(n),E(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function eT(t){let e,n;return e=new Rt({props:{size:"sm",type:"magenta",$$slots:{default:[a2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function a2e(t){let e;return{c(){e=$("shared address")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function tT(t){let e,n;return e=new Rt({props:{size:"sm",type:"warm-gray",$$slots:{default:[u2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function u2e(t){let e;return{c(){e=$("stale observation")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function nT(t){let e,n;return e=new Rt({props:{size:"sm",type:"red",$$slots:{default:[f2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function f2e(t){let e;return{c(){e=$("DNS does not resolve to this device")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function iT(t){var l;let e,n,i=t[75].ip===((l=t[0])==null?void 0:l.ipv4)&&x8(t);return{c(){i&&i.c(),e=je()},m(r,s){i&&i.m(r,s),O(r,e,s),n=!0},p(r,s){var o;r[75].ip===((o=r[0])==null?void 0:o.ipv4)?i?(i.p(r,s),s[0]&257&&p(i,1)):(i=x8(r),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(r){n||(p(i),n=!0)},o(r){v(i),n=!1},d(r){r&&E(e),i&&i.d(r)}}}function c2e(t){var u,f;let e=(((u=t[0])==null?void 0:u.ipv4)||"—")+"",n,i,l,r,s=it(((f=t[8])==null?void 0:f.addresses)||[]),o=[];for(let c=0;cv(o[c],1,1,()=>{o[c]=null});return{c(){n=$(e),i=F();for(let c=0;c{l=null}),fe()),s[75].stale_observation?r?o[0]&256&&p(r,1):(r=sT(s),r.c(),p(r,1),r.m(n.parentNode,n)):r&&(ue(),v(r,1,1,()=>{r=null}),fe())},i(s){i||(p(l),p(r),i=!0)},o(s){v(l),v(r),i=!1},d(s){s&&(E(e),E(n)),l&&l.d(s),r&&r.d(s)}}}function rT(t){let e,n;return e=new Rt({props:{size:"sm",type:"magenta",$$slots:{default:[m2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function m2e(t){let e;return{c(){e=$("shared address")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function sT(t){let e,n;return e=new Rt({props:{size:"sm",type:"warm-gray",$$slots:{default:[g2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function g2e(t){let e;return{c(){e=$("stale observation")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function oT(t){var l,r;let e,n,i=t[75].ip===((l=t[0])==null?void 0:l.ipv6)&&((r=t[0])==null?void 0:r.ipv6)&&lT(t);return{c(){i&&i.c(),e=je()},m(s,o){i&&i.m(s,o),O(s,e,o),n=!0},p(s,o){var a,u;s[75].ip===((a=s[0])==null?void 0:a.ipv6)&&((u=s[0])!=null&&u.ipv6)?i?(i.p(s,o),o[0]&257&&p(i,1)):(i=lT(s),i.c(),p(i,1),i.m(e.parentNode,e)):i&&(ue(),v(i,1,1,()=>{i=null}),fe())},i(s){n||(p(i),n=!0)},o(s){v(i),n=!1},d(s){s&&E(e),i&&i.d(s)}}}function _2e(t){var f,c;let e,n=(((f=t[0])==null?void 0:f.ipv6)||"—")+"",i,l,r,s,o=it(((c=t[8])==null?void 0:c.addresses)||[]),a=[];for(let d=0;dv(a[d],1,1,()=>{a[d]=null});return{c(){e=P("span"),i=$(n),l=F();for(let d=0;dv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function T2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[b2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[y2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function S2e(t){let e;return{c(){e=$("mDNS names")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function E2e(t){let e;return{c(){e=$("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function O2e(t){let e,n,i=it(t[0].mdns_names),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function A2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[S2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[C2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function L2e(t){let e;return{c(){e=$("MAC addresses")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function D2e(t){let e;return{c(){e=$("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function I2e(t){let e,n,i=it(t[0].macs),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function N2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[L2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[P2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function B2e(t){let e;return{c(){e=$("Device ID")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function z2e(t){var l;let e,n=(((l=t[0])==null?void 0:l.id)||"—")+"",i;return{c(){e=P("code"),i=$(n),I(e,"class","break-value svelte-cnehxk")},m(r,s){O(r,e,s),w(e,i)},p(r,s){var o;s[0]&1&&n!==(n=(((o=r[0])==null?void 0:o.id)||"—")+"")&&Y(i,n)},d(r){r&&E(e)}}}function H2e(t){let e,n,i,l;return e=new qt({props:{$$slots:{default:[B2e]},$$scope:{ctx:t}}}),i=new qt({props:{$$slots:{default:[z2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function U2e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k;return e=new si({props:{$$slots:{default:[i2e]},$$scope:{ctx:t}}}),i=new si({props:{$$slots:{default:[s2e]},$$scope:{ctx:t}}}),r=new si({props:{$$slots:{default:[d2e]},$$scope:{ctx:t}}}),o=new si({props:{$$slots:{default:[p2e]},$$scope:{ctx:t}}}),u=new si({props:{$$slots:{default:[T2e]},$$scope:{ctx:t}}}),c=new si({props:{$$slots:{default:[A2e]},$$scope:{ctx:t}}}),h=new si({props:{$$slots:{default:[N2e]},$$scope:{ctx:t}}}),_=new si({props:{$$slots:{default:[H2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),d=F(),U(h.$$.fragment),g=F(),U(_.$$.fragment)},m(y,T){z(e,y,T),O(y,n,T),z(i,y,T),O(y,l,T),z(r,y,T),O(y,s,T),z(o,y,T),O(y,a,T),z(u,y,T),O(y,f,T),z(c,y,T),O(y,d,T),z(h,y,T),O(y,g,T),z(_,y,T),k=!0},p(y,T){const M={};T[0]&256|T[3]&4&&(M.$$scope={dirty:T,ctx:y}),e.$set(M);const A={};T[0]&1|T[3]&4&&(A.$$scope={dirty:T,ctx:y}),i.$set(A);const C={};T[0]&257|T[3]&4&&(C.$$scope={dirty:T,ctx:y}),r.$set(C);const D={};T[0]&257|T[3]&4&&(D.$$scope={dirty:T,ctx:y}),o.$set(D);const R={};T[0]&1|T[3]&4&&(R.$$scope={dirty:T,ctx:y}),u.$set(R);const N={};T[0]&1|T[3]&4&&(N.$$scope={dirty:T,ctx:y}),c.$set(N);const G={};T[0]&1|T[3]&4&&(G.$$scope={dirty:T,ctx:y}),h.$set(G);const B={};T[0]&1|T[3]&4&&(B.$$scope={dirty:T,ctx:y}),_.$set(B)},i(y){k||(p(e.$$.fragment,y),p(i.$$.fragment,y),p(r.$$.fragment,y),p(o.$$.fragment,y),p(u.$$.fragment,y),p(c.$$.fragment,y),p(h.$$.fragment,y),p(_.$$.fragment,y),k=!0)},o(y){v(e.$$.fragment,y),v(i.$$.fragment,y),v(r.$$.fragment,y),v(o.$$.fragment,y),v(u.$$.fragment,y),v(c.$$.fragment,y),v(h.$$.fragment,y),v(_.$$.fragment,y),k=!1},d(y){y&&(E(n),E(l),E(s),E(a),E(f),E(d),E(g)),H(e,y),H(i,y),H(r,y),H(o,y),H(u,y),H(c,y),H(h,y),H(_,y)}}}function F2e(t){let e,n,i,l;return e=new i5({props:{$$slots:{default:[Jbe]},$$scope:{ctx:t}}}),i=new qu({props:{$$slots:{default:[U2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&257|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function G2e(t){let e,n,i=it(t[26]),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){e=P("ul");for(let s=0;s{M=null}),fe()),(!T||C[0]&67108864)&&f!==(f=A[63].url+"")&&Y(c,f),(!T||C[0]&67108864)&&_!==(_=A[63].ip+"")&&Y(k,_)},i(A){T||(p(s.$$.fragment,A),p(M),T=!0)},o(A){v(s.$$.fragment,A),v(M),T=!1},d(A){A&&E(e),H(s),M&&M.d()}}}function hT(t){let e,n,i;return{c(){e=P("p"),n=$("Live refresh unavailable: "),i=$(t[28]),I(e,"class","refresh-error svelte-cnehxk")},m(l,r){O(l,e,r),w(e,n),w(e,i)},p(l,r){r[0]&268435456&&Y(i,l[28])},d(l){l&&E(e)}}}function q2e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k;o=new $u({props:{condensed:!0,flush:!0,$$slots:{default:[F2e]},$$scope:{ctx:t}}});const y=[W2e,V2e,G2e],T=[];function M(C,D){return C[27]&&!C[29]?0:C[26].length===0?1:2}c=M(t),d=T[c]=y[c](t);let A=t[28]&&hT(t);return{c(){e=P("section"),n=P("h3"),n.textContent="Identity & activity",i=F(),l=P("p"),l.textContent=`These observed identifiers explain how GateSentry recognizes this device. Shared address and stale observation signals can reduce - confidence in device-specific protection.`,r=F(),s=P("div"),U(o.$$.fragment),a=F(),u=P("h4"),u.textContent="Recent activity (decision history)",f=F(),d.c(),h=F(),A&&A.c(),g=F(),_=P("p"),_.innerHTML=`View full decision history`,I(n,"id","device-identity-title"),I(n,"class","svelte-cnehxk"),I(l,"class","section-note svelte-cnehxk"),I(s,"class","identity-list svelte-cnehxk"),I(u,"class","svelte-cnehxk"),I(_,"class","section-note svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-identity-title")},m(C,D){O(C,e,D),w(e,n),w(e,i),w(e,l),w(e,r),w(e,s),z(o,s,null),w(e,a),w(e,u),w(e,f),T[c].m(e,null),w(e,h),A&&A.m(e,null),w(e,g),w(e,_),k=!0},p(C,D){const R={};D[0]&257|D[3]&4&&(R.$$scope={dirty:D,ctx:C}),o.$set(R);let N=c;c=M(C),c===N?T[c].p(C,D):(ue(),v(T[N],1,1,()=>{T[N]=null}),fe(),d=T[c],d?d.p(C,D):(d=T[c]=y[c](C),d.c()),p(d,1),d.m(e,h)),C[28]?A?A.p(C,D):(A=hT(C),A.c(),A.m(e,g)):A&&(A.d(1),A=null)},i(C){k||(p(o.$$.fragment,C),p(d),k=!0)},o(C){v(o.$$.fragment,C),v(d),k=!1},d(C){C&&E(e),H(o),T[c].d(),A&&A.d()}}}function X2e(t){let e,n,i,l,r,s,o,a;return e=new Yl({props:{$$slots:{default:[Cbe]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[Nbe]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[Xbe]},$$scope:{ctx:t}}}),o=new Yl({props:{$$slots:{default:[Z2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f[0]&29|f[3]&4&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65280|f[3]&4&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const h={};f[0]&33488896|f[3]&4&&(h.$$scope={dirty:f,ctx:u}),r.$set(h);const g={};f[0]&1006633217|f[3]&4&&(g.$$scope={dirty:f,ctx:u}),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function K2e(t){let e,n,i,l,r=t[6]&&R8(t);function s(a){t[47](a)}let o={type:"container",autoWidth:!0,"aria-label":"Device details",$$slots:{content:[X2e],default:[ube]},$$scope:{ctx:t}};return t[7]!==void 0&&(o.selected=t[7]),n=new mg({props:o}),xe.push(()=>At(n,"selected",s)),{c(){r&&r.c(),e=F(),U(n.$$.fragment)},m(a,u){r&&r.m(a,u),O(a,e,u),z(n,a,u),l=!0},p(a,u){a[6]?r?(r.p(a,u),u[0]&64&&p(r,1)):(r=R8(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe());const f={};u[0]&1040187165|u[3]&4&&(f.$$scope={dirty:u,ctx:a}),!i&&u[0]&128&&(i=!0,f.selected=a[7],Ct(()=>i=!1)),n.$set(f)},i(a){l||(p(r),p(n.$$.fragment,a),l=!0)},o(a){v(r),v(n.$$.fragment,a),l=!1},d(a){a&&E(e),r&&r.d(a),H(n,a)}}}function J2e(t){var o;let e,n,i,l,r,s;return e=new Od({props:{title:"Device details",label:((o=t[0])==null?void 0:o.display_name)||"Unknown device"}}),i=new Md({props:{hasForm:!0,$$slots:{default:[K2e]},$$scope:{ctx:t}}}),r=new Cd({props:{primaryButtonText:t[5]?"Saving…":"Save labels",primaryButtonDisabled:t[5],secondaryButtonText:"Close"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(a,u){z(e,a,u),O(a,n,u),z(i,a,u),O(a,l,u),z(r,a,u),s=!0},p(a,u){var h;const f={};u[0]&1&&(f.label=((h=a[0])==null?void 0:h.display_name)||"Unknown device"),e.$set(f);const c={};u[0]&1040187357|u[3]&4&&(c.$$scope={dirty:u,ctx:a}),i.$set(c);const d={};u[0]&32&&(d.primaryButtonText=a[5]?"Saving…":"Save labels"),u[0]&32&&(d.primaryButtonDisabled=a[5]),r.$set(d)},i(a){s||(p(e.$$.fragment,a),p(i.$$.fragment,a),p(r.$$.fragment,a),s=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),v(r.$$.fragment,a),s=!1},d(a){a&&(E(n),E(l)),H(e,a),H(i,a),H(r,a)}}}function Q2e(t){let e,n,i,l=(t[25]?Ms(t[25]):"this peer")+"",r,s;return{c(){e=P("p"),n=j("Unlink "),i=P("strong"),r=j(l),s=j(` - from this device? The peer will remain available to link again.`)},m(o,a){O(o,e,a),w(e,n),w(e,i),w(i,r),w(e,s)},p(o,a){a[0]&33554432&&l!==(l=(o[25]?Ms(o[25]):"this peer")+"")&&Y(r,l)},d(o){o&&E(e)}}}function x2e(t){let e,n,i,l;return e=new Ed({props:{open:t[1],size:"lg",$$slots:{default:[J2e]},$$scope:{ctx:t}}}),e.$on("close",t[36]),e.$on("submit",t[34]),i=new Zu({props:{open:!!t[25],title:"Unlink Tailscale peer?",label:"Confirm identity change",confirmText:"Unlink peer",danger:!0,busy:t[22],$$slots:{default:[Q2e]},$$scope:{ctx:t}}}),i.$on("close",t[48]),i.$on("submit",t[33]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&2&&(o.open=r[1]),s[0]&1040187389|s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&33554432&&(a.open=!!r[25]),s[0]&4194304&&(a.busy=r[22]),s[0]&33554432|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function eve(){return localStorage.getItem("jwt")||""}function bs(t){const e={Authorization:"Bearer "+eve()};return t&&(e["Content-Type"]="application/json"),e}async function vs(t){const e=await t.text();try{const n=JSON.parse(e);if(n!=null&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}function mT(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function gT(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function Ms(t){return t.name||t.dns_name||t.node_id}function Cs(t){return t?new Date(t).toLocaleString():"—"}function _T(t){return t?new Date(t*1e3).toLocaleString():"—"}function pT(t){return t==="high"?"green":t==="medium"?"teal":t==="low"?"magenta":"red"}function bT(t){return t==="high"?"High confidence":t==="medium"?"Medium confidence":t==="low"?"Low confidence":"No protection signal"}function vT(t){var n,i,l;if(!t)return"";const e=[];return(n=t.blocked_categories)!=null&&n.length&&e.push(`${t.blocked_categories.length} blocked categor${t.blocked_categories.length===1?"y":"ies"}`),(i=t.blocked_domains)!=null&&i.length&&e.push(`${t.blocked_domains.length} blocked domain${t.blocked_domains.length===1?"":"s"}`),(l=t.allowed_domains)!=null&&l.length&&e.push(`${t.allowed_domains.length} allowed domain${t.allowed_domains.length===1?"":"s"}`),t.rule_count&&e.push(`${t.rule_count} rule${t.rule_count===1?"":"s"}`),t.safe_search&&e.push("safe search"),e.length?e.join(", "):"blocks nothing of its own"}const kT=t=>t.id!=="default";function tve(t,e,n){const i=Un()+"/api/devices",l=Un()+"/api/policy",r=Un()+"/api/tailscale",s=on();let{device:o}=e,{open:a=!1}=e,u=(o==null?void 0:o.manual_name)||"",f=(o==null?void 0:o.owner)||"",c=(o==null?void 0:o.category)||"",d=!1,h="",g=0,_=null,k=!1,y="",T=[],M="",A=!1,C="",D=!1,R=[],N=null,G=(o==null?void 0:o.tailscale_nodes)||[],B=[],$="",q=!1,V=!1,K=!1,x="",ie="",X=null,ce=[],ae=!1,ee="",he=!1,ne=null,re=null,oe=!1,Re=0,qe=!1,Ce="",Ze="";async function be(){var pe;n(9,k=!0),n(10,y="");try{const et=await fetch(i+"/"+o.id+"/policy",{headers:bs(!1)});if(!et.ok)throw new Error(await vs(et));n(8,_=await et.json()),n(12,M=((pe=_==null?void 0:_.assignment)==null?void 0:pe.id)||"")}catch(et){n(10,y=et instanceof Error?et.message:"Policy could not be loaded")}finally{n(9,k=!1)}}async function Ae(){try{const pe=await fetch(l+"/groups",{headers:bs(!1)});if(!pe.ok)throw new Error(await vs(pe));const et=await pe.json();n(11,T=et.groups||[])}catch(pe){n(10,y=y||(pe instanceof Error?pe.message:"Policies could not be loaded"))}}async function ve(){n(20,q=!0),n(23,x="");try{const pe=await fetch(r+"/peers",{headers:bs(!1)});if(!pe.ok)throw new Error(await vs(pe));const et=await pe.json();n(16,N=et),n(37,R=et.state==="connected"?et.peers||[]:[]),et.state==="connected"&&n(17,G=R.filter(gt=>gt.mapped_device_id===o.id)),n(21,V=!0)}catch(pe){n(16,N=null),n(37,R=[]),n(23,x=pe instanceof Error?pe.message:"Tailscale peers failed")}finally{n(20,q=!1)}}async function me(){if(!(!$||K)){n(22,K=!0),n(23,x=""),n(24,ie="");try{const pe=await fetch(i+"/"+o.id+"/tailscale",{method:"PUT",headers:bs(!0),body:JSON.stringify({node_id:$})});if(!pe.ok)throw new Error(await vs(pe));n(19,$=""),n(24,ie="Tailscale peer linked."),await ve(),s("tailscaleChanged")}catch(pe){n(23,x=pe instanceof Error?pe.message:"Peer could not be linked")}finally{n(22,K=!1)}}}function lt(pe){n(25,X=pe)}async function De(){if(!X||K)return;const pe=X;n(22,K=!0),n(23,x=""),n(24,ie="");try{const et=await fetch(i+"/"+o.id+"/tailscale/"+encodeURIComponent(pe.node_id),{method:"DELETE",headers:bs(!1)});if(!et.ok)throw new Error(await vs(et));n(17,G=G.filter(gt=>gt.node_id!==pe.node_id)),n(25,X=null),n(24,ie="Tailscale peer unlinked."),await ve(),s("tailscaleChanged")}catch(et){n(23,x=et instanceof Error?et.message:"Peer could not be unlinked")}finally{n(22,K=!1)}}function vt(pe=!1){Re+=1,ne&&clearTimeout(ne),ne=null,re==null||re.abort(),re=null,oe=!1,pe&&n(39,Ze="")}async function dt(){const pe=Ze,et=Re;if(!(oe||qe||!a||!pe||pe!==(o==null?void 0:o.id))){oe=!0,n(27,ae=!he),n(28,ee=""),re=new AbortController;try{const gt=await fetch(i+"/"+pe+"/activity?since=86400&limit=100",{headers:bs(!1),signal:re.signal});if(!gt.ok)throw new Error(await vs(gt));const Kt=await gt.json();!qe&&a&&et===Re&&pe===Ze&&(n(26,ce=Kt.items||[]),n(29,he=!0))}catch(gt){!qe&&a&&et===Re&&pe===Ze&&(gt==null?void 0:gt.name)!=="AbortError"&&n(28,ee=gt instanceof Error?gt.message:"Activity could not be refreshed")}finally{et===Re&&(oe=!1,n(27,ae=!1),re=null),!qe&&a&&et===Re&&pe===Ze&&(ne=setTimeout(dt,5e3))}}}function ot(pe){vt(),n(39,Ze=pe),n(26,ce=[]),n(29,he=!1),n(28,ee=""),dt()}async function ht(){if(!d){n(5,d=!0),n(6,h="");try{const pe=await fetch(i+"/"+o.id+"/name",{method:"POST",headers:bs(!0),body:JSON.stringify({name:u,owner:f,category:c})});if(!pe.ok)throw new Error(await vs(pe));s("saved")}catch(pe){n(6,h=pe instanceof Error?pe.message:"Labels could not be saved")}finally{n(5,d=!1)}}}async function Bt(){if(!A){n(13,A=!0),n(14,C=""),n(15,D=!1);try{const pe=await fetch(i+"/"+o.id+"/assignment",{method:"PUT",headers:bs(!0),body:JSON.stringify({group_id:M})});if(!pe.ok)throw new Error(await vs(pe));await be(),n(15,D=!0)}catch(pe){n(14,C=pe instanceof Error?pe.message:"Policy assignment could not be saved")}finally{n(13,A=!1)}}}Ls(()=>{qe=!0,vt(!0)});function Ot(){vt(!0),s("close")}const Zt=()=>n(6,h="");function Ve(pe){u=pe,n(2,u),n(1,a),n(0,o),n(38,Ce)}function Nt(pe){f=pe,n(3,f),n(1,a),n(0,o),n(38,Ce)}function Tt(pe){c=pe,n(4,c),n(1,a),n(0,o),n(38,Ce)}function Gt(pe){M=pe,n(12,M)}const fn=pe=>lt(pe);function an(pe){$=pe,n(19,$)}function Qt(pe){g=pe,n(7,g)}const Ne=()=>{K||n(25,X=null)};return t.$$set=pe=>{"device"in pe&&n(0,o=pe.device),"open"in pe&&n(1,a=pe.open)},t.$$.update=()=>{t.$$.dirty[1]&64&&n(18,B=R.filter(pe=>!pe.mapped_device_id)),t.$$.dirty[0]&3|t.$$.dirty[1]&128&&a&&o!=null&&o.id&&Ce!==o.id&&(n(38,Ce=o.id),n(2,u=(o==null?void 0:o.manual_name)||""),n(3,f=(o==null?void 0:o.owner)||""),n(4,c=(o==null?void 0:o.category)||""),n(17,G=(o==null?void 0:o.tailscale_nodes)||[]),be(),Ae(),ve(),ot(o.id)),t.$$.dirty[0]&2|t.$$.dirty[1]&256&&!a&&Ze&&vt(!0)},[o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,N,G,B,$,q,V,K,x,ie,X,ce,ae,ee,he,ve,me,lt,De,ht,Bt,Ot,R,Ce,Ze,Zt,Ve,Nt,Tt,Gt,fn,an,Qt,Ne]}class nve extends Oe{constructor(e){super(),Ee(this,e,tve,x2e,Se,{device:0,open:1},null,[-1,-1,-1,-1])}}const{Boolean:ive}=Sd;function wT(t,e,n){const i=t.slice();return i[30]=e[n],i}function yT(t){let e,n;return e=new nn({props:{kind:"error",title:"Device action failed",subtitle:t[3]}}),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function TT(t){let e,n;return e=new nn({props:{kind:"success",title:"Device inventory updated",subtitle:t[4]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lve(t){let e,n,i,l,r=t[0].length+"",s,o,a=t[0].length!==1?"s":"",u,f,c=t[0].filter(AT).length+"",d,h,g;return n=new ml({props:{sortable:!0,size:"compact",headers:t[9],rows:t[0],$$slots:{cell:[yve,({row:_,cell:k})=>({28:_,29:k}),({row:_,cell:k})=>[(_?268435456:0)|(k?536870912:0)]],default:[fve]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),i=F(),l=P("p"),s=j(r),o=j(" device"),u=j(a),f=j(" discovered · "),d=j(c),h=j(" online"),I(e,"class","inventory-table svelte-qaftwy"),I(e,"aria-label","Discovered device inventory"),I(l,"class","device-summary svelte-qaftwy"),I(l,"aria-live","polite")},m(_,k){O(_,e,k),z(n,e,null),O(_,i,k),O(_,l,k),w(l,s),w(l,o),w(l,u),w(l,f),w(l,d),w(l,h),g=!0},p(_,k){const y={};k[0]&1&&(y.rows=_[0]),k[0]&805306368|k[1]&4&&(y.$$scope={dirty:k,ctx:_}),n.$set(y),(!g||k[0]&1)&&r!==(r=_[0].length+"")&&Y(s,r),(!g||k[0]&1)&&a!==(a=_[0].length!==1?"s":"")&&Y(u,a),(!g||k[0]&1)&&c!==(c=_[0].filter(AT).length+"")&&Y(d,c)},i(_){g||(p(n.$$.fragment,_),g=!0)},o(_){v(n.$$.fragment,_),g=!1},d(_){_&&(E(e),E(i),E(l)),H(n)}}}function rve(t){let e,n;return e=new hi({props:{state:"empty",title:"No devices discovered yet",message:"GateSentry will list devices after it observes DNS or proxy traffic."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sve(t){let e,n;return e=new hi({props:{state:"error",title:"Unable to load network devices",message:t[3],retryLabel:"Retry",onRetry:t[10]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.message=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ove(t){let e,n;return e=new hi({props:{state:"loading",message:"Loading network devices…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ave(t){let e,n;return e=new ZT({props:{persistent:!0,shouldFilterRows:!0,placeholder:"Search devices…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function uve(t){let e,n;return e=new hg({props:{$$slots:{default:[ave]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function fve(t){let e,n;return e=new dg({props:{$$slots:{default:[uve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function cve(t){let e=(t[29].value||"—")+"",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&536870912&&e!==(e=(i[29].value||"—")+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function dve(t){let e,n;return e=new Wu({props:{flipped:!0,"aria-label":"Device actions",$$slots:{default:[_ve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&268435456|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function hve(t){let e,n,i,l;const r=[bve,pve],s=[];function o(a,u){var f;return(f=a[28].tailscale_nodes)!=null&&f.length?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function mve(t){let e,n=t[29].value+"",i,l,r,s,o,a,u;function f(){return t[18](t[28])}let c=!t[28].manual_name&&t[28].source!=="manual"&&ET(t),d=(t[28].owner||t[28].category)&&OT(t);return{c(){e=P("button"),i=j(n),l=F(),c&&c.c(),r=F(),d&&d.c(),s=je(),I(e,"class","device-name-link svelte-qaftwy")},m(h,g){O(h,e,g),w(e,i),O(h,l,g),c&&c.m(h,g),O(h,r,g),d&&d.m(h,g),O(h,s,g),o=!0,a||(u=J(e,"click",f),a=!0)},p(h,g){t=h,(!o||g[0]&536870912)&&n!==(n=t[29].value+"")&&Y(i,n),!t[28].manual_name&&t[28].source!=="manual"?c?g[0]&268435456&&p(c,1):(c=ET(t),c.c(),p(c,1),c.m(r.parentNode,r)):c&&(ue(),v(c,1,1,()=>{c=null}),fe()),t[28].owner||t[28].category?d?d.p(t,g):(d=OT(t),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},i(h){o||(p(c),o=!0)},o(h){v(c),o=!1},d(h){h&&(E(e),E(l),E(r),E(s)),c&&c.d(h),d&&d.d(h),a=!1,u()}}}function gve(t){let e,n;return e=new Rt({props:{size:"sm",type:t[28].online?"green":"warm-gray",$$slots:{default:[wve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&268435456&&(r.type=i[28].online?"green":"warm-gray"),l[0]&268435456|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function _ve(t){let e,n,i,l,r,s;function o(){return t[19](t[28])}e=new Al({props:{text:"View details"}}),e.$on("click",o);function a(){return t[20](t[28])}i=new Al({props:{text:"Manage Tailscale links"}}),i.$on("click",a);function u(){return t[21](t[28])}return r=new Al({props:{danger:!0,text:"Remove"}}),r.$on("click",u),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,l,c),z(r,f,c),s=!0},p(f,c){t=f},i(f){s||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(r.$$.fragment,f),s=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(r.$$.fragment,f),s=!1},d(f){f&&(E(n),E(l)),H(e,f),H(i,f),H(r,f)}}}function pve(t){let e;return{c(){e=j("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function bve(t){let e,n,i=it(t[28].tailscale_nodes),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){e=P("div");for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function Tve(t){let e,n,i,l;const r=[ove,sve,rve,lve],s=[];function o(a,u){return a[1]&&!a[2]?0:a[3]&&a[0].length===0?1:a[0].length===0?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function Sve(t){let e=t[1]?"Refreshing…":"Refresh",n;return{c(){n=j(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2&&e!==(e=i[1]?"Refreshing…":"Refresh")&&Y(n,e)},d(i){i&&E(n)}}}function Eve(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[Sve]},$$scope:{ctx:t}}}),e.$on("click",t[10]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2&&(r.disabled=i[1]),l[0]&2|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MT(t){let e,n;return e=new nve({props:{device:t[5],open:t[6]}}),e.$on("close",t[12]),e.$on("saved",t[13]),e.$on("tailscaleChanged",t[10]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&32&&(r.device=i[5]),l[0]&64&&(r.open=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Ove(t){var o;let e,n,i,l=(((o=t[7])==null?void 0:o.display_name)||"this device")+"",r,s;return{c(){e=P("p"),n=j("Remove "),i=P("strong"),r=j(l),s=j(` from - the inventory? GateSentry may discover it again when it next sends traffic.`)},m(a,u){O(a,e,u),w(e,n),w(e,i),w(i,r),w(e,s)},p(a,u){var f;u[0]&128&&l!==(l=(((f=a[7])==null?void 0:f.display_name)||"this device")+"")&&Y(r,l)},d(a){a&&E(e)}}}function Mve(t){let e,n,i,l,r,s,o,a=t[3]&&t[0].length>0&&yT(t),u=t[4]&&TT(t);i=new jr({props:{title:"Device inventory",description:"Devices discovered on your network, including peers you explicitly linked from Tailscale.",$$slots:{actions:[Eve],default:[Tve]},$$scope:{ctx:t}}});let f=t[6]&&t[5]&&MT(t);return s=new Zu({props:{open:!!t[7],title:"Remove device?",label:"Confirm inventory change",confirmText:"Remove device",danger:!0,busy:t[8],$$slots:{default:[Ove]},$$scope:{ctx:t}}}),s.$on("close",t[22]),s.$on("submit",t[15]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),U(i.$$.fragment),l=F(),f&&f.c(),r=F(),U(s.$$.fragment)},m(c,d){a&&a.m(c,d),O(c,e,d),u&&u.m(c,d),O(c,n,d),z(i,c,d),O(c,l,d),f&&f.m(c,d),O(c,r,d),z(s,c,d),o=!0},p(c,d){c[3]&&c[0].length>0?a?(a.p(c,d),d[0]&9&&p(a,1)):(a=yT(c),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),c[4]?u?(u.p(c,d),d[0]&16&&p(u,1)):(u=TT(c),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());const h={};d[0]&15|d[1]&4&&(h.$$scope={dirty:d,ctx:c}),i.$set(h),c[6]&&c[5]?f?(f.p(c,d),d[0]&96&&p(f,1)):(f=MT(c),f.c(),p(f,1),f.m(r.parentNode,r)):f&&(ue(),v(f,1,1,()=>{f=null}),fe());const g={};d[0]&128&&(g.open=!!c[7]),d[0]&256&&(g.busy=c[8]),d[0]&128|d[1]&4&&(g.$$scope={dirty:d,ctx:c}),s.$set(g)},i(c){o||(p(a),p(u),p(i.$$.fragment,c),p(f),p(s.$$.fragment,c),o=!0)},o(c){v(a),v(u),v(i.$$.fragment,c),v(f),v(s.$$.fragment,c),o=!1},d(c){c&&(E(e),E(n),E(l),E(r)),a&&a.d(c),u&&u.d(c),H(i,c),f&&f.d(c),H(s,c)}}}function CT(){return localStorage.getItem("jwt")||""}function Cve(t){var e;return{...t,id:t.id,status:t.online?"online":"offline",display_name:t.manual_name||t.display_name||t.dns_name||"Unknown",address_display:t.ipv4||t.ipv6||"—",tailscale_display:(e=t.tailscale_nodes)!=null&&e.length?t.tailscale_nodes.map(n=>n.name||n.dns_name).join(", "):"—",last_seen_display:Ave(t.last_seen)}}function Ave(t){if(!t)return"Never";const e=new Date(t),n=Math.floor((Date.now()-e.getTime())/1e3);if(n<60)return"Just now";const i=Math.floor(n/60);if(i<60)return`${i}m ago`;const l=Math.floor(i/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}const AT=t=>t.online;function Lve(t,e,n){const i=Un()+"/api/devices";let l=[],r=!1,s=!1,o="",a="",u=null,f=!1,c=null,d=!1,h,g=null;const _=[{key:"status",value:"Status"},{key:"display_name",value:"Device"},{key:"address_display",value:"Address"},{key:"tailscale_display",value:"Tailscale"},{key:"last_seen_display",value:"Last seen"},{key:"actions",value:""}];function k(x){n(4,a=x),g&&clearTimeout(g),g=setTimeout(()=>n(4,a=""),3e3)}async function y(){n(1,r=!0),n(3,o="");try{const x=CT();if(!x)throw new Error("Please login first to view devices");const ie=await fetch(i,{headers:{Authorization:`Bearer ${x}`}});if(ie.status===401)throw new Error("Authentication failed. Please login again");if(ie.status===503){n(0,l=[]);return}if(!ie.ok){const ce=await ie.text();throw new Error(`Failed to load devices: ${ie.status} - ${ce}`)}const X=await ie.json();n(0,l=(X.devices||[]).map(Cve))}catch(x){n(3,o=x instanceof Error?x.message:"Devices could not be loaded")}finally{n(1,r=!1),n(2,s=!0)}}function T(x){n(5,u=x),n(6,f=!0)}function M(x){T(x)}function A(){n(6,f=!1),n(5,u=null)}async function C(){A(),k("Device updated successfully"),await y()}function D(x){n(7,c=x)}async function R(){if(!c||d)return;const x=c;n(8,d=!0),n(3,o="");try{const ie=await fetch(`${i}/${x.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${CT()}`}});if(!ie.ok){const X=await ie.text();throw new Error(`Failed to remove device: ${X}`)}n(7,c=null),k(`"${x.display_name}" removed`),await y()}catch(ie){n(3,o=ie instanceof Error?ie.message:"Device could not be removed")}finally{n(8,d=!1)}}return sn(()=>{y(),h=setInterval(y,3e4)}),Ls(()=>{h&&clearInterval(h),g&&clearTimeout(g)}),[l,r,s,o,a,u,f,c,d,_,y,M,A,C,D,R,()=>n(3,o=""),()=>n(4,a=""),x=>M(x),x=>M(x),x=>M(x),x=>D(x),()=>{d||n(7,c=null)}]}class Dve extends Oe{constructor(e){super(),Ee(this,e,Lve,Mve,Se,{},null,[-1,-1])}}function Ive(t){let e,n;return e=new Dve({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Rve(t){let e;return{c(){e=j("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Pve(t){let e;return{c(){e=j("Devices")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Nve(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[Rve]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[Pve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Bve(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[Nve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function zve(t){let e,n;return e=new Nl({props:{title:"Network devices",description:"Review devices GateSentry has observed, assign protection, and manage explicit identity links.",$$slots:{breadcrumb:[Bve],default:[Ive]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class Hve extends Oe{constructor(e){super(),Ee(this,e,null,zve,Se,{})}}function Uve(t){let e;return{c(){e=j("Return to overview")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Fve(t){let e,n;return e=new bt({props:{$$slots:{default:[Uve]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Gve(t){let e,n;return e=new hi({props:{state:"empty",title:"We could not find that page",message:"Return to the overview or choose another destination from the navigation.",$$slots:{default:[Fve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Vve(t){let e,n;return e=new Nl({props:{title:"Page not found",description:"The requested GateSentry administration page does not exist.",narrow:!0,$$slots:{default:[Gve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Wve(t){return[()=>Vi("/")]}class jve extends Oe{constructor(e){super(),Ee(this,e,Wve,Vve,Se,{})}}const{window:QO}=Sd;function $ve(t){let e,n,i,l,r,s,o,a,u,f,c,d;function h(T){t[12](T)}function g(T){t[13](T)}let _={pathname:t[5]};t[1]!==void 0&&(_.isSideNavOpen=t[1]),t[4]!==void 0&&(_.userProfilePanelOpen=t[4]),n=new jY({props:_}),xe.push(()=>At(n,"isSideNavOpen",h)),xe.push(()=>At(n,"userProfilePanelOpen",g));function k(T){t[14](T)}let y={rail:!0,expansionBreakpoint:xO,ariaLabel:"Primary navigation","aria-hidden":!t[6],inert:!t[6],$$slots:{default:[Kve]},$$scope:{ctx:t}};return t[1]!==void 0&&(y.isOpen=t[1]),s=new dW({props:y}),xe.push(()=>At(s,"isOpen",k)),u=new HW({props:{id:"main-content",$$slots:{default:[tke]},$$scope:{ctx:t}}}),c=new eZ({}),{c(){e=P("div"),U(n.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),I(e,"class","app-frame")},m(T,M){O(T,e,M),z(n,e,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),w(e,f),z(c,e,null),d=!0},p(T,M){const A={};M&32&&(A.pathname=T[5]),!i&&M&2&&(i=!0,A.isSideNavOpen=T[1],Ct(()=>i=!1)),!l&&M&16&&(l=!0,A.userProfilePanelOpen=T[4],Ct(()=>l=!1)),n.$set(A);const C={};M&64&&(C["aria-hidden"]=!T[6]),M&64&&(C.inert=!T[6]),M&524320&&(C.$$scope={dirty:M,ctx:T}),!o&&M&2&&(o=!0,C.isOpen=T[1],Ct(()=>o=!1)),s.$set(C);const D={};M&524288&&(D.$$scope={dirty:M,ctx:T}),u.$set(D)},i(T){d||(p(n.$$.fragment,T),p(s.$$.fragment,T),p(u.$$.fragment,T),p(c.$$.fragment,T),d=!0)},o(T){v(n.$$.fragment,T),v(s.$$.fragment,T),v(u.$$.fragment,T),v(c.$$.fragment,T),d=!1},d(T){T&&E(e),H(n),H(s),H(u),H(c)}}}function qve(t){let e,n;return e=new yi({props:{path:"/login",$$slots:{default:[nke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&524296&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Yve(t){let e,n;return e=new yi({props:{path:"/setup",component:AZ}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Zve(t){let e,n;return e=new Nd({props:{title:"GateSentry",description:"The administration interface is unavailable.",$$slots:{default:[ike]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Xve(t){let e,n;return e=new Nd({props:{title:"GateSentry",description:"Checking this installation…",$$slots:{default:[lke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Kve(t){let e,n;return e=new JY({props:{pathname:t[5],onNavigate:t[7]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.pathname=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Jve(t){let e,n;return e=new Bd({props:{type:"blockedkeywords"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Qve(t){let e,n;return e=new Bd({props:{type:"blockedfiletypes"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xve(t){let e,n;return e=new Bd({props:{type:"excludeurls"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function eke(t){let e,n;return e=new Bd({props:{type:"excludehosts"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tke(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G,B,$,q,V,K;return e=new yi({props:{path:"/dns",component:fx}}),i=new yi({props:{path:"/logs",component:aX}}),r=new yi({props:{path:"/settings",component:QK}}),o=new yi({props:{path:"/blockedkeywords",$$slots:{default:[Jve]},$$scope:{ctx:t}}}),u=new yi({props:{path:"/blockedfiletypes",$$slots:{default:[Qve]},$$scope:{ctx:t}}}),c=new yi({props:{path:"/excludeurls",$$slots:{default:[xve]},$$scope:{ctx:t}}}),h=new yi({props:{path:"/excludehosts",$$slots:{default:[eke]},$$scope:{ctx:t}}}),_=new yi({props:{path:"/services",component:sJ}}),y=new yi({props:{path:"/rules",component:abe}}),M=new yi({props:{path:"/devices",component:Hve}}),C=new yi({props:{path:"/stats",component:__e}}),R=new yi({props:{path:"/ai",component:F_e}}),G=new yi({props:{path:"/users",component:m0e}}),$=new yi({props:{path:"/",component:JJ}}),V=new yi({props:{component:jve}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),d=F(),U(h.$$.fragment),g=F(),U(_.$$.fragment),k=F(),U(y.$$.fragment),T=F(),U(M.$$.fragment),A=F(),U(C.$$.fragment),D=F(),U(R.$$.fragment),N=F(),U(G.$$.fragment),B=F(),U($.$$.fragment),q=F(),U(V.$$.fragment)},m(x,ie){z(e,x,ie),O(x,n,ie),z(i,x,ie),O(x,l,ie),z(r,x,ie),O(x,s,ie),z(o,x,ie),O(x,a,ie),z(u,x,ie),O(x,f,ie),z(c,x,ie),O(x,d,ie),z(h,x,ie),O(x,g,ie),z(_,x,ie),O(x,k,ie),z(y,x,ie),O(x,T,ie),z(M,x,ie),O(x,A,ie),z(C,x,ie),O(x,D,ie),z(R,x,ie),O(x,N,ie),z(G,x,ie),O(x,B,ie),z($,x,ie),O(x,q,ie),z(V,x,ie),K=!0},p(x,ie){const X={};ie&524288&&(X.$$scope={dirty:ie,ctx:x}),o.$set(X);const ce={};ie&524288&&(ce.$$scope={dirty:ie,ctx:x}),u.$set(ce);const ae={};ie&524288&&(ae.$$scope={dirty:ie,ctx:x}),c.$set(ae);const ee={};ie&524288&&(ee.$$scope={dirty:ie,ctx:x}),h.$set(ee)},i(x){K||(p(e.$$.fragment,x),p(i.$$.fragment,x),p(r.$$.fragment,x),p(o.$$.fragment,x),p(u.$$.fragment,x),p(c.$$.fragment,x),p(h.$$.fragment,x),p(_.$$.fragment,x),p(y.$$.fragment,x),p(M.$$.fragment,x),p(C.$$.fragment,x),p(R.$$.fragment,x),p(G.$$.fragment,x),p($.$$.fragment,x),p(V.$$.fragment,x),K=!0)},o(x){v(e.$$.fragment,x),v(i.$$.fragment,x),v(r.$$.fragment,x),v(o.$$.fragment,x),v(u.$$.fragment,x),v(c.$$.fragment,x),v(h.$$.fragment,x),v(_.$$.fragment,x),v(y.$$.fragment,x),v(M.$$.fragment,x),v(C.$$.fragment,x),v(R.$$.fragment,x),v(G.$$.fragment,x),v($.$$.fragment,x),v(V.$$.fragment,x),K=!1},d(x){x&&(E(n),E(l),E(s),E(a),E(f),E(d),E(g),E(k),E(T),E(A),E(D),E(N),E(B),E(q)),H(e,x),H(i,x),H(r,x),H(o,x),H(u,x),H(c,x),H(h,x),H(_,x),H(y,x),H(M,x),H(C,x),H(R,x),H(G,x),H($,x),H(V,x)}}}function nke(t){let e,n;return e=new wZ({}),e.$on("authenticated",t[11]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ike(t){let e,n;return e=new hi({props:{state:"error",title:"Unable to read GateSentry setup status.",message:"Check that the GateSentry service is running, then try again.",retryLabel:"Retry status check",onRetry:t[8]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lke(t){let e,n;return e=new hi({props:{state:"loading",message:"Checking setup and session status"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rke(t){let e,n,i,l;const r=[Xve,Zve,Yve,qve,$ve],s=[];function o(a,u){return a[3]==="checking"?0:a[3]==="error"?1:a[3]==="setup"?2:a[3]==="login"?3:4}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function ske(t){let e,n,i,l;return Es(t[10]),e=new gj({props:{url:t[0],basepath:Un(),$$slots:{default:[rke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,s){z(e,r,s),n=!0,i||(l=J(QO,"resize",t[10]),i=!0)},p(r,[s]){const o={};s&1&&(o.url=r[0]),s&524410&&(o.$$scope={dirty:s,ctx:r}),e.$set(o)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){v(e.$$.fragment,r),n=!1},d(r){H(e,r),i=!1,l()}}}const xO=1056;function oke(t,e,n){let i,l,r;ct(t,Ln,D=>n(15,r=D));let{url:s=""}=e;D$("en",()=>WD(()=>import("./en-1d19a117.js"),[]));const o=H$({initialLocale:"en",fallbackLocale:"en"});let a="checking",u=!1,f=!1,c="/",d=0;const h=()=>{const D=Un(),R=typeof window>"u"?s:window.location.pathname;return D&&(R===D||R.startsWith(D+"/"))?R.slice(D.length)||"/":R||"/"},g=()=>{n(5,c=h()),n(1,u=!1)},_=()=>{n(1,u=!1),i&&typeof window<"u"&&window.requestAnimationFrame(()=>{var D;(D=document.querySelector(".bx--header__menu-toggle"))==null||D.focus()})};async function k(){n(3,a="checking");try{const D=await fetch(Un()+"/api/setup/status");if(!D.ok)throw new Error("setup status failed");if(!(await D.json()).complete){Ln.logout(),n(3,a="setup"),h()!=="/setup"&&Vi("/setup",{replace:!0});return}await r.api.verifyToken()?(Ln.refresh(),n(3,a="authenticated"),(h()==="/login"||h()==="/setup")&&Vi("/",{replace:!0})):(n(3,a="login"),h()!=="/login"&&Vi("/login",{replace:!0}))}catch{n(3,a="error")}}sn(()=>(g(),window.addEventListener("popstate",g),()=>window.removeEventListener("popstate",g))),Promise.resolve(o).then(k).catch(()=>n(3,a="error"));function y(){n(2,d=QO.innerWidth)}const T=()=>n(3,a="authenticated");function M(D){u=D,n(1,u)}function A(D){f=D,n(4,f)}function C(D){u=D,n(1,u)}return t.$$set=D=>{"url"in D&&n(0,s=D.url)},t.$$.update=()=>{t.$$.dirty&4&&n(9,i=dView full decision history`,I(n,"id","device-identity-title"),I(n,"class","svelte-cnehxk"),I(l,"class","section-note svelte-cnehxk"),I(s,"class","identity-list svelte-cnehxk"),I(u,"class","svelte-cnehxk"),I(_,"class","section-note svelte-cnehxk"),I(e,"class","tab-section svelte-cnehxk"),I(e,"aria-labelledby","device-identity-title")},m(C,D){O(C,e,D),w(e,n),w(e,i),w(e,l),w(e,r),w(e,s),z(o,s,null),w(e,a),w(e,u),w(e,f),T[c].m(e,null),w(e,h),A&&A.m(e,null),w(e,g),w(e,_),k=!0},p(C,D){const R={};D[0]&257|D[3]&4&&(R.$$scope={dirty:D,ctx:C}),o.$set(R);let N=c;c=M(C),c===N?T[c].p(C,D):(ue(),v(T[N],1,1,()=>{T[N]=null}),fe(),d=T[c],d?d.p(C,D):(d=T[c]=y[c](C),d.c()),p(d,1),d.m(e,h)),C[28]?A?A.p(C,D):(A=hT(C),A.c(),A.m(e,g)):A&&(A.d(1),A=null)},i(C){k||(p(o.$$.fragment,C),p(d),k=!0)},o(C){v(o.$$.fragment,C),v(d),k=!1},d(C){C&&E(e),H(o),T[c].d(),A&&A.d()}}}function Y2e(t){let e,n,i,l,r,s,o,a;return e=new Yl({props:{$$slots:{default:[Obe]},$$scope:{ctx:t}}}),i=new Yl({props:{$$slots:{default:[Rbe]},$$scope:{ctx:t}}}),r=new Yl({props:{$$slots:{default:[Ybe]},$$scope:{ctx:t}}}),o=new Yl({props:{$$slots:{default:[q2e]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment)},m(u,f){z(e,u,f),O(u,n,f),z(i,u,f),O(u,l,f),z(r,u,f),O(u,s,f),z(o,u,f),a=!0},p(u,f){const c={};f[0]&29|f[3]&4&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65280|f[3]&4&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const h={};f[0]&33488896|f[3]&4&&(h.$$scope={dirty:f,ctx:u}),r.$set(h);const g={};f[0]&1006633217|f[3]&4&&(g.$$scope={dirty:f,ctx:u}),o.$set(g)},i(u){a||(p(e.$$.fragment,u),p(i.$$.fragment,u),p(r.$$.fragment,u),p(o.$$.fragment,u),a=!0)},o(u){v(e.$$.fragment,u),v(i.$$.fragment,u),v(r.$$.fragment,u),v(o.$$.fragment,u),a=!1},d(u){u&&(E(n),E(l),E(s)),H(e,u),H(i,u),H(r,u),H(o,u)}}}function Z2e(t){let e,n,i,l,r=t[6]&&R8(t);function s(a){t[47](a)}let o={type:"container",autoWidth:!0,"aria-label":"Device details",$$slots:{content:[Y2e],default:[obe]},$$scope:{ctx:t}};return t[7]!==void 0&&(o.selected=t[7]),n=new mg({props:o}),xe.push(()=>At(n,"selected",s)),{c(){r&&r.c(),e=F(),U(n.$$.fragment)},m(a,u){r&&r.m(a,u),O(a,e,u),z(n,a,u),l=!0},p(a,u){a[6]?r?(r.p(a,u),u[0]&64&&p(r,1)):(r=R8(a),r.c(),p(r,1),r.m(e.parentNode,e)):r&&(ue(),v(r,1,1,()=>{r=null}),fe());const f={};u[0]&1040187165|u[3]&4&&(f.$$scope={dirty:u,ctx:a}),!i&&u[0]&128&&(i=!0,f.selected=a[7],Ct(()=>i=!1)),n.$set(f)},i(a){l||(p(r),p(n.$$.fragment,a),l=!0)},o(a){v(r),v(n.$$.fragment,a),l=!1},d(a){a&&E(e),r&&r.d(a),H(n,a)}}}function X2e(t){var o;let e,n,i,l,r,s;return e=new Od({props:{title:"Device details",label:((o=t[0])==null?void 0:o.display_name)||"Unknown device"}}),i=new Md({props:{hasForm:!0,$$slots:{default:[Z2e]},$$scope:{ctx:t}}}),r=new Cd({props:{primaryButtonText:t[5]?"Saving…":"Save labels",primaryButtonDisabled:t[5],secondaryButtonText:"Close"}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(a,u){z(e,a,u),O(a,n,u),z(i,a,u),O(a,l,u),z(r,a,u),s=!0},p(a,u){var h;const f={};u[0]&1&&(f.label=((h=a[0])==null?void 0:h.display_name)||"Unknown device"),e.$set(f);const c={};u[0]&1040187357|u[3]&4&&(c.$$scope={dirty:u,ctx:a}),i.$set(c);const d={};u[0]&32&&(d.primaryButtonText=a[5]?"Saving…":"Save labels"),u[0]&32&&(d.primaryButtonDisabled=a[5]),r.$set(d)},i(a){s||(p(e.$$.fragment,a),p(i.$$.fragment,a),p(r.$$.fragment,a),s=!0)},o(a){v(e.$$.fragment,a),v(i.$$.fragment,a),v(r.$$.fragment,a),s=!1},d(a){a&&(E(n),E(l)),H(e,a),H(i,a),H(r,a)}}}function K2e(t){let e,n,i,l=(t[25]?Ms(t[25]):"this peer")+"",r,s;return{c(){e=P("p"),n=$("Unlink "),i=P("strong"),r=$(l),s=$(` + from this device? The peer will remain available to link again.`)},m(o,a){O(o,e,a),w(e,n),w(e,i),w(i,r),w(e,s)},p(o,a){a[0]&33554432&&l!==(l=(o[25]?Ms(o[25]):"this peer")+"")&&Y(r,l)},d(o){o&&E(e)}}}function J2e(t){let e,n,i,l;return e=new Ed({props:{open:t[1],size:"lg",$$slots:{default:[X2e]},$$scope:{ctx:t}}}),e.$on("close",t[36]),e.$on("submit",t[34]),i=new Zu({props:{open:!!t[25],title:"Unlink Tailscale peer?",label:"Confirm identity change",confirmText:"Unlink peer",danger:!0,busy:t[22],$$slots:{default:[K2e]},$$scope:{ctx:t}}}),i.$on("close",t[48]),i.$on("submit",t[33]),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s[0]&2&&(o.open=r[1]),s[0]&1040187389|s[3]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&33554432&&(a.open=!!r[25]),s[0]&4194304&&(a.busy=r[22]),s[0]&33554432|s[3]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Q2e(){return localStorage.getItem("jwt")||""}function bs(t){const e={Authorization:"Bearer "+Q2e()};return t&&(e["Content-Type"]="application/json"),e}async function vs(t){const e=await t.text();try{const n=JSON.parse(e);if(n!=null&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}function mT(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function gT(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function Ms(t){return t.name||t.dns_name||t.node_id}function Cs(t){return t?new Date(t).toLocaleString():"—"}function _T(t){return t?new Date(t*1e3).toLocaleString():"—"}function pT(t){return t==="high"?"green":t==="medium"?"teal":t==="low"?"magenta":"red"}function bT(t){return t==="high"?"High confidence":t==="medium"?"Medium confidence":t==="low"?"Low confidence":"No protection signal"}function vT(t){var n,i,l;if(!t)return"";const e=[];return(n=t.blocked_categories)!=null&&n.length&&e.push(`${t.blocked_categories.length} blocked categor${t.blocked_categories.length===1?"y":"ies"}`),(i=t.blocked_domains)!=null&&i.length&&e.push(`${t.blocked_domains.length} blocked domain${t.blocked_domains.length===1?"":"s"}`),(l=t.allowed_domains)!=null&&l.length&&e.push(`${t.allowed_domains.length} allowed domain${t.allowed_domains.length===1?"":"s"}`),t.rule_count&&e.push(`${t.rule_count} rule${t.rule_count===1?"":"s"}`),t.safe_search&&e.push("safe search"),e.length?e.join(", "):"blocks nothing of its own"}const kT=t=>t.id!=="default";function x2e(t,e,n){const i=Un()+"/api/devices",l=Un()+"/api/policy",r=Un()+"/api/tailscale",s=nn();let{device:o}=e,{open:a=!1}=e,u=(o==null?void 0:o.manual_name)||"",f=(o==null?void 0:o.owner)||"",c=(o==null?void 0:o.category)||"",d=!1,h="",g=0,_=null,k=!1,y="",T=[],M="",A=!1,C="",D=!1,R=[],N=null,G=(o==null?void 0:o.tailscale_nodes)||[],B=[],j="",q=!1,V=!1,K=!1,x="",ie="",X=null,ce=[],ae=!1,ee="",he=!1,ne=null,re=null,oe=!1,Re=0,qe=!1,Ce="",Ze="";async function be(){var pe;n(9,k=!0),n(10,y="");try{const et=await fetch(i+"/"+o.id+"/policy",{headers:bs(!1)});if(!et.ok)throw new Error(await vs(et));n(8,_=await et.json()),n(12,M=((pe=_==null?void 0:_.assignment)==null?void 0:pe.id)||"")}catch(et){n(10,y=et instanceof Error?et.message:"Policy could not be loaded")}finally{n(9,k=!1)}}async function Ae(){try{const pe=await fetch(l+"/groups",{headers:bs(!1)});if(!pe.ok)throw new Error(await vs(pe));const et=await pe.json();n(11,T=et.groups||[])}catch(pe){n(10,y=y||(pe instanceof Error?pe.message:"Policies could not be loaded"))}}async function ve(){n(20,q=!0),n(23,x="");try{const pe=await fetch(r+"/peers",{headers:bs(!1)});if(!pe.ok)throw new Error(await vs(pe));const et=await pe.json();n(16,N=et),n(37,R=et.state==="connected"?et.peers||[]:[]),et.state==="connected"&&n(17,G=R.filter(gt=>gt.mapped_device_id===o.id)),n(21,V=!0)}catch(pe){n(16,N=null),n(37,R=[]),n(23,x=pe instanceof Error?pe.message:"Tailscale peers failed")}finally{n(20,q=!1)}}async function me(){if(!(!j||K)){n(22,K=!0),n(23,x=""),n(24,ie="");try{const pe=await fetch(i+"/"+o.id+"/tailscale",{method:"PUT",headers:bs(!0),body:JSON.stringify({node_id:j})});if(!pe.ok)throw new Error(await vs(pe));n(19,j=""),n(24,ie="Tailscale peer linked."),await ve(),s("tailscaleChanged")}catch(pe){n(23,x=pe instanceof Error?pe.message:"Peer could not be linked")}finally{n(22,K=!1)}}}function lt(pe){n(25,X=pe)}async function De(){if(!X||K)return;const pe=X;n(22,K=!0),n(23,x=""),n(24,ie="");try{const et=await fetch(i+"/"+o.id+"/tailscale/"+encodeURIComponent(pe.node_id),{method:"DELETE",headers:bs(!1)});if(!et.ok)throw new Error(await vs(et));n(17,G=G.filter(gt=>gt.node_id!==pe.node_id)),n(25,X=null),n(24,ie="Tailscale peer unlinked."),await ve(),s("tailscaleChanged")}catch(et){n(23,x=et instanceof Error?et.message:"Peer could not be unlinked")}finally{n(22,K=!1)}}function vt(pe=!1){Re+=1,ne&&clearTimeout(ne),ne=null,re==null||re.abort(),re=null,oe=!1,pe&&n(39,Ze="")}async function dt(){const pe=Ze,et=Re;if(!(oe||qe||!a||!pe||pe!==(o==null?void 0:o.id))){oe=!0,n(27,ae=!he),n(28,ee=""),re=new AbortController;try{const gt=await fetch(i+"/"+pe+"/activity?since=86400&limit=100",{headers:bs(!1),signal:re.signal});if(!gt.ok)throw new Error(await vs(gt));const Kt=await gt.json();!qe&&a&&et===Re&&pe===Ze&&(n(26,ce=Kt.items||[]),n(29,he=!0))}catch(gt){!qe&&a&&et===Re&&pe===Ze&&(gt==null?void 0:gt.name)!=="AbortError"&&n(28,ee=gt instanceof Error?gt.message:"Activity could not be refreshed")}finally{et===Re&&(oe=!1,n(27,ae=!1),re=null),!qe&&a&&et===Re&&pe===Ze&&(ne=setTimeout(dt,5e3))}}}function ot(pe){vt(),n(39,Ze=pe),n(26,ce=[]),n(29,he=!1),n(28,ee=""),dt()}async function ht(){if(!d){n(5,d=!0),n(6,h="");try{const pe=await fetch(i+"/"+o.id+"/name",{method:"POST",headers:bs(!0),body:JSON.stringify({name:u,owner:f,category:c})});if(!pe.ok)throw new Error(await vs(pe));s("saved")}catch(pe){n(6,h=pe instanceof Error?pe.message:"Labels could not be saved")}finally{n(5,d=!1)}}}async function Bt(){if(!A){n(13,A=!0),n(14,C=""),n(15,D=!1);try{const pe=await fetch(i+"/"+o.id+"/assignment",{method:"PUT",headers:bs(!0),body:JSON.stringify({group_id:M})});if(!pe.ok)throw new Error(await vs(pe));await be(),n(15,D=!0)}catch(pe){n(14,C=pe instanceof Error?pe.message:"Policy assignment could not be saved")}finally{n(13,A=!1)}}}Ls(()=>{qe=!0,vt(!0)});function Ot(){vt(!0),s("close")}const Zt=()=>n(6,h="");function Ve(pe){u=pe,n(2,u),n(1,a),n(0,o),n(38,Ce)}function Nt(pe){f=pe,n(3,f),n(1,a),n(0,o),n(38,Ce)}function Tt(pe){c=pe,n(4,c),n(1,a),n(0,o),n(38,Ce)}function Gt(pe){M=pe,n(12,M)}const fn=pe=>lt(pe);function an(pe){j=pe,n(19,j)}function Qt(pe){g=pe,n(7,g)}const Ne=()=>{K||n(25,X=null)};return t.$$set=pe=>{"device"in pe&&n(0,o=pe.device),"open"in pe&&n(1,a=pe.open)},t.$$.update=()=>{t.$$.dirty[1]&64&&n(18,B=R.filter(pe=>!pe.mapped_device_id)),t.$$.dirty[0]&3|t.$$.dirty[1]&128&&a&&o!=null&&o.id&&Ce!==o.id&&(n(38,Ce=o.id),n(2,u=(o==null?void 0:o.manual_name)||""),n(3,f=(o==null?void 0:o.owner)||""),n(4,c=(o==null?void 0:o.category)||""),n(17,G=(o==null?void 0:o.tailscale_nodes)||[]),be(),Ae(),ve(),ot(o.id)),t.$$.dirty[0]&2|t.$$.dirty[1]&256&&!a&&Ze&&vt(!0)},[o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,N,G,B,j,q,V,K,x,ie,X,ce,ae,ee,he,ve,me,lt,De,ht,Bt,Ot,R,Ce,Ze,Zt,Ve,Nt,Tt,Gt,fn,an,Qt,Ne]}class eve extends Oe{constructor(e){super(),Ee(this,e,x2e,J2e,Se,{device:0,open:1},null,[-1,-1,-1,-1])}}const{Boolean:tve}=Sd;function wT(t,e,n){const i=t.slice();return i[30]=e[n],i}function yT(t){let e,n;return e=new ln({props:{kind:"error",title:"Device action failed",subtitle:t[3]}}),e.$on("close",t[16]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function TT(t){let e,n;return e=new ln({props:{kind:"success",title:"Device inventory updated",subtitle:t[4]}}),e.$on("close",t[17]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&16&&(r.subtitle=i[4]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function nve(t){let e,n,i,l,r=t[0].length+"",s,o,a=t[0].length!==1?"s":"",u,f,c=t[0].filter(AT).length+"",d,h,g;return n=new ml({props:{sortable:!0,size:"compact",headers:t[9],rows:t[0],$$slots:{cell:[kve,({row:_,cell:k})=>({28:_,29:k}),({row:_,cell:k})=>[(_?268435456:0)|(k?536870912:0)]],default:[ave]},$$scope:{ctx:t}}}),{c(){e=P("div"),U(n.$$.fragment),i=F(),l=P("p"),s=$(r),o=$(" device"),u=$(a),f=$(" discovered · "),d=$(c),h=$(" online"),I(e,"class","inventory-table svelte-qaftwy"),I(e,"aria-label","Discovered device inventory"),I(l,"class","device-summary svelte-qaftwy"),I(l,"aria-live","polite")},m(_,k){O(_,e,k),z(n,e,null),O(_,i,k),O(_,l,k),w(l,s),w(l,o),w(l,u),w(l,f),w(l,d),w(l,h),g=!0},p(_,k){const y={};k[0]&1&&(y.rows=_[0]),k[0]&805306368|k[1]&4&&(y.$$scope={dirty:k,ctx:_}),n.$set(y),(!g||k[0]&1)&&r!==(r=_[0].length+"")&&Y(s,r),(!g||k[0]&1)&&a!==(a=_[0].length!==1?"s":"")&&Y(u,a),(!g||k[0]&1)&&c!==(c=_[0].filter(AT).length+"")&&Y(d,c)},i(_){g||(p(n.$$.fragment,_),g=!0)},o(_){v(n.$$.fragment,_),g=!1},d(_){_&&(E(e),E(i),E(l)),H(n)}}}function ive(t){let e,n;return e=new hi({props:{state:"empty",title:"No devices discovered yet",message:"GateSentry will list devices after it observes DNS or proxy traffic."}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function lve(t){let e,n;return e=new hi({props:{state:"error",title:"Unable to load network devices",message:t[3],retryLabel:"Retry",onRetry:t[10]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&8&&(r.message=i[3]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function rve(t){let e,n;return e=new hi({props:{state:"loading",message:"Loading network devices…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function sve(t){let e,n;return e=new ZT({props:{persistent:!0,shouldFilterRows:!0,placeholder:"Search devices…"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ove(t){let e,n;return e=new hg({props:{$$slots:{default:[sve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ave(t){let e,n;return e=new dg({props:{$$slots:{default:[ove]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function uve(t){let e=(t[29].value||"—")+"",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&536870912&&e!==(e=(i[29].value||"—")+"")&&Y(n,e)},i:_e,o:_e,d(i){i&&E(n)}}}function fve(t){let e,n;return e=new Wu({props:{flipped:!0,"aria-label":"Device actions",$$slots:{default:[mve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&268435456|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function cve(t){let e,n,i,l;const r=[_ve,gve],s=[];function o(a,u){var f;return(f=a[28].tailscale_nodes)!=null&&f.length?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function dve(t){let e,n=t[29].value+"",i,l,r,s,o,a,u;function f(){return t[18](t[28])}let c=!t[28].manual_name&&t[28].source!=="manual"&&ET(t),d=(t[28].owner||t[28].category)&&OT(t);return{c(){e=P("button"),i=$(n),l=F(),c&&c.c(),r=F(),d&&d.c(),s=je(),I(e,"class","device-name-link svelte-qaftwy")},m(h,g){O(h,e,g),w(e,i),O(h,l,g),c&&c.m(h,g),O(h,r,g),d&&d.m(h,g),O(h,s,g),o=!0,a||(u=J(e,"click",f),a=!0)},p(h,g){t=h,(!o||g[0]&536870912)&&n!==(n=t[29].value+"")&&Y(i,n),!t[28].manual_name&&t[28].source!=="manual"?c?g[0]&268435456&&p(c,1):(c=ET(t),c.c(),p(c,1),c.m(r.parentNode,r)):c&&(ue(),v(c,1,1,()=>{c=null}),fe()),t[28].owner||t[28].category?d?d.p(t,g):(d=OT(t),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},i(h){o||(p(c),o=!0)},o(h){v(c),o=!1},d(h){h&&(E(e),E(l),E(r),E(s)),c&&c.d(h),d&&d.d(h),a=!1,u()}}}function hve(t){let e,n;return e=new Rt({props:{size:"sm",type:t[28].online?"green":"warm-gray",$$slots:{default:[vve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&268435456&&(r.type=i[28].online?"green":"warm-gray"),l[0]&268435456|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function mve(t){let e,n,i,l,r,s;function o(){return t[19](t[28])}e=new Al({props:{text:"View details"}}),e.$on("click",o);function a(){return t[20](t[28])}i=new Al({props:{text:"Manage Tailscale links"}}),i.$on("click",a);function u(){return t[21](t[28])}return r=new Al({props:{danger:!0,text:"Remove"}}),r.$on("click",u),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment)},m(f,c){z(e,f,c),O(f,n,c),z(i,f,c),O(f,l,c),z(r,f,c),s=!0},p(f,c){t=f},i(f){s||(p(e.$$.fragment,f),p(i.$$.fragment,f),p(r.$$.fragment,f),s=!0)},o(f){v(e.$$.fragment,f),v(i.$$.fragment,f),v(r.$$.fragment,f),s=!1},d(f){f&&(E(n),E(l)),H(e,f),H(i,f),H(r,f)}}}function gve(t){let e;return{c(){e=$("—")},m(n,i){O(n,e,i)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function _ve(t){let e,n,i=it(t[28].tailscale_nodes),l=[];for(let s=0;sv(l[s],1,1,()=>{l[s]=null});return{c(){e=P("div");for(let s=0;s{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function wve(t){let e,n,i,l;const r=[rve,lve,ive,nve],s=[];function o(a,u){return a[1]&&!a[2]?0:a[3]&&a[0].length===0?1:a[0].length===0?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function yve(t){let e=t[1]?"Refreshing…":"Refresh",n;return{c(){n=$(e)},m(i,l){O(i,n,l)},p(i,l){l[0]&2&&e!==(e=i[1]?"Refreshing…":"Refresh")&&Y(n,e)},d(i){i&&E(n)}}}function Tve(t){let e,n;return e=new bt({props:{kind:"ghost",size:"small",icon:Rd,disabled:t[1],$$slots:{default:[yve]},$$scope:{ctx:t}}}),e.$on("click",t[10]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&2&&(r.disabled=i[1]),l[0]&2|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function MT(t){let e,n;return e=new eve({props:{device:t[5],open:t[6]}}),e.$on("close",t[12]),e.$on("saved",t[13]),e.$on("tailscaleChanged",t[10]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l[0]&32&&(r.device=i[5]),l[0]&64&&(r.open=i[6]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Sve(t){var o;let e,n,i,l=(((o=t[7])==null?void 0:o.display_name)||"this device")+"",r,s;return{c(){e=P("p"),n=$("Remove "),i=P("strong"),r=$(l),s=$(` from + the inventory? GateSentry may discover it again when it next sends traffic.`)},m(a,u){O(a,e,u),w(e,n),w(e,i),w(i,r),w(e,s)},p(a,u){var f;u[0]&128&&l!==(l=(((f=a[7])==null?void 0:f.display_name)||"this device")+"")&&Y(r,l)},d(a){a&&E(e)}}}function Eve(t){let e,n,i,l,r,s,o,a=t[3]&&t[0].length>0&&yT(t),u=t[4]&&TT(t);i=new jr({props:{title:"Device inventory",description:"Devices discovered on your network, including peers you explicitly linked from Tailscale.",$$slots:{actions:[Tve],default:[wve]},$$scope:{ctx:t}}});let f=t[6]&&t[5]&&MT(t);return s=new Zu({props:{open:!!t[7],title:"Remove device?",label:"Confirm inventory change",confirmText:"Remove device",danger:!0,busy:t[8],$$slots:{default:[Sve]},$$scope:{ctx:t}}}),s.$on("close",t[22]),s.$on("submit",t[15]),{c(){a&&a.c(),e=F(),u&&u.c(),n=F(),U(i.$$.fragment),l=F(),f&&f.c(),r=F(),U(s.$$.fragment)},m(c,d){a&&a.m(c,d),O(c,e,d),u&&u.m(c,d),O(c,n,d),z(i,c,d),O(c,l,d),f&&f.m(c,d),O(c,r,d),z(s,c,d),o=!0},p(c,d){c[3]&&c[0].length>0?a?(a.p(c,d),d[0]&9&&p(a,1)):(a=yT(c),a.c(),p(a,1),a.m(e.parentNode,e)):a&&(ue(),v(a,1,1,()=>{a=null}),fe()),c[4]?u?(u.p(c,d),d[0]&16&&p(u,1)):(u=TT(c),u.c(),p(u,1),u.m(n.parentNode,n)):u&&(ue(),v(u,1,1,()=>{u=null}),fe());const h={};d[0]&15|d[1]&4&&(h.$$scope={dirty:d,ctx:c}),i.$set(h),c[6]&&c[5]?f?(f.p(c,d),d[0]&96&&p(f,1)):(f=MT(c),f.c(),p(f,1),f.m(r.parentNode,r)):f&&(ue(),v(f,1,1,()=>{f=null}),fe());const g={};d[0]&128&&(g.open=!!c[7]),d[0]&256&&(g.busy=c[8]),d[0]&128|d[1]&4&&(g.$$scope={dirty:d,ctx:c}),s.$set(g)},i(c){o||(p(a),p(u),p(i.$$.fragment,c),p(f),p(s.$$.fragment,c),o=!0)},o(c){v(a),v(u),v(i.$$.fragment,c),v(f),v(s.$$.fragment,c),o=!1},d(c){c&&(E(e),E(n),E(l),E(r)),a&&a.d(c),u&&u.d(c),H(i,c),f&&f.d(c),H(s,c)}}}function CT(){return localStorage.getItem("jwt")||""}function Ove(t){var e;return{...t,id:t.id,status:t.online?"online":"offline",display_name:t.manual_name||t.display_name||t.dns_name||"Unknown",address_display:t.ipv4||t.ipv6||"—",tailscale_display:(e=t.tailscale_nodes)!=null&&e.length?t.tailscale_nodes.map(n=>n.name||n.dns_name).join(", "):"—",last_seen_display:Mve(t.last_seen)}}function Mve(t){if(!t)return"Never";const e=new Date(t),n=Math.floor((Date.now()-e.getTime())/1e3);if(n<60)return"Just now";const i=Math.floor(n/60);if(i<60)return`${i}m ago`;const l=Math.floor(i/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}const AT=t=>t.online;function Cve(t,e,n){const i=Un()+"/api/devices";let l=[],r=!1,s=!1,o="",a="",u=null,f=!1,c=null,d=!1,h,g=null;const _=[{key:"status",value:"Status"},{key:"display_name",value:"Device"},{key:"address_display",value:"Address"},{key:"tailscale_display",value:"Tailscale"},{key:"last_seen_display",value:"Last seen"},{key:"actions",value:""}];function k(x){n(4,a=x),g&&clearTimeout(g),g=setTimeout(()=>n(4,a=""),3e3)}async function y(){n(1,r=!0),n(3,o="");try{const x=CT();if(!x)throw new Error("Please login first to view devices");const ie=await fetch(i,{headers:{Authorization:`Bearer ${x}`}});if(ie.status===401)throw new Error("Authentication failed. Please login again");if(ie.status===503){n(0,l=[]);return}if(!ie.ok){const ce=await ie.text();throw new Error(`Failed to load devices: ${ie.status} - ${ce}`)}const X=await ie.json();n(0,l=(X.devices||[]).map(Ove))}catch(x){n(3,o=x instanceof Error?x.message:"Devices could not be loaded")}finally{n(1,r=!1),n(2,s=!0)}}function T(x){n(5,u=x),n(6,f=!0)}function M(x){T(x)}function A(){n(6,f=!1),n(5,u=null)}async function C(){A(),k("Device updated successfully"),await y()}function D(x){n(7,c=x)}async function R(){if(!c||d)return;const x=c;n(8,d=!0),n(3,o="");try{const ie=await fetch(`${i}/${x.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${CT()}`}});if(!ie.ok){const X=await ie.text();throw new Error(`Failed to remove device: ${X}`)}n(7,c=null),k(`"${x.display_name}" removed`),await y()}catch(ie){n(3,o=ie instanceof Error?ie.message:"Device could not be removed")}finally{n(8,d=!1)}}return on(()=>{y(),h=setInterval(y,3e4)}),Ls(()=>{h&&clearInterval(h),g&&clearTimeout(g)}),[l,r,s,o,a,u,f,c,d,_,y,M,A,C,D,R,()=>n(3,o=""),()=>n(4,a=""),x=>M(x),x=>M(x),x=>M(x),x=>D(x),()=>{d||n(7,c=null)}]}class Ave extends Oe{constructor(e){super(),Ee(this,e,Cve,Eve,Se,{},null,[-1,-1])}}function Lve(t){let e,n;return e=new Ave({}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Dve(t){let e;return{c(){e=$("Dashboard")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Ive(t){let e;return{c(){e=$("Devices")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Rve(t){let e,n,i,l;return e=new xn({props:{href:"/",$$slots:{default:[Dve]},$$scope:{ctx:t}}}),i=new xn({props:{$$slots:{default:[Ive]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment)},m(r,s){z(e,r,s),O(r,n,s),z(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(p(e.$$.fragment,r),p(i.$$.fragment,r),l=!0)},o(r){v(e.$$.fragment,r),v(i.$$.fragment,r),l=!1},d(r){r&&E(n),H(e,r),H(i,r)}}}function Pve(t){let e,n;return e=new mr({props:{noTrailingSlash:!0,$$slots:{default:[Rve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Nve(t){let e,n;return e=new Nl({props:{title:"Network devices",description:"Review devices GateSentry has observed, assign protection, and manage explicit identity links.",$$slots:{breadcrumb:[Pve],default:[Lve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}class Bve extends Oe{constructor(e){super(),Ee(this,e,null,Nve,Se,{})}}function zve(t){let e;return{c(){e=$("Return to overview")},m(n,i){O(n,e,i)},d(n){n&&E(e)}}}function Hve(t){let e,n;return e=new bt({props:{$$slots:{default:[zve]},$$scope:{ctx:t}}}),e.$on("click",t[0]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Uve(t){let e,n;return e=new hi({props:{state:"empty",title:"We could not find that page",message:"Return to the overview or choose another destination from the navigation.",$$slots:{default:[Hve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Fve(t){let e,n;return e=new Nl({props:{title:"Page not found",description:"The requested GateSentry administration page does not exist.",narrow:!0,$$slots:{default:[Uve]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,[l]){const r={};l&2&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Gve(t){return[()=>Vi("/")]}class Vve extends Oe{constructor(e){super(),Ee(this,e,Gve,Fve,Se,{})}}const{window:QO}=Sd;function Wve(t){let e,n,i,l,r,s,o,a,u,f,c,d;function h(T){t[12](T)}function g(T){t[13](T)}let _={pathname:t[5]};t[1]!==void 0&&(_.isSideNavOpen=t[1]),t[4]!==void 0&&(_.userProfilePanelOpen=t[4]),n=new jY({props:_}),xe.push(()=>At(n,"isSideNavOpen",h)),xe.push(()=>At(n,"userProfilePanelOpen",g)),n.$on("loggedout",t[14]);function k(T){t[15](T)}let y={rail:!0,expansionBreakpoint:xO,ariaLabel:"Primary navigation","aria-hidden":!t[6],inert:!t[6],$$slots:{default:[Zve]},$$scope:{ctx:t}};return t[1]!==void 0&&(y.isOpen=t[1]),s=new dW({props:y}),xe.push(()=>At(s,"isOpen",k)),u=new HW({props:{id:"main-content",$$slots:{default:[xve]},$$scope:{ctx:t}}}),c=new eZ({}),{c(){e=P("div"),U(n.$$.fragment),r=F(),U(s.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),I(e,"class","app-frame")},m(T,M){O(T,e,M),z(n,e,null),w(e,r),z(s,e,null),w(e,a),z(u,e,null),w(e,f),z(c,e,null),d=!0},p(T,M){const A={};M&32&&(A.pathname=T[5]),!i&&M&2&&(i=!0,A.isSideNavOpen=T[1],Ct(()=>i=!1)),!l&&M&16&&(l=!0,A.userProfilePanelOpen=T[4],Ct(()=>l=!1)),n.$set(A);const C={};M&64&&(C["aria-hidden"]=!T[6]),M&64&&(C.inert=!T[6]),M&1048608&&(C.$$scope={dirty:M,ctx:T}),!o&&M&2&&(o=!0,C.isOpen=T[1],Ct(()=>o=!1)),s.$set(C);const D={};M&1048576&&(D.$$scope={dirty:M,ctx:T}),u.$set(D)},i(T){d||(p(n.$$.fragment,T),p(s.$$.fragment,T),p(u.$$.fragment,T),p(c.$$.fragment,T),d=!0)},o(T){v(n.$$.fragment,T),v(s.$$.fragment,T),v(u.$$.fragment,T),v(c.$$.fragment,T),d=!1},d(T){T&&E(e),H(n),H(s),H(u),H(c)}}}function jve(t){let e,n;return e=new yi({props:{path:"/login",$$slots:{default:[eke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1048584&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function $ve(t){let e,n;return e=new yi({props:{path:"/setup",component:AZ}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function qve(t){let e,n;return e=new Nd({props:{title:"GateSentry",description:"The administration interface is unavailable.",$$slots:{default:[tke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Yve(t){let e,n;return e=new Nd({props:{title:"GateSentry",description:"Checking this installation…",$$slots:{default:[nke]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Zve(t){let e,n;return e=new JY({props:{pathname:t[5],onNavigate:t[7]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p(i,l){const r={};l&32&&(r.pathname=i[5]),e.$set(r)},i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Xve(t){let e,n;return e=new Bd({props:{type:"blockedkeywords"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Kve(t){let e,n;return e=new Bd({props:{type:"blockedfiletypes"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Jve(t){let e,n;return e=new Bd({props:{type:"excludeurls"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function Qve(t){let e,n;return e=new Bd({props:{type:"excludehosts"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function xve(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,k,y,T,M,A,C,D,R,N,G,B,j,q,V,K;return e=new yi({props:{path:"/dns",component:ax}}),i=new yi({props:{path:"/logs",component:aX}}),r=new yi({props:{path:"/settings",component:QK}}),o=new yi({props:{path:"/blockedkeywords",$$slots:{default:[Xve]},$$scope:{ctx:t}}}),u=new yi({props:{path:"/blockedfiletypes",$$slots:{default:[Kve]},$$scope:{ctx:t}}}),c=new yi({props:{path:"/excludeurls",$$slots:{default:[Jve]},$$scope:{ctx:t}}}),h=new yi({props:{path:"/excludehosts",$$slots:{default:[Qve]},$$scope:{ctx:t}}}),_=new yi({props:{path:"/services",component:sJ}}),y=new yi({props:{path:"/rules",component:sbe}}),M=new yi({props:{path:"/devices",component:Bve}}),C=new yi({props:{path:"/stats",component:m_e}}),R=new yi({props:{path:"/ai",component:H_e}}),G=new yi({props:{path:"/users",component:d0e}}),j=new yi({props:{path:"/",component:JJ}}),V=new yi({props:{component:Vve}}),{c(){U(e.$$.fragment),n=F(),U(i.$$.fragment),l=F(),U(r.$$.fragment),s=F(),U(o.$$.fragment),a=F(),U(u.$$.fragment),f=F(),U(c.$$.fragment),d=F(),U(h.$$.fragment),g=F(),U(_.$$.fragment),k=F(),U(y.$$.fragment),T=F(),U(M.$$.fragment),A=F(),U(C.$$.fragment),D=F(),U(R.$$.fragment),N=F(),U(G.$$.fragment),B=F(),U(j.$$.fragment),q=F(),U(V.$$.fragment)},m(x,ie){z(e,x,ie),O(x,n,ie),z(i,x,ie),O(x,l,ie),z(r,x,ie),O(x,s,ie),z(o,x,ie),O(x,a,ie),z(u,x,ie),O(x,f,ie),z(c,x,ie),O(x,d,ie),z(h,x,ie),O(x,g,ie),z(_,x,ie),O(x,k,ie),z(y,x,ie),O(x,T,ie),z(M,x,ie),O(x,A,ie),z(C,x,ie),O(x,D,ie),z(R,x,ie),O(x,N,ie),z(G,x,ie),O(x,B,ie),z(j,x,ie),O(x,q,ie),z(V,x,ie),K=!0},p(x,ie){const X={};ie&1048576&&(X.$$scope={dirty:ie,ctx:x}),o.$set(X);const ce={};ie&1048576&&(ce.$$scope={dirty:ie,ctx:x}),u.$set(ce);const ae={};ie&1048576&&(ae.$$scope={dirty:ie,ctx:x}),c.$set(ae);const ee={};ie&1048576&&(ee.$$scope={dirty:ie,ctx:x}),h.$set(ee)},i(x){K||(p(e.$$.fragment,x),p(i.$$.fragment,x),p(r.$$.fragment,x),p(o.$$.fragment,x),p(u.$$.fragment,x),p(c.$$.fragment,x),p(h.$$.fragment,x),p(_.$$.fragment,x),p(y.$$.fragment,x),p(M.$$.fragment,x),p(C.$$.fragment,x),p(R.$$.fragment,x),p(G.$$.fragment,x),p(j.$$.fragment,x),p(V.$$.fragment,x),K=!0)},o(x){v(e.$$.fragment,x),v(i.$$.fragment,x),v(r.$$.fragment,x),v(o.$$.fragment,x),v(u.$$.fragment,x),v(c.$$.fragment,x),v(h.$$.fragment,x),v(_.$$.fragment,x),v(y.$$.fragment,x),v(M.$$.fragment,x),v(C.$$.fragment,x),v(R.$$.fragment,x),v(G.$$.fragment,x),v(j.$$.fragment,x),v(V.$$.fragment,x),K=!1},d(x){x&&(E(n),E(l),E(s),E(a),E(f),E(d),E(g),E(k),E(T),E(A),E(D),E(N),E(B),E(q)),H(e,x),H(i,x),H(r,x),H(o,x),H(u,x),H(c,x),H(h,x),H(_,x),H(y,x),H(M,x),H(C,x),H(R,x),H(G,x),H(j,x),H(V,x)}}}function eke(t){let e,n;return e=new wZ({}),e.$on("authenticated",t[11]),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function tke(t){let e,n;return e=new hi({props:{state:"error",title:"Unable to read GateSentry setup status.",message:"Check that the GateSentry service is running, then try again.",retryLabel:"Retry status check",onRetry:t[8]}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function nke(t){let e,n;return e=new hi({props:{state:"loading",message:"Checking setup and session status"}}),{c(){U(e.$$.fragment)},m(i,l){z(e,i,l),n=!0},p:_e,i(i){n||(p(e.$$.fragment,i),n=!0)},o(i){v(e.$$.fragment,i),n=!1},d(i){H(e,i)}}}function ike(t){let e,n,i,l;const r=[Yve,qve,$ve,jve,Wve],s=[];function o(a,u){return a[3]==="checking"?0:a[3]==="error"?1:a[3]==="setup"?2:a[3]==="login"?3:4}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=je()},m(a,u){s[e].m(a,u),O(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(ue(),v(s[f],1,1,()=>{s[f]=null}),fe(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),p(n,1),n.m(i.parentNode,i))},i(a){l||(p(n),l=!0)},o(a){v(n),l=!1},d(a){a&&E(i),s[e].d(a)}}}function lke(t){let e,n,i,l;return Es(t[10]),e=new gj({props:{url:t[0],basepath:Un(),$$slots:{default:[ike]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,s){z(e,r,s),n=!0,i||(l=J(QO,"resize",t[10]),i=!0)},p(r,[s]){const o={};s&1&&(o.url=r[0]),s&1048698&&(o.$$scope={dirty:s,ctx:r}),e.$set(o)},i(r){n||(p(e.$$.fragment,r),n=!0)},o(r){v(e.$$.fragment,r),n=!1},d(r){H(e,r),i=!1,l()}}}const xO=1056;function rke(t,e,n){let i,l,r;ct(t,Ln,R=>n(16,r=R));let{url:s=""}=e;D$("en",()=>WD(()=>import("./en-1d19a117.js"),[]));const o=H$({initialLocale:"en",fallbackLocale:"en"});let a="checking",u=!1,f=!1,c="/",d=0;const h=()=>{const R=Un(),N=typeof window>"u"?s:window.location.pathname;return R&&(N===R||N.startsWith(R+"/"))?N.slice(R.length)||"/":N||"/"},g=()=>{n(5,c=h()),n(1,u=!1)},_=()=>{n(1,u=!1),i&&typeof window<"u"&&window.requestAnimationFrame(()=>{var R;(R=document.querySelector(".bx--header__menu-toggle"))==null||R.focus()})};async function k(){n(3,a="checking");try{const R=await fetch(Un()+"/api/setup/status");if(!R.ok)throw new Error("setup status failed");if(!(await R.json()).complete){Ln.logout(),n(3,a="setup"),h()!=="/setup"&&Vi("/setup",{replace:!0});return}await r.api.verifyToken()?(Ln.refresh(),n(3,a="authenticated"),(h()==="/login"||h()==="/setup")&&Vi("/",{replace:!0})):(n(3,a="login"),h()!=="/login"&&Vi("/login",{replace:!0}))}catch{n(3,a="error")}}on(()=>(g(),window.addEventListener("popstate",g),()=>window.removeEventListener("popstate",g))),Promise.resolve(o).then(k).catch(()=>n(3,a="error"));function y(){n(2,d=QO.innerWidth)}const T=()=>n(3,a="authenticated");function M(R){u=R,n(1,u)}function A(R){f=R,n(4,f)}const C=()=>n(3,a="login");function D(R){u=R,n(1,u)}return t.$$set=R=>{"url"in R&&n(0,s=R.url)},t.$$.update=()=>{t.$$.dirty&4&&n(9,i=d {:else}
        - + (state = "login")} + /> { + expect(recordsSource.match(/Add record/g)?.length ?? 0).toBe(1); + expect(recordsSource).toContain('slot="actions"'); + expect(recordsSource).toContain("on:click={openCreate}"); +}); + test("DNS block lists edit by row identity and confirm removal", () => { const lists = compact(listsSource); expect(lists).toContain('getSetting("dns_custom_entries")'); diff --git a/ui/src/components/__tests__/secure_setup_ui.test.ts b/ui/src/components/__tests__/secure_setup_ui.test.ts index f96e02f..930b7b9 100644 --- a/ui/src/components/__tests__/secure_setup_ui.test.ts +++ b/ui/src/components/__tests__/secure_setup_ui.test.ts @@ -5,6 +5,7 @@ import loginSource from "../../routes/login/login.svelte?raw"; import appSource from "../../App.svelte?raw"; import generalSettingsSource from "../connectedGeneralSettingInputs.svelte?raw"; import headerSource from "../headerrightnav.svelte?raw"; +import globalHeaderSource from "../globalheader.svelte?raw"; import settingsSource from "../../routes/settings/settings.svelte?raw"; import certificateLinkSource from "../downloadCertificateLink.svelte?raw"; @@ -55,3 +56,14 @@ test("authenticated administrator identity is displayed from the verified sessio expect(settingsSource).toContain("value={$store.api.username}"); expect(settingsSource).not.toContain('keyName="admin_username"'); }); + +test("login keeps clear and submit actions in one row", () => { + expect(loginSource).toContain(""); + expect(loginSource).not.toContain(""); +}); + +test("logout signals the shell so the login route renders immediately", () => { + expect(headerSource).toContain('dispatch("loggedout")'); + expect(globalHeaderSource).toContain('on:loggedout={() => dispatch("loggedout")}'); + expect(appSource).toContain('on:loggedout={() => (state = "login")}'); +}); diff --git a/ui/src/components/__tests__/shell_foundation.test.ts b/ui/src/components/__tests__/shell_foundation.test.ts index c857e81..4ec855a 100644 --- a/ui/src/components/__tests__/shell_foundation.test.ts +++ b/ui/src/components/__tests__/shell_foundation.test.ts @@ -3,6 +3,7 @@ import appSource from "../../App.svelte?raw"; import menuSource from "../../menu.ts?raw"; import mainSource from "../../main.ts?raw"; import logsSource from "../../routes/logs/logs.svelte?raw"; +import servicesSource from "../../routes/services/services.svelte?raw"; const compact = (source: string) => source.replace(/\s+/g, " "); @@ -54,3 +55,8 @@ test("Raspberry Pi storage guidance is not shown on the decision log", () => { expect(logsSource).not.toContain("Raspberry Pi"); expect(logsSource).not.toContain("/tmp/log.db"); }); + +test("services page uses the standard page width like other routes", () => { + expect(servicesSource).toContain(" - - + /> {:else}
        diff --git a/ui/src/components/globalheader.svelte b/ui/src/components/globalheader.svelte index 61f8574..f505be5 100644 --- a/ui/src/components/globalheader.svelte +++ b/ui/src/components/globalheader.svelte @@ -1,6 +1,6 @@