@blueprint-chart/editor 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/assets/{CopyRedirect-DWJqAXhM.js → CopyRedirect-D-57xalZ.js} +1 -1
- package/dist/assets/LandingPage-BVJ4ljon.js +4 -0
- package/dist/assets/LandingPage-DwbySIyi.css +1 -0
- package/dist/assets/index-DNhFANuK.js +859 -0
- package/dist/assets/index-DkGlODiu.js +44 -0
- package/dist/assets/{index-CQLeIi0R.css → index-YAiDDaCu.css} +2 -2
- package/dist/index.html +2 -2
- package/package.json +4 -3
- package/dist/assets/LandingPage-B7LxmH7R.js +0 -4
- package/dist/assets/LandingPage-DpynvD5x.css +0 -1
- package/dist/assets/index-Bv8IEq6k.js +0 -859
|
@@ -1,859 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-B7LxmH7R.js","assets/LandingPage-DpynvD5x.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var u9=Object.defineProperty;var d9=(t,e,n)=>e in t?u9(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var bn=(t,e,n)=>d9(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();/**
|
|
3
|
-
* @vue/shared v3.5.29
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function Zb(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Wt={},Lc=[],pi=()=>{},gS=()=>!1,z0=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Qb=t=>t.startsWith("onUpdate:"),Rn=Object.assign,Jb=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},f9=Object.prototype.hasOwnProperty,Zt=(t,e)=>f9.call(t,e),dt=Array.isArray,Pc=t=>_f(t)==="[object Map]",yu=t=>_f(t)==="[object Set]",jx=t=>_f(t)==="[object Date]",bt=t=>typeof t=="function",vn=t=>typeof t=="string",xi=t=>typeof t=="symbol",Xt=t=>t!==null&&typeof t=="object",vS=t=>(Xt(t)||bt(t))&&bt(t.then)&&bt(t.catch),bS=Object.prototype.toString,_f=t=>bS.call(t),h9=t=>_f(t).slice(8,-1),yS=t=>_f(t)==="[object Object]",H0=t=>vn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,vd=Zb(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),W0=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},p9=/-\w/g,Cr=W0(t=>t.replace(p9,e=>e.slice(1).toUpperCase())),m9=/\B([A-Z])/g,ea=W0(t=>t.replace(m9,"-$1").toLowerCase()),U0=W0(t=>t.charAt(0).toUpperCase()+t.slice(1)),Bg=W0(t=>t?`on${U0(t)}`:""),Jo=(t,e)=>!Object.is(t,e),Gh=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},xS=(t,e,n,o=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:o,value:n})},G0=t=>{const e=parseFloat(t);return isNaN(e)?t:e},g9=t=>{const e=vn(t)?Number(t):NaN;return isNaN(e)?t:e};let Xx;const q0=()=>Xx||(Xx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Dt(t){if(dt(t)){const e={};for(let n=0;n<t.length;n++){const o=t[n],r=vn(o)?x9(o):Dt(o);if(r)for(const i in r)e[i]=r[i]}return e}else if(vn(t)||Xt(t))return t}const v9=/;(?![^(]*\))/g,b9=/:([^]+)/,y9=/\/\*[^]*?\*\//g;function x9(t){const e={};return t.replace(y9,"").split(v9).forEach(n=>{if(n){const o=n.split(b9);o.length>1&&(e[o[0].trim()]=o[1].trim())}}),e}function Te(t){let e="";if(vn(t))e=t;else if(dt(t))for(let n=0;n<t.length;n++){const o=Te(t[n]);o&&(e+=o+" ")}else if(Xt(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function Hn(t){if(!t)return null;let{class:e,style:n}=t;return e&&!vn(e)&&(t.class=Te(e)),n&&(t.style=Dt(n)),t}const w9="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_9=Zb(w9);function wS(t){return!!t||t===""}function k9(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Oa(t[o],e[o]);return n}function Oa(t,e){if(t===e)return!0;let n=jx(t),o=jx(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=xi(t),o=xi(e),n||o)return t===e;if(n=dt(t),o=dt(e),n||o)return n&&o?k9(t,e):!1;if(n=Xt(t),o=Xt(e),n||o){if(!n||!o)return!1;const r=Object.keys(t).length,i=Object.keys(e).length;if(r!==i)return!1;for(const s in t){const a=t.hasOwnProperty(s),l=e.hasOwnProperty(s);if(a&&!l||!a&&l||!Oa(t[s],e[s]))return!1}}return String(t)===String(e)}function ey(t,e){return t.findIndex(n=>Oa(n,e))}const _S=t=>!!(t&&t.__v_isRef===!0),be=t=>vn(t)?t:t==null?"":dt(t)||Xt(t)&&(t.toString===bS||!bt(t.toString))?_S(t)?be(t.value):JSON.stringify(t,kS,2):String(t),kS=(t,e)=>_S(e)?kS(t,e.value):Pc(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[o,r],i)=>(n[Lg(o,i)+" =>"]=r,n),{})}:yu(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Lg(n))}:xi(e)?Lg(e):Xt(e)&&!dt(e)&&!yS(e)?String(e):e,Lg=(t,e="")=>{var n;return xi(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function S9(t){return t==null?"initial":typeof t=="string"?t===""?" ":t:String(t)}/**
|
|
7
|
-
* @vue/reactivity v3.5.29
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let vo;class SS{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=vo,!e&&vo&&(this.index=(vo.scopes||(vo.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=vo;try{return vo=this,e()}finally{vo=n}}}on(){++this._on===1&&(this.prevScope=vo,vo=this)}off(){this._on>0&&--this._on===0&&(vo=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Y0(t){return new SS(t)}function Xl(){return vo}function Ba(t,e=!1){vo&&vo.cleanups.push(t)}let un;const Pg=new WeakSet;class AS{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,vo&&vo.active&&vo.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Pg.has(this)&&(Pg.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$S(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Kx(this),TS(this);const e=un,n=mi;un=this,mi=!0;try{return this.fn()}finally{MS(this),un=e,mi=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)oy(e);this.deps=this.depsTail=void 0,Kx(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Pg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){e1(this)&&this.run()}get dirty(){return e1(this)}}let CS=0,bd,yd;function $S(t,e=!1){if(t.flags|=8,e){t.next=yd,yd=t;return}t.next=bd,bd=t}function ty(){CS++}function ny(){if(--CS>0)return;if(yd){let e=yd;for(yd=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;bd;){let e=bd;for(bd=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(o){t||(t=o)}e=n}}if(t)throw t}function TS(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function MS(t){let e,n=t.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),oy(o),A9(o)):e=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}t.deps=e,t.depsTail=n}function e1(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(OS(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function OS(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Fd)||(t.globalVersion=Fd,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!e1(t))))return;t.flags|=2;const e=t.dep,n=un,o=mi;un=t,mi=!0;try{TS(t);const r=t.fn(t._value);(e.version===0||Jo(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{un=n,mi=o,MS(t),t.flags&=-3}}function oy(t,e=!1){const{dep:n,prevSub:o,nextSub:r}=t;if(o&&(o.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=o,t.nextSub=void 0),n.subs===t&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)oy(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function A9(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let mi=!0;const BS=[];function qs(){BS.push(mi),mi=!1}function Ys(){const t=BS.pop();mi=t===void 0?!0:t}function Kx(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=un;un=void 0;try{e()}finally{un=n}}}let Fd=0;class C9{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class j0{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!un||!mi||un===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==un)n=this.activeLink=new C9(un,this),un.deps?(n.prevDep=un.depsTail,un.depsTail.nextDep=n,un.depsTail=n):un.deps=un.depsTail=n,LS(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=un.depsTail,n.nextDep=void 0,un.depsTail.nextDep=n,un.depsTail=n,un.deps===n&&(un.deps=o)}return n}trigger(e){this.version++,Fd++,this.notify(e)}notify(e){ty();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ny()}}}function LS(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let o=e.deps;o;o=o.nextDep)LS(o)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const pp=new WeakMap,Al=Symbol(""),t1=Symbol(""),Vd=Symbol("");function xo(t,e,n){if(mi&&un){let o=pp.get(t);o||pp.set(t,o=new Map);let r=o.get(n);r||(o.set(n,r=new j0),r.map=o,r.key=n),r.track()}}function Ls(t,e,n,o,r,i){const s=pp.get(t);if(!s){Fd++;return}const a=l=>{l&&l.trigger()};if(ty(),e==="clear")s.forEach(a);else{const l=dt(t),c=l&&H0(n);if(l&&n==="length"){const u=Number(o);s.forEach((d,f)=>{(f==="length"||f===Vd||!xi(f)&&f>=u)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(Vd)),e){case"add":l?c&&a(s.get("length")):(a(s.get(Al)),Pc(t)&&a(s.get(t1)));break;case"delete":l||(a(s.get(Al)),Pc(t)&&a(s.get(t1)));break;case"set":Pc(t)&&a(s.get(Al));break}}ny()}function $9(t,e){const n=pp.get(t);return n&&n.get(e)}function dc(t){const e=Lt(t);return e===t?e:(xo(e,"iterate",Vd),kr(t)?e:e.map(wi))}function X0(t){return xo(t=Lt(t),"iterate",Vd),t}function ga(t,e){return js(t)?Yc(ts(t)?wi(e):e):wi(e)}const T9={__proto__:null,[Symbol.iterator](){return Dg(this,Symbol.iterator,t=>ga(this,t))},concat(...t){return dc(this).concat(...t.map(e=>dt(e)?dc(e):e))},entries(){return Dg(this,"entries",t=>(t[1]=ga(this,t[1]),t))},every(t,e){return bs(this,"every",t,e,void 0,arguments)},filter(t,e){return bs(this,"filter",t,e,n=>n.map(o=>ga(this,o)),arguments)},find(t,e){return bs(this,"find",t,e,n=>ga(this,n),arguments)},findIndex(t,e){return bs(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return bs(this,"findLast",t,e,n=>ga(this,n),arguments)},findLastIndex(t,e){return bs(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return bs(this,"forEach",t,e,void 0,arguments)},includes(...t){return Eg(this,"includes",t)},indexOf(...t){return Eg(this,"indexOf",t)},join(t){return dc(this).join(t)},lastIndexOf(...t){return Eg(this,"lastIndexOf",t)},map(t,e){return bs(this,"map",t,e,void 0,arguments)},pop(){return Vu(this,"pop")},push(...t){return Vu(this,"push",t)},reduce(t,...e){return Zx(this,"reduce",t,e)},reduceRight(t,...e){return Zx(this,"reduceRight",t,e)},shift(){return Vu(this,"shift")},some(t,e){return bs(this,"some",t,e,void 0,arguments)},splice(...t){return Vu(this,"splice",t)},toReversed(){return dc(this).toReversed()},toSorted(t){return dc(this).toSorted(t)},toSpliced(...t){return dc(this).toSpliced(...t)},unshift(...t){return Vu(this,"unshift",t)},values(){return Dg(this,"values",t=>ga(this,t))}};function Dg(t,e,n){const o=X0(t),r=o[e]();return o!==t&&!kr(t)&&(r._next=r.next,r.next=()=>{const i=r._next();return i.done||(i.value=n(i.value)),i}),r}const M9=Array.prototype;function bs(t,e,n,o,r,i){const s=X0(t),a=s!==t&&!kr(t),l=s[e];if(l!==M9[e]){const d=l.apply(t,i);return a?wi(d):d}let c=n;s!==t&&(a?c=function(d,f){return n.call(this,ga(t,d),f,t)}:n.length>2&&(c=function(d,f){return n.call(this,d,f,t)}));const u=l.call(s,c,o);return a&&r?r(u):u}function Zx(t,e,n,o){const r=X0(t);let i=n;return r!==t&&(kr(t)?n.length>3&&(i=function(s,a,l){return n.call(this,s,a,l,t)}):i=function(s,a,l){return n.call(this,s,ga(t,a),l,t)}),r[e](i,...o)}function Eg(t,e,n){const o=Lt(t);xo(o,"iterate",Vd);const r=o[e](...n);return(r===-1||r===!1)&&Q0(n[0])?(n[0]=Lt(n[0]),o[e](...n)):r}function Vu(t,e,n=[]){qs(),ty();const o=Lt(t)[e].apply(t,n);return ny(),Ys(),o}const O9=Zb("__proto__,__v_isRef,__isVue"),PS=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(xi));function B9(t){xi(t)||(t=String(t));const e=Lt(this);return xo(e,"has",t),e.hasOwnProperty(t)}class DS{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,o){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return i;if(n==="__v_raw")return o===(r?i?VS:FS:i?RS:IS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(o)?e:void 0;const s=dt(e);if(!r){let l;if(s&&(l=T9[n]))return l;if(n==="hasOwnProperty")return B9}const a=Reflect.get(e,n,Ze(e)?e:o);if((xi(n)?PS.has(n):O9(n))||(r||xo(e,"get",n),i))return a;if(Ze(a)){const l=s&&H0(n)?a:a.value;return r&&Xt(l)?ao(l):l}return Xt(a)?r?ao(a):ar(a):a}}class ES extends DS{constructor(e=!1){super(!1,e)}set(e,n,o,r){let i=e[n];const s=dt(e)&&H0(n);if(!this._isShallow){const c=js(i);if(!kr(o)&&!js(o)&&(i=Lt(i),o=Lt(o)),!s&&Ze(i)&&!Ze(o))return c||(i.value=o),!0}const a=s?Number(n)<e.length:Zt(e,n),l=Reflect.set(e,n,o,Ze(e)?e:r);return e===Lt(r)&&(a?Jo(o,i)&&Ls(e,"set",n,o):Ls(e,"add",n,o)),l}deleteProperty(e,n){const o=Zt(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&o&&Ls(e,"delete",n,void 0),r}has(e,n){const o=Reflect.has(e,n);return(!xi(n)||!PS.has(n))&&xo(e,"has",n),o}ownKeys(e){return xo(e,"iterate",dt(e)?"length":Al),Reflect.ownKeys(e)}}class NS extends DS{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const L9=new ES,P9=new NS,D9=new ES(!0),E9=new NS(!0),n1=t=>t,Kf=t=>Reflect.getPrototypeOf(t);function N9(t,e,n){return function(...o){const r=this.__v_raw,i=Lt(r),s=Pc(i),a=t==="entries"||t===Symbol.iterator&&s,l=t==="keys"&&s,c=r[t](...o),u=n?n1:e?Yc:wi;return!e&&xo(i,"iterate",l?t1:Al),Rn(Object.create(c),{next(){const{value:d,done:f}=c.next();return f?{value:d,done:f}:{value:a?[u(d[0]),u(d[1])]:u(d),done:f}}})}}function Zf(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function I9(t,e){const n={get(r){const i=this.__v_raw,s=Lt(i),a=Lt(r);t||(Jo(r,a)&&xo(s,"get",r),xo(s,"get",a));const{has:l}=Kf(s),c=e?n1:t?Yc:wi;if(l.call(s,r))return c(i.get(r));if(l.call(s,a))return c(i.get(a));i!==s&&i.get(r)},get size(){const r=this.__v_raw;return!t&&xo(Lt(r),"iterate",Al),r.size},has(r){const i=this.__v_raw,s=Lt(i),a=Lt(r);return t||(Jo(r,a)&&xo(s,"has",r),xo(s,"has",a)),r===a?i.has(r):i.has(r)||i.has(a)},forEach(r,i){const s=this,a=s.__v_raw,l=Lt(a),c=e?n1:t?Yc:wi;return!t&&xo(l,"iterate",Al),a.forEach((u,d)=>r.call(i,c(u),c(d),s))}};return Rn(n,t?{add:Zf("add"),set:Zf("set"),delete:Zf("delete"),clear:Zf("clear")}:{add(r){!e&&!kr(r)&&!js(r)&&(r=Lt(r));const i=Lt(this);return Kf(i).has.call(i,r)||(i.add(r),Ls(i,"add",r,r)),this},set(r,i){!e&&!kr(i)&&!js(i)&&(i=Lt(i));const s=Lt(this),{has:a,get:l}=Kf(s);let c=a.call(s,r);c||(r=Lt(r),c=a.call(s,r));const u=l.call(s,r);return s.set(r,i),c?Jo(i,u)&&Ls(s,"set",r,i):Ls(s,"add",r,i),this},delete(r){const i=Lt(this),{has:s,get:a}=Kf(i);let l=s.call(i,r);l||(r=Lt(r),l=s.call(i,r)),a&&a.call(i,r);const c=i.delete(r);return l&&Ls(i,"delete",r,void 0),c},clear(){const r=Lt(this),i=r.size!==0,s=r.clear();return i&&Ls(r,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=N9(r,t,e)}),n}function K0(t,e){const n=I9(t,e);return(o,r,i)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?o:Reflect.get(Zt(n,r)&&r in o?n:o,r,i)}const R9={get:K0(!1,!1)},F9={get:K0(!1,!0)},V9={get:K0(!0,!1)},z9={get:K0(!0,!0)},IS=new WeakMap,RS=new WeakMap,FS=new WeakMap,VS=new WeakMap;function H9(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function W9(t){return t.__v_skip||!Object.isExtensible(t)?0:H9(h9(t))}function ar(t){return js(t)?t:Z0(t,!1,L9,R9,IS)}function zS(t){return Z0(t,!1,D9,F9,RS)}function ao(t){return Z0(t,!0,P9,V9,FS)}function hl(t){return Z0(t,!0,E9,z9,VS)}function Z0(t,e,n,o,r){if(!Xt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const i=W9(t);if(i===0)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,i===2?o:n);return r.set(t,a),a}function ts(t){return js(t)?ts(t.__v_raw):!!(t&&t.__v_isReactive)}function js(t){return!!(t&&t.__v_isReadonly)}function kr(t){return!!(t&&t.__v_isShallow)}function Q0(t){return t?!!t.__v_raw:!1}function Lt(t){const e=t&&t.__v_raw;return e?Lt(e):t}function Me(t){return!Zt(t,"__v_skip")&&Object.isExtensible(t)&&xS(t,"__v_skip",!0),t}const wi=t=>Xt(t)?ar(t):t,Yc=t=>Xt(t)?ao(t):t;function Ze(t){return t?t.__v_isRef===!0:!1}function ze(t){return HS(t,!1)}function Fe(t){return HS(t,!0)}function HS(t,e){return Ze(t)?t:new U9(t,e)}class U9{constructor(e,n){this.dep=new j0,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:Lt(e),this._value=n?e:wi(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,o=this.__v_isShallow||kr(e)||js(e);e=o?e:Lt(e),Jo(e,n)&&(this._rawValue=e,this._value=o?e:wi(e),this.dep.trigger())}}function p(t){return Ze(t)?t.value:t}function yt(t){return bt(t)?t():p(t)}const G9={get:(t,e,n)=>e==="__v_raw"?t:p(Reflect.get(t,e,n)),set:(t,e,n,o)=>{const r=t[e];return Ze(r)&&!Ze(n)?(r.value=n,!0):Reflect.set(t,e,n,o)}};function WS(t){return ts(t)?t:new Proxy(t,G9)}class q9{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new j0,{get:o,set:r}=e(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}}function US(t){return new q9(t)}function J0(t){const e=dt(t)?new Array(t.length):{};for(const n in t)e[n]=GS(t,n);return e}class Y9{constructor(e,n,o){this._object=e,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0,this._raw=Lt(e);let r=!0,i=e;if(!dt(e)||!H0(String(n)))do r=!Q0(i)||kr(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=p(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Ze(this._raw[this._key])){const n=this._object[this._key];if(Ze(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return $9(this._raw,this._key)}}class j9{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function zt(t,e,n){return Ze(t)?t:bt(t)?new j9(t):Xt(t)&&arguments.length>1?GS(t,e,n):ze(t)}function GS(t,e,n){return new Y9(t,e,n)}class X9{constructor(e,n,o){this.fn=e,this.setter=n,this._value=void 0,this.dep=new j0(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fd-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&un!==this)return $S(this,!0),!0}get value(){const e=this.dep.track();return OS(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function K9(t,e,n=!1){let o,r;return bt(t)?o=t:(o=t.get,r=t.set),new X9(o,r,n)}const Qf={},mp=new WeakMap;let pl;function Z9(t,e=!1,n=pl){if(n){let o=mp.get(n);o||mp.set(n,o=[]),o.push(t)}}function Q9(t,e,n=Wt){const{immediate:o,deep:r,once:i,scheduler:s,augmentJob:a,call:l}=n,c=_=>r?_:kr(_)||r===!1||r===0?Ps(_,1):Ps(_);let u,d,f,h,g=!1,v=!1;if(Ze(t)?(d=()=>t.value,g=kr(t)):ts(t)?(d=()=>c(t),g=!0):dt(t)?(v=!0,g=t.some(_=>ts(_)||kr(_)),d=()=>t.map(_=>{if(Ze(_))return _.value;if(ts(_))return c(_);if(bt(_))return l?l(_,2):_()})):bt(t)?e?d=l?()=>l(t,2):t:d=()=>{if(f){qs();try{f()}finally{Ys()}}const _=pl;pl=u;try{return l?l(t,3,[h]):t(h)}finally{pl=_}}:d=pi,e&&r){const _=d,S=r===!0?1/0:r;d=()=>Ps(_(),S)}const m=Xl(),b=()=>{u.stop(),m&&m.active&&Jb(m.effects,u)};if(i&&e){const _=e;e=(...S)=>{_(...S),b()}}let y=v?new Array(t.length).fill(Qf):Qf;const x=_=>{if(!(!(u.flags&1)||!u.dirty&&!_))if(e){const S=u.run();if(r||g||(v?S.some((N,B)=>Jo(N,y[B])):Jo(S,y))){f&&f();const N=pl;pl=u;try{const B=[S,y===Qf?void 0:v&&y[0]===Qf?[]:y,h];y=S,l?l(e,3,B):e(...B)}finally{pl=N}}}else u.run()};return a&&a(x),u=new AS(d),u.scheduler=s?()=>s(x,!1):x,h=_=>Z9(_,!1,u),f=u.onStop=()=>{const _=mp.get(u);if(_){if(l)l(_,4);else for(const S of _)S();mp.delete(u)}},e?o?x(!0):y=u.run():s?s(x.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function Ps(t,e=1/0,n){if(e<=0||!Xt(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Ze(t))Ps(t.value,e,n);else if(dt(t))for(let o=0;o<t.length;o++)Ps(t[o],e,n);else if(yu(t)||Pc(t))t.forEach(o=>{Ps(o,e,n)});else if(yS(t)){for(const o in t)Ps(t[o],e,n);for(const o of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,o)&&Ps(t[o],e,n)}return t}/**
|
|
11
|
-
* @vue/runtime-core v3.5.29
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/function kf(t,e,n,o){try{return o?t(...o):t()}catch(r){em(r,e,n)}}function _i(t,e,n,o){if(bt(t)){const r=kf(t,e,n,o);return r&&vS(r)&&r.catch(i=>{em(i,e,n)}),r}if(dt(t)){const r=[];for(let i=0;i<t.length;i++)r.push(_i(t[i],e,n,o));return r}}function em(t,e,n,o=!0){const r=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||Wt;if(e){let a=e.parent;const l=e.proxy,c=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](t,l,c)===!1)return}a=a.parent}if(i){qs(),kf(i,null,10,[t,l,c]),Ys();return}}J9(t,n,r,o,s)}function J9(t,e,n,o=!0,r=!1){if(r)throw t;console.error(t)}const Vo=[];let qi=-1;const Dc=[];let va=null,_c=0;const qS=Promise.resolve();let gp=null;function wn(t){const e=gp||qS;return t?e.then(this?t.bind(this):t):e}function eL(t){let e=qi+1,n=Vo.length;for(;e<n;){const o=e+n>>>1,r=Vo[o],i=zd(r);i<t||i===t&&r.flags&2?e=o+1:n=o}return e}function ry(t){if(!(t.flags&1)){const e=zd(t),n=Vo[Vo.length-1];!n||!(t.flags&2)&&e>=zd(n)?Vo.push(t):Vo.splice(eL(e),0,t),t.flags|=1,YS()}}function YS(){gp||(gp=qS.then(KS))}function jS(t){dt(t)?Dc.push(...t):va&&t.id===-1?va.splice(_c+1,0,t):t.flags&1||(Dc.push(t),t.flags|=1),YS()}function Qx(t,e,n=qi+1){for(;n<Vo.length;n++){const o=Vo[n];if(o&&o.flags&2){if(t&&o.id!==t.uid)continue;Vo.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function XS(t){if(Dc.length){const e=[...new Set(Dc)].sort((n,o)=>zd(n)-zd(o));if(Dc.length=0,va){va.push(...e);return}for(va=e,_c=0;_c<va.length;_c++){const n=va[_c];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}va=null,_c=0}}const zd=t=>t.id==null?t.flags&2?-1:1/0:t.id;function KS(t){try{for(qi=0;qi<Vo.length;qi++){const e=Vo[qi];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),kf(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;qi<Vo.length;qi++){const e=Vo[qi];e&&(e.flags&=-2)}qi=-1,Vo.length=0,XS(),gp=null,(Vo.length||Dc.length)&&KS()}}let so=null,ZS=null;function vp(t){const e=so;return so=t,ZS=t&&t.type.__scopeId||null,e}function J(t,e=so,n){if(!e||t._n)return t;const o=(...r)=>{o._d&&wp(-1);const i=vp(e);let s;try{s=t(...r)}finally{vp(i),o._d&&wp(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function sr(t,e){if(so===null)return t;const n=cm(so),o=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[i,s,a,l=Wt]=e[r];i&&(bt(i)&&(i={mounted:i,updated:i}),i.deep&&Ps(s),o.push({dir:i,instance:n,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function sl(t,e,n,o){const r=t.dirs,i=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];i&&(a.oldValue=i[s].value);let l=a.dir[o];l&&(qs(),_i(l,n,8,[t.el,a,t,e]),Ys())}}function gi(t,e){if(ko){let n=ko.provides;const o=ko.parent&&ko.parent.provides;o===n&&(n=ko.provides=Object.create(o)),n[t]=e}}function jt(t,e,n=!1){const o=Bo();if(o||Cl){let r=Cl?Cl._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&bt(e)?e.call(o&&o.proxy):e}}function iy(){return!!(Bo()||Cl)}const tL=Symbol.for("v-scx"),nL=()=>jt(tL);function tm(t,e){return nm(t,null,e)}function oL(t,e){return nm(t,null,{flush:"sync"})}function je(t,e,n){return nm(t,e,n)}function nm(t,e,n=Wt){const{immediate:o,deep:r,flush:i,once:s}=n,a=Rn({},n),l=e&&o||!e&&i!=="post";let c;if(Gd){if(i==="sync"){const h=nL();c=h.__watcherHandles||(h.__watcherHandles=[])}else if(!l){const h=()=>{};return h.stop=pi,h.resume=pi,h.pause=pi,h}}const u=ko;a.call=(h,g,v)=>_i(h,u,g,v);let d=!1;i==="post"?a.scheduler=h=>{go(h,u&&u.suspense)}:i!=="sync"&&(d=!0,a.scheduler=(h,g)=>{g?h():ry(h)}),a.augmentJob=h=>{e&&(h.flags|=4),d&&(h.flags|=2,u&&(h.id=u.uid,h.i=u))};const f=Q9(t,e,a);return Gd&&(c?c.push(f):l&&f()),f}function rL(t,e,n){const o=this.proxy,r=vn(t)?t.includes(".")?QS(o,t):()=>o[t]:t.bind(o,o);let i;bt(e)?i=e:(i=e.handler,n=e);const s=Sf(this),a=nm(r,i.bind(o),n);return s(),a}function QS(t,e){const n=e.split(".");return()=>{let o=t;for(let r=0;r<n.length&&o;r++)o=o[n[r]];return o}}const JS=Symbol("_vte"),e3=t=>t.__isTeleport,xd=t=>t&&(t.disabled||t.disabled===""),Jx=t=>t&&(t.defer||t.defer===""),ew=t=>typeof SVGElement<"u"&&t instanceof SVGElement,tw=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,o1=(t,e)=>{const n=t&&t.to;return vn(n)?e?e(n):null:n},t3={name:"Teleport",__isTeleport:!0,process(t,e,n,o,r,i,s,a,l,c){const{mc:u,pc:d,pbc:f,o:{insert:h,querySelector:g,createText:v,createComment:m}}=c,b=xd(e.props);let{shapeFlag:y,children:x,dynamicChildren:_}=e;if(t==null){const S=e.el=v(""),N=e.anchor=v("");h(S,n,o),h(N,n,o);const B=(L,E)=>{y&16&&u(x,L,E,r,i,s,a,l)},k=()=>{const L=e.target=o1(e.props,g),E=r1(L,e,v,h);L&&(s!=="svg"&&ew(L)?s="svg":s!=="mathml"&&tw(L)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(L),b||(B(L,E),qh(e,!1)))};b&&(B(n,N),qh(e,!0)),Jx(e.props)?(e.el.__isMounted=!1,go(()=>{k(),delete e.el.__isMounted},i)):k()}else{if(Jx(e.props)&&t.el.__isMounted===!1){go(()=>{t3.process(t,e,n,o,r,i,s,a,l,c)},i);return}e.el=t.el,e.targetStart=t.targetStart;const S=e.anchor=t.anchor,N=e.target=t.target,B=e.targetAnchor=t.targetAnchor,k=xd(t.props),L=k?n:N,E=k?S:B;if(s==="svg"||ew(N)?s="svg":(s==="mathml"||tw(N))&&(s="mathml"),_?(f(t.dynamicChildren,_,L,r,i,s,a),uy(t,e,!0)):l||d(t,e,L,E,r,i,s,a,!1),b)k?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Jf(e,n,S,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const I=e.target=o1(e.props,g);I&&Jf(e,I,null,c,0)}else k&&Jf(e,N,B,c,1);qh(e,b)}},remove(t,e,n,{um:o,o:{remove:r}},i){const{shapeFlag:s,children:a,anchor:l,targetStart:c,targetAnchor:u,target:d,props:f}=t;if(d&&(r(c),r(u)),i&&r(l),s&16){const h=i||!xd(f);for(let g=0;g<a.length;g++){const v=a[g];o(v,e,n,h,!!v.dynamicChildren)}}},move:Jf,hydrate:iL};function Jf(t,e,n,{o:{insert:o},m:r},i=2){i===0&&o(t.targetAnchor,e,n);const{el:s,anchor:a,shapeFlag:l,children:c,props:u}=t,d=i===2;if(d&&o(s,e,n),(!d||xd(u))&&l&16)for(let f=0;f<c.length;f++)r(c[f],e,n,2);d&&o(a,e,n)}function iL(t,e,n,o,r,i,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:c,createText:u}},d){function f(m,b){let y=b;for(;y;){if(y&&y.nodeType===8){if(y.data==="teleport start anchor")e.targetStart=y;else if(y.data==="teleport anchor"){e.targetAnchor=y,m._lpa=e.targetAnchor&&s(e.targetAnchor);break}}y=s(y)}}function h(m,b){b.anchor=d(s(m),b,a(m),n,o,r,i)}const g=e.target=o1(e.props,l),v=xd(e.props);if(g){const m=g._lpa||g.firstChild;e.shapeFlag&16&&(v?(h(t,e),f(g,m),e.targetAnchor||r1(g,e,u,c,a(t)===g?t:null)):(e.anchor=s(t),f(g,m),e.targetAnchor||r1(g,e,u,c),d(m&&s(m),e,g,n,o,r,i))),qh(e,v)}else v&&e.shapeFlag&16&&(h(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}const sy=t3;function qh(t,e){const n=t.ctx;if(n&&n.ut){let o,r;for(e?(o=t.el,r=t.anchor):(o=t.targetStart,r=t.targetAnchor);o&&o!==r;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function r1(t,e,n,o,r=null){const i=e.targetStart=n(""),s=e.targetAnchor=n("");return i[JS]=s,t&&(o(i,t,r),o(s,t,r)),s}const Yi=Symbol("_leaveCb"),zu=Symbol("_enterCb");function sL(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return hn(()=>{t.isMounted=!0}),Xs(()=>{t.isUnmounting=!0}),t}const Nr=[Function,Array],n3={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Nr,onEnter:Nr,onAfterEnter:Nr,onEnterCancelled:Nr,onBeforeLeave:Nr,onLeave:Nr,onAfterLeave:Nr,onLeaveCancelled:Nr,onBeforeAppear:Nr,onAppear:Nr,onAfterAppear:Nr,onAppearCancelled:Nr},o3=t=>{const e=t.subTree;return e.component?o3(e.component):e},aL={name:"BaseTransition",props:n3,setup(t,{slots:e}){const n=Bo(),o=sL();return()=>{const r=e.default&&s3(e.default(),!0);if(!r||!r.length)return;const i=r3(r),s=Lt(t),{mode:a}=s;if(o.isLeaving)return Ng(i);const l=nw(i);if(!l)return Ng(i);let c=i1(l,s,o,n,d=>c=d);l.type!==_o&&Hd(l,c);let u=n.subTree&&nw(n.subTree);if(u&&u.type!==_o&&!bl(u,l)&&o3(n).type!==_o){let d=i1(u,s,o,n);if(Hd(u,d),a==="out-in"&&l.type!==_o)return o.isLeaving=!0,d.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete d.afterLeave,u=void 0},Ng(i);a==="in-out"&&l.type!==_o?d.delayLeave=(f,h,g)=>{const v=i3(o,u);v[String(u.key)]=u,f[Yi]=()=>{h(),f[Yi]=void 0,delete c.delayedLeave,u=void 0},c.delayedLeave=()=>{g(),delete c.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return i}}};function r3(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==_o){e=n;break}}return e}const lL=aL;function i3(t,e){const{leavingVNodes:n}=t;let o=n.get(e.type);return o||(o=Object.create(null),n.set(e.type,o)),o}function i1(t,e,n,o,r){const{appear:i,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:c,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:h,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:m,onAppear:b,onAfterAppear:y,onAppearCancelled:x}=e,_=String(t.key),S=i3(n,t),N=(L,E)=>{L&&_i(L,o,9,E)},B=(L,E)=>{const I=E[1];N(L,E),dt(L)?L.every(C=>C.length<=1)&&I():L.length<=1&&I()},k={mode:s,persisted:a,beforeEnter(L){let E=l;if(!n.isMounted)if(i)E=m||l;else return;L[Yi]&&L[Yi](!0);const I=S[_];I&&bl(t,I)&&I.el[Yi]&&I.el[Yi](),N(E,[L])},enter(L){if(S[_]===t)return;let E=c,I=u,C=d;if(!n.isMounted)if(i)E=b||c,I=y||u,C=x||d;else return;let $=!1;L[zu]=M=>{$||($=!0,M?N(C,[L]):N(I,[L]),k.delayedLeave&&k.delayedLeave(),L[zu]=void 0)};const P=L[zu].bind(null,!1);E?B(E,[L,P]):P()},leave(L,E){const I=String(t.key);if(L[zu]&&L[zu](!0),n.isUnmounting)return E();N(f,[L]);let C=!1;L[Yi]=P=>{C||(C=!0,E(),P?N(v,[L]):N(g,[L]),L[Yi]=void 0,S[I]===t&&delete S[I])};const $=L[Yi].bind(null,!1);S[I]=t,h?B(h,[L,$]):$()},clone(L){const E=i1(L,e,n,o,r);return r&&r(E),E}};return k}function Ng(t){if(om(t))return t=La(t),t.children=null,t}function nw(t){if(!om(t))return e3(t.type)&&t.children?r3(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&bt(n.default))return n.default()}}function Hd(t,e){t.shapeFlag&6&&t.component?(t.transition=e,Hd(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function s3(t,e=!1,n){let o=[],r=0;for(let i=0;i<t.length;i++){let s=t[i];const a=n==null?s.key:String(n)+String(s.key!=null?s.key:i);s.type===Ge?(s.patchFlag&128&&r++,o=o.concat(s3(s.children,e,a))):(e||s.type!==_o)&&o.push(a!=null?La(s,{key:a}):s)}if(r>1)for(let i=0;i<o.length;i++)o[i].patchFlag=-2;return o}function le(t,e){return bt(t)?Rn({name:t.name},e,{setup:t}):t}function a3(){const t=Bo();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function l3(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function mt(t){const e=Bo(),n=Fe(null);if(e){const r=e.refs===Wt?e.refs={}:e.refs;Object.defineProperty(r,t,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function ow(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const bp=new WeakMap;function wd(t,e,n,o,r=!1){if(dt(t)){t.forEach((v,m)=>wd(v,e&&(dt(e)?e[m]:e),n,o,r));return}if(Ec(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&wd(t,e,n,o.component.subTree);return}const i=o.shapeFlag&4?cm(o.component):o.el,s=r?null:i,{i:a,r:l}=t,c=e&&e.r,u=a.refs===Wt?a.refs={}:a.refs,d=a.setupState,f=Lt(d),h=d===Wt?gS:v=>ow(u,v)?!1:Zt(f,v),g=(v,m)=>!(m&&ow(u,m));if(c!=null&&c!==l){if(rw(e),vn(c))u[c]=null,h(c)&&(d[c]=null);else if(Ze(c)){const v=e;g(c,v.k)&&(c.value=null),v.k&&(u[v.k]=null)}}if(bt(l))kf(l,a,12,[s,u]);else{const v=vn(l),m=Ze(l);if(v||m){const b=()=>{if(t.f){const y=v?h(l)?d[l]:u[l]:g()||!t.k?l.value:u[t.k];if(r)dt(y)&&Jb(y,i);else if(dt(y))y.includes(i)||y.push(i);else if(v)u[l]=[i],h(l)&&(d[l]=u[l]);else{const x=[i];g(l,t.k)&&(l.value=x),t.k&&(u[t.k]=x)}}else v?(u[l]=s,h(l)&&(d[l]=s)):m&&(g(l,t.k)&&(l.value=s),t.k&&(u[t.k]=s))};if(s){const y=()=>{b(),bp.delete(t)};y.id=-1,bp.set(t,y),go(y,n)}else rw(t),b()}}}function rw(t){const e=bp.get(t);e&&(e.flags|=8,bp.delete(t))}q0().requestIdleCallback;q0().cancelIdleCallback;const Ec=t=>!!t.type.__asyncLoader,om=t=>t.type.__isKeepAlive;function ay(t,e){u3(t,"a",e)}function c3(t,e){u3(t,"da",e)}function u3(t,e,n=ko){const o=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(rm(e,o,n),n){let r=n.parent;for(;r&&r.parent;)om(r.parent.vnode)&&cL(o,e,n,r),r=r.parent}}function cL(t,e,n,o){const r=rm(e,t,o,!0);na(()=>{Jb(o[e],r)},n)}function rm(t,e,n=ko,o=!1){if(n){const r=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...s)=>{qs();const a=Sf(n),l=_i(e,n,t,s);return a(),Ys(),l});return o?r.unshift(i):r.push(i),i}}const ta=t=>(e,n=ko)=>{(!Gd||t==="sp")&&rm(t,(...o)=>e(...o),n)},uL=ta("bm"),hn=ta("m"),d3=ta("bu"),dL=ta("u"),Xs=ta("bum"),na=ta("um"),fL=ta("sp"),hL=ta("rtg"),pL=ta("rtc");function mL(t,e=ko){rm("ec",t,e)}const f3="components";function im(t,e){return p3(f3,t,!0,e)||t}const h3=Symbol.for("v-ndc");function Gt(t){return vn(t)?p3(f3,t,!1)||t:t||h3}function p3(t,e,n=!0,o=!1){const r=so||ko;if(r){const i=r.type;{const a=KL(i,!1);if(a&&(a===e||a===Cr(e)||a===U0(Cr(e))))return i}const s=iw(r[t]||i[t],e)||iw(r.appContext[t],e);return!s&&o?i:s}}function iw(t,e){return t&&(t[e]||t[Cr(e)]||t[U0(Cr(e))])}function gt(t,e,n,o){let r;const i=n,s=dt(t);if(s||vn(t)){const a=s&&ts(t);let l=!1,c=!1;a&&(l=!kr(t),c=js(t),t=X0(t)),r=new Array(t.length);for(let u=0,d=t.length;u<d;u++)r[u]=e(l?c?Yc(wi(t[u])):wi(t[u]):t[u],u,void 0,i)}else if(typeof t=="number"){r=new Array(t);for(let a=0;a<t;a++)r[a]=e(a+1,a,void 0,i)}else if(Xt(t))if(t[Symbol.iterator])r=Array.from(t,(a,l)=>e(a,l,void 0,i));else{const a=Object.keys(t);r=new Array(a.length);for(let l=0,c=a.length;l<c;l++){const u=a[l];r[l]=e(t[u],u,l,i)}}else r=[];return r}function ki(t,e){for(let n=0;n<e.length;n++){const o=e[n];if(dt(o))for(let r=0;r<o.length;r++)t[o[r].name]=o[r].fn;else o&&(t[o.name]=o.key?(...r)=>{const i=o.fn(...r);return i&&(i.key=o.key),i}:o.fn)}return t}function Ae(t,e,n={},o,r){if(so.ce||so.parent&&Ec(so.parent)&&so.parent.ce){const c=Object.keys(n).length>0;return e!=="default"&&(n.name=e),w(),Q(Ge,null,[H("slot",n,o&&o())],c?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),w();const s=i&&m3(i(n)),a=n.key||s&&s.key,l=Q(Ge,{key:(a&&!xi(a)?a:`_${e}`)+(!s&&o?"_fb":"")},s||(o?o():[]),s&&t._===1?64:-2);return!r&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),i&&i._c&&(i._d=!0),l}function m3(t){return t.some(e=>Ud(e)?!(e.type===_o||e.type===Ge&&!m3(e.children)):!0)?t:null}const s1=t=>t?N3(t)?cm(t):s1(t.parent):null,_d=Rn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>s1(t.parent),$root:t=>s1(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>b3(t),$forceUpdate:t=>t.f||(t.f=()=>{ry(t.update)}),$nextTick:t=>t.n||(t.n=wn.bind(t.proxy)),$watch:t=>rL.bind(t)}),Ig=(t,e)=>t!==Wt&&!t.__isScriptSetup&&Zt(t,e),gL={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:i,accessCache:s,type:a,appContext:l}=t;if(e[0]!=="$"){const f=s[e];if(f!==void 0)switch(f){case 1:return o[e];case 2:return r[e];case 4:return n[e];case 3:return i[e]}else{if(Ig(o,e))return s[e]=1,o[e];if(r!==Wt&&Zt(r,e))return s[e]=2,r[e];if(Zt(i,e))return s[e]=3,i[e];if(n!==Wt&&Zt(n,e))return s[e]=4,n[e];a1&&(s[e]=0)}}const c=_d[e];let u,d;if(c)return e==="$attrs"&&xo(t.attrs,"get",""),c(t);if((u=a.__cssModules)&&(u=u[e]))return u;if(n!==Wt&&Zt(n,e))return s[e]=4,n[e];if(d=l.config.globalProperties,Zt(d,e))return d[e]},set({_:t},e,n){const{data:o,setupState:r,ctx:i}=t;return Ig(r,e)?(r[e]=n,!0):o!==Wt&&Zt(o,e)?(o[e]=n,!0):Zt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:o,appContext:r,props:i,type:s}},a){let l;return!!(n[a]||t!==Wt&&a[0]!=="$"&&Zt(t,a)||Ig(e,a)||Zt(i,a)||Zt(o,a)||Zt(_d,a)||Zt(r.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Zt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function ds(){return g3().slots}function sm(){return g3().attrs}function g3(t){const e=Bo();return e.setupContext||(e.setupContext=R3(e))}function yp(t){return dt(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function at(t,e){return!t||!e?t||e:dt(t)&&dt(e)?t.concat(e):Rn({},yp(t),yp(e))}let a1=!0;function vL(t){const e=b3(t),n=t.proxy,o=t.ctx;a1=!1,e.beforeCreate&&sw(e.beforeCreate,t,"bc");const{data:r,computed:i,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:f,beforeUpdate:h,updated:g,activated:v,deactivated:m,beforeDestroy:b,beforeUnmount:y,destroyed:x,unmounted:_,render:S,renderTracked:N,renderTriggered:B,errorCaptured:k,serverPrefetch:L,expose:E,inheritAttrs:I,components:C,directives:$,filters:P}=e;if(c&&bL(c,o,null),s)for(const V in s){const G=s[V];bt(G)&&(o[V]=G.bind(n))}if(r){const V=r.call(n,n);Xt(V)&&(t.data=ar(V))}if(a1=!0,i)for(const V in i){const G=i[V],K=bt(G)?G.bind(n,n):bt(G.get)?G.get.bind(n,n):pi,ue=!bt(G)&&bt(G.set)?G.set.bind(n):pi,de=A({get:K,set:ue});Object.defineProperty(o,V,{enumerable:!0,configurable:!0,get:()=>de.value,set:he=>de.value=he})}if(a)for(const V in a)v3(a[V],o,n,V);if(l){const V=bt(l)?l.call(n):l;Reflect.ownKeys(V).forEach(G=>{gi(G,V[G])})}u&&sw(u,t,"c");function F(V,G){dt(G)?G.forEach(K=>V(K.bind(n))):G&&V(G.bind(n))}if(F(uL,d),F(hn,f),F(d3,h),F(dL,g),F(ay,v),F(c3,m),F(mL,k),F(pL,N),F(hL,B),F(Xs,y),F(na,_),F(fL,L),dt(E))if(E.length){const V=t.exposed||(t.exposed={});E.forEach(G=>{Object.defineProperty(V,G,{get:()=>n[G],set:K=>n[G]=K,enumerable:!0})})}else t.exposed||(t.exposed={});S&&t.render===pi&&(t.render=S),I!=null&&(t.inheritAttrs=I),C&&(t.components=C),$&&(t.directives=$),L&&l3(t)}function bL(t,e,n=pi){dt(t)&&(t=l1(t));for(const o in t){const r=t[o];let i;Xt(r)?"default"in r?i=jt(r.from||o,r.default,!0):i=jt(r.from||o):i=jt(r),Ze(i)?Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>i.value,set:s=>i.value=s}):e[o]=i}}function sw(t,e,n){_i(dt(t)?t.map(o=>o.bind(e.proxy)):t.bind(e.proxy),e,n)}function v3(t,e,n,o){let r=o.includes(".")?QS(n,o):()=>n[o];if(vn(t)){const i=e[t];bt(i)&&je(r,i)}else if(bt(t))je(r,t.bind(n));else if(Xt(t))if(dt(t))t.forEach(i=>v3(i,e,n,o));else{const i=bt(t.handler)?t.handler.bind(n):e[t.handler];bt(i)&&je(r,i,t)}}function b3(t){const e=t.type,{mixins:n,extends:o}=e,{mixins:r,optionsCache:i,config:{optionMergeStrategies:s}}=t.appContext,a=i.get(e);let l;return a?l=a:!r.length&&!n&&!o?l=e:(l={},r.length&&r.forEach(c=>xp(l,c,s,!0)),xp(l,e,s)),Xt(e)&&i.set(e,l),l}function xp(t,e,n,o=!1){const{mixins:r,extends:i}=e;i&&xp(t,i,n,!0),r&&r.forEach(s=>xp(t,s,n,!0));for(const s in e)if(!(o&&s==="expose")){const a=yL[s]||n&&n[s];t[s]=a?a(t[s],e[s]):e[s]}return t}const yL={data:aw,props:lw,emits:lw,methods:id,computed:id,beforeCreate:No,created:No,beforeMount:No,mounted:No,beforeUpdate:No,updated:No,beforeDestroy:No,beforeUnmount:No,destroyed:No,unmounted:No,activated:No,deactivated:No,errorCaptured:No,serverPrefetch:No,components:id,directives:id,watch:wL,provide:aw,inject:xL};function aw(t,e){return e?t?function(){return Rn(bt(t)?t.call(this,this):t,bt(e)?e.call(this,this):e)}:e:t}function xL(t,e){return id(l1(t),l1(e))}function l1(t){if(dt(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function No(t,e){return t?[...new Set([].concat(t,e))]:e}function id(t,e){return t?Rn(Object.create(null),t,e):e}function lw(t,e){return t?dt(t)&&dt(e)?[...new Set([...t,...e])]:Rn(Object.create(null),yp(t),yp(e??{})):e}function wL(t,e){if(!t)return e;if(!e)return t;const n=Rn(Object.create(null),t);for(const o in e)n[o]=No(t[o],e[o]);return n}function y3(){return{app:null,config:{isNativeTag:gS,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let _L=0;function kL(t,e){return function(o,r=null){bt(o)||(o=Rn({},o)),r!=null&&!Xt(r)&&(r=null);const i=y3(),s=new WeakSet,a=[];let l=!1;const c=i.app={_uid:_L++,_component:o,_props:r,_container:null,_context:i,_instance:null,version:QL,get config(){return i.config},set config(u){},use(u,...d){return s.has(u)||(u&&bt(u.install)?(s.add(u),u.install(c,...d)):bt(u)&&(s.add(u),u(c,...d))),c},mixin(u){return i.mixins.includes(u)||i.mixins.push(u),c},component(u,d){return d?(i.components[u]=d,c):i.components[u]},directive(u,d){return d?(i.directives[u]=d,c):i.directives[u]},mount(u,d,f){if(!l){const h=c._ceVNode||H(o,r);return h.appContext=i,f===!0?f="svg":f===!1&&(f=void 0),t(h,u,f),l=!0,c._container=u,u.__vue_app__=c,cm(h.component)}},onUnmount(u){a.push(u)},unmount(){l&&(_i(a,c._instance,16),t(null,c._container),delete c._container.__vue_app__)},provide(u,d){return i.provides[u]=d,c},runWithContext(u){const d=Cl;Cl=c;try{return u()}finally{Cl=d}}};return c}}let Cl=null;function pt(t,e,n=Wt){const o=Bo(),r=Cr(e),i=ea(e),s=x3(t,r),a=US((l,c)=>{let u,d=Wt,f;return oL(()=>{const h=t[r];Jo(u,h)&&(u=h,c())}),{get(){return l(),n.get?n.get(u):u},set(h){const g=n.set?n.set(h):h;if(!Jo(g,u)&&!(d!==Wt&&Jo(h,d)))return;const v=o.vnode.props;v&&(e in v||r in v||i in v)&&(`onUpdate:${e}`in v||`onUpdate:${r}`in v||`onUpdate:${i}`in v)||(u=h,c()),o.emit(`update:${e}`,g),Jo(h,g)&&Jo(h,d)&&!Jo(g,f)&&c(),d=h,f=g}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||Wt:a,done:!1}:{done:!0}}}},a}const x3=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Cr(e)}Modifiers`]||t[`${ea(e)}Modifiers`];function SL(t,e,...n){if(t.isUnmounted)return;const o=t.vnode.props||Wt;let r=n;const i=e.startsWith("update:"),s=i&&x3(o,e.slice(7));s&&(s.trim&&(r=n.map(u=>vn(u)?u.trim():u)),s.number&&(r=n.map(G0)));let a,l=o[a=Bg(e)]||o[a=Bg(Cr(e))];!l&&i&&(l=o[a=Bg(ea(e))]),l&&_i(l,t,6,r);const c=o[a+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,_i(c,t,6,r)}}const AL=new WeakMap;function w3(t,e,n=!1){const o=n?AL:e.emitsCache,r=o.get(t);if(r!==void 0)return r;const i=t.emits;let s={},a=!1;if(!bt(t)){const l=c=>{const u=w3(c,e,!0);u&&(a=!0,Rn(s,u))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!i&&!a?(Xt(t)&&o.set(t,null),null):(dt(i)?i.forEach(l=>s[l]=null):Rn(s,i),Xt(t)&&o.set(t,s),s)}function am(t,e){return!t||!z0(e)?!1:(e=e.slice(2).replace(/Once$/,""),Zt(t,e[0].toLowerCase()+e.slice(1))||Zt(t,ea(e))||Zt(t,e))}function cw(t){const{type:e,vnode:n,proxy:o,withProxy:r,propsOptions:[i],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:f,setupState:h,ctx:g,inheritAttrs:v}=t,m=vp(t);let b,y;try{if(n.shapeFlag&4){const _=r||o,S=_;b=ji(c.call(S,_,u,d,h,f,g)),y=a}else{const _=e;b=ji(_.length>1?_(d,{attrs:a,slots:s,emit:l}):_(d,null)),y=e.props?a:CL(a)}}catch(_){Sd.length=0,em(_,t,1),b=H(_o)}let x=b;if(y&&v!==!1){const _=Object.keys(y),{shapeFlag:S}=x;_.length&&S&7&&(i&&_.some(Qb)&&(y=$L(y,i)),x=La(x,y,!1,!0))}return n.dirs&&(x=La(x,null,!1,!0),x.dirs=x.dirs?x.dirs.concat(n.dirs):n.dirs),n.transition&&Hd(x,n.transition),b=x,vp(m),b}const CL=t=>{let e;for(const n in t)(n==="class"||n==="style"||z0(n))&&((e||(e={}))[n]=t[n]);return e},$L=(t,e)=>{const n={};for(const o in t)(!Qb(o)||!(o.slice(9)in e))&&(n[o]=t[o]);return n};function TL(t,e,n){const{props:o,children:r,component:i}=t,{props:s,children:a,patchFlag:l}=e,c=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return o?uw(o,s,c):!!s;if(l&8){const u=e.dynamicProps;for(let d=0;d<u.length;d++){const f=u[d];if(_3(s,o,f)&&!am(c,f))return!0}}}else return(r||a)&&(!a||!a.$stable)?!0:o===s?!1:o?s?uw(o,s,c):!0:!!s;return!1}function uw(t,e,n){const o=Object.keys(e);if(o.length!==Object.keys(t).length)return!0;for(let r=0;r<o.length;r++){const i=o[r];if(_3(e,t,i)&&!am(n,i))return!0}return!1}function _3(t,e,n){const o=t[n],r=e[n];return n==="style"&&Xt(o)&&Xt(r)?!Oa(o,r):o!==r}function ML({vnode:t,parent:e},n){for(;e;){const o=e.subTree;if(o.suspense&&o.suspense.activeBranch===t&&(o.el=t.el),o===t)(t=e.vnode).el=n,e=e.parent;else break}}const k3={},S3=()=>Object.create(k3),A3=t=>Object.getPrototypeOf(t)===k3;function OL(t,e,n,o=!1){const r={},i=S3();t.propsDefaults=Object.create(null),C3(t,e,r,i);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=o?r:zS(r):t.type.props?t.props=r:t.props=i,t.attrs=i}function BL(t,e,n,o){const{props:r,attrs:i,vnode:{patchFlag:s}}=t,a=Lt(r),[l]=t.propsOptions;let c=!1;if((o||s>0)&&!(s&16)){if(s&8){const u=t.vnode.dynamicProps;for(let d=0;d<u.length;d++){let f=u[d];if(am(t.emitsOptions,f))continue;const h=e[f];if(l)if(Zt(i,f))h!==i[f]&&(i[f]=h,c=!0);else{const g=Cr(f);r[g]=c1(l,a,g,h,t,!1)}else h!==i[f]&&(i[f]=h,c=!0)}}}else{C3(t,e,r,i)&&(c=!0);let u;for(const d in a)(!e||!Zt(e,d)&&((u=ea(d))===d||!Zt(e,u)))&&(l?n&&(n[d]!==void 0||n[u]!==void 0)&&(r[d]=c1(l,a,d,void 0,t,!0)):delete r[d]);if(i!==a)for(const d in i)(!e||!Zt(e,d))&&(delete i[d],c=!0)}c&&Ls(t.attrs,"set","")}function C3(t,e,n,o){const[r,i]=t.propsOptions;let s=!1,a;if(e)for(let l in e){if(vd(l))continue;const c=e[l];let u;r&&Zt(r,u=Cr(l))?!i||!i.includes(u)?n[u]=c:(a||(a={}))[u]=c:am(t.emitsOptions,l)||(!(l in o)||c!==o[l])&&(o[l]=c,s=!0)}if(i){const l=Lt(n),c=a||Wt;for(let u=0;u<i.length;u++){const d=i[u];n[d]=c1(r,l,d,c[d],t,!Zt(c,d))}}return s}function c1(t,e,n,o,r,i){const s=t[n];if(s!=null){const a=Zt(s,"default");if(a&&o===void 0){const l=s.default;if(s.type!==Function&&!s.skipFactory&&bt(l)){const{propsDefaults:c}=r;if(n in c)o=c[n];else{const u=Sf(r);o=c[n]=l.call(null,e),u()}}else o=l;r.ce&&r.ce._setProp(n,o)}s[0]&&(i&&!a?o=!1:s[1]&&(o===""||o===ea(n))&&(o=!0))}return o}const LL=new WeakMap;function $3(t,e,n=!1){const o=n?LL:e.propsCache,r=o.get(t);if(r)return r;const i=t.props,s={},a=[];let l=!1;if(!bt(t)){const u=d=>{l=!0;const[f,h]=$3(d,e,!0);Rn(s,f),h&&a.push(...h)};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}if(!i&&!l)return Xt(t)&&o.set(t,Lc),Lc;if(dt(i))for(let u=0;u<i.length;u++){const d=Cr(i[u]);dw(d)&&(s[d]=Wt)}else if(i)for(const u in i){const d=Cr(u);if(dw(d)){const f=i[u],h=s[d]=dt(f)||bt(f)?{type:f}:Rn({},f),g=h.type;let v=!1,m=!0;if(dt(g))for(let b=0;b<g.length;++b){const y=g[b],x=bt(y)&&y.name;if(x==="Boolean"){v=!0;break}else x==="String"&&(m=!1)}else v=bt(g)&&g.name==="Boolean";h[0]=v,h[1]=m,(v||Zt(h,"default"))&&a.push(d)}}const c=[s,a];return Xt(t)&&o.set(t,c),c}function dw(t){return t[0]!=="$"&&!vd(t)}const ly=t=>t==="_"||t==="_ctx"||t==="$stable",cy=t=>dt(t)?t.map(ji):[ji(t)],PL=(t,e,n)=>{if(e._n)return e;const o=J((...r)=>cy(e(...r)),n);return o._c=!1,o},T3=(t,e,n)=>{const o=t._ctx;for(const r in t){if(ly(r))continue;const i=t[r];if(bt(i))e[r]=PL(r,i,o);else if(i!=null){const s=cy(i);e[r]=()=>s}}},M3=(t,e)=>{const n=cy(e);t.slots.default=()=>n},O3=(t,e,n)=>{for(const o in e)(n||!ly(o))&&(t[o]=e[o])},DL=(t,e,n)=>{const o=t.slots=S3();if(t.vnode.shapeFlag&32){const r=e._;r?(O3(o,e,n),n&&xS(o,"_",r,!0)):T3(e,o)}else e&&M3(t,e)},EL=(t,e,n)=>{const{vnode:o,slots:r}=t;let i=!0,s=Wt;if(o.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:O3(r,e,n):(i=!e.$stable,T3(e,r)),s=e}else e&&(M3(t,e),s={default:1});if(i)for(const a in r)!ly(a)&&s[a]==null&&delete r[a]},go=VL;function NL(t){return IL(t)}function IL(t,e){const n=q0();n.__VUE__=!0;const{insert:o,remove:r,patchProp:i,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:f,setScopeId:h=pi,insertStaticContent:g}=t,v=(D,W,j,ne=null,ie=null,ae=null,te=void 0,Y=null,X=!!W.dynamicChildren)=>{if(D===W)return;D&&!bl(D,W)&&(ne=Z(D),he(D,ie,ae,!0),D=null),W.patchFlag===-2&&(X=!1,W.dynamicChildren=null);const{type:q,ref:re,shapeFlag:me}=W;switch(q){case lm:m(D,W,j,ne);break;case _o:b(D,W,j,ne);break;case kd:D==null&&y(W,j,ne,te);break;case Ge:C(D,W,j,ne,ie,ae,te,Y,X);break;default:me&1?S(D,W,j,ne,ie,ae,te,Y,X):me&6?$(D,W,j,ne,ie,ae,te,Y,X):(me&64||me&128)&&q.process(D,W,j,ne,ie,ae,te,Y,X,ve)}re!=null&&ie?wd(re,D&&D.ref,ae,W||D,!W):re==null&&D&&D.ref!=null&&wd(D.ref,null,ae,D,!0)},m=(D,W,j,ne)=>{if(D==null)o(W.el=a(W.children),j,ne);else{const ie=W.el=D.el;W.children!==D.children&&c(ie,W.children)}},b=(D,W,j,ne)=>{D==null?o(W.el=l(W.children||""),j,ne):W.el=D.el},y=(D,W,j,ne)=>{[D.el,D.anchor]=g(D.children,W,j,ne,D.el,D.anchor)},x=({el:D,anchor:W},j,ne)=>{let ie;for(;D&&D!==W;)ie=f(D),o(D,j,ne),D=ie;o(W,j,ne)},_=({el:D,anchor:W})=>{let j;for(;D&&D!==W;)j=f(D),r(D),D=j;r(W)},S=(D,W,j,ne,ie,ae,te,Y,X)=>{if(W.type==="svg"?te="svg":W.type==="math"&&(te="mathml"),D==null)N(W,j,ne,ie,ae,te,Y,X);else{const q=D.el&&D.el._isVueCE?D.el:null;try{q&&q._beginPatch(),L(D,W,ie,ae,te,Y,X)}finally{q&&q._endPatch()}}},N=(D,W,j,ne,ie,ae,te,Y)=>{let X,q;const{props:re,shapeFlag:me,transition:we,dirs:ke}=D;if(X=D.el=s(D.type,ae,re&&re.is,re),me&8?u(X,D.children):me&16&&k(D.children,X,null,ne,ie,Rg(D,ae),te,Y),ke&&sl(D,null,ne,"created"),B(X,D,D.scopeId,te,ne),re){for(const De in re)De!=="value"&&!vd(De)&&i(X,De,null,re[De],ae,ne);"value"in re&&i(X,"value",null,re.value,ae),(q=re.onVnodeBeforeMount)&&Vi(q,ne,D)}ke&&sl(D,null,ne,"beforeMount");const $e=RL(ie,we);$e&&we.beforeEnter(X),o(X,W,j),((q=re&&re.onVnodeMounted)||$e||ke)&&go(()=>{q&&Vi(q,ne,D),$e&&we.enter(X),ke&&sl(D,null,ne,"mounted")},ie)},B=(D,W,j,ne,ie)=>{if(j&&h(D,j),ne)for(let ae=0;ae<ne.length;ae++)h(D,ne[ae]);if(ie){let ae=ie.subTree;if(W===ae||P3(ae.type)&&(ae.ssContent===W||ae.ssFallback===W)){const te=ie.vnode;B(D,te,te.scopeId,te.slotScopeIds,ie.parent)}}},k=(D,W,j,ne,ie,ae,te,Y,X=0)=>{for(let q=X;q<D.length;q++){const re=D[q]=Y?Ts(D[q]):ji(D[q]);v(null,re,W,j,ne,ie,ae,te,Y)}},L=(D,W,j,ne,ie,ae,te)=>{const Y=W.el=D.el;let{patchFlag:X,dynamicChildren:q,dirs:re}=W;X|=D.patchFlag&16;const me=D.props||Wt,we=W.props||Wt;let ke;if(j&&al(j,!1),(ke=we.onVnodeBeforeUpdate)&&Vi(ke,j,W,D),re&&sl(W,D,j,"beforeUpdate"),j&&al(j,!0),(me.innerHTML&&we.innerHTML==null||me.textContent&&we.textContent==null)&&u(Y,""),q?E(D.dynamicChildren,q,Y,j,ne,Rg(W,ie),ae):te||G(D,W,Y,null,j,ne,Rg(W,ie),ae,!1),X>0){if(X&16)I(Y,me,we,j,ie);else if(X&2&&me.class!==we.class&&i(Y,"class",null,we.class,ie),X&4&&i(Y,"style",me.style,we.style,ie),X&8){const $e=W.dynamicProps;for(let De=0;De<$e.length;De++){const He=$e[De],Oe=me[He],We=we[He];(We!==Oe||He==="value")&&i(Y,He,Oe,We,ie,j)}}X&1&&D.children!==W.children&&u(Y,W.children)}else!te&&q==null&&I(Y,me,we,j,ie);((ke=we.onVnodeUpdated)||re)&&go(()=>{ke&&Vi(ke,j,W,D),re&&sl(W,D,j,"updated")},ne)},E=(D,W,j,ne,ie,ae,te)=>{for(let Y=0;Y<W.length;Y++){const X=D[Y],q=W[Y],re=X.el&&(X.type===Ge||!bl(X,q)||X.shapeFlag&198)?d(X.el):j;v(X,q,re,null,ne,ie,ae,te,!0)}},I=(D,W,j,ne,ie)=>{if(W!==j){if(W!==Wt)for(const ae in W)!vd(ae)&&!(ae in j)&&i(D,ae,W[ae],null,ie,ne);for(const ae in j){if(vd(ae))continue;const te=j[ae],Y=W[ae];te!==Y&&ae!=="value"&&i(D,ae,Y,te,ie,ne)}"value"in j&&i(D,"value",W.value,j.value,ie)}},C=(D,W,j,ne,ie,ae,te,Y,X)=>{const q=W.el=D?D.el:a(""),re=W.anchor=D?D.anchor:a("");let{patchFlag:me,dynamicChildren:we,slotScopeIds:ke}=W;ke&&(Y=Y?Y.concat(ke):ke),D==null?(o(q,j,ne),o(re,j,ne),k(W.children||[],j,re,ie,ae,te,Y,X)):me>0&&me&64&&we&&D.dynamicChildren&&D.dynamicChildren.length===we.length?(E(D.dynamicChildren,we,j,ie,ae,te,Y),(W.key!=null||ie&&W===ie.subTree)&&uy(D,W,!0)):G(D,W,j,re,ie,ae,te,Y,X)},$=(D,W,j,ne,ie,ae,te,Y,X)=>{W.slotScopeIds=Y,D==null?W.shapeFlag&512?ie.ctx.activate(W,j,ne,te,X):P(W,j,ne,ie,ae,te,X):M(D,W,X)},P=(D,W,j,ne,ie,ae,te)=>{const Y=D.component=qL(D,ne,ie);if(om(D)&&(Y.ctx.renderer=ve),YL(Y,!1,te),Y.asyncDep){if(ie&&ie.registerDep(Y,F,te),!D.el){const X=Y.subTree=H(_o);b(null,X,W,j),D.placeholder=X.el}}else F(Y,D,W,j,ie,ae,te)},M=(D,W,j)=>{const ne=W.component=D.component;if(TL(D,W,j))if(ne.asyncDep&&!ne.asyncResolved){V(ne,W,j);return}else ne.next=W,ne.update();else W.el=D.el,ne.vnode=W},F=(D,W,j,ne,ie,ae,te)=>{const Y=()=>{if(D.isMounted){let{next:me,bu:we,u:ke,parent:$e,vnode:De}=D;{const lt=B3(D);if(lt){me&&(me.el=De.el,V(D,me,te)),lt.asyncDep.then(()=>{go(()=>{D.isUnmounted||q()},ie)});return}}let He=me,Oe;al(D,!1),me?(me.el=De.el,V(D,me,te)):me=De,we&&Gh(we),(Oe=me.props&&me.props.onVnodeBeforeUpdate)&&Vi(Oe,$e,me,De),al(D,!0);const We=cw(D),st=D.subTree;D.subTree=We,v(st,We,d(st.el),Z(st),D,ie,ae),me.el=We.el,He===null&&ML(D,We.el),ke&&go(ke,ie),(Oe=me.props&&me.props.onVnodeUpdated)&&go(()=>Vi(Oe,$e,me,De),ie)}else{let me;const{el:we,props:ke}=W,{bm:$e,m:De,parent:He,root:Oe,type:We}=D,st=Ec(W);al(D,!1),$e&&Gh($e),!st&&(me=ke&&ke.onVnodeBeforeMount)&&Vi(me,He,W),al(D,!0);{Oe.ce&&Oe.ce._hasShadowRoot()&&Oe.ce._injectChildStyle(We);const lt=D.subTree=cw(D);v(null,lt,j,ne,D,ie,ae),W.el=lt.el}if(De&&go(De,ie),!st&&(me=ke&&ke.onVnodeMounted)){const lt=W;go(()=>Vi(me,He,lt),ie)}(W.shapeFlag&256||He&&Ec(He.vnode)&&He.vnode.shapeFlag&256)&&D.a&&go(D.a,ie),D.isMounted=!0,W=j=ne=null}};D.scope.on();const X=D.effect=new AS(Y);D.scope.off();const q=D.update=X.run.bind(X),re=D.job=X.runIfDirty.bind(X);re.i=D,re.id=D.uid,X.scheduler=()=>ry(re),al(D,!0),q()},V=(D,W,j)=>{W.component=D;const ne=D.vnode.props;D.vnode=W,D.next=null,BL(D,W.props,ne,j),EL(D,W.children,j),qs(),Qx(D),Ys()},G=(D,W,j,ne,ie,ae,te,Y,X=!1)=>{const q=D&&D.children,re=D?D.shapeFlag:0,me=W.children,{patchFlag:we,shapeFlag:ke}=W;if(we>0){if(we&128){ue(q,me,j,ne,ie,ae,te,Y,X);return}else if(we&256){K(q,me,j,ne,ie,ae,te,Y,X);return}}ke&8?(re&16&&xe(q,ie,ae),me!==q&&u(j,me)):re&16?ke&16?ue(q,me,j,ne,ie,ae,te,Y,X):xe(q,ie,ae,!0):(re&8&&u(j,""),ke&16&&k(me,j,ne,ie,ae,te,Y,X))},K=(D,W,j,ne,ie,ae,te,Y,X)=>{D=D||Lc,W=W||Lc;const q=D.length,re=W.length,me=Math.min(q,re);let we;for(we=0;we<me;we++){const ke=W[we]=X?Ts(W[we]):ji(W[we]);v(D[we],ke,j,null,ie,ae,te,Y,X)}q>re?xe(D,ie,ae,!0,!1,me):k(W,j,ne,ie,ae,te,Y,X,me)},ue=(D,W,j,ne,ie,ae,te,Y,X)=>{let q=0;const re=W.length;let me=D.length-1,we=re-1;for(;q<=me&&q<=we;){const ke=D[q],$e=W[q]=X?Ts(W[q]):ji(W[q]);if(bl(ke,$e))v(ke,$e,j,null,ie,ae,te,Y,X);else break;q++}for(;q<=me&&q<=we;){const ke=D[me],$e=W[we]=X?Ts(W[we]):ji(W[we]);if(bl(ke,$e))v(ke,$e,j,null,ie,ae,te,Y,X);else break;me--,we--}if(q>me){if(q<=we){const ke=we+1,$e=ke<re?W[ke].el:ne;for(;q<=we;)v(null,W[q]=X?Ts(W[q]):ji(W[q]),j,$e,ie,ae,te,Y,X),q++}}else if(q>we)for(;q<=me;)he(D[q],ie,ae,!0),q++;else{const ke=q,$e=q,De=new Map;for(q=$e;q<=we;q++){const Nt=W[q]=X?Ts(W[q]):ji(W[q]);Nt.key!=null&&De.set(Nt.key,q)}let He,Oe=0;const We=we-$e+1;let st=!1,lt=0;const At=new Array(We);for(q=0;q<We;q++)At[q]=0;for(q=ke;q<=me;q++){const Nt=D[q];if(Oe>=We){he(Nt,ie,ae,!0);continue}let Yt;if(Nt.key!=null)Yt=De.get(Nt.key);else for(He=$e;He<=we;He++)if(At[He-$e]===0&&bl(Nt,W[He])){Yt=He;break}Yt===void 0?he(Nt,ie,ae,!0):(At[Yt-$e]=q+1,Yt>=lt?lt=Yt:st=!0,v(Nt,W[Yt],j,null,ie,ae,te,Y,X),Oe++)}const on=st?FL(At):Lc;for(He=on.length-1,q=We-1;q>=0;q--){const Nt=$e+q,Yt=W[Nt],Fn=W[Nt+1],Vn=Nt+1<re?Fn.el||L3(Fn):ne;At[q]===0?v(null,Yt,j,Vn,ie,ae,te,Y,X):st&&(He<0||q!==on[He]?de(Yt,j,Vn,2):He--)}}},de=(D,W,j,ne,ie=null)=>{const{el:ae,type:te,transition:Y,children:X,shapeFlag:q}=D;if(q&6){de(D.component.subTree,W,j,ne);return}if(q&128){D.suspense.move(W,j,ne);return}if(q&64){te.move(D,W,j,ve);return}if(te===Ge){o(ae,W,j);for(let me=0;me<X.length;me++)de(X[me],W,j,ne);o(D.anchor,W,j);return}if(te===kd){x(D,W,j);return}if(ne!==2&&q&1&&Y)if(ne===0)Y.beforeEnter(ae),o(ae,W,j),go(()=>Y.enter(ae),ie);else{const{leave:me,delayLeave:we,afterLeave:ke}=Y,$e=()=>{D.ctx.isUnmounted?r(ae):o(ae,W,j)},De=()=>{ae._isLeaving&&ae[Yi](!0),me(ae,()=>{$e(),ke&&ke()})};we?we(ae,$e,De):De()}else o(ae,W,j)},he=(D,W,j,ne=!1,ie=!1)=>{const{type:ae,props:te,ref:Y,children:X,dynamicChildren:q,shapeFlag:re,patchFlag:me,dirs:we,cacheIndex:ke}=D;if(me===-2&&(ie=!1),Y!=null&&(qs(),wd(Y,null,j,D,!0),Ys()),ke!=null&&(W.renderCache[ke]=void 0),re&256){W.ctx.deactivate(D);return}const $e=re&1&&we,De=!Ec(D);let He;if(De&&(He=te&&te.onVnodeBeforeUnmount)&&Vi(He,W,D),re&6)fe(D.component,j,ne);else{if(re&128){D.suspense.unmount(j,ne);return}$e&&sl(D,null,W,"beforeUnmount"),re&64?D.type.remove(D,W,j,ve,ne):q&&!q.hasOnce&&(ae!==Ge||me>0&&me&64)?xe(q,W,j,!1,!0):(ae===Ge&&me&384||!ie&&re&16)&&xe(X,W,j),ne&&ge(D)}(De&&(He=te&&te.onVnodeUnmounted)||$e)&&go(()=>{He&&Vi(He,W,D),$e&&sl(D,null,W,"unmounted")},j)},ge=D=>{const{type:W,el:j,anchor:ne,transition:ie}=D;if(W===Ge){ee(j,ne);return}if(W===kd){_(D);return}const ae=()=>{r(j),ie&&!ie.persisted&&ie.afterLeave&&ie.afterLeave()};if(D.shapeFlag&1&&ie&&!ie.persisted){const{leave:te,delayLeave:Y}=ie,X=()=>te(j,ae);Y?Y(D.el,ae,X):X()}else ae()},ee=(D,W)=>{let j;for(;D!==W;)j=f(D),r(D),D=j;r(W)},fe=(D,W,j)=>{const{bum:ne,scope:ie,job:ae,subTree:te,um:Y,m:X,a:q}=D;fw(X),fw(q),ne&&Gh(ne),ie.stop(),ae&&(ae.flags|=8,he(te,D,W,j)),Y&&go(Y,W),go(()=>{D.isUnmounted=!0},W)},xe=(D,W,j,ne=!1,ie=!1,ae=0)=>{for(let te=ae;te<D.length;te++)he(D[te],W,j,ne,ie)},Z=D=>{if(D.shapeFlag&6)return Z(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const W=f(D.anchor||D.el),j=W&&W[JS];return j?f(j):W};let pe=!1;const oe=(D,W,j)=>{let ne;D==null?W._vnode&&(he(W._vnode,null,null,!0),ne=W._vnode.component):v(W._vnode||null,D,W,null,null,null,j),W._vnode=D,pe||(pe=!0,Qx(ne),XS(),pe=!1)},ve={p:v,um:he,m:de,r:ge,mt:P,mc:k,pc:G,pbc:E,n:Z,o:t};return{render:oe,hydrate:void 0,createApp:kL(oe)}}function Rg({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function al({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function RL(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function uy(t,e,n=!1){const o=t.children,r=e.children;if(dt(o)&&dt(r))for(let i=0;i<o.length;i++){const s=o[i];let a=r[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=r[i]=Ts(r[i]),a.el=s.el),!n&&a.patchFlag!==-2&&uy(s,a)),a.type===lm&&(a.patchFlag===-1&&(a=r[i]=Ts(a)),a.el=s.el),a.type===_o&&!a.el&&(a.el=s.el)}}function FL(t){const e=t.slice(),n=[0];let o,r,i,s,a;const l=t.length;for(o=0;o<l;o++){const c=t[o];if(c!==0){if(r=n[n.length-1],t[r]<c){e[o]=r,n.push(o);continue}for(i=0,s=n.length-1;i<s;)a=i+s>>1,t[n[a]]<c?i=a+1:s=a;c<t[n[i]]&&(i>0&&(e[o]=n[i-1]),n[i]=o)}}for(i=n.length,s=n[i-1];i-- >0;)n[i]=s,s=e[s];return n}function B3(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:B3(e)}function fw(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function L3(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?L3(e.subTree):null}const P3=t=>t.__isSuspense;function VL(t,e){e&&e.pendingBranch?dt(t)?e.effects.push(...t):e.effects.push(t):jS(t)}const Ge=Symbol.for("v-fgt"),lm=Symbol.for("v-txt"),_o=Symbol.for("v-cmt"),kd=Symbol.for("v-stc"),Sd=[];let wr=null;function w(t=!1){Sd.push(wr=t?null:[])}function zL(){Sd.pop(),wr=Sd[Sd.length-1]||null}let Wd=1;function wp(t,e=!1){Wd+=t,t<0&&wr&&e&&(wr.hasOnce=!0)}function D3(t){return t.dynamicChildren=Wd>0?wr||Lc:null,zL(),Wd>0&&wr&&wr.push(t),t}function R(t,e,n,o,r,i){return D3(T(t,e,n,o,r,i,!0))}function Q(t,e,n,o,r){return D3(H(t,e,n,o,r,!0))}function Ud(t){return t?t.__v_isVNode===!0:!1}function bl(t,e){return t.type===e.type&&t.key===e.key}const E3=({key:t})=>t??null,Yh=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?vn(t)||Ze(t)||bt(t)?{i:so,r:t,k:e,f:!!n}:t:null);function T(t,e=null,n=null,o=0,r=null,i=t===Ge?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&E3(e),ref:e&&Yh(e),scopeId:ZS,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:so};return a?(dy(l,n),i&128&&t.normalize(l)):n&&(l.shapeFlag|=vn(n)?8:16),Wd>0&&!s&&wr&&(l.patchFlag>0||i&6)&&l.patchFlag!==32&&wr.push(l),l}const H=HL;function HL(t,e=null,n=null,o=0,r=null,i=!1){if((!t||t===h3)&&(t=_o),Ud(t)){const a=La(t,e,!0);return n&&dy(a,n),Wd>0&&!i&&wr&&(a.shapeFlag&6?wr[wr.indexOf(t)]=a:wr.push(a)),a.patchFlag=-2,a}if(ZL(t)&&(t=t.__vccOpts),e){e=er(e);let{class:a,style:l}=e;a&&!vn(a)&&(e.class=Te(a)),Xt(l)&&(Q0(l)&&!dt(l)&&(l=Rn({},l)),e.style=Dt(l))}const s=vn(t)?1:P3(t)?128:e3(t)?64:Xt(t)?4:bt(t)?2:0;return T(t,e,n,o,r,s,i,!0)}function er(t){return t?Q0(t)||A3(t)?Rn({},t):t:null}function La(t,e,n=!1,o=!1){const{props:r,ref:i,patchFlag:s,children:a,transition:l}=t,c=e?Tt(r||{},e):r,u={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&E3(c),ref:e&&e.ref?n&&i?dt(i)?i.concat(Yh(e)):[i,Yh(e)]:Yh(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Ge?s===-1?16:s|16:s,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&La(t.ssContent),ssFallback:t.ssFallback&&La(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&o&&Hd(u,l.clone(u)),u}function Xe(t=" ",e=0){return H(lm,null,t,e)}function WL(t,e){const n=H(kd,null,t);return n.staticCount=e,n}function se(t="",e=!1){return e?(w(),Q(_o,null,t)):H(_o,null,t)}function ji(t){return t==null||typeof t=="boolean"?H(_o):dt(t)?H(Ge,null,t.slice()):Ud(t)?Ts(t):H(lm,null,String(t))}function Ts(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:La(t)}function dy(t,e){let n=0;const{shapeFlag:o}=t;if(e==null)e=null;else if(dt(e))n=16;else if(typeof e=="object")if(o&65){const r=e.default;r&&(r._c&&(r._d=!1),dy(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!A3(e)?e._ctx=so:r===3&&so&&(so.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else bt(e)?(e={default:e,_ctx:so},n=32):(e=String(e),o&64?(n=16,e=[Xe(e)]):n=8);t.children=e,t.shapeFlag|=n}function Tt(...t){const e={};for(let n=0;n<t.length;n++){const o=t[n];for(const r in o)if(r==="class")e.class!==o.class&&(e.class=Te([e.class,o.class]));else if(r==="style")e.style=Dt([e.style,o.style]);else if(z0(r)){const i=e[r],s=o[r];s&&i!==s&&!(dt(i)&&i.includes(s))&&(e[r]=i?[].concat(i,s):s)}else r!==""&&(e[r]=o[r])}return e}function Vi(t,e,n,o=null){_i(t,e,7,[n,o])}const UL=y3();let GL=0;function qL(t,e,n){const o=t.type,r=(e?e.appContext:t.appContext)||UL,i={uid:GL++,vnode:t,type:o,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new SS(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:$3(o,r),emitsOptions:w3(o,r),emit:null,emitted:null,propsDefaults:Wt,inheritAttrs:o.inheritAttrs,ctx:Wt,data:Wt,props:Wt,attrs:Wt,slots:Wt,refs:Wt,setupState:Wt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=SL.bind(null,i),t.ce&&t.ce(i),i}let ko=null;const Bo=()=>ko||so;let _p,u1;{const t=q0(),e=(n,o)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(o),i=>{r.length>1?r.forEach(s=>s(i)):r[0](i)}};_p=e("__VUE_INSTANCE_SETTERS__",n=>ko=n),u1=e("__VUE_SSR_SETTERS__",n=>Gd=n)}const Sf=t=>{const e=ko;return _p(t),t.scope.on(),()=>{t.scope.off(),_p(e)}},hw=()=>{ko&&ko.scope.off(),_p(null)};function N3(t){return t.vnode.shapeFlag&4}let Gd=!1;function YL(t,e=!1,n=!1){e&&u1(e);const{props:o,children:r}=t.vnode,i=N3(t);OL(t,o,i,e),DL(t,r,n||e);const s=i?jL(t,e):void 0;return e&&u1(!1),s}function jL(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,gL);const{setup:o}=n;if(o){qs();const r=t.setupContext=o.length>1?R3(t):null,i=Sf(t),s=kf(o,t,0,[t.props,r]),a=vS(s);if(Ys(),i(),(a||t.sp)&&!Ec(t)&&l3(t),a){if(s.then(hw,hw),e)return s.then(l=>{pw(t,l)}).catch(l=>{em(l,t,0)});t.asyncDep=s}else pw(t,s)}else I3(t)}function pw(t,e,n){bt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Xt(e)&&(t.setupState=WS(e)),I3(t)}function I3(t,e,n){const o=t.type;t.render||(t.render=o.render||pi);{const r=Sf(t);qs();try{vL(t)}finally{Ys(),r()}}}const XL={get(t,e){return xo(t,"get",""),t[e]}};function R3(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,XL),slots:t.slots,emit:t.emit,expose:e}}function cm(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(WS(Me(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in _d)return _d[n](t)},has(e,n){return n in e||n in _d}})):t.proxy}function KL(t,e=!0){return bt(t)?t.displayName||t.name:t.name||e&&t.__name}function ZL(t){return bt(t)&&"__vccOpts"in t}const A=(t,e)=>K9(t,e,Gd);function Vt(t,e,n){try{wp(-1);const o=arguments.length;return o===2?Xt(e)&&!dt(e)?Ud(e)?H(t,null,[e]):H(t,e):H(t,null,e):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Ud(n)&&(n=[n]),H(t,e,n))}finally{wp(1)}}const QL="3.5.29";/**
|
|
15
|
-
* @vue/runtime-dom v3.5.29
|
|
16
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
-
* @license MIT
|
|
18
|
-
**/let d1;const mw=typeof window<"u"&&window.trustedTypes;if(mw)try{d1=mw.createPolicy("vue",{createHTML:t=>t})}catch{}const F3=d1?t=>d1.createHTML(t):t=>t,JL="http://www.w3.org/2000/svg",eP="http://www.w3.org/1998/Math/MathML",Cs=typeof document<"u"?document:null,gw=Cs&&Cs.createElement("template"),tP={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,o)=>{const r=e==="svg"?Cs.createElementNS(JL,t):e==="mathml"?Cs.createElementNS(eP,t):n?Cs.createElement(t,{is:n}):Cs.createElement(t);return t==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:t=>Cs.createTextNode(t),createComment:t=>Cs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Cs.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,o,r,i){const s=n?n.previousSibling:e.lastChild;if(r&&(r===i||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===i||!(r=r.nextSibling)););else{gw.innerHTML=F3(o==="svg"?`<svg>${t}</svg>`:o==="mathml"?`<math>${t}</math>`:t);const a=gw.content;if(o==="svg"||o==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},da="transition",Hu="animation",qd=Symbol("_vtc"),V3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},nP=Rn({},n3,V3),oP=t=>(t.displayName="Transition",t.props=nP,t),Pl=oP((t,{slots:e})=>Vt(lL,rP(t),e)),ll=(t,e=[])=>{dt(t)?t.forEach(n=>n(...e)):t&&t(...e)},vw=t=>t?dt(t)?t.some(e=>e.length>1):t.length>1:!1;function rP(t){const e={};for(const C in t)C in V3||(e[C]=t[C]);if(t.css===!1)return e;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=s,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=t,g=iP(r),v=g&&g[0],m=g&&g[1],{onBeforeEnter:b,onEnter:y,onEnterCancelled:x,onLeave:_,onLeaveCancelled:S,onBeforeAppear:N=b,onAppear:B=y,onAppearCancelled:k=x}=e,L=(C,$,P,M)=>{C._enterCancelled=M,cl(C,$?u:a),cl(C,$?c:s),P&&P()},E=(C,$)=>{C._isLeaving=!1,cl(C,d),cl(C,h),cl(C,f),$&&$()},I=C=>($,P)=>{const M=C?B:y,F=()=>L($,C,P);ll(M,[$,F]),bw(()=>{cl($,C?l:i),ys($,C?u:a),vw(M)||yw($,o,v,F)})};return Rn(e,{onBeforeEnter(C){ll(b,[C]),ys(C,i),ys(C,s)},onBeforeAppear(C){ll(N,[C]),ys(C,l),ys(C,c)},onEnter:I(!1),onAppear:I(!0),onLeave(C,$){C._isLeaving=!0;const P=()=>E(C,$);ys(C,d),C._enterCancelled?(ys(C,f),_w(C)):(_w(C),ys(C,f)),bw(()=>{C._isLeaving&&(cl(C,d),ys(C,h),vw(_)||yw(C,o,m,P))}),ll(_,[C,P])},onEnterCancelled(C){L(C,!1,void 0,!0),ll(x,[C])},onAppearCancelled(C){L(C,!0,void 0,!0),ll(k,[C])},onLeaveCancelled(C){E(C),ll(S,[C])}})}function iP(t){if(t==null)return null;if(Xt(t))return[Fg(t.enter),Fg(t.leave)];{const e=Fg(t);return[e,e]}}function Fg(t){return g9(t)}function ys(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[qd]||(t[qd]=new Set)).add(e)}function cl(t,e){e.split(/\s+/).forEach(o=>o&&t.classList.remove(o));const n=t[qd];n&&(n.delete(e),n.size||(t[qd]=void 0))}function bw(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let sP=0;function yw(t,e,n,o){const r=t._endId=++sP,i=()=>{r===t._endId&&o()};if(n!=null)return setTimeout(i,n);const{type:s,timeout:a,propCount:l}=aP(t,e);if(!s)return o();const c=s+"end";let u=0;const d=()=>{t.removeEventListener(c,f),i()},f=h=>{h.target===t&&++u>=l&&d()};setTimeout(()=>{u<l&&d()},a+1),t.addEventListener(c,f)}function aP(t,e){const n=window.getComputedStyle(t),o=g=>(n[g]||"").split(", "),r=o(`${da}Delay`),i=o(`${da}Duration`),s=xw(r,i),a=o(`${Hu}Delay`),l=o(`${Hu}Duration`),c=xw(a,l);let u=null,d=0,f=0;e===da?s>0&&(u=da,d=s,f=i.length):e===Hu?c>0&&(u=Hu,d=c,f=l.length):(d=Math.max(s,c),u=d>0?s>c?da:Hu:null,f=u?u===da?i.length:l.length:0);const h=u===da&&/\b(?:transform|all)(?:,|$)/.test(o(`${da}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:h}}function xw(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,o)=>ww(n)+ww(t[o])))}function ww(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function _w(t){return(t?t.ownerDocument:document).body.offsetHeight}function lP(t,e,n){const o=t[qd];o&&(e=(e?[e,...o]:[...o]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const kp=Symbol("_vod"),z3=Symbol("_vsh"),jc={name:"show",beforeMount(t,{value:e},{transition:n}){t[kp]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Wu(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:o}){!e!=!n&&(o?e?(o.beforeEnter(t),Wu(t,!0),o.enter(t)):o.leave(t,()=>{Wu(t,!1)}):Wu(t,e))},beforeUnmount(t,{value:e}){Wu(t,e)}};function Wu(t,e){t.style.display=e?t[kp]:"none",t[z3]=!e}const H3=Symbol("");function W3(t){const e=Bo();if(!e)return;const n=e.ut=(r=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(i=>Sp(i,r))},o=()=>{const r=t(e.proxy);e.ce?Sp(e.ce,r):f1(e.subTree,r),n(r)};d3(()=>{jS(o)}),hn(()=>{je(o,pi,{flush:"post"});const r=new MutationObserver(o);r.observe(e.subTree.el.parentNode,{childList:!0}),na(()=>r.disconnect())})}function f1(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{f1(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)Sp(t.el,e);else if(t.type===Ge)t.children.forEach(n=>f1(n,e));else if(t.type===kd){let{el:n,anchor:o}=t;for(;n&&(Sp(n,e),n!==o);)n=n.nextSibling}}function Sp(t,e){if(t.nodeType===1){const n=t.style;let o="";for(const r in e){const i=S9(e[r]);n.setProperty(`--${r}`,i),o+=`--${r}: ${i};`}n[H3]=o}}const cP=/(?:^|;)\s*display\s*:/;function uP(t,e,n){const o=t.style,r=vn(n);let i=!1;if(n&&!r){if(e)if(vn(e))for(const s of e.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&jh(o,a,"")}else for(const s in e)n[s]==null&&jh(o,s,"");for(const s in n)s==="display"&&(i=!0),jh(o,s,n[s])}else if(r){if(e!==n){const s=o[H3];s&&(n+=";"+s),o.cssText=n,i=cP.test(n)}}else e&&t.removeAttribute("style");kp in t&&(t[kp]=i?o.display:"",t[z3]&&(o.display="none"))}const kw=/\s*!important$/;function jh(t,e,n){if(dt(n))n.forEach(o=>jh(t,e,o));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const o=dP(t,e);kw.test(n)?t.setProperty(ea(o),n.replace(kw,""),"important"):t[o]=n}}const Sw=["Webkit","Moz","ms"],Vg={};function dP(t,e){const n=Vg[e];if(n)return n;let o=Cr(e);if(o!=="filter"&&o in t)return Vg[e]=o;o=U0(o);for(let r=0;r<Sw.length;r++){const i=Sw[r]+o;if(i in t)return Vg[e]=i}return e}const Aw="http://www.w3.org/1999/xlink";function Cw(t,e,n,o,r,i=_9(e)){o&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Aw,e.slice(6,e.length)):t.setAttributeNS(Aw,e,n):n==null||i&&!wS(n)?t.removeAttribute(e):t.setAttribute(e,i?"":xi(n)?String(n):n)}function $w(t,e,n,o,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?F3(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let s=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=wS(n):n==null&&a==="string"?(n="",s=!0):a==="number"&&(n=0,s=!0)}try{t[e]=n}catch{}s&&t.removeAttribute(r||e)}function Ds(t,e,n,o){t.addEventListener(e,n,o)}function fP(t,e,n,o){t.removeEventListener(e,n,o)}const Tw=Symbol("_vei");function hP(t,e,n,o,r=null){const i=t[Tw]||(t[Tw]={}),s=i[e];if(o&&s)s.value=o;else{const[a,l]=pP(e);if(o){const c=i[e]=vP(o,r);Ds(t,a,c,l)}else s&&(fP(t,a,s,l),i[e]=void 0)}}const Mw=/(?:Once|Passive|Capture)$/;function pP(t){let e;if(Mw.test(t)){e={};let o;for(;o=t.match(Mw);)t=t.slice(0,t.length-o[0].length),e[o[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):ea(t.slice(2)),e]}let zg=0;const mP=Promise.resolve(),gP=()=>zg||(mP.then(()=>zg=0),zg=Date.now());function vP(t,e){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;_i(bP(o,n.value),e,5,[o])};return n.value=t,n.attached=gP(),n}function bP(t,e){if(dt(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(o=>r=>!r._stopped&&o&&o(r))}else return e}const Ow=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,yP=(t,e,n,o,r,i)=>{const s=r==="svg";e==="class"?lP(t,o,s):e==="style"?uP(t,n,o):z0(e)?Qb(e)||hP(t,e,n,o,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):xP(t,e,o,s))?($w(t,e,o),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Cw(t,e,o,s,i,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!vn(o))?$w(t,Cr(e),o,i,e):(e==="true-value"?t._trueValue=o:e==="false-value"&&(t._falseValue=o),Cw(t,e,o,s))};function xP(t,e,n,o){if(o)return!!(e==="innerHTML"||e==="textContent"||e in t&&Ow(e)&&bt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Ow(e)&&vn(n)?!1:e in t}const Pa=t=>{const e=t.props["onUpdate:modelValue"]||!1;return dt(e)?n=>Gh(e,n):e};function wP(t){t.target.composing=!0}function Bw(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const zr=Symbol("_assign");function Lw(t,e,n){return e&&(t=t.trim()),n&&(t=G0(t)),t}const Ap={created(t,{modifiers:{lazy:e,trim:n,number:o}},r){t[zr]=Pa(r);const i=o||r.props&&r.props.type==="number";Ds(t,e?"change":"input",s=>{s.target.composing||t[zr](Lw(t.value,n,i))}),(n||i)&&Ds(t,"change",()=>{t.value=Lw(t.value,n,i)}),e||(Ds(t,"compositionstart",wP),Ds(t,"compositionend",Bw),Ds(t,"change",Bw))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:o,trim:r,number:i}},s){if(t[zr]=Pa(s),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?G0(t.value):t.value,l=e??"";a!==l&&(document.activeElement===t&&t.type!=="range"&&(o&&e===n||r&&t.value.trim()===l)||(t.value=l))}},U3={deep:!0,created(t,e,n){t[zr]=Pa(n),Ds(t,"change",()=>{const o=t._modelValue,r=Xc(t),i=t.checked,s=t[zr];if(dt(o)){const a=ey(o,r),l=a!==-1;if(i&&!l)s(o.concat(r));else if(!i&&l){const c=[...o];c.splice(a,1),s(c)}}else if(yu(o)){const a=new Set(o);i?a.add(r):a.delete(r),s(a)}else s(G3(t,i))})},mounted:Pw,beforeUpdate(t,e,n){t[zr]=Pa(n),Pw(t,e,n)}};function Pw(t,{value:e,oldValue:n},o){t._modelValue=e;let r;if(dt(e))r=ey(e,o.props.value)>-1;else if(yu(e))r=e.has(o.props.value);else{if(e===n)return;r=Oa(e,G3(t,!0))}t.checked!==r&&(t.checked=r)}const _P={created(t,{value:e},n){t.checked=Oa(e,n.props.value),t[zr]=Pa(n),Ds(t,"change",()=>{t[zr](Xc(t))})},beforeUpdate(t,{value:e,oldValue:n},o){t[zr]=Pa(o),e!==n&&(t.checked=Oa(e,o.props.value))}},kP={deep:!0,created(t,{value:e,modifiers:{number:n}},o){const r=yu(e);Ds(t,"change",()=>{const i=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?G0(Xc(s)):Xc(s));t[zr](t.multiple?r?new Set(i):i:i[0]),t._assigning=!0,wn(()=>{t._assigning=!1})}),t[zr]=Pa(o)},mounted(t,{value:e}){Dw(t,e)},beforeUpdate(t,e,n){t[zr]=Pa(n)},updated(t,{value:e}){t._assigning||Dw(t,e)}};function Dw(t,e){const n=t.multiple,o=dt(e);if(!(n&&!o&&!yu(e))){for(let r=0,i=t.options.length;r<i;r++){const s=t.options[r],a=Xc(s);if(n)if(o){const l=typeof a;l==="string"||l==="number"?s.selected=e.some(c=>String(c)===String(a)):s.selected=ey(e,a)>-1}else s.selected=e.has(a);else if(Oa(Xc(s),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Xc(t){return"_value"in t?t._value:t.value}function G3(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const SP=["ctrl","shift","alt","meta"],AP={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>SP.some(n=>t[`${n}Key`]&&!e.includes(n))},gn=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),o=e.join(".");return n[o]||(n[o]=((r,...i)=>{for(let s=0;s<e.length;s++){const a=AP[e[s]];if(a&&a(r,e))return}return t(r,...i)}))},CP={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},nr=(t,e)=>{const n=t._withKeys||(t._withKeys={}),o=e.join(".");return n[o]||(n[o]=(r=>{if(!("key"in r))return;const i=ea(r.key);if(e.some(s=>s===i||CP[s]===i))return t(r)}))},$P=Rn({patchProp:yP},tP);let Ew;function TP(){return Ew||(Ew=NL($P))}const MP=((...t)=>{const e=TP().createApp(...t),{mount:n}=e;return e.mount=o=>{const r=BP(o);if(!r)return;const i=e._component;!bt(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const s=n(r,!1,OP(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),s},e});function OP(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function BP(t){return vn(t)?document.querySelector(t):t}/*!
|
|
19
|
-
* pinia v3.0.4
|
|
20
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
-
* @license MIT
|
|
22
|
-
*/let q3;const um=t=>q3=t,Y3=Symbol();function h1(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Ad;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Ad||(Ad={}));function LP(){const t=Y0(!0),e=t.run(()=>ze({}));let n=[],o=[];const r=Me({install(i){um(r),r._a=i,i.provide(Y3,r),i.config.globalProperties.$pinia=r,o.forEach(s=>n.push(s)),o=[]},use(i){return this._a?n.push(i):o.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return r}const j3=()=>{};function Nw(t,e,n,o=j3){t.add(e);const r=()=>{t.delete(e)&&o()};return!n&&Xl()&&Ba(r),r}function fc(t,...e){t.forEach(n=>{n(...e)})}const PP=t=>t(),Iw=Symbol(),Hg=Symbol();function p1(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,o)=>t.set(o,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const o=e[n],r=t[n];h1(r)&&h1(o)&&t.hasOwnProperty(n)&&!Ze(o)&&!ts(o)?t[n]=p1(r,o):t[n]=o}return t}const DP=Symbol();function EP(t){return!h1(t)||!Object.prototype.hasOwnProperty.call(t,DP)}const{assign:ma}=Object;function NP(t){return!!(Ze(t)&&t.effect)}function IP(t,e,n,o){const{state:r,actions:i,getters:s}=e,a=n.state.value[t];let l;function c(){a||(n.state.value[t]=r?r():{});const u=J0(n.state.value[t]);return ma(u,i,Object.keys(s||{}).reduce((d,f)=>(d[f]=Me(A(()=>{um(n);const h=n._s.get(t);return s[f].call(h,h)})),d),{}))}return l=X3(t,c,e,n,o,!0),l}function X3(t,e,n={},o,r,i){let s;const a=ma({actions:{}},n),l={deep:!0};let c,u,d=new Set,f=new Set,h;const g=o.state.value[t];!i&&!g&&(o.state.value[t]={});let v;function m(k){let L;c=u=!1,typeof k=="function"?(k(o.state.value[t]),L={type:Ad.patchFunction,storeId:t,events:h}):(p1(o.state.value[t],k),L={type:Ad.patchObject,payload:k,storeId:t,events:h});const E=v=Symbol();wn().then(()=>{v===E&&(c=!0)}),u=!0,fc(d,L,o.state.value[t])}const b=i?function(){const{state:L}=n,E=L?L():{};this.$patch(I=>{ma(I,E)})}:j3;function y(){s.stop(),d.clear(),f.clear(),o._s.delete(t)}const x=(k,L="")=>{if(Iw in k)return k[Hg]=L,k;const E=function(){um(o);const I=Array.from(arguments),C=new Set,$=new Set;function P(V){C.add(V)}function M(V){$.add(V)}fc(f,{args:I,name:E[Hg],store:S,after:P,onError:M});let F;try{F=k.apply(this&&this.$id===t?this:S,I)}catch(V){throw fc($,V),V}return F instanceof Promise?F.then(V=>(fc(C,V),V)).catch(V=>(fc($,V),Promise.reject(V))):(fc(C,F),F)};return E[Iw]=!0,E[Hg]=L,E},_={_p:o,$id:t,$onAction:Nw.bind(null,f),$patch:m,$reset:b,$subscribe(k,L={}){const E=Nw(d,k,L.detached,()=>I()),I=s.run(()=>je(()=>o.state.value[t],C=>{(L.flush==="sync"?u:c)&&k({storeId:t,type:Ad.direct,events:h},C)},ma({},l,L)));return E},$dispose:y},S=ar(_);o._s.set(t,S);const B=(o._a&&o._a.runWithContext||PP)(()=>o._e.run(()=>(s=Y0()).run(()=>e({action:x}))));for(const k in B){const L=B[k];if(Ze(L)&&!NP(L)||ts(L))i||(g&&EP(L)&&(Ze(L)?L.value=g[k]:p1(L,g[k])),o.state.value[t][k]=L);else if(typeof L=="function"){const E=x(L,k);B[k]=E,a.actions[k]=L}}return ma(S,B),ma(Lt(S),B),Object.defineProperty(S,"$state",{get:()=>o.state.value[t],set:k=>{m(L=>{ma(L,k)})}}),o._p.forEach(k=>{ma(S,s.run(()=>k({store:S,app:o._a,pinia:o,options:a})))}),g&&i&&n.hydrate&&n.hydrate(S.$state,g),c=!0,u=!0,S}/*! #__NO_SIDE_EFFECTS__ */function Lo(t,e,n){let o;const r=typeof e=="function";o=r?n:e;function i(s,a){const l=iy();return s=s||(l?jt(Y3,null):null),s&&um(s),s=q3,s._s.has(t)||(r?X3(t,e,o,s):IP(t,o,s)),s._s.get(t)}return i.$id=t,i}function Mt(t){const e=Lt(t),n={};for(const o in e){const r=e[o];r.effect?n[o]=A({get:()=>t[o],set(i){t[o]=i}}):(Ze(r)||ts(r))&&(n[o]=zt(t,o))}return n}function RP(t,e){if(t==null)return;let n=t;for(let o=0;o<e.length;o++){if(n===void 0||n[e[o]]===void 0)return;if(n===null||n[e[o]]===null)return null;n=n[e[o]]}return n}function fy(t,e,n){if(n.length===0)return e;const o=n[0];return n.length>1&&(e=fy(typeof t!="object"||t===null||!Object.prototype.hasOwnProperty.call(t,o)?Number.isInteger(Number(n[1]))?[]:{}:t[o],e,Array.prototype.slice.call(n,1))),Number.isInteger(Number(o))&&Array.isArray(t)?t.slice()[o]:Object.assign({},t,{[o]:e})}function K3(t,e){if(t==null||e.length===0)return t;if(e.length===1){if(t==null)return t;if(Number.isInteger(e[0])&&Array.isArray(t))return Array.prototype.slice.call(t,0).splice(e[0],1);const n={};for(const o in t)n[o]=t[o];return delete n[e[0]],n}if(t[e[0]]==null){if(Number.isInteger(e[0])&&Array.isArray(t))return Array.prototype.concat.call([],t);const n={};for(const o in t)n[o]=t[o];return n}return fy(t,K3(t[e[0]],Array.prototype.slice.call(e,1)),[e[0]])}function Z3(t,e){return e.map(n=>n.split(".")).map(n=>[n,RP(t,n)]).filter(n=>n[1]!==void 0).reduce((n,o)=>fy(n,o[1],o[0]),{})}function Q3(t,e){return e.map(n=>n.split(".")).reduce((n,o)=>K3(n,o),t)}function Rw(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s,beforeHydrate:a,afterHydrate:l},c,u=!0){try{u&&(a==null||a(c));const d=e.getItem(o);if(d){const f=n.deserialize(d),h=i?Z3(f,i):f,g=s?Q3(h,s):h;t.$patch(g)}u&&(l==null||l(c))}catch(d){r&&console.error("[pinia-plugin-persistedstate]",d)}}function Fw(t,{storage:e,serializer:n,key:o,debug:r,pick:i,omit:s}){try{const a=i?Z3(t,i):t,l=s?Q3(a,s):a,c=n.serialize(l);e.setItem(o,c)}catch(a){r&&console.error("[pinia-plugin-persistedstate]",a)}}function FP(t,e){return typeof t=="function"?t(e):typeof t=="string"?t:e}function VP(t,e,n){const{pinia:o,store:r,options:{persist:i=n}}=t;if(!i)return;// v8 ignore if -- @preserve
|
|
23
|
-
if(!(r.$id in o.state.value)){const a=o._s.get(r.$id.replace("__hot:",""));a&&Promise.resolve().then(()=>a.$persist());return}const s=(Array.isArray(i)?i:i===!0?[{}]:[i]).map(e);r.$hydrate=({runHooks:a=!0}={})=>{s.forEach(l=>{Rw(r,l,t,a)})},r.$persist=()=>{s.forEach(a=>{Fw(r.$state,a)})},s.forEach(a=>{Rw(r,a,t),r.$subscribe((l,c)=>Fw(c,a),{detached:!0})})}function zP(t={}){return function(e){VP(e,n=>{const o=FP(n.key,e.store.$id);return{key:(t.key?t.key:r=>r)(o),debug:n.debug??t.debug??!1,serializer:n.serializer??t.serializer??{serialize:r=>JSON.stringify(r),deserialize:r=>JSON.parse(r)},storage:n.storage??t.storage??window.localStorage,beforeHydrate:n.beforeHydrate??t.beforeHydrate,afterHydrate:n.afterHydrate??t.afterHydrate,pick:n.pick,omit:n.omit}},t.auto??!1)}}var HP=zP();const hy=(t,e="")=>{const n=`${e}___`;return`___BVN__ID__${t}__${e?n:""}`},qa=t=>hy(t),Ya=t=>hy(`${t}__plugin`),WP=qa("checkboxGroup"),J3=qa("radioGroup"),e4=qa("collapse"),t4=Ya("globalShowHideStorage"),n4=qa("dropdown"),o4=qa("navbar"),UP=Ya("rtl"),GP=Ya("breadcrumbPlugin"),r4=Ya("modalManager"),Xh=Ya("defaults"),qP=qa("inputGroup"),i4=qa("buttonGroup"),YP=Ya("toast"),jP=Ya("modalController"),XP=Ya("popover"),s4=qa("formGroupPlugin");function Kl(t){return Xl()?(Ba(t),!0):!1}function a4(t){let e=0,n,o;const r=()=>{e-=1,o&&e<=0&&(o.stop(),n=void 0,o=void 0)};return(...i)=>(e+=1,o||(o=Y0(!0),n=o.run(()=>t(...i))),Kl(r),n)}function KP(t,e){if(typeof Symbol<"u"){const n={...t};return Object.defineProperty(n,Symbol.iterator,{enumerable:!1,value(){let o=0;return{next:()=>({value:e[o++],done:o>e.length})}}}),n}else return Object.assign([...e],t)}function lo(t){return typeof t=="function"?t():p(t)}const l4=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ZP=t=>t!=null,QP=Object.prototype.toString,JP=t=>QP.call(t)==="[object Object]",Vs=()=>{},m1=e7();function e7(){var t,e;return l4&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function c4(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function t7(t,e={}){let n,o,r=Vs;const i=a=>{clearTimeout(a),r(),r=Vs};return a=>{const l=lo(t),c=lo(e.maxWait);return n&&i(n),l<=0||c!==void 0&&c<=0?(o&&(i(o),o=null),Promise.resolve(a())):new Promise((u,d)=>{r=e.rejectOnCancel?d:u,c&&!o&&(o=setTimeout(()=>{n&&i(n),o=null,u(a())},c)),n=setTimeout(()=>{o&&i(o),o=null,u(a())},l)})}}function n7(...t){let e=0,n,o=!0,r=Vs,i,s,a,l,c;!Ze(t[0])&&typeof t[0]=="object"?{delay:s,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=t[0]:[s,a=!0,l=!0,c=!1]=t;const u=()=>{n&&(clearTimeout(n),n=void 0,r(),r=Vs)};return f=>{const h=lo(s),g=Date.now()-e,v=()=>i=f();return u(),h<=0?(e=Date.now(),v()):(g>h&&(l||!o)?(e=Date.now(),v()):a&&(i=new Promise((m,b)=>{r=c?b:m,n=setTimeout(()=>{e=Date.now(),o=!0,m(v()),u()},Math.max(0,h-g))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function o7(t){const e=Object.create(null);return n=>e[n]||(e[n]=t(n))}const r7=/-(\w)/g,i7=o7(t=>t.replace(r7,(e,n)=>n?n.toUpperCase():""));function s7(t,e){var n;if(typeof t=="number")return t+e;const o=((n=t.match(/^-?\d+\.?\d*/))==null?void 0:n[0])||"",r=t.slice(o.length),i=Number.parseFloat(o)+e;return Number.isNaN(i)?t:i+r}function a7(...t){if(t.length!==1)return zt(...t);const e=t[0];return typeof e=="function"?ao(US(()=>({get:e,set:Vs}))):ze(e)}function l7(t,e=200,n={}){return c4(t7(e,n),t)}function Vw(t,e=200,n=!1,o=!0,r=!1){return c4(n7(e,n,o,r),t)}function Dl(t,e={}){const{method:n="parseFloat",radix:o,nanToZero:r}=e;return A(()=>{let i=lo(t);return typeof i=="string"&&(i=Number[n](i,o)),r&&Number.isNaN(i)&&(i=0),i})}function zw(t={}){const{inheritAttrs:e=!0}=t,n=Fe(),o=le({setup(i,{slots:s}){return()=>{n.value=s.default}}}),r=le({inheritAttrs:e,setup(i,{attrs:s,slots:a}){return()=>{var l;n.value;const c=(l=n.value)==null?void 0:l.call(n,{...c7(s),$slots:a});return e&&(c==null?void 0:c.length)===1?c[0]:c}}});return KP({define:o,reuse:r},[o,r])}function c7(t){const e={};for(const n in t)e[i7(n)]=t[n];return e}const Zl=l4?window:void 0;function ka(t){var e;const n=lo(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Rr(...t){let e,n,o,r;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,o,r]=t,e=Zl):[e,n,o,r]=t,!e)return Vs;Array.isArray(n)||(n=[n]),Array.isArray(o)||(o=[o]);const i=[],s=()=>{i.forEach(u=>u()),i.length=0},a=(u,d,f,h)=>(u.addEventListener(d,f,h),()=>u.removeEventListener(d,f,h)),l=je(()=>[ka(e),lo(r)],([u,d])=>{if(s(),!u)return;const f=JP(d)?{...d}:d;i.push(...n.flatMap(h=>o.map(g=>a(u,h,g,f))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return Kl(c),c}let Hw=!1;function u4(t,e,n={}){const{window:o=Zl,ignore:r=[],capture:i=!0,detectIframe:s=!1}=n;if(!o)return Vs;m1&&!Hw&&(Hw=!0,Array.from(o.document.body.children).forEach(v=>v.addEventListener("click",Vs)),o.document.documentElement.addEventListener("click",Vs));let a=!0;const l=v=>lo(r).some(m=>{if(typeof m=="string")return Array.from(o.document.querySelectorAll(m)).some(b=>b===v.target||v.composedPath().includes(b));{const b=ka(m);return b&&(v.target===b||v.composedPath().includes(b))}});function c(v){const m=lo(v);return m&&m.$.subTree.shapeFlag===16}function u(v,m){const b=lo(v),y=b.$.subTree&&b.$.subTree.children;return y==null||!Array.isArray(y)?!1:y.some(x=>x.el===m.target||m.composedPath().includes(x.el))}const d=v=>{const m=ka(t);if(v.target!=null&&!(!(m instanceof Element)&&c(t)&&u(t,v))&&!(!m||m===v.target||v.composedPath().includes(m))){if(v.detail===0&&(a=!l(v)),!a){a=!0;return}e(v)}};let f=!1;const h=[Rr(o,"click",v=>{f||(f=!0,setTimeout(()=>{f=!1},0),d(v))},{passive:!0,capture:i}),Rr(o,"pointerdown",v=>{const m=ka(t);a=!l(v)&&!!(m&&!v.composedPath().includes(m))},{passive:!0}),s&&Rr(o,"blur",v=>{setTimeout(()=>{var m;const b=ka(t);((m=o.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(b!=null&&b.contains(o.document.activeElement))&&e(v)},0)})].filter(Boolean);return()=>h.forEach(v=>v())}function u7(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function Ms(...t){let e,n,o={};t.length===3?(e=t[0],n=t[1],o=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],o=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:r=Zl,eventName:i="keydown",passive:s=!1,dedupe:a=!1}=o,l=u7(e);return Rr(r,i,u=>{u.repeat&&lo(a)||l(u)&&n(u)},s)}function d7(){const t=ze(!1),e=Bo();return e&&hn(()=>{t.value=!0},e),t}function d4(t){const e=d7();return A(()=>(e.value,!!t()))}function f7(t,e,n={}){const{window:o=Zl,...r}=n;let i;const s=d4(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=A(()=>{const f=lo(t),h=(Array.isArray(f)?f:[f]).map(ka).filter(ZP);return new Set(h)}),c=je(()=>l.value,f=>{a(),s.value&&f.size&&(i=new MutationObserver(e),f.forEach(h=>i.observe(h,r)))},{immediate:!0,flush:"post"}),u=()=>i==null?void 0:i.takeRecords(),d=()=>{c(),a()};return Kl(d),{isSupported:s,stop:d,takeRecords:u}}function Uu(t,e={}){const{window:n=Zl}=e,o=d4(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function");let r;const i=ze(!1),s=c=>{i.value=c.matches},a=()=>{r&&("removeEventListener"in r?r.removeEventListener("change",s):r.removeListener(s))},l=tm(()=>{o.value&&(a(),r=n.matchMedia(lo(t)),"addEventListener"in r?r.addEventListener("change",s):r.addListener(s),i.value=r.matches)});return Kl(()=>{l(),a(),r=void 0}),i}const h7={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400};function p7(t,e={}){function n(u,d){let f=lo(t[lo(u)]);return d!=null&&(f=s7(f,d)),typeof f=="number"&&(f=`${f}px`),f}const{window:o=Zl,strategy:r="min-width"}=e;function i(u){return o?o.matchMedia(u).matches:!1}const s=u=>Uu(()=>`(min-width: ${n(u)})`,e),a=u=>Uu(()=>`(max-width: ${n(u)})`,e),l=Object.keys(t).reduce((u,d)=>(Object.defineProperty(u,d,{get:()=>r==="min-width"?s(d):a(d),enumerable:!0,configurable:!0}),u),{});function c(){const u=Object.keys(t).map(d=>[d,s(d)]);return A(()=>u.filter(([,d])=>d.value).map(([d])=>d))}return Object.assign(l,{greaterOrEqual:s,smallerOrEqual:a,greater(u){return Uu(()=>`(min-width: ${n(u,.1)})`,e)},smaller(u){return Uu(()=>`(max-width: ${n(u,-.1)})`,e)},between(u,d){return Uu(()=>`(min-width: ${n(u)}) and (max-width: ${n(d,-.1)})`,e)},isGreater(u){return i(`(min-width: ${n(u,.1)})`)},isGreaterOrEqual(u){return i(`(min-width: ${n(u)})`)},isSmaller(u){return i(`(max-width: ${n(u,-.1)})`)},isSmallerOrEqual(u){return i(`(max-width: ${n(u)})`)},isInBetween(u,d){return i(`(min-width: ${n(u)}) and (max-width: ${n(d,-.1)})`)},current:c,active(){const u=c();return A(()=>u.value.length===0?"":u.value.at(-1))}})}const eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},th="__vueuse_ssr_handlers__",m7=g7();function g7(){return th in eh||(eh[th]=eh[th]||{}),eh[th]}function v7(t,e){return m7[t]||e}function Zi(t,e={}){const{initialValue:n=!1,focusVisible:o=!1,preventScroll:r=!1}=e,i=ze(!1),s=A(()=>ka(t));Rr(s,"focus",l=>{var c,u;(!o||(u=(c=l.target).matches)!=null&&u.call(c,":focus-visible"))&&(i.value=!0)}),Rr(s,"blur",()=>i.value=!1);const a=A({get:()=>i.value,set(l){var c,u;!l&&i.value?(c=s.value)==null||c.blur():l&&!i.value&&((u=s.value)==null||u.focus({preventScroll:r}))}});return je(s,()=>{a.value=n},{immediate:!0,flush:"post"}),{focused:a}}function Wg(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}const b7={page:t=>[t.pageX,t.pageY],client:t=>[t.clientX,t.clientY],screen:t=>[t.screenX,t.screenY],movement:t=>t instanceof Touch?null:[t.movementX,t.movementY]};function y7(t={}){const{type:e="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:r={x:0,y:0},window:i=Zl,target:s=i,scroll:a=!0,eventFilter:l}=t;let c=null,u=0,d=0;const f=ze(r.x),h=ze(r.y),g=ze(null),v=typeof e=="function"?e:b7[e],m=B=>{const k=v(B);c=B,k&&([f.value,h.value]=k,g.value="mouse"),i&&(u=i.scrollX,d=i.scrollY)},b=B=>{if(B.touches.length>0){const k=v(B.touches[0]);k&&([f.value,h.value]=k,g.value="touch")}},y=()=>{if(!c||!i)return;const B=v(c);c instanceof MouseEvent&&B&&(f.value=B[0]+i.scrollX-u,h.value=B[1]+i.scrollY-d)},x=()=>{f.value=r.x,h.value=r.y},_=l?B=>l(()=>m(B),{}):B=>m(B),S=l?B=>l(()=>b(B),{}):B=>b(B),N=l?()=>l(()=>y(),{}):()=>y();if(s){const B={passive:!0};Rr(s,["mousemove","dragover"],_,B),n&&e!=="movement"&&(Rr(s,["touchstart","touchmove"],S,B),o&&Rr(s,"touchend",x,B)),a&&e==="page"&&Rr(i,"scroll",N,{passive:!0})}return{x:f,y:h,sourceType:g}}function f4(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:f4(n)}}function x7(t){const e=t||window.event,n=e.target;return f4(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Ug=new WeakMap;function w7(t,e=!1){const n=ze(e);let o=null,r="";je(a7(t),a=>{const l=Wg(lo(a));if(l){const c=l;if(Ug.get(c)||Ug.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(r=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const i=()=>{const a=Wg(lo(t));!a||n.value||(m1&&(o=Rr(a,"touchmove",l=>{x7(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=Wg(lo(t));!a||!n.value||(m1&&(o==null||o()),a.style.overflow=r,Ug.delete(a),n.value=!1)};return Kl(s),A({get(){return n.value},set(a){a?i():s()}})}const Gg="modal-open",_7=()=>{const t=jt(r4),e=o=>{t==null||t.removeStack(o),t==null||t.removeRegistry(o)},n=v7("updateHTMLAttrs",(o,r,i)=>{const s=typeof o=="string"?window==null?void 0:window.document.querySelector(o):ka(o);s&&(r==="class"?s.classList.toggle(Gg,i===Gg):s.setAttribute(r,i))});return Kl(()=>{n("body","class","")}),je(()=>t==null?void 0:t.countStack.value,o=>{o!==void 0&&n("body","class",o>0?Gg:"")}),{...t,dispose:e}},k7=(t,e)=>{const{pushRegistry:n,pushStack:o,removeStack:r,stack:i,dispose:s,countStack:a}=_7(),l=Bo();if(!l||l.type.__name!=="BModal")throw new Error("useModalManager must only use in BModal component");n==null||n(l),Kl(()=>{s(l)});const c=(u,d)=>{u?o==null||o(l):d&&!u&&(r==null||r(l))};return c(e,e),je(t,c),{activePosition:A(()=>i==null?void 0:i.value.findIndex(u=>{var d,f;return yt((d=u.exposed)==null?void 0:d.id)===yt((f=l.exposed)==null?void 0:f.id)})),activeModalCount:a,stackWithoutSelf:A(()=>(i==null?void 0:i.value.filter(u=>{var d,f;return yt((d=u.exposed)==null?void 0:d.id)!==yt((f=l.exposed)==null?void 0:f.id)}))??[])}},Cp=t=>{if(t)return typeof t=="string"?typeof document>"u"?void 0:document.getElementById(t)??document.querySelector(t)??void 0:t.$el??t},S7=/^[0-9]*\.?[0-9]+$/;function A7(t,e=h4("injectSelf")){const{provides:n}=e;if(n&&t in n)return n[t]}function h4(t,e){const n=Bo();if(!n)throw new Error(`[Bvn] ${t} must be called from inside a setup function`);return n}const C7=(t="")=>t.replace(/[^a-z]/gi,"-").replace(/\B([A-Z])/g,"-$1").toLowerCase(),Ww=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);function p4(t={},e={},n){const o={};for(const r in t)o[r]=t[r];for(const r in e){const i=t[r],s=e[r];if(Ww(i)&&Ww(s)){o[r]=p4(i,s);continue}o[r]=s}return o}const $7=(t,e)=>{var n,o;return typeof((n=t.props)==null?void 0:n[e])<"u"||typeof((o=t.props)==null?void 0:o[C7(e)])<"u"};function T7(t={},e){const n=jt(Xh,ze({})),o=h4("useDefaults");if(e=e??o.type.name??o.type.__name,!e)throw new Error("[Bvn] Could not determine component name");const r=A(()=>{var l;return(l=n.value)==null?void 0:l[t._as??e]}),i=new Proxy(t,{get(l,c){var u,d,f,h;const g=Reflect.get(l,c);return c==="class"||c==="style"?[(u=r.value)==null?void 0:u[c],g].filter(v=>v!=null):typeof c=="string"&&!$7(o.vnode,c)?((d=r.value)==null?void 0:d[c])??((h=(f=n.value)==null?void 0:f.global)==null?void 0:h[c])??g:g}}),s=Fe();tm(()=>{if(r.value){const l=Object.entries(r.value).filter(([c])=>c.startsWith(c[0].toUpperCase()));s.value=l.length?Object.fromEntries(l):void 0}else s.value=void 0});function a(){const l=A7(Xh,o);gi(Xh,A(()=>s.value?p4((l==null?void 0:l.value)??{},s.value):l==null?void 0:l.value))}return{props:i,provideSubDefaults:a}}function Ht(t,e){const{props:n,provideSubDefaults:o}=T7(t,e);return o(),n}const So=(t,e)=>{const n=a3();return A(()=>yt(t)||hy(n||"",e))},dm=le({name:"ConditionalTeleport",inheritAttrs:!1,slots:Object,props:{to:{type:[String,Object],default:null},disabled:{type:Boolean,required:!0}},setup(t,{slots:e}){return()=>{var n,o;return t.to?Vt(sy,{to:t.to,disabled:t.disabled||!t.to},[(o=e.default)==null?void 0:o.call(e,{})]):(n=e.default)==null?void 0:n.call(e,{})}}});var M7=Object.defineProperty,O7=(t,e,n)=>e in t?M7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ss=(t,e,n)=>O7(t,typeof e!="symbol"?e+"":e,n);class $p{constructor(e,n={}){if(Ss(this,"cancelable",!0),Ss(this,"componentId",null),Ss(this,"_defaultPrevented",!1),Ss(this,"eventType",""),Ss(this,"nativeEvent",null),Ss(this,"_preventDefault"),Ss(this,"relatedTarget",null),Ss(this,"target",null),!e)throw new TypeError(`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`);Object.assign(this,$p.Defaults,n,{eventType:e}),this._preventDefault=function(){this.cancelable&&(this.defaultPrevented=!0)}}get defaultPrevented(){return this._defaultPrevented}set defaultPrevented(e){this._defaultPrevented=e}get preventDefault(){return this._preventDefault}set preventDefault(e){this._preventDefault=e}static get Defaults(){return{cancelable:!0,componentId:null,eventType:"",nativeEvent:null,relatedTarget:null,target:null}}}class B7 extends $p{constructor(e,n={}){super(e,n),Ss(this,"trigger",null),Object.assign(this,$p.Defaults,n,{eventType:e})}static get Defaults(){return{...super.Defaults,trigger:null}}}const Uw={name:"fade",enterActiveClass:"",enterFromClass:"showing",enterToClass:"",leaveActiveClass:"",leaveFromClass:"",leaveToClass:"showing",css:!0},fm=(t,e,n,o,r,i={transitionProps:{},showFn:()=>{},hideFn:()=>{}})=>{var s;let a=!1;const l=!!t.value&&!e.initialAnimation||e.visible||!1,c=ze(!1),u=ze(l),d=ze(l);let f=typeof t.value!="boolean";je(t,()=>{if(f=typeof t.value!="boolean",a){a=!1;return}t.value?y():x()});const h=ze(l),g=ze(!1),v=A(()=>e.noAnimation||e.noFade||h.value||!1);hn(()=>{var ee;if(!e.show&&l){const fe=m("show",{cancelable:!0});if(n("show",fe),fe.defaultPrevented){n("show-prevented",m("show-prevented"));return}h.value=!0,t.value||(a=!0,t.value=!0),u.value=!0,d.value=!0,C.value=!0,de.value=!0,he.value=!0,c.value=!0,(ee=i.showFn)==null||ee.call(i)}else(e.show||t.value&&e.initialAnimation)&&y()}),je(()=>e.visible,ee=>{h.value=!0,wn(()=>{ee&&(C.value=!0),ee?y():x()})}),je(()=>e.show,ee=>{ee?y():x()}),Rr(o,"bv-toggle",()=>{t.value=!t.value});const m=(ee,fe={})=>new B7(ee,{cancelable:!1,target:(o==null?void 0:o.value)||null,relatedTarget:null,trigger:null,...fe,componentId:r==null?void 0:r.value});let b;const y=()=>{if(c.value)return;const ee=m("show",{cancelable:!0});if(n("show",ee),ee.defaultPrevented){n("show-prevented",m("show-prevented")),C.value&&(C.value=!1),t.value&&!f&&(a=!0,wn(()=>{t.value=!1}));return}u.value=!0,d.value=!0,requestAnimationFrame(()=>{var fe;b=setTimeout(()=>{var xe;c.value=!0,(xe=i.showFn)==null||xe.call(i),t.value||(a=!0,wn(()=>{t.value=!0}))},h.value?0:typeof e.delay=="number"?e.delay:((fe=e.delay)==null?void 0:fe.show)||0)})},x=ee=>{var fe;if(!c.value)return;const xe=m("hide",{cancelable:!0,trigger:ee}),Z=m(ee||"ignore",{cancelable:!0,trigger:ee});if(ee==="backdrop"&&e.noCloseOnBackdrop||ee==="esc"&&e.noCloseOnEsc){n("hide-prevented",m("hide-prevented"));return}if(b&&(clearTimeout(b),b=void 0),ee&&n(ee,Z),n("hide",xe),xe.defaultPrevented||Z.defaultPrevented){n("hide-prevented",m("hide-prevented")),t.value||wn(()=>{a=!0,t.value=!0});return}setTimeout(()=>{var pe;E.value=!0,c.value=!1,(pe=i.hideFn)==null||pe.call(i),t.value&&(a=!0,t.value=f?0:!1)},h.value?0:typeof e.delay=="number"?e.delay:((fe=e.delay)==null?void 0:fe.hide)||0)},_=Vw(ee=>x(ee),500),S=Vw(()=>y(),500),N=()=>{const ee=m("toggle",{cancelable:!0});if(n("toggle",ee),ee.defaultPrevented){n("toggle-prevented",m("toggle-prevented"));return}c.value?x():y()},B=(s=jt(t4,void 0))==null?void 0:s({id:r.value,toggle:N,show:y,hide:x,value:ao(c)});Xs(()=>{B==null||B.unregister()});const k=ze(!1),L=()=>{e.lazy===!0&&(k.value=!0)},E=ze(!1),I=ze(!1),C=ze(!1),$=ee=>{var fe,xe,Z,pe;(xe=(fe=i.transitionProps)==null?void 0:fe.onBeforeEnter)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onBeforeEnter)==null||pe.call(Z,ee),I.value=!0},P=ee=>{var fe,xe,Z,pe;requestAnimationFrame(()=>{requestAnimationFrame(()=>{C.value=!0})}),(xe=(fe=i.transitionProps)==null?void 0:fe.onEnter)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onEnter)==null||pe.call(Z,ee)},M=ee=>{var fe,xe,Z,pe;n("shown",m("shown")),L(),(xe=(fe=i.transitionProps)==null?void 0:fe.onAfterEnter)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onAfterEnter)==null||pe.call(Z,ee),h.value&&requestAnimationFrame(()=>{h.value=!1}),g.value&&(g.value=!1)},F=ee=>{var fe,xe,Z,pe;E.value||(E.value=!0),(xe=(fe=i.transitionProps)==null?void 0:fe.onBeforeLeave)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onBeforeLeave)==null||pe.call(Z,ee)},V=ee=>{var fe,xe,Z,pe;C.value=!1,(xe=(fe=i.transitionProps)==null?void 0:fe.onLeave)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onLeave)==null||pe.call(Z,ee)},G=ee=>{var fe,xe,Z,pe;n("hidden",m("hidden")),(xe=(fe=i.transitionProps)==null?void 0:fe.onAfterLeave)==null||xe.call(fe,ee),(pe=(Z=e.transitionProps)==null?void 0:Z.onAfterLeave)==null||pe.call(Z,ee),E.value=!1,I.value=!1,h.value&&requestAnimationFrame(()=>{h.value=!1}),requestAnimationFrame(()=>{g.value||(u.value=!1)})},K=A(()=>g.value===!0||I.value===!0||e.lazy===!1||e.lazy===!0&&k.value===!0&&e.unmountLazy===!1),ue=ze(!1);je(C,ee=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{setTimeout(()=>{ue.value=ee},32)})})})})});const de=ze(!1),he=ze(!1),ge={...i.transitionProps,onBeforeEnter:$,onEnter:P,onAfterEnter:M,onBeforeLeave:F,onLeave:V,onAfterLeave:G};return{showRef:c,renderRef:u,renderBackdropRef:d,isVisible:C,isActive:I,trapActive:ue,show:y,hide:x,toggle:N,throttleHide:_,throttleShow:S,buildTriggerableEvent:m,computedNoAnimation:v,localNoAnimation:h,localTemporaryHide:g,isLeaving:E,transitionProps:{...Uw,...e.transitionProps,...ge},lazyLoadCompleted:k,markLazyLoadCompleted:L,contentShowing:K,backdropReady:he,backdropVisible:de,backdropTransitionProps:{...Uw,onBeforeEnter:()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{de.value=!0})}),he.value=!1},onAfterEnter:()=>{he.value=!0},onBeforeLeave:()=>{de.value=!1},onAfterLeave:()=>{he.value=!1,requestAnimationFrame(()=>{d.value=!1})}}}},hm=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},m4=["top","right","bottom","left"],Gw=["start","end"],qw=m4.reduce((t,e)=>t.concat(e,e+"-"+Gw[0],e+"-"+Gw[1]),[]),Si=Math.min,wo=Math.max,Tp=Math.round,nh=Math.floor,ns=t=>({x:t,y:t}),L7={left:"right",right:"left",bottom:"top",top:"bottom"},P7={start:"end",end:"start"};function g1(t,e,n){return wo(t,Si(e,n))}function oa(t,e){return typeof t=="function"?t(e):t}function qr(t){return t.split("-")[0]}function vi(t){return t.split("-")[1]}function g4(t){return t==="x"?"y":"x"}function py(t){return t==="y"?"height":"width"}function Da(t){return["top","bottom"].includes(qr(t))?"y":"x"}function my(t){return g4(Da(t))}function v4(t,e,n){n===void 0&&(n=!1);const o=vi(t),r=my(t),i=py(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Op(s)),[s,Op(s)]}function D7(t){const e=Op(t);return[Mp(t),e,Mp(e)]}function Mp(t){return t.replace(/start|end/g,e=>P7[e])}function E7(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function N7(t,e,n,o){const r=vi(t);let i=E7(qr(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(Mp)))),i}function Op(t){return t.replace(/left|right|bottom|top/g,e=>L7[e])}function I7(t){return{top:0,right:0,bottom:0,left:0,...t}}function gy(t){return typeof t!="number"?I7(t):{top:t,right:t,bottom:t,left:t}}function Kc(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Yw(t,e,n){let{reference:o,floating:r}=t;const i=Da(e),s=my(e),a=py(s),l=qr(e),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(vi(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}const R7=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Yw(c,o,l),f=o,h={},g=0;for(let v=0;v<a.length;v++){const{name:m,fn:b}=a[v],{x:y,y:x,data:_,reset:S}=await b({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});u=y??u,d=x??d,h={...h,[m]:{...h[m],..._}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(f=S.placement),S.rects&&(c=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):S.rects),{x:u,y:d}=Yw(c,f,l)),v=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}};async function Zc(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=oa(e,t),g=gy(h),m=a[f?d==="floating"?"reference":"floating":d],b=Kc(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},S=Kc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(b.top-S.top+g.top)/_.y,bottom:(S.bottom-b.bottom+g.bottom)/_.y,left:(b.left-S.left+g.left)/_.x,right:(S.right-b.right+g.right)/_.x}}const F7=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:i,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=oa(t,e)||{};if(c==null)return{};const d=gy(u),f={x:n,y:o},h=my(r),g=py(h),v=await s.getDimensions(c),m=h==="y",b=m?"top":"left",y=m?"bottom":"right",x=m?"clientHeight":"clientWidth",_=i.reference[g]+i.reference[h]-f[h]-i.floating[g],S=f[h]-i.reference[h],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let B=N?N[x]:0;(!B||!await(s.isElement==null?void 0:s.isElement(N)))&&(B=a.floating[x]||i.floating[g]);const k=_/2-S/2,L=B/2-v[g]/2-1,E=Si(d[b],L),I=Si(d[y],L),C=E,$=B-v[g]-I,P=B/2-v[g]/2+k,M=g1(C,P,$),F=!l.arrow&&vi(r)!=null&&P!==M&&i.reference[g]/2-(P<C?E:I)-v[g]/2<0,V=F?P<C?P-C:P-$:0;return{[h]:f[h]+V,data:{[h]:M,centerOffset:P-M-V,...F&&{alignmentOffset:V}},reset:F}}});function V7(t,e,n){return(t?[...n.filter(r=>vi(r)===t),...n.filter(r=>vi(r)!==t)]:n.filter(r=>qr(r)===r)).filter(r=>t?vi(r)===t||(e?Mp(r)!==r:!1):!0)}const z7=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:i,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:f=qw,autoAlignment:h=!0,...g}=oa(t,e),v=d!==void 0||f===qw?V7(d||null,h,f):f,m=await Zc(e,g),b=((n=s.autoPlacement)==null?void 0:n.index)||0,y=v[b];if(y==null)return{};const x=v4(y,i,await(l.isRTL==null?void 0:l.isRTL(c.floating)));if(a!==y)return{reset:{placement:v[0]}};const _=[m[qr(y)],m[x[0]],m[x[1]]],S=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:_}],N=v[b+1];if(N)return{data:{index:b+1,overflows:S},reset:{placement:N}};const B=S.map(E=>{const I=vi(E.placement);return[E.placement,I&&u?E.overflows.slice(0,2).reduce((C,$)=>C+$,0):E.overflows[0],E.overflows]}).sort((E,I)=>E[1]-I[1]),L=((r=B.filter(E=>E[2].slice(0,vi(E[0])?2:3).every(I=>I<=0))[0])==null?void 0:r[0])||B[0][0];return L!==a?{data:{index:b+1,overflows:S},reset:{placement:L}}:{}}}},H7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=oa(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=qr(r),y=Da(a),x=qr(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(x||!v?[Op(a)]:D7(a)),N=g!=="none";!f&&N&&S.push(...N7(a,v,g,_));const B=[a,...S],k=await Zc(e,m),L=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push(k[b]),d){const P=v4(r,s,_);L.push(k[P[0]],k[P[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(P=>P<=0)){var I,C;const P=(((I=i.flip)==null?void 0:I.index)||0)+1,M=B[P];if(M)return{data:{index:P,overflows:E},reset:{placement:M}};let F=(C=E.filter(V=>V.overflows[0]<=0).sort((V,G)=>V.overflows[1]-G.overflows[1])[0])==null?void 0:C.placement;if(!F)switch(h){case"bestFit":{var $;const V=($=E.filter(G=>{if(N){const K=Da(G.placement);return K===y||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,ue)=>K+ue,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:$[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function jw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Xw(t){return m4.some(e=>t[e]>=0)}const W7=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=oa(t,e);switch(o){case"referenceHidden":{const i=await Zc(e,{...r,elementContext:"reference"}),s=jw(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Xw(s)}}}case"escaped":{const i=await Zc(e,{...r,altBoundary:!0}),s=jw(i,n.floating);return{data:{escapedOffsets:s,escaped:Xw(s)}}}default:return{}}}}};function b4(t){const e=Si(...t.map(i=>i.left)),n=Si(...t.map(i=>i.top)),o=wo(...t.map(i=>i.right)),r=wo(...t.map(i=>i.bottom));return{x:e,y:n,width:o-e,height:r-n}}function U7(t){const e=t.slice().sort((r,i)=>r.y-i.y),n=[];let o=null;for(let r=0;r<e.length;r++){const i=e[r];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(r=>Kc(b4(r)))}const G7=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:r,platform:i,strategy:s}=e,{padding:a=2,x:l,y:c}=oa(t,e),u=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(o.reference))||[]),d=U7(u),f=Kc(b4(u)),h=gy(a);function g(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&c!=null)return d.find(m=>l>m.left-h.left&&l<m.right+h.right&&c>m.top-h.top&&c<m.bottom+h.bottom)||f;if(d.length>=2){if(Da(n)==="y"){const E=d[0],I=d[d.length-1],C=qr(n)==="top",$=E.top,P=I.bottom,M=C?E.left:I.left,F=C?E.right:I.right,V=F-M,G=P-$;return{top:$,bottom:P,left:M,right:F,width:V,height:G,x:M,y:$}}const m=qr(n)==="left",b=wo(...d.map(E=>E.right)),y=Si(...d.map(E=>E.left)),x=d.filter(E=>m?E.left===y:E.right===b),_=x[0].top,S=x[x.length-1].bottom,N=y,B=b,k=B-N,L=S-_;return{top:_,bottom:S,left:N,right:B,width:k,height:L,x:N,y:_}}return f}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:o.floating,strategy:s});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function q7(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=qr(n),a=vi(n),l=Da(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=oa(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const Y7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,l=await q7(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},j7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:m=>{let{x:b,y}=m;return{x:b,y}}},...l}=oa(t,e),c={x:n,y:o},u=await Zc(e,l),d=Da(qr(r)),f=g4(d);let h=c[f],g=c[d];if(i){const m=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=h+u[m],x=h-u[b];h=g1(y,h,x)}if(s){const m=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=g+u[m],x=g-u[b];g=g1(y,g,x)}const v=a.fn({...e,[f]:h,[d]:g});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[f]:i,[d]:s}}}}}},X7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:a}=e,{apply:l=()=>{},...c}=oa(t,e),u=await Zc(e,c),d=qr(r),f=vi(r),h=Da(r)==="y",{width:g,height:v}=i.floating;let m,b;d==="top"||d==="bottom"?(m=d,b=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=d,m=f==="end"?"top":"bottom");const y=v-u.top-u.bottom,x=g-u.left-u.right,_=Si(v-u[m],y),S=Si(g-u[b],x),N=!e.middlewareData.shift;let B=_,k=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(k=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(B=y),N&&!f){const E=wo(u.left,0),I=wo(u.right,0),C=wo(u.top,0),$=wo(u.bottom,0);h?k=g-2*(E!==0||I!==0?E+I:wo(u.left,u.right)):B=v-2*(C!==0||$!==0?C+$:wo(u.top,u.bottom))}await l({...e,availableWidth:k,availableHeight:B});const L=await s.getDimensions(a.floating);return g!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function pm(){return typeof window<"u"}function Ql(t){return vy(t)?(t.nodeName||"").toLowerCase():"#document"}function Sr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fs(t){var e;return(e=(vy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vy(t){return pm()?t instanceof Node||t instanceof Sr(t).Node:!1}function Ai(t){return pm()?t instanceof Element||t instanceof Sr(t).Element:!1}function as(t){return pm()?t instanceof HTMLElement||t instanceof Sr(t).HTMLElement:!1}function Kw(t){return!pm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Sr(t).ShadowRoot}function Af(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Ci(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function K7(t){return["table","td","th"].includes(Ql(t))}function mm(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function by(t){const e=yy(),n=Ai(t)?Ci(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Z7(t){let e=Ea(t);for(;as(e)&&!Qc(e);){if(by(e))return e;if(mm(e))return null;e=Ea(e)}return null}function yy(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qc(t){return["html","body","#document"].includes(Ql(t))}function Ci(t){return Sr(t).getComputedStyle(t)}function gm(t){return Ai(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ea(t){if(Ql(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Kw(t)&&t.host||fs(t);return Kw(e)?e.host:e}function y4(t){const e=Ea(t);return Qc(e)?t.ownerDocument?t.ownerDocument.body:t.body:as(e)&&Af(e)?e:y4(e)}function Yd(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=y4(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=Sr(r);if(i){const a=v1(s);return e.concat(s,s.visualViewport||[],Af(r)?r:[],a&&n?Yd(a):[])}return e.concat(r,Yd(r,[],n))}function v1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function x4(t){const e=Ci(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=as(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=Tp(n)!==i||Tp(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function xy(t){return Ai(t)?t:t.contextElement}function Nc(t){const e=xy(t);if(!as(e))return ns(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=x4(e);let s=(i?Tp(n.width):n.width)/o,a=(i?Tp(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Q7=ns(0);function w4(t){const e=Sr(t);return!yy()||!e.visualViewport?Q7:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function J7(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Sr(t)?!1:e}function El(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=xy(t);let s=ns(1);e&&(o?Ai(o)&&(s=Nc(o)):s=Nc(t));const a=J7(i,n,o)?w4(i):ns(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const f=Sr(i),h=o&&Ai(o)?Sr(o):o;let g=f,v=v1(g);for(;v&&o&&h!==g;){const m=Nc(v),b=v.getBoundingClientRect(),y=Ci(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=_,g=Sr(v),v=v1(g)}}return Kc({width:u,height:d,x:l,y:c})}function wy(t,e){const n=gm(t).scrollLeft;return e?e.left+n:El(fs(t)).left+n}function _4(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:wy(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function eD(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=fs(o),a=e?mm(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ns(1);const u=ns(0),d=as(o);if((d||!d&&!i)&&((Ql(o)!=="body"||Af(s))&&(l=gm(o)),as(o))){const h=El(o);c=Nc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?_4(s,l,!0):ns(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function tD(t){return Array.from(t.getClientRects())}function nD(t){const e=fs(t),n=gm(t),o=t.ownerDocument.body,r=wo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=wo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+wy(t);const a=-n.scrollTop;return Ci(o).direction==="rtl"&&(s+=wo(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}function oD(t,e){const n=Sr(t),o=fs(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const c=yy();(!c||c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:i,height:s,x:a,y:l}}function rD(t,e){const n=El(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=as(t)?Nc(t):ns(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function Zw(t,e,n){let o;if(e==="viewport")o=oD(t,n);else if(e==="document")o=nD(fs(t));else if(Ai(e))o=rD(e,n);else{const r=w4(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Kc(o)}function k4(t,e){const n=Ea(t);return n===e||!Ai(n)||Qc(n)?!1:Ci(n).position==="fixed"||k4(n,e)}function iD(t,e){const n=e.get(t);if(n)return n;let o=Yd(t,[],!1).filter(a=>Ai(a)&&Ql(a)!=="body"),r=null;const i=Ci(t).position==="fixed";let s=i?Ea(t):t;for(;Ai(s)&&!Qc(s);){const a=Ci(s),l=by(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Af(s)&&!l&&k4(t,s))?o=o.filter(u=>u!==s):r=a,s=Ea(s)}return e.set(t,o),o}function sD(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mm(e)?[]:iD(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=Zw(e,u,r);return c.top=wo(d.top,c.top),c.right=Si(d.right,c.right),c.bottom=Si(d.bottom,c.bottom),c.left=wo(d.left,c.left),c},Zw(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function aD(t){const{width:e,height:n}=x4(t);return{width:e,height:n}}function lD(t,e,n){const o=as(e),r=fs(e),i=n==="fixed",s=El(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=ns(0);if(o||!o&&!i)if((Ql(e)!=="body"||Af(r))&&(a=gm(e)),o){const f=El(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else r&&(l.x=wy(r));const c=r&&!o&&!i?_4(r,a):ns(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function qg(t){return Ci(t).position==="static"}function Qw(t,e){if(!as(t)||Ci(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fs(t)===n&&(n=n.ownerDocument.body),n}function S4(t,e){const n=Sr(t);if(mm(t))return n;if(!as(t)){let r=Ea(t);for(;r&&!Qc(r);){if(Ai(r)&&!qg(r))return r;r=Ea(r)}return n}let o=Qw(t,e);for(;o&&K7(o)&&qg(o);)o=Qw(o,e);return o&&Qc(o)&&qg(o)&&!by(o)?n:o||Z7(t)||n}const cD=async function(t){const e=this.getOffsetParent||S4,n=this.getDimensions,o=await n(t.floating);return{reference:lD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function uD(t){return Ci(t).direction==="rtl"}const dD={convertOffsetParentRelativeRectToViewportRelativeRect:eD,getDocumentElement:fs,getClippingRect:sD,getOffsetParent:S4,getElementRects:cD,getClientRects:tD,getDimensions:aD,getScale:Nc,isElement:Ai,isRTL:uD};function fD(t,e){let n=null,o;const r=fs(t);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=t.getBoundingClientRect();if(a||e(),!d||!f)return;const h=nh(u),g=nh(r.clientWidth-(c+d)),v=nh(r.clientHeight-(u+f)),m=nh(c),y={rootMargin:-h+"px "+-g+"px "+-v+"px "+-m+"px",threshold:wo(0,Si(1,l))||1};let x=!0;function _(S){const N=S[0].intersectionRatio;if(N!==l){if(!x)return s();N?s(!1,N):o=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(_,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(_,y)}n.observe(t)}return s(!0),i}function A4(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=xy(t),u=r||i?[...c?Yd(c):[],...Yd(e)]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const d=c&&a?fD(c,n):null;let f=-1,h=null;s&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(e)})),n()}),c&&!l&&h.observe(c),h.observe(e));let g,v=l?El(t):null;l&&m();function m(){const b=El(t);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,g=requestAnimationFrame(m)}return n(),()=>{var b;u.forEach(y=>{r&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const C4=Y7,hD=z7,$4=j7,T4=H7,M4=X7,pD=W7,mD=F7,gD=G7,vD=(t,e,n)=>{const o=new Map,r={platform:dD,...n},i={...r.platform,_c:o};return R7(t,e,{...r,platform:i})};function bD(t){return t!=null&&typeof t=="object"&&"$el"in t}function b1(t){if(bD(t)){const e=t.$el;return vy(e)&&Ql(e)==="#comment"?null:e}return t}function kc(t){return typeof t=="function"?t():p(t)}function yD(t){return{name:"arrow",options:t,fn(e){const n=b1(kc(t.element));return n==null?{}:mD({element:n,padding:t.padding}).fn(e)}}}function O4(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Jw(t,e){const n=O4(t);return Math.round(e*n)/n}function B4(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,r=A(()=>{var B;return(B=kc(n.open))!=null?B:!0}),i=A(()=>kc(n.middleware)),s=A(()=>{var B;return(B=kc(n.placement))!=null?B:"bottom"}),a=A(()=>{var B;return(B=kc(n.strategy))!=null?B:"absolute"}),l=A(()=>{var B;return(B=kc(n.transform))!=null?B:!0}),c=A(()=>b1(t.value)),u=A(()=>b1(e.value)),d=ze(0),f=ze(0),h=ze(a.value),g=ze(s.value),v=Fe({}),m=ze(!1),b=A(()=>{const B={position:h.value,left:"0",top:"0"};if(!u.value)return B;const k=Jw(u.value,d.value),L=Jw(u.value,f.value);return l.value?{...B,transform:"translate("+k+"px, "+L+"px)",...O4(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:k+"px",top:L+"px"}});let y;function x(){if(c.value==null||u.value==null)return;const B=r.value;vD(c.value,u.value,{middleware:i.value,placement:s.value,strategy:a.value}).then(k=>{d.value=k.x,f.value=k.y,h.value=k.strategy,g.value=k.placement,v.value=k.middlewareData,m.value=B!==!1})}function _(){typeof y=="function"&&(y(),y=void 0)}function S(){if(_(),o===void 0){x();return}if(c.value!=null&&u.value!=null){y=o(c.value,u.value,x);return}}function N(){r.value||(m.value=!1)}return je([i,s,a,r],x,{flush:"sync"}),je([c,u],S,{flush:"sync"}),je(r,N,{flush:"sync"}),Xl()&&Ba(_),{x:hl(d),y:hl(f),strategy:hl(h),placement:hl(g),middlewareData:hl(v),isPositioned:hl(m),floatingStyles:b,update:x}}const xD=a4(y7),wD=["id"],_D=["id"],kD=le({inheritAttrs:!1,__name:"BPopover",props:at({boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},click:{type:Boolean,default:!1},closeOnHide:{type:Boolean,default:!1},content:{default:void 0},customClass:{default:""},delay:{default:()=>({show:100,hide:300})},floatingMiddleware:{default:void 0},hideMargin:{default:2},id:{default:void 0},inline:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},noAutoClose:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noHide:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},noninteractive:{type:Boolean,default:!1},offset:{default:null},placement:{default:"top"},realtime:{type:Boolean,default:!1},reference:{default:null},strategy:{default:"absolute"},target:{default:null},title:{default:void 0},tooltip:{type:Boolean,default:!1},variant:{default:null},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:at(["pointerleave","blur","click-outside","close-on-hide","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BPopover"),i=n,s=ds(),a=pt(t,"modelValue"),l=So(()=>r.id,"popover"),c=ze(!1),u=mt("_element"),d=mt("_content"),f=mt("_arrow"),h=mt("_placeholder"),g=ze(null),v=ze(null),m=A(()=>r.placement.startsWith("auto")),b=Dl(()=>r.offset??NaN),y=A(()=>_y(r.boundary)?r.boundary:void 0),x=A(()=>P4(r.boundary)?r.boundary:void 0),_=ze({}),S=A(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const W=r.offset!==null?b.value:r.tooltip?6:8,j=[C4(W)];return r.noFlip===!1&&!m.value&&j.push(T4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),m.value&&j.push(hD({alignment:r.placement.split("-")[1]||void 0,boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noShift===!1&&j.push($4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.noHide===!1&&j.push(pD({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding})),r.inline===!0&&j.push(gD()),j.push(yD({element:f,padding:10})),r.noSize===!1&&j.push(M4({boundary:y.value,rootBoundary:x.value,padding:r.boundaryPadding,apply({availableWidth:ne,availableHeight:ie}){var ae,te;_.value={maxHeight:ie>=(((ae=d.value)==null?void 0:ae.scrollHeight)??0)?void 0:ie?`${Math.max(0,ie)}px`:void 0,maxWidth:ne>=(((te=d.value)==null?void 0:te.scrollWidth)??0)?void 0:ne?`${Math.max(0,ne)}px`:void 0}}})),j}),N=A(()=>m.value?void 0:r.placement),{floatingStyles:B,middlewareData:k,placement:L,update:E}=B4(g,u,{placement:N,middleware:S,strategy:zt(()=>r.strategy)}),I=ze({position:"absolute"});je(k,W=>{var j,ne;if(r.noHide===!1&&((j=W.hide)!=null&&j.referenceHidden&&!c.value&&$.value?r.closeOnHide&&!r.noAutoClose&&!r.manual?V("close-on-hide"):(ge.value=!0,c.value=!0):ge.value&&!((ne=W.hide)!=null&&ne.referenceHidden)&&(ge.value=!1,c.value=!1)),W.arrow){const{x:ie,y:ae}=W.arrow;I.value={position:"absolute",top:ae?`${ae}px`:"",left:ie?`${ie}px`:""}}});let C;const{showRef:$,hide:P,show:M,toggle:F,throttleHide:V,computedNoAnimation:G,transitionProps:K,contentShowing:ue,isVisible:de,renderRef:he,localTemporaryHide:ge}=fm(a,r,i,u,l,{showFn:()=>{E(),wn(()=>{C=A4(g.value,u.value,E,{animationFrame:r.realtime})})},hideFn:()=>{C&&(C(),C=void 0)}}),ee=A(()=>{const W=r.tooltip?"tooltip":"popover";return[W,`b-${W}`,{[`b-${W}-${r.variant}`]:r.variant!==null,show:de.value&&!c.value,fade:!G.value,[`${r.customClass}`]:r.customClass!==void 0,[`bs-${W}-${SD(L.value)}`]:L.value!==void 0}]}),{x:fe,y:xe}=xD(),Z=()=>{var W,j;const ne=(W=v.value)==null?void 0:W.getBoundingClientRect(),ie=(j=u.value)==null?void 0:j.getBoundingClientRect(),ae=parseInt(r.hideMargin,10)||0,te=(window==null?void 0:window.scrollX)||0,Y=(window==null?void 0:window.scrollY)||0,X=!ne||fe.value<ne.left+te-ae||fe.value>ne.right+te+ae||xe.value<ne.top+Y-ae||xe.value>ne.bottom+Y+ae,q=!ie||fe.value<ie.left+te-ae||fe.value>ie.right+te+ae||xe.value<ie.top+Y-ae||xe.value>ie.bottom+Y+ae;return{triggerIsOutside:X,isOutside:q}};let pe;const oe=W=>{var j,ne,ie;const ae=typeof r.delay=="number"?r.delay:((j=r.delay)==null?void 0:j.hide)||0,{triggerIsOutside:te,isOutside:Y}=Z();!r.noninteractive&&Y&&te&&!((ne=u.value)!=null&&ne.contains(document==null?void 0:document.activeElement))&&!((ie=v.value)!=null&&ie.contains(document==null?void 0:document.activeElement))||r.noninteractive&&te?P(W==null?void 0:W.type):(pe&&clearTimeout(pe),pe=setTimeout(()=>{oe(W)},ae<50?50:ae))};je(de,()=>{E()}),e({hide:P,show:M,toggle:F});const ve=W=>{$.value?P(W.type==="click"?"click":"toggle"):M()},ce=()=>{var W;if(r.target){const j=Cp(yt(r.target));j?v.value=j:console.warn("Target element not found",r.target)}else v.value=(W=h.value)==null?void 0:W.nextElementSibling;if(r.reference){const j=Cp(yt(r.reference));j?g.value=j:console.warn("Reference element not found",r.reference)}else g.value=v.value;if(!(!v.value||r.manual)){if(r.click){v.value.addEventListener("click",ve);return}v.value.addEventListener("pointerenter",M),v.value.addEventListener("pointerleave",oe),v.value.addEventListener("focus",M),v.value.addEventListener("blur",oe)}},D=()=>{v.value&&(v.value.removeEventListener("click",ve),v.value.removeEventListener("pointerenter",M),v.value.removeEventListener("pointerleave",oe),v.value.removeEventListener("focus",M),v.value.removeEventListener("blur",oe))};return u4(u,()=>{$.value&&r.click&&!r.noAutoClose&&!r.manual&&P("click-outside")},{ignore:[v]}),je([()=>r.click,()=>r.target,()=>r.reference],()=>{D(),ce()}),hn(()=>{ce(),wn(()=>{E()})}),Xs(D),(W,j)=>(w(),R(Ge,null,[T("span",{id:p(l)+"_placeholder",ref:"_placeholder",style:{display:"none"}},null,8,wD),Ae(W.$slots,"target",{show:p(M),hide:p(P),toggle:p(F),visible:p($)},void 0,!0),H(dm,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:J(()=>[p(he)||p(ue)?(w(),Q(Pl,Tt({key:0},p(K),{appear:a.value||p(r).visible}),{default:J(()=>[sr(T("div",Tt({id:p(l)},W.$attrs,{ref:"_element",class:ee.value,role:"tooltip",tabindex:"-1",style:p(B)}),[T("div",{ref:"_arrow",class:Te(`${p(r).tooltip?"tooltip":"popover"}-arrow`),style:Dt(I.value),"data-popper-arrow":""},null,6),T("div",{ref:"_content",class:"overflow-auto",style:Dt(_.value)},[p(r).title||s.title?(w(),R("div",{key:0,class:Te(["position-sticky top-0",p(r).tooltip?"tooltip-inner":"popover-header"])},[Ae(W.$slots,"title",{},()=>[Xe(be(p(r).title),1)],!0)],2)):se("",!0),p(r).tooltip&&!s.title&&!p(r).title||!p(r).tooltip?(w(),R("div",{key:1,class:Te(p(r).tooltip?"tooltip-inner":"popover-body")},[Ae(W.$slots,"default",{},()=>[Xe(be(p(r).content),1)],!0)],2)):se("",!0)],4)],16,_D),[[jc,p($)&&!c.value]])]),_:3},16,["appear"])):se("",!0)]),_:3},8,["to","disabled"])],64))}}),L4=hm(kD,[["__scopeId","data-v-9445feff"]]),SD=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";default:return e}},AD=t=>{const[e]=t.split("-");switch(e){case"left":return"start";case"right":return"end";case"top":return"up";case"bottom":return"down";default:return e}},_y=t=>t==="clippingAncestors"||t instanceof Element||Array.isArray(t),P4=t=>!_y(t),CD=(t,e)=>[...e].reduce((n,o)=>(n[o]=t[o],n),{}),Gu=(t,e,n)=>{const o=e.split(/[.[\]]/g);let r=t;for(const i of o){if(r===null||r===void 0)return n;i.trim()!==""&&(r=r[i])}return r===void 0?n:r},$D=["type","disabled","aria-label"],D4=le({__name:"BCloseButton",props:{ariaLabel:{default:"Close"},disabled:{type:Boolean,default:!1},type:{default:"button"}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BCloseButton"),r=e;return(i,s)=>(w(),R("button",{type:p(o).type,class:"btn-close",disabled:p(o).disabled,"aria-label":p(o).ariaLabel,onClick:s[0]||(s[0]=a=>r("click",a))},null,8,$D))}}),TD=(t=[])=>{const{activeElement:e}=document;return e&&!(t!=null&&t.some(n=>n===e))?e:null},MD=(t,e={})=>{const n=o=>o===TD();try{t.focus(e)}catch(o){console.error(o)}return n(t)},Jc=t=>((t==null?void 0:t())??[]).length===0,E4=t=>{if(t.getAttribute("display")==="none")return!1;const e=t.getBoundingClientRect();return!!(e&&e.height>0&&e.width>0)},zs=t=>A(()=>{let e=yt(t);return e={variant:e.variant??null,bgVariant:e.bgVariant??null,textVariant:e.textVariant??null,borderVariant:e.borderVariant??null},{[`text-bg-${e.variant}`]:e.variant!==null,[`text-${e.textVariant}`]:e.textVariant!==null,[`bg-${e.bgVariant}`]:e.bgVariant!==null,[`border-${e.borderVariant}`]:e.borderVariant!==null}}),OD={key:0,class:"visually-hidden"},BD=le({__name:"BSpinner",props:{label:{default:void 0},role:{default:"status"},small:{type:Boolean,default:!1},tag:{default:"span"},type:{default:"border"},variant:{default:null}},setup(t){const n=Ht(t,"BSpinner"),o=ds(),r=zs(A(()=>({textVariant:n.variant}))),i=A(()=>[`spinner-${n.type}`,r.value,{[`spinner-${n.type}-sm`]:n.small}]),s=A(()=>!Jc(o.label));return(a,l)=>(w(),Q(Gt(p(n).tag),{class:Te(i.value),role:p(n).label||s.value?p(n).role:null,"aria-hidden":p(n).label||s.value?null:!0},{default:J(()=>[p(n).label||s.value?(w(),R("span",OD,[Ae(a.$slots,"label",{},()=>[Xe(be(p(n).label),1)])])):se("",!0)]),_:3},8,["class","role","aria-hidden"]))}}),LD=t=>{const e=t.trim();return e.charAt(0).toUpperCase()+e.slice(1)},PD=t=>t.replace(/-./g,e=>e.charAt(1).toUpperCase()).replace(/\b\w/g,e=>e.toUpperCase()).replace(/\s+/g,""),DD=t=>!!(t.href||t.to),ky=(t,e)=>{const n=ao(zt(e)),o=ao(zt(t)),r=A(()=>DD(o.value)),i=A(()=>r.value?CD(o.value,n.value??["active","activeClass","append","href","rel","replace","routerComponentName","target","to","variant","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover"]):{});return{computedLink:r,computedLinkProps:i}},ED=t=>{const e=Bo(),n=e==null?void 0:e.appContext.app.config.globalProperties.$router,o=e==null?void 0:e.appContext.app.config.globalProperties.$route,r=Gt("RouterLink"),i=typeof r=="string"?null:r.useLink,s=zt(t),a=zt(()=>s.value.to||""),l=zt(()=>s.value.replace),c=A(()=>PD(s.value.routerComponentName)),u=A(()=>!((e==null?void 0:e.appContext.app.component(c.value))!==void 0)||s.value.disabled||!s.value.to?"a":c.value),d=A(()=>u.value==="RouterLink"),f=A(()=>d.value&&typeof(e==null?void 0:e.appContext.app.$nuxt)<"u"),h=A(()=>u.value!=="a"&&!d.value&&!f.value),g=A(()=>d.value||f.value),v=A(()=>({to:a.value,replace:l.value})),m=i==null?void 0:i({to:a,replace:l}),b=A(()=>g.value?m:null),y=A(()=>{var x;if((x=b.value)!=null&&x.href.value)return b.value.href.value;const _="#";if(s.value.href)return s.value.href;if(typeof s.value.to=="string")return s.value.to||_;const{to:S}=s.value;if(S!==void 0&&"path"in S){const N=S.path||"",B=S.query?`?${Object.keys(S.query).map(L=>{var E;return`${L}=${(E=S.query)==null?void 0:E[L]}`}).join("=")}`:"",k=!S.hash||S.hash.charAt(0)==="#"?S.hash||"":`#${S.hash}`;return`${N}${B}${k}`||_}return _});return{isNonStandardTag:h,tag:u,isRouterLink:d,isNuxtLink:f,computedHref:y,routerName:c,router:n,route:o,link:b,linkProps:v}},N4=t=>A(()=>{const e=yt(t);return{[`link-${e.variant}`]:e.variant!==null,[`link-opacity-${e.opacity}`]:e.opacity!==void 0,[`link-opacity-${e.opacityHover}-hover`]:e.opacityHover!==void 0,[`link-underline-${e.underlineVariant}`]:e.underlineVariant!==null,[`link-offset-${e.underlineOffset}`]:e.underlineOffset!==void 0,[`link-offset-${e.underlineOffsetHover}-hover`]:e.underlineOffsetHover!==void 0,"link-underline":e.underlineVariant===null&&(e.underlineOpacity!==void 0||e.underlineOpacityHover!==void 0),[`link-underline-opacity-${e.underlineOpacity}`]:e.underlineOpacity!==void 0,[`link-underline-opacity-${e.underlineOpacityHover}-hover`]:e.underlineOpacityHover!==void 0,"icon-link":e.icon===!0}}),e_="active",Sy=le({__name:"BLink",props:{active:{type:Boolean,default:void 0},activeClass:{default:"router-link-active"},disabled:{type:Boolean,default:!1},exactActiveClass:{default:"router-link-exact-active"},href:{default:void 0},icon:{type:Boolean,default:!1},noRel:{type:Boolean,default:!1},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean,default:void 0},prefetchOn:{default:void 0},noPrefetch:{type:Boolean,default:void 0},prefetchedClass:{default:void 0},rel:{default:void 0},replace:{type:Boolean,default:!1},routerComponentName:{default:"router-link"},routerTag:{default:"a"},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:null},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BLink"),r=e,i=sm(),{computedHref:s,tag:a,link:l,isNuxtLink:c,isRouterLink:u,linkProps:d,isNonStandardTag:f}=ED(A(()=>({routerComponentName:o.routerComponentName,disabled:o.disabled,to:o.to,replace:o.replace,href:o.href}))),h=jt(e4,null),g=jt(o4,null),v=N4(o),m=A(()=>{var B,k;return[v.value,i.class,b.value,{[e_]:o.active,[o.activeClass]:((B=l.value)==null?void 0:B.isActive.value)||!1,[o.exactActiveClass]:((k=l.value)==null?void 0:k.isExactActive.value)||!1,"stretched-link":o.stretched===!0}]}),b=A(()=>({[e_]:o.active,disabled:o.disabled})),y=B=>{var k,L,E;if(o.disabled){B.preventDefault(),B.stopImmediatePropagation();return}(((k=h==null?void 0:h.isNav)==null?void 0:k.value)===!0&&g===null||g!==null&&((L=g.autoClose)==null?void 0:L.value)===!0)&&((E=h==null?void 0:h.hide)==null||E.call(h)),r("click",B)},x=A(()=>o.target==="_blank"?!o.rel&&o.noRel?"noopener":o.rel:void 0),_=A(()=>o.disabled?"-1":typeof i.tabindex>"u"?null:i.tabindex),S=A(()=>({prefetch:o.prefetch,noPrefetch:o.noPrefetch,prefetchOn:o.prefetchOn,prefetchedClass:o.prefetchedClass,...d.value})),N=A(()=>({...u.value?d.value:void 0,...c.value||f.value?S.value:void 0}));return(B,k)=>(w(),Q(Gt(p(a)),Tt({class:m.value,target:p(o).target,href:p(s),rel:x.value,tabindex:_.value,"aria-disabled":p(o).disabled?!0:null},N.value,{onClick:k[0]||(k[0]=L=>{var E;y(L),(E=p(l))==null||E.navigate(L)})}),{default:J(()=>[Ae(B.$slots,"default")]),_:3},16,["class","target","href","rel","tabindex","aria-disabled"]))}}),Ho=le({__name:"BButton",props:at({loading:{type:Boolean,default:!1},loadingFill:{type:Boolean,default:!1},loadingText:{default:"Loading..."},pill:{type:Boolean,default:!1},size:{default:"md"},squared:{type:Boolean,default:!1},tag:{default:"button"},type:{default:"button"},variant:{default:"secondary"},active:{type:Boolean,default:!1},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:!1},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},routerTag:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:null}},{pressed:{type:Boolean,default:void 0},pressedModifiers:{}}),emits:at(["click"],["update:pressed"]),setup(t,{emit:e}){const o=Ht(t,"BButton"),r=e,i=mt("_element"),s=pt(t,"pressed"),{computedLink:a,computedLinkProps:l}=ky(o,["active-class","exact-active-class","replace","routerComponentName","routerTag"]),c=A(()=>typeof s.value=="boolean"),u=A(()=>o.tag==="button"&&o.href===void 0&&o.to===void 0),d=A(()=>o.to!==void 0),f=A(()=>o.href!==void 0?!1:!u.value),h=A(()=>d.value?l.value:[]),g=A(()=>o.href==="#"&&o.disabled?!0:f.value?o.disabled:null),v=A(()=>{var S;return((S=o.variant)==null?void 0:S.startsWith("link"))||!1}),m=A(()=>{var S;return((S=o.variant)==null?void 0:S.startsWith("link-"))||!1}),b=N4(A(()=>{var S;return{...v.value?{icon:o.icon,opacity:o.opacity,opacityHover:o.opacityHover,underlineOffset:o.underlineOffset,underlineOffsetHover:o.underlineOffsetHover,underlineOpacity:o.underlineOpacity,underlineOpacityHover:o.underlineOpacityHover,underlineVariant:o.underlineVariant,variant:m.value===!0?(S=o.variant)==null?void 0:S.slice(5):null}:void 0}})),y=A(()=>[v.value===!0&&a.value===!1?b.value:void 0,[`btn-${o.size}`],{[`btn-${o.variant}`]:o.variant!==null&&m.value===!1,active:o.active||s.value,"rounded-pill":o.pill,"rounded-0":o.squared,disabled:o.disabled}]),x=A(()=>d.value?Sy:o.href?"a":o.tag),_=S=>{if(o.disabled){S.preventDefault(),S.stopPropagation();return}r("click",S),c.value&&(s.value=!s.value)};return Ms([" ","enter"],S=>{var N;o.href==="#"&&(S.preventDefault(),(N=i.value)==null||N.click())},{target:i}),(S,N)=>(w(),Q(Gt(x.value),Tt({ref:"_element",class:"btn"},h.value,{class:y.value,"aria-disabled":g.value,"aria-pressed":c.value?s.value:null,autocomplete:c.value?"off":null,disabled:u.value?p(o).disabled:null,href:p(o).href,rel:p(a)?p(o).rel:null,role:f.value||p(a)?"button":null,target:p(a)?p(o).target:null,type:u.value?p(o).type:null,to:u.value?null:p(o).to,onClick:_}),{default:J(()=>[p(o).loading?Ae(S.$slots,"loading",{key:0},()=>[p(o).loadingFill?se("",!0):(w(),R(Ge,{key:0},[Xe(be(p(o).loadingText),1)],64)),Ae(S.$slots,"loading-spinner",{},()=>[H(BD,{small:p(o).size!=="lg",label:p(o).loadingFill?p(o).loadingText:void 0},null,8,["small","label"])])]):Ae(S.$slots,"default",{key:1})]),_:3},16,["class","aria-disabled","aria-pressed","autocomplete","disabled","href","rel","role","target","type","to"]))}}),vm=le({name:"ConditionalWrapper",inheritAttrs:!1,slots:Object,props:{tag:{type:String,default:"div"},skip:{type:Boolean,required:!0}},setup(t,{slots:e,attrs:n}){return()=>{var o,r;return t.skip?(o=e.default)==null?void 0:o.call(e,{}):Vt(t.tag,{...n},[(r=e.default)==null?void 0:r.call(e,{})])}}}),Ay=le({__name:"BBadge",props:{dotIndicator:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},placement:{default:void 0},tag:{default:"span"},active:{type:Boolean,default:void 0},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:void 0},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:void 0},variant:{default:"secondary"},bgVariant:{default:null},textVariant:{default:null}},setup(t){const n=Ht(t,"BBadge"),{computedLink:o,computedLinkProps:r}=ky(n,["active","activeClass","append","disabled","href","rel","replace","routerComponentName","target","to","opacity","opacityHover","underlineVariant","underlineOffset","underlineOffsetHover","underlineOpacity","underlineOpacityHover","icon"]),i=A(()=>o.value?Sy:n.tag),s=A(()=>{const c=n.placement??(n.dotIndicator?"top-end":void 0);return["position-absolute","translate-middle",{"start-0 top-0":c==="top-start","start-0 top-50":c==="start","start-0 top-100":c==="bottom-start","start-50 top-0":c==="top","start-50 top-100":c==="bottom","start-100 top-0":c==="top-end","start-100 top-50":c==="end","start-100 top-100":c==="bottom-end"}]}),a=zs(n),l=A(()=>[a.value,n.placement!==void 0||n.dotIndicator===!0?s.value:void 0,{active:n.active,disabled:n.disabled,"rounded-pill":n.pill,"p-2 border border-light rounded-circle":n.dotIndicator,"text-decoration-none":o.value}]);return(c,u)=>(w(),Q(Gt(i.value),Tt({class:["badge",l.value]},p(r)),{default:J(()=>[H(vm,Tt({skip:p(n).dotIndicator!==!0,tag:"span"},p(n).dotIndicator?{class:"visually-hidden"}:{}),{default:J(()=>[Ae(c.$slots,"default")]),_:3},16,["skip"])]),_:3},16,["class"]))}}),ND=(t,e="px")=>A(()=>{const n=yt(t),o=yt(e);return S7.test(String(n))?`${Number(n)}${o}`:n}),ID=le({__name:"BButtonGroup",props:{ariaLabel:{default:"Group"},size:{default:"md"},tag:{default:"div"},vertical:{type:Boolean,default:!1}},setup(t){gi(i4,!0);const n=Ht(t,"BButtonGroup"),o=A(()=>({"btn-group":!n.vertical,[`btn-group-${n.size}`]:n.size!=="md","btn-group-vertical":n.vertical}));return(r,i)=>(w(),Q(Gt(p(n).tag),{class:Te(o.value),role:"group","aria-label":p(n).ariaLabel},{default:J(()=>[Ae(r.$slots,"default")]),_:3},8,["class","aria-label"]))}}),Yg=(t,e,n,o=n)=>e.reduce((r,i)=>(t[i]&&r.push([o,i.replace(n,""),t[i]].filter(s=>s&&typeof s!="boolean").join("-").toLowerCase()),r),[]),t_=le({__name:"BCol",props:{alignSelf:{default:void 0},tag:{default:"div"},order:{default:void 0},offset:{default:void 0},cols:{default:void 0},col:{type:Boolean,default:!1},offsetSm:{default:void 0},offsetMd:{default:void 0},offsetLg:{default:void 0},offsetXl:{default:void 0},offsetXxl:{default:void 0},orderSm:{default:void 0},orderMd:{default:void 0},orderLg:{default:void 0},orderXl:{default:void 0},orderXxl:{default:void 0},sm:{type:[Boolean,Number,String],default:!1},md:{type:[Boolean,Number,String],default:!1},lg:{type:[Boolean,Number,String],default:!1},xl:{type:[Boolean,Number,String],default:!1},xxl:{type:[Boolean,Number,String],default:!1}},setup(t){const n=Ht(t,"BCol"),o=A(()=>[...Yg({sm:n.sm,md:n.md,lg:n.lg,xl:n.xl,xxl:n.xxl},["sm","md","lg","xl","xxl"],"col"),...Yg({order:n.order,orderLg:n.orderLg,orderMd:n.orderMd,orderSm:n.orderSm,orderXl:n.orderXl,orderXxl:n.orderXxl},["order","orderLg","orderMd","orderSm","orderXl","orderXxl"],"order"),...Yg({offset:n.offset,offsetLg:n.offsetLg,offsetMd:n.offsetMd,offsetSm:n.offsetSm,offsetXl:n.offsetXl,offsetXxl:n.offsetXxl},["offset","offsetLg","offsetMd","offsetSm","offsetXl","offsetXxl"],"offset")]),r=A(()=>[o.value,{col:n.col||!o.value.some(i=>i.startsWith("col-"))&&!n.cols,[`col-${n.cols}`]:n.cols!==void 0,[`offset-${n.offset}`]:n.offset!==void 0,[`order-${n.order}`]:n.order!==void 0,[`align-self-${n.alignSelf}`]:n.alignSelf!==void 0}]);return(i,s)=>(w(),Q(Gt(p(n).tag),{class:Te(r.value)},{default:J(()=>[Ae(i.$slots,"default")]),_:3},8,["class"]))}}),RD={class:"visually-hidden"},FD=["id","aria-labelledby","role"],VD=le({__name:"BDropdown",props:at({ariaLabel:{default:void 0},autoClose:{type:[Boolean,String],default:!0},boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},disabled:{type:Boolean,default:!1},floatingMiddleware:{default:void 0},id:{default:void 0},isNav:{type:Boolean,default:!1},menuClass:{default:void 0},noCaret:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},offset:{default:0},role:{default:"menu"},size:{default:"md"},noWrapper:{type:Boolean,default:!1},split:{type:Boolean,default:!1},splitButtonType:{default:"button"},splitClass:{default:void 0},splitDisabled:{type:Boolean,default:void 0},splitHref:{default:void 0},splitTo:{default:void 0},splitVariant:{default:void 0},strategy:{default:"absolute"},text:{default:void 0},toggleClass:{default:void 0},toggleText:{default:"Toggle dropdown"},variant:{default:"secondary"},wrapperClass:{default:void 0},placement:{default:"bottom-start"},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{default:void 0},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:at(["split-click","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BDropdown"),i=n,s=So(()=>r.id,"dropdown"),a=pt(t,"modelValue"),l=jt(qP,!1),c=jt(i4,!1),u=A(()=>typeof r.offset=="string"||typeof r.offset=="number"?r.offset:NaN),d=Dl(u),f=mt("_floating"),h=mt("_button"),g=mt("_splitButton"),v=A(()=>_y(r.boundary)?r.boundary:void 0),m=A(()=>P4(r.boundary)?r.boundary:void 0),b=A(()=>r.split?h.value:g.value),{showRef:y,renderRef:x,hide:_,show:S,toggle:N,computedNoAnimation:B,transitionProps:k,contentShowing:L,isVisible:E}=fm(a,r,i,b,s),I=A(()=>[{show:E.value,fade:!B.value}]);Ms("Escape",()=>{var ge;_(),(ge=Cp(b.value))==null||ge.focus()},{target:b}),Ms("Escape",()=>{var ge;_(),(ge=Cp(b.value))==null||ge.focus()},{target:f});const C=(ge,ee)=>{var fe,xe,Z,pe,oe,ve,ce;if((xe=f.value)!=null&&xe.contains((fe=ge.target)==null?void 0:fe.closest("form"))||/input|select|option|textarea|form/i.test((Z=ge.target)==null?void 0:Z.tagName))return;if(ge.preventDefault(),!y.value){S();const W=setInterval(()=>{E.value&&(clearInterval(W),wn(()=>C(ge,ee)))},16);return}const D=(pe=f.value)==null?void 0:pe.querySelectorAll(".dropdown-item:not(.disabled):not(:disabled)");if(D)if((oe=f.value)!=null&&oe.contains(document.activeElement)){const W=f.value.querySelector(".dropdown-item:focus"),j=Array.prototype.indexOf.call(D,W)+ee;j>=0&&j<(D==null?void 0:D.length)&&((ve=D[j])==null||ve.focus())}else(ce=D[ee===-1?D.length-1:0])==null||ce.focus()};Ms("ArrowUp",ge=>C(ge,-1),{target:b}),Ms("ArrowDown",ge=>C(ge,1),{target:b}),Ms("ArrowUp",ge=>C(ge,-1),{target:f}),Ms("ArrowDown",ge=>C(ge,1),{target:f});const $=ze({}),P=A(()=>{if(r.floatingMiddleware!==void 0)return r.floatingMiddleware;const ge=typeof r.offset=="string"||typeof r.offset=="number"?d.value:r.offset,ee=[C4(ge)];return r.noFlip===!1&&ee.push(T4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding})),r.noShift===!1&&ee.push($4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding})),r.noSize===!1&&ee.push(M4({boundary:v.value,rootBoundary:m.value,padding:r.boundaryPadding,apply({availableWidth:fe,availableHeight:xe}){var Z,pe;$.value={maxHeight:xe>=(((Z=f.value)==null?void 0:Z.scrollHeight)??0)?void 0:xe?`${Math.max(0,xe)}px`:void 0,maxWidth:fe>=(((pe=f.value)==null?void 0:pe.scrollWidth)??0)?void 0:fe?`${Math.max(0,fe)}px`:void 0}}})),ee}),{update:M,floatingStyles:F}=B4(b,f,{placement:()=>r.placement,middleware:P,strategy:zt(()=>r.strategy),whileElementsMounted:A4}),V=c?{class:"btn-group",role:"group"}:void 0,G=A(()=>[V==null?void 0:V.class,r.wrapperClass,{"btn-group":!r.wrapperClass&&r.split,[`drop${AD(r.placement)}`]:!r.wrapperClass,"position-static":r.boundary!=="clippingAncestors"&&!r.isNav}]),K=A(()=>[r.split?r.splitClass:r.toggleClass,{"nav-link":r.isNav,"dropdown-toggle":!r.split,"dropdown-toggle-no-caret":r.noCaret&&!r.split,show:r.split?void 0:y.value}]),ue=()=>{N()},de=ge=>{if(r.split){i("split-click",ge);return}ue()};u4(f,()=>{y.value&&(r.autoClose===!0||r.autoClose==="outside")&&_()},{ignore:[h,g]});const he=()=>{y.value&&(r.autoClose===!0||r.autoClose==="inside")&&_()};return je(E,()=>{M()}),e({hide:_,show:S,toggle:N}),gi(n4,{id:s,show:S,hide:_,toggle:N,visible:zt(()=>y.value),isNav:zt(()=>r.isNav)}),(ge,ee)=>{var fe;return w(),Q(vm,{skip:p(l)||p(r).noWrapper,class:Te(G.value),role:(fe=p(V))==null?void 0:fe.role},{default:J(()=>[H(Ho,{id:p(s),ref:"_splitButton",variant:p(r).splitVariant||p(r).variant,size:p(r).size,class:Te(K.value),disabled:p(r).splitDisabled||p(r).disabled,type:p(r).splitButtonType,"aria-label":p(r).ariaLabel,"aria-expanded":p(r).split?void 0:p(y),"aria-haspopup":p(r).split?void 0:"menu",href:p(r).split?p(r).splitHref:void 0,to:p(r).split&&p(r).splitTo?p(r).splitTo:void 0,onClick:de},{default:J(()=>[Ae(ge.$slots,"button-content",{},()=>[Xe(be(p(r).text),1)],!0)]),_:3},8,["id","variant","size","class","disabled","type","aria-label","aria-expanded","aria-haspopup","href","to"]),p(r).split?(w(),Q(Ho,{key:0,id:p(s)+"-split",ref:"_button",variant:p(r).variant,size:p(r).size,disabled:p(r).disabled,class:Te([[p(r).toggleClass,{show:p(y)}],"dropdown-toggle-split dropdown-toggle"]),"aria-expanded":p(y),"aria-haspopup":"menu",onClick:ue},{default:J(()=>[T("span",RD,[Ae(ge.$slots,"toggle-text",{},()=>[Xe(be(p(r).toggleText),1)],!0)])]),_:3},8,["id","variant","size","disabled","class","aria-expanded"])):se("",!0),H(dm,{to:p(r).teleportTo,disabled:!p(r).teleportTo||p(r).teleportDisabled},{default:J(()=>[p(x)||p(L)?(w(),Q(Pl,Tt({key:0},p(k),{appear:a.value||p(r).visible}),{default:J(()=>[sr(T("ul",{id:p(s)+"-menu",ref:"_floating",style:Dt([p(F),$.value]),class:Te(["dropdown-menu overflow-auto",[p(r).menuClass,I.value]]),"aria-labelledby":p(s),role:p(r).role,onClick:he},[p(L)?Ae(ge.$slots,"default",{key:0,hide:p(_),show:p(S),visible:p(y)},void 0,!0):se("",!0)],14,FD),[[jc,p(y)]])]),_:3},16,["appear"])):se("",!0)]),_:3},8,["to","disabled"])]),_:3},8,["skip","class","role"])}}}),Cy=hm(VD,[["__scopeId","data-v-8ac2524d"]]),zD=le({inheritAttrs:!1,__name:"BDropdownItem",props:{linkClass:{default:void 0},wrapperAttrs:{default:void 0},active:{type:Boolean,default:void 0},activeClass:{default:void 0},disabled:{type:Boolean,default:void 0},exactActiveClass:{default:void 0},href:{default:void 0},icon:{type:Boolean,default:void 0},noRel:{type:Boolean},opacity:{default:void 0},opacityHover:{default:void 0},prefetch:{type:Boolean},prefetchOn:{},noPrefetch:{type:Boolean},prefetchedClass:{},rel:{default:void 0},replace:{type:Boolean,default:void 0},routerComponentName:{default:void 0},stretched:{type:Boolean,default:!1},target:{default:void 0},to:{default:void 0},underlineOffset:{default:void 0},underlineOffsetHover:{default:void 0},underlineOpacity:{default:void 0},underlineOpacityHover:{default:void 0},underlineVariant:{default:void 0},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BDropdownItem"),r=e,i=sm(),s=A(()=>{const{class:m,...b}=i;return{wrapperClass:m,dropdownItemAttrs:b}}),{computedLink:a,computedLinkProps:l}=ky(o),c=zs(A(()=>({textVariant:o.variant}))),u=A(()=>[o.linkClass,c.value,{active:o.active,disabled:o.disabled}]),d=A(()=>a.value?Sy:o.href?"a":"button"),f=jt(e4,null),h=jt(n4,null),g=jt(o4,null),v=m=>{var b,y,x;r("click",m),g!==null&&((b=g==null?void 0:g.autoClose)==null?void 0:b.value)===!0&&((y=f==null?void 0:f.hide)==null||y.call(f)),(x=h==null?void 0:h.hide)==null||x.call(h)};return(m,b)=>(w(),R("li",Tt({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[(w(),Q(Gt(d.value),Tt({class:["dropdown-item",u.value],disabled:p(o).disabled,"aria-disabled":p(o).disabled?!0:null,"aria-current":p(o).active?!0:null,href:d.value==="a"?p(o).href:null,rel:p(o).rel,role:"menuitem",type:d.value==="button"?"button":null,target:p(o).target},{...p(l),...s.value.dropdownItemAttrs},{onClick:v}),{default:J(()=>[Ae(m.$slots,"default")]),_:3},16,["class","disabled","aria-disabled","aria-current","href","rel","type","target"]))],16))}}),HD=["disabled"],I4=le({inheritAttrs:!1,__name:"BDropdownItemButton",props:{active:{type:Boolean,default:!1},activeClass:{default:"active"},buttonClass:{default:void 0},wrapperAttrs:{default:void 0},disabled:{type:Boolean,default:!1},variant:{default:null}},emits:["click"],setup(t,{emit:e}){const o=Ht(t,"BDropdownItemButton"),r=e,i=sm(),s=A(()=>{const{class:u,...d}=i;return{wrapperClass:u,buttonAttrs:d}}),a=zs(A(()=>({textVariant:o.variant}))),l=A(()=>[o.buttonClass,a.value,{[o.activeClass]:o.active,disabled:o.disabled}]),c=u=>{if(o.disabled){u.preventDefault(),u.stopPropagation();return}r("click",u)};return(u,d)=>(w(),R("li",Tt({role:"presentation",class:s.value.wrapperClass},p(o).wrapperAttrs),[T("button",Tt({role:"menu",type:"button",class:["dropdown-item",l.value],disabled:p(o).disabled},s.value.buttonAttrs,{onClick:c}),[Ae(u.$slots,"default")],16,HD)],16))}}),WD=["value","disabled"],R4=le({__name:"BFormSelectOption",props:{disabled:{type:Boolean,default:!1},value:{default:void 0}},setup(t){const n=Ht(t,"BFormSelectOption");return(o,r)=>(w(),R("option",{value:p(n).value,disabled:p(n).disabled},[Ae(o.$slots,"default")],8,WD))}}),F4=(t,e)=>{const n=s=>typeof s=="object"&&s!==null&&"label"in s,o=s=>{const a=yt(e);if(typeof s=="string")return{value:s,text:s};if(typeof s=="number")return{value:s,text:`${s}`};if(s instanceof Date)return{value:s,text:s.toLocaleString()};const l=Gu(s,a.valueField),c=Gu(s,a.textField),u=Gu(s,a.disabledField),d=a.optionsField?Gu(s,a.optionsField):void 0;return d!==void 0?{label:Gu(s,a.labelField)||c,options:d}:{...typeof s=="object"?s:void 0,value:l,text:c,disabled:u}},r=s=>s.map(a=>o(a));return{normalizedOptions:A(()=>r(yt(t))),isComplex:n}},UD=le({__name:"BFormInvalidFeedback",props:{ariaLive:{default:void 0},forceShow:{type:Boolean,default:!1},id:{default:void 0},role:{default:void 0},state:{type:[Boolean,null],default:null},tag:{default:"div"},text:{default:void 0},tooltip:{type:Boolean,default:!1}},setup(t){const n=Ht(t,"BFormInvalidFeedback"),o=A(()=>n.forceShow===!0||n.state===!1),r=A(()=>({"d-block":o.value,"invalid-feedback":!n.tooltip,"invalid-tooltip":n.tooltip}));return(i,s)=>(w(),Q(Gt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:J(()=>[Ae(i.$slots,"default",{},()=>[Xe(be(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),GD=le({__name:"BFormRow",props:{tag:{default:"div"}},setup(t){const n=Ht(t,"BFormRow");return(o,r)=>(w(),Q(Gt(p(n).tag),{class:"row d-flex flex-wrap"},{default:J(()=>[Ae(o.$slots,"default")]),_:3}))}}),qD=le({__name:"BFormText",props:{id:{default:void 0},inline:{type:Boolean,default:!1},tag:{default:"small"},text:{default:void 0},textVariant:{default:"body-secondary"}},setup(t){const n=Ht(t,"BFormText"),o=zs(n),r=A(()=>[o.value,{"form-text":!n.inline}]);return(i,s)=>(w(),Q(Gt(p(n).tag),{id:p(n).id,class:Te(r.value)},{default:J(()=>[Ae(i.$slots,"default",{},()=>[Xe(be(p(n).text),1)])]),_:3},8,["id","class"]))}}),YD=le({__name:"BFormValidFeedback",props:{ariaLive:{default:void 0},forceShow:{type:Boolean,default:!1},id:{default:void 0},role:{default:void 0},state:{type:[Boolean,null],default:null},tag:{default:"div"},text:{default:void 0},tooltip:{type:Boolean,default:!1}},setup(t){const n=Ht(t,"BFormInvalidFeedback"),o=A(()=>n.forceShow===!0||n.state===!0),r=A(()=>({"d-block":o.value,"valid-feedback":!n.tooltip,"valid-tooltip":n.tooltip}));return(i,s)=>(w(),Q(Gt(p(n).tag),{id:p(n).id,role:p(n).role,"aria-live":p(n).ariaLive,"aria-atomic":p(n).ariaLive?!0:void 0,class:Te(r.value)},{default:J(()=>[Ae(i.$slots,"default",{},()=>[Xe(be(p(n).text),1)])]),_:3},8,["id","role","aria-live","aria-atomic","class"]))}}),bm=(t,e)=>A(()=>{const n=yt(t),o=yt(e);return n===!0?"true":typeof n=="string"?n:o===!1?"true":n===!1?"false":void 0}),ym=t=>A(()=>{const e=yt(t);return e===!0?"is-valid":e===!1?"is-invalid":null}),V4=t=>A(()=>{const e=yt(t);return{"form-check":e.plain===!1&&e.button===!1&&e.hasDefaultSlot,"form-check-reverse":e.reverse===!0,"form-check-inline":e.inline===!0,"form-switch":e.switch===!0,[`form-control-${e.size}`]:e.size!==void 0&&e.size!=="md"&&e.button===!1}}),z4=t=>{const e=ao(zt(t)),n=ym(()=>e.value.state??null);return A(()=>[n.value,{"form-check-input":e.value.plain===!1&&e.value.button===!1,"btn-check":e.value.button===!0}])},H4=t=>A(()=>{const e=yt(t);return{"form-check-label":e.plain===!1&&e.button===!1,btn:e.button===!0,[`btn-${e.buttonVariant}`]:e.button===!0&&e.buttonVariant!==void 0&&e.buttonVariant!==null,[`btn-${e.size}`]:e.button&&e.size&&e.size!=="md"}}),jD=t=>{const e=ao(zt(t)),n=bm(()=>e.value.ariaInvalid,()=>e.value.state);return A(()=>({"aria-invalid":n.value,"aria-required":e.value.required===!0?!0:void 0}))},XD=t=>A(()=>{const e=yt(t);return{"was-validated":e.validated===!0,"btn-group":e.buttons===!0&&e.stacked===!1,"btn-group-vertical":e.stacked===!0&&e.buttons===!0,[`btn-group-${e.size}`]:e.size!==void 0}}),KD=["id","disabled","required","name","form","aria-label","aria-labelledby","aria-required","value","true-value","false-value","indeterminate"],ZD=["for"],Hs=le({inheritAttrs:!1,__name:"BFormCheckbox",props:at({ariaLabel:{default:void 0},ariaLabelledby:{default:void 0},autofocus:{type:Boolean,default:!1},button:{type:Boolean,default:!1},buttonGroup:{type:Boolean,default:!1},buttonVariant:{default:null},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{default:void 0},inline:{type:Boolean,default:!1},name:{default:void 0},plain:{type:Boolean,default:!1},required:{type:Boolean,default:void 0},reverse:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:null},switch:{type:Boolean,default:!1},uncheckedValue:{type:[Array,Set,String,Boolean,Object,Number,null],default:!1},wrapperAttrs:{default:void 0},inputClass:{default:void 0},value:{type:[String,Boolean,Array,Set,Object,Number,null],default:!0}},{modelValue:{type:[Array,Set,String,Boolean,Object,Number,null],default:void 0},modelModifiers:{},indeterminate:{type:Boolean,default:!1},indeterminateModifiers:{}}),emits:["update:modelValue","update:indeterminate"],setup(t,{expose:e}){const n=sm(),o=A(()=>{const{class:B,...k}=n;return{wrapperClass:B,inputAttrs:k}}),i=Ht(t,"BFormCheckbox"),s=ds(),a=pt(t,"modelValue"),l=pt(t,"indeterminate"),c=So(()=>i.id,"form-check"),u=jt(WP,null),d=mt("_input"),{focused:f}=Zi(d,{initialValue:i.autofocus}),h=A(()=>!Jc(s.default)),g=A({get:()=>u?u.modelValue.value:a.value,set:B=>{if(B!==void 0){if(l.value=!1,u!==null&&Array.isArray(B)){u.modelValue.value=B;return}a.value=B}}}),v=A(()=>!!(i.name??(u==null?void 0:u.name.value))&&(i.required||(u==null?void 0:u.required.value))),m=A(()=>i.buttonGroup||((u==null?void 0:u.buttons.value)??!1)),b=A(()=>({plain:i.plain||((u==null?void 0:u.plain.value)??!1),button:i.button||((u==null?void 0:u.buttons.value)??!1),inline:i.inline||((u==null?void 0:u.inline.value)??!1),reverse:i.reverse||((u==null?void 0:u.reverse.value)??!1),switch:i.switch||((u==null?void 0:u.switch.value)??!1),state:i.state===!0||i.state===!1?i.state:(u==null?void 0:u.state.value)??null,size:i.size??(u==null?void 0:u.size.value)??"md",buttonVariant:i.buttonVariant??(u==null?void 0:u.buttonVariant.value)??"secondary",hasDefaultSlot:h.value})),y=V4(b),x=A(()=>[y.value,o.value.wrapperClass]),_=z4(b),S=A(()=>[_.value,i.inputClass]),N=H4(b);return e({blur:()=>{f.value=!1},element:d,focus:()=>{f.value=!0}}),(B,k)=>(w(),Q(vm,Tt({skip:m.value},p(i).wrapperAttrs,{class:x.value}),{default:J(()=>{var L,E,I;return[sr(T("input",Tt({id:p(c),ref:"_input","onUpdate:modelValue":k[0]||(k[0]=C=>g.value=C),class:S.value,type:"checkbox",disabled:p(i).disabled||((L=p(u))==null?void 0:L.disabled.value),required:v.value||void 0,name:p(i).name||((E=p(u))==null?void 0:E.name.value),form:p(i).form||((I=p(u))==null?void 0:I.form.value),"aria-label":p(i).ariaLabel,"aria-labelledby":p(i).ariaLabelledby,"aria-required":v.value||void 0,value:p(i).value,"true-value":p(i).value,"false-value":p(i).uncheckedValue,indeterminate:l.value||void 0},o.value.inputAttrs),null,16,KD),[[U3,g.value]]),h.value||p(i).plain===!1?(w(),R("label",{key:0,for:p(c),class:Te(p(N))},[Ae(B.$slots,"default")],10,ZD)):se("",!0)]}),_:3},16,["skip","class"]))}}),n_=(t,e)=>e+(t?LD(t):""),QD={key:0,ref:"_content",class:"form-floating"},Mn=le({__name:"BFormGroup",props:{contentCols:{type:[Boolean,String,Number],default:void 0},labelCols:{type:[Boolean,String,Number],default:void 0},labelAlign:{default:void 0},ariaInvalid:{type:[Boolean,String],default:void 0},description:{default:void 0},disabled:{type:Boolean,default:!1},feedbackAriaLive:{default:"assertive"},floating:{type:Boolean,default:!1},id:{default:void 0},invalidFeedback:{default:void 0},label:{default:void 0},labelClass:{default:void 0},labelFor:{default:void 0},labelSize:{default:void 0},labelVisuallyHidden:{type:Boolean,default:!1},state:{type:[Boolean,null],default:null},tooltip:{type:Boolean,default:!1},validFeedback:{default:void 0},validated:{type:Boolean,default:!1},contentColsSm:{type:[Boolean,String,Number],default:void 0},contentColsMd:{type:[Boolean,String,Number],default:void 0},contentColsLg:{type:[Boolean,String,Number],default:void 0},contentColsXl:{type:[Boolean,String,Number],default:void 0},labelColsSm:{type:[Boolean,String,Number],default:void 0},labelColsMd:{type:[Boolean,String,Number],default:void 0},labelColsLg:{type:[Boolean,String,Number],default:void 0},labelColsXl:{type:[Boolean,String,Number],default:void 0},labelAlignSm:{default:void 0},labelAlignMd:{default:void 0},labelAlignLg:{default:void 0},labelAlignXl:{default:void 0}},setup(t){const e=["input","select","textarea"],o=Ht(t,"BFormGroup"),r=ds(),i=zw(),s=zw(),a=zt(()=>o.state),l=ze([]);gi(s4,C=>(l.value=[C],{state:a}));const c=A(()=>o.labelFor!==void 0?o.labelFor:l.value[0]&&l.value[0].value?l.value[0].value:null),u=["xs","sm","md","lg","xl"],d=(C,$)=>u.reduce((P,M)=>{const F=n_(M==="xs"?"":M,`${$}Cols`);let V=C[F];if(V=V===""?!0:V||!1,typeof V!="boolean"&&V!=="auto"){const G=Number.parseInt(V);V=Number.isNaN(G)?0:G,V=V>0?V:!1}return V&&(M==="xs"?P[typeof V=="boolean"?"col":"cols"]=V:P[M||(typeof V=="boolean"?"col":"cols")]=V),P},{}),f=mt("_content"),h=A(()=>d(o,"content")),g=A(()=>((C,$)=>u.reduce((P,M)=>{const F=n_(M==="xs"?"":M,`${$}Align`),V=C[F]||null;return V&&(M==="xs"?P.push(`text-${V}`):P.push(`text-${M}-${V}`)),P},[]))(o,"label")),v=A(()=>d(o,"label")),m=A(()=>Object.keys(h.value).length>0||Object.keys(v.value).length>0),b=ym(a),y=bm(()=>o.ariaInvalid,a),x=C=>{if(c.value||f.value===null)return;const{target:$}=C,P=$?$.tagName:"";if([...e,"a","button","label"].indexOf(P)!==-1)return;const M=[...f.value.querySelectorAll(e.map(V=>`${V}:not([disabled])`).join())].filter(E4),[F]=M;M.length===1&&F instanceof HTMLElement&&MD(F)},_=So(()=>o.id),S=So(void 0,"_BV_label_"),N=A(()=>c.value?"label":"legend"),B=A(()=>[m.value?"col-form-label":"form-label",{"bv-no-focus-ring":!c.value,"col-form-label":m.value||!c.value,"pt-0":!m.value&&!c.value,"d-block":!m.value&&c.value,[`col-form-label-${o.labelSize}`]:!!o.labelSize,"visually-hidden":o.labelVisuallyHidden},g.value,o.labelClass]),k=So(void 0,"_BV_feedback_invalid_"),L=So(void 0,"_BV_feedback_valid_"),E=So(void 0,"_BV_description_"),I=A(()=>!c.value);return(C,$)=>(w(),Q(Gt(I.value?"fieldset":"div"),{id:p(_),disabled:I.value?p(o).disabled:null,role:I.value?null:"group","aria-invalid":p(y),"aria-labelledby":I.value&&m.value?p(S):null,class:Te([[p(b),{"was-validated":p(o).validated}],"b-form-group"])},{default:J(()=>[H(p(s).define,null,{default:J(()=>[r["invalid-feedback"]||p(o).invalidFeedback?(w(),Q(UD,{key:0,id:p(k),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:J(()=>[Ae(C.$slots,"invalid-feedback",{},()=>[Xe(be(p(o).invalidFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):se("",!0),r["valid-feedback"]||p(o).validFeedback?(w(),Q(YD,{key:1,id:p(L),"aria-live":p(o).feedbackAriaLive,state:a.value,tooltip:p(o).tooltip},{default:J(()=>[Ae(C.$slots,"valid-feedback",{},()=>[Xe(be(p(o).validFeedback),1)])]),_:3},8,["id","aria-live","state","tooltip"])):se("",!0),r.description||p(o).description?(w(),Q(qD,{key:2,id:p(E)},{default:J(()=>[Ae(C.$slots,"description",{},()=>[Xe(be(p(o).description),1)])]),_:3},8,["id"])):se("",!0)]),_:3}),H(p(i).define,null,{default:J(()=>[r.label||p(o).label||m.value?(w(),R(Ge,{key:0},[m.value?(w(),Q(t_,Hn(Tt({key:0},v.value)),{default:J(()=>[(w(),Q(Gt(N.value),{id:p(S),for:c.value||null,tabindex:I.value?"-1":null,class:Te(B.value),onClick:$[0]||($[0]=P=>I.value?x:null)},{default:J(()=>[Ae(C.$slots,"label",{},()=>[Xe(be(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))]),_:3},16)):(w(),Q(Gt(N.value),{key:1,id:p(S),for:c.value||null,tabindex:I.value?"-1":null,class:Te(B.value),onClick:$[1]||($[1]=P=>I.value?x:null)},{default:J(()=>[Ae(C.$slots,"label",{},()=>[Xe(be(p(o).label),1)])]),_:3},8,["id","for","tabindex","class"]))],64)):se("",!0)]),_:3}),m.value?(w(),Q(GD,{key:0},{default:J(()=>[H(p(i).reuse),H(t_,Tt(h.value,{ref:"_content"}),{default:J(()=>[Ae(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(S)}),H(p(s).reuse)]),_:3},16)]),_:3})):(w(),R(Ge,{key:1},[p(o).floating&&!m.value?(w(),R("div",QD,[Ae(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(S)}),H(p(i).reuse),H(p(s).reuse)],512)):(w(),R(Ge,{key:1},[H(p(i).reuse),Ae(C.$slots,"default",{id:p(_),ariaDescribedby:null,descriptionId:p(E),labelId:p(S)}),H(p(s).reuse)],64))],64))]),_:3},8,["id","disabled","role","aria-invalid","aria-labelledby","class"]))}}),W4=(t,e)=>{if(t===null)return;let n=t;if(e.number&&typeof n=="string"&&n!==""){const o=Number.parseFloat(n);n=Number.isNaN(o)?n:o}return n},U4=(t,e,n,o)=>{var r;const i=ze(0),s=So(()=>t.id,"input"),a=Dl(()=>t.debounce??0),l=Dl(()=>t.debounceMaxWait??NaN),c=(r=jt(s4,null))==null?void 0:r(s),u=A(()=>t.state!==void 0?t.state:(c==null?void 0:c.state.value)??null),d=bm(()=>t.ariaInvalid,u),f=ym(u),h=l7(N=>{n.value=N},()=>o.lazy===!0?0:a.value,{maxWait:()=>o.lazy===!0?NaN:l.value}),g=(N,B=!1)=>{o.lazy===!0&&B===!1||h(N)},{focused:v}=Zi(e,{initialValue:t.autofocus}),m=(N,B,k=!1)=>t.formatter!==void 0&&(!t.lazyFormatter||k)?t.formatter(N,B):N;return hn(()=>{var N;e.value&&(e.value.value=((N=n.value)==null?void 0:N.toString())??"")}),ay(()=>{wn(()=>{t.autofocus&&(v.value=!0)})}),{input:e,computedId:s,computedAriaInvalid:d,onInput:N=>{const{value:B}=N.target,k=m(B,N);if(N.defaultPrevented){N.preventDefault();return}g(k)},onChange:N=>{const{value:B}=N.target,k=m(B,N);if(N.defaultPrevented){N.preventDefault();return}const L=k;n.value!==L&&g(k,!0)},onBlur:N=>{if(!o.lazy&&!t.lazyFormatter&&!o.trim)return;const{value:B}=N.target,k=m(B,N,!0),L=o.trim?k.trim():k,E=L.length!==k.length;n.value!==L&&g(k,!0),o.trim&&E&&(i.value=i.value+1)},focus:()=>{t.disabled||(v.value=!0)},blur:()=>{t.disabled||(v.value=!1)},forceUpdateKey:i,stateClass:f}},JD=["id","value","name","form","type","disabled","placeholder","required","autocomplete","readonly","min","max","step","list","aria-required","aria-invalid"],ra=le({__name:"BFormInput",props:at({max:{default:void 0},min:{default:void 0},step:{default:void 0},type:{default:"text"},ariaInvalid:{type:[Boolean,String],default:void 0},autocomplete:{default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},form:{default:void 0},formatter:{type:Function,default:void 0},id:{default:void 0},lazyFormatter:{type:Boolean,default:!1},list:{default:void 0},name:{default:void 0},placeholder:{default:void 0},plaintext:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:void 0},debounce:{default:0},debounceMaxWait:{default:NaN}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormInput"),[r,i]=pt(t,"modelValue",{set:b=>W4(b,i)}),s=mt("_input"),{computedId:a,computedAriaInvalid:l,onInput:c,onChange:u,onBlur:d,stateClass:f,focus:h,blur:g,forceUpdateKey:v}=U4(o,s,r,i),m=A(()=>{const b=o.type==="range",y=o.type==="color";return[f.value,{"form-range":b,"form-control":y||!o.plaintext&&!b,"form-control-color":y,"form-control-plaintext":o.plaintext&&!b&&!y,[`form-control-${o.size}`]:!!o.size}]});return e({blur:g,element:s,focus:h}),(b,y)=>(w(),R("input",{id:p(a),ref:"_input",key:p(v),value:p(r),class:Te(m.value),name:p(o).name||void 0,form:p(o).form||void 0,type:p(o).type,disabled:p(o).disabled,placeholder:p(o).placeholder,required:p(o).required||void 0,autocomplete:p(o).autocomplete||void 0,readonly:p(o).readonly||p(o).plaintext,min:p(o).min,max:p(o).max,step:p(o).step,list:p(o).type!=="password"?p(o).list:void 0,"aria-required":p(o).required||void 0,"aria-invalid":p(l),onInput:y[0]||(y[0]=(...x)=>p(c)&&p(c)(...x)),onChange:y[1]||(y[1]=(...x)=>p(u)&&p(u)(...x)),onBlur:y[2]||(y[2]=(...x)=>p(d)&&p(d)(...x))},null,42,JD))}}),eE=["id","disabled","required","name","form","aria-label","aria-labelledby","value","aria-required"],tE=["for"],nE=le({inheritAttrs:!1,__name:"BFormRadio",props:at({ariaLabel:{default:void 0},ariaLabelledby:{default:void 0},autofocus:{type:Boolean,default:!1},button:{type:Boolean,default:!1},buttonGroup:{type:Boolean,default:!1},buttonVariant:{default:null},disabled:{type:Boolean,default:!1},form:{default:void 0},id:{default:void 0},inline:{type:Boolean,default:!1},name:{default:void 0},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:null},value:{type:[Boolean,String,Array,Object,Number,null],default:!0}},{modelValue:{type:[Boolean,String,Array,Object,Number,null],default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormRadio"),r=ds(),i=pt(t,"modelValue"),s=So(()=>o.id,"form-check"),a=jt(J3,null),l=mt("_input"),{focused:c}=Zi(l,{initialValue:o.autofocus}),u=A(()=>!Jc(r.default)),d=A({get:()=>a?a.modelValue.value:i.value,set:y=>{if(y!==void 0){if(a!==null){a.modelValue.value=y;return}i.value=y}}}),f=A(()=>!!(o.name??(a==null?void 0:a.name.value))&&(o.required||(a==null?void 0:a.required.value))),h=A(()=>o.buttonGroup||((a==null?void 0:a.buttons.value)??!1)),g=A(()=>({plain:o.plain||((a==null?void 0:a.plain.value)??!1),button:o.button||((a==null?void 0:a.buttons.value)??!1),inline:o.inline||((a==null?void 0:a.inline.value)??!1),state:o.state||(a==null?void 0:a.state.value),reverse:o.reverse||((a==null?void 0:a.reverse.value)??!1),size:o.size??(a==null?void 0:a.size.value)??"md",buttonVariant:o.buttonVariant??(a==null?void 0:a.buttonVariant.value)??"secondary",hasDefaultSlot:u.value})),v=V4(g),m=z4(g),b=H4(g);return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(y,x)=>(w(),Q(vm,{skip:h.value,class:Te(p(v))},{default:J(()=>{var _,S,N;return[sr(T("input",Tt({id:p(s)},y.$attrs,{ref:"_input","onUpdate:modelValue":x[0]||(x[0]=B=>d.value=B),class:p(m),type:"radio",disabled:p(o).disabled||((_=p(a))==null?void 0:_.disabled.value),required:f.value||void 0,name:p(o).name||((S=p(a))==null?void 0:S.name.value),form:p(o).form||((N=p(a))==null?void 0:N.form.value),"aria-label":p(o).ariaLabel,"aria-labelledby":p(o).ariaLabelledby,value:p(o).value,"aria-required":f.value||void 0}),null,16,eE),[[_P,d.value]]),u.value||p(o).plain===!1?(w(),R("label",{key:0,for:p(s),class:Te(p(b))},[Ae(y.$slots,"default")],10,tE)):se("",!0)]}),_:3},8,["skip","class"]))}}),oE=["id"],rE=le({__name:"BFormRadioGroup",props:at({ariaInvalid:{type:[Boolean,String],default:void 0},autofocus:{type:Boolean,default:!1},buttonVariant:{default:"secondary"},buttons:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disabledField:{default:"disabled"},form:{default:void 0},id:{default:void 0},name:{default:void 0},options:{default:()=>[]},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},size:{default:"md"},stacked:{type:Boolean,default:!1},state:{type:[Boolean,null],default:null},textField:{default:"text"},validated:{type:Boolean,default:!1},valueField:{default:"value"}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormRadioGroup"),r=pt(t,"modelValue"),i=So(()=>o.id,"radio"),s=So(()=>o.name,"checkbox"),a=mt("_element"),{focused:l}=Zi(a,{initialValue:o.autofocus});gi(J3,{modelValue:r,buttonVariant:zt(()=>o.buttonVariant),form:zt(()=>o.form),name:s,buttons:zt(()=>o.buttons),state:zt(()=>o.state),plain:zt(()=>o.plain),size:zt(()=>o.size),inline:zt(()=>!o.stacked),reverse:zt(()=>o.reverse),required:zt(()=>o.required),disabled:zt(()=>o.disabled)});const c=A(()=>o.options.map(h=>typeof h=="string"||typeof h=="number"?{value:h,disabled:o.disabled,text:h.toString()}:{value:h[o.valueField],disabled:h[o.disabledField],...h.props?h.props:void 0,text:h[o.textField]})),u=A(()=>({required:o.required,ariaInvalid:o.ariaInvalid,state:o.state,validated:o.validated,buttons:o.buttons,stacked:o.stacked,size:o.size})),d=jD(u),f=XD(u);return e({blur:()=>{l.value=!1},focus:()=>{l.value=!0}}),(h,g)=>(w(),R("div",Tt(p(d),{id:p(i),ref:"_element",role:"radiogroup",class:[p(f),"bv-no-focus-ring"],tabindex:"-1"}),[Ae(h.$slots,"first"),(w(!0),R(Ge,null,gt(c.value,(v,m)=>(w(),Q(nE,Tt({key:m,ref_for:!0},v),{default:J(()=>[Ae(h.$slots,"option",Tt({ref_for:!0},v),()=>[Xe(be(v.text),1)])]),_:2},1040))),128)),Ae(h.$slots,"default")],16,oE))}}),iE=["label"],sE=le({__name:"BFormSelectOptionGroup",props:{disabledField:{default:"disabled"},label:{default:void 0},options:{default:()=>[]},textField:{default:"text"},valueField:{default:"value"}},setup(t){const n=Ht(t,"BFormSelectOptionGroup"),{normalizedOptions:o}=F4(()=>n.options,n),r=A(()=>o.value);return(i,s)=>(w(),R("optgroup",{label:p(n).label},[Ae(i.$slots,"first"),(w(!0),R(Ge,null,gt(r.value,(a,l)=>(w(),Q(R4,Tt({key:l,disabled:a.disabled,value:a.value,ref_for:!0},i.$attrs),{default:J(()=>[Ae(i.$slots,"option",Tt({ref_for:!0},a),()=>[Xe(be(a.text),1)])]),_:2},1040,["disabled","value"]))),128)),Ae(i.$slots,"default")],8,iE))}}),aE=["id","name","form","multiple","size","disabled","required","aria-required","aria-invalid"],ja=le({__name:"BFormSelect",props:at({ariaInvalid:{type:[Boolean,String],default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},disabledField:{default:"disabled"},form:{default:void 0},id:{default:void 0},labelField:{default:"label"},multiple:{type:Boolean,default:!1},name:{default:void 0},options:{default:()=>[]},optionsField:{default:"options"},plain:{type:Boolean,default:!1},required:{type:Boolean,default:!1},selectSize:{default:0},size:{default:"md"},state:{type:[Boolean,null],default:null},textField:{default:"text"},valueField:{default:"value"}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormSelect"),r=pt(t,"modelValue"),i=So(()=>o.id,"input"),s=Dl(()=>o.selectSize),a=ym(()=>o.state),l=mt("_input"),{focused:c}=Zi(l,{initialValue:o.autofocus}),u=A(()=>[a.value,{"form-control":o.plain,[`form-control-${o.size}`]:o.size!=="md"&&o.plain,"form-select":!o.plain,[`form-select-${o.size}`]:o.size!=="md"&&!o.plain}]),d=A(()=>s.value||o.plain?s.value:void 0),f=bm(()=>o.ariaInvalid,()=>o.state),{normalizedOptions:h,isComplex:g}=F4(()=>o.options,o),v=A(()=>h.value),m=A({get:()=>r.value,set:b=>{r.value=b}});return e({blur:()=>{c.value=!1},element:l,focus:()=>{c.value=!0}}),(b,y)=>sr((w(),R("select",{id:p(i),ref:"_input","onUpdate:modelValue":y[0]||(y[0]=x=>m.value=x),class:Te(u.value),name:p(o).name,form:p(o).form||void 0,multiple:p(o).multiple||void 0,size:d.value,disabled:p(o).disabled,required:p(o).required||void 0,"aria-required":p(o).required||void 0,"aria-invalid":p(f)},[Ae(b.$slots,"first"),(w(!0),R(Ge,null,gt(v.value,(x,_)=>(w(),R(Ge,{key:_},[p(g)(x)?(w(),Q(sE,{key:0,label:x.label,options:x.options,"value-field":p(o).valueField,"text-field":p(o).textField,"disabled-field":p(o).disabledField},null,8,["label","options","value-field","text-field","disabled-field"])):(w(),Q(R4,{key:1,value:x.value,disabled:x.disabled},{default:J(()=>[Ae(b.$slots,"option",Tt({ref_for:!0},x),()=>[Xe(be(x.text),1)])]),_:2},1032,["value","disabled"]))],64))),128)),Ae(b.$slots,"default")],10,aE)),[[kP,m.value]])}}),lE=(t,e)=>{const n=ze(0),o=ao(zt(e)),r=Dl(()=>o.value.maxRows||NaN,{method:"parseInt",nanToZero:!0}),i=Dl(()=>o.value.rows||NaN,{method:"parseInt",nanToZero:!0}),s=A(()=>Math.max(i.value||2,2)),a=A(()=>Math.max(s.value,r.value||0)),l=A(()=>s.value===a.value?s.value:null),c=async()=>{if(!t.value||!E4(t.value)){n.value=null;return}const d=getComputedStyle(t.value),f=Number.parseFloat(d.lineHeight)||1,h=(Number.parseFloat(d.borderTopWidth)||0)+(Number.parseFloat(d.borderBottomWidth)||0),g=(Number.parseFloat(d.paddingTop)||0)+(Number.parseFloat(d.paddingBottom)||0),v=h+g,m=f*s.value+v,b=t.value.style.height||d.height;n.value="auto",await wn();const{scrollHeight:y}=t.value;n.value=b,await wn();const x=Math.max((y-g)/f,2),_=Math.min(Math.max(x,s.value),a.value),S=Math.max(Math.ceil(_*f+v),m);if(o.value.noAutoShrink&&(Number.parseFloat(b.toString())||0)>S){n.value=b;return}n.value=`${S}px`};hn(c);const u=A(()=>({resize:"none",height:typeof n.value=="string"?n.value:n.value?`${n.value}px`:void 0}));return{onInput:c,computedStyles:u,computedRows:l}},cE=["id","name","form","value","disabled","placeholder","required","autocomplete","readonly","aria-required","aria-invalid","rows","wrap"],$y=le({__name:"BFormTextarea",props:at({noResize:{type:Boolean,default:!1},rows:{default:2},wrap:{default:"soft"},noAutoShrink:{type:Boolean,default:!1},maxRows:{default:void 0},ariaInvalid:{type:[Boolean,String],default:void 0},autocomplete:{default:void 0},autofocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},form:{default:void 0},formatter:{type:Function,default:void 0},id:{default:void 0},lazyFormatter:{type:Boolean,default:!1},list:{default:void 0},name:{default:void 0},placeholder:{default:void 0},plaintext:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},size:{default:void 0},state:{type:[Boolean,null],default:void 0},debounce:{default:0},debounceMaxWait:{default:NaN}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BFormTextarea"),[r,i]=pt(t,"modelValue",{set:S=>W4(S,i)}),s=mt("_input"),{computedId:a,forceUpdateKey:l,computedAriaInvalid:c,onInput:u,stateClass:d,onChange:f,onBlur:h,focus:g,blur:v}=U4(o,s,r,i),m=A(()=>[d.value,o.plaintext?"form-control-plaintext":"form-control",{[`form-control-${o.size}`]:!!o.size}]),{computedStyles:b,onInput:y,computedRows:x}=lE(s,A(()=>({maxRows:o.maxRows,rows:o.rows,noAutoShrink:o.noAutoShrink}))),_=A(()=>({resize:o.noResize?"none":void 0,...o.maxRows||o.noAutoShrink?b.value:void 0}));return e({blur:v,element:s,focus:g}),(S,N)=>(w(),R("textarea",{id:p(a),ref:"_input",key:p(l),class:Te(m.value),name:p(o).name||void 0,form:p(o).form||void 0,value:p(r)??void 0,disabled:p(o).disabled,placeholder:p(o).placeholder,required:p(o).required||void 0,autocomplete:p(o).autocomplete||void 0,readonly:p(o).readonly||p(o).plaintext,"aria-required":p(o).required||void 0,"aria-invalid":p(c),rows:p(x)||2,style:Dt(_.value),wrap:p(o).wrap||void 0,onInput:N[0]||(N[0]=B=>{p(u)(B),p(y)()}),onChange:N[1]||(N[1]=(...B)=>p(f)&&p(f)(...B)),onBlur:N[2]||(N[2]=(...B)=>p(h)&&p(h)(...B))},null,46,cE))}});function uE(t){return Xl()?(Ba(t),!0):!1}function y1(t){return typeof t=="function"?t():p(t)}typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const dE=t=>t!=null;function fE(t){var e;const n=y1(t);return(e=n==null?void 0:n.$el)!=null?e:n}/*!
|
|
24
|
-
* tabbable 6.2.0
|
|
25
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
26
|
-
*/var G4=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Bp=G4.join(","),q4=typeof Element>"u",Nl=q4?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Lp=!q4&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Pp=function t(e,n){var o;n===void 0&&(n=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),i=r===""||r==="true",s=i||n&&e&&t(e.parentNode);return s},hE=function(e){var n,o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return o===""||o==="true"},Y4=function(e,n,o){if(Pp(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Bp));return n&&Nl.call(e,Bp)&&r.unshift(e),r=r.filter(o),r},j4=function t(e,n,o){for(var r=[],i=Array.from(e);i.length;){var s=i.shift();if(!Pp(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=t(l,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{var u=Nl.call(s,Bp);u&&o.filter(s)&&(n||!e.includes(s))&&r.push(s);var d=s.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(s),f=!Pp(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(s));if(d&&f){var h=t(d===!0?s.children:d.children,!0,o);o.flatten?r.push.apply(r,h):r.push({scopeParent:s,candidates:h})}else i.unshift.apply(i,s.children)}}return r},X4=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},yl=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||hE(e))&&!X4(e)?0:e.tabIndex},pE=function(e,n){var o=yl(e);return o<0&&n&&!X4(e)?0:o},mE=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},K4=function(e){return e.tagName==="INPUT"},gE=function(e){return K4(e)&&e.type==="hidden"},vE=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return n},bE=function(e,n){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===n)return e[o]},yE=function(e){if(!e.name)return!0;var n=e.form||Lp(e),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=bE(r,e.form);return!i||i===e},xE=function(e){return K4(e)&&e.type==="radio"},wE=function(e){return xE(e)&&!yE(e)},_E=function(e){var n,o=e&&Lp(e),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==e){var s,a,l;for(i=!!((s=r)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(r)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&r;){var c,u,d;o=Lp(r),r=(c=o)===null||c===void 0?void 0:c.host,i=!!((u=r)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(r))}}return i},o_=function(e){var n=e.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},kE=function(e,n){var o=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var i=Nl.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(Nl.call(s,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof r=="function"){for(var a=e;e;){var l=e.parentElement,c=Lp(e);if(l&&!l.shadowRoot&&r(l)===!0)return o_(e);e.assignedSlot?e=e.assignedSlot:!l&&c!==e.ownerDocument?e=c.host:e=l}e=a}if(_E(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return o_(e);return!1},SE=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return Nl.call(n,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}n=n.parentElement}return!1},Dp=function(e,n){return!(n.disabled||Pp(n)||gE(n)||kE(n,e)||vE(n)||SE(n))},x1=function(e,n){return!(wE(n)||yl(n)<0||!Dp(e,n))},AE=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},CE=function t(e){var n=[],o=[];return e.forEach(function(r,i){var s=!!r.scopeParent,a=s?r.scopeParent:r,l=pE(a,s),c=s?t(r.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):o.push({documentOrder:i,tabIndex:l,item:r,isScope:s,content:c})}),o.sort(mE).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},$E=function(e,n){n=n||{};var o;return n.getShadowRoot?o=j4([e],n.includeContainer,{filter:x1.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:AE}):o=Y4(e,n.includeContainer,x1.bind(null,n)),CE(o)},TE=function(e,n){n=n||{};var o;return n.getShadowRoot?o=j4([e],n.includeContainer,{filter:Dp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Y4(e,n.includeContainer,Dp.bind(null,n)),o},hc=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Nl.call(e,Bp)===!1?!1:x1(n,e)},ME=G4.concat("iframe").join(","),jg=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Nl.call(e,ME)===!1?!1:Dp(n,e)};/*!
|
|
27
|
-
* focus-trap 7.6.2
|
|
28
|
-
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
29
|
-
*/function w1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function OE(t){if(Array.isArray(t))return w1(t)}function BE(t,e,n){return(e=NE(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LE(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
30
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function i_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?r_(Object(n),!0).forEach(function(o){BE(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function DE(t){return OE(t)||LE(t)||IE(t)||PE()}function EE(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function NE(t){var e=EE(t,"string");return typeof e=="symbol"?e:e+""}function IE(t,e){if(t){if(typeof t=="string")return w1(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w1(t,e):void 0}}var s_={activateTrap:function(e,n){if(e.length>0){var o=e[e.length-1];o!==n&&o.pause()}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(e,n){var o=e.indexOf(n);o!==-1&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()}},RE=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},FE=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Cd=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},VE=function(e){return Cd(e)&&!e.shiftKey},zE=function(e){return Cd(e)&&e.shiftKey},a_=function(e){return setTimeout(e,0)},qu=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,o):e},oh=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},HE=[],WE=function(e,n){var o=(n==null?void 0:n.document)||document,r=(n==null?void 0:n.trapStack)||HE,i=i_({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:VE,isKeyBackward:zE},n),s={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function($,P,M){return $&&$[P]!==void 0?$[P]:i[M||P]},c=function($,P){var M=typeof(P==null?void 0:P.composedPath)=="function"?P.composedPath():void 0;return s.containerGroups.findIndex(function(F){var V=F.container,G=F.tabbableNodes;return V.contains($)||(M==null?void 0:M.includes(V))||G.find(function(K){return K===$})})},u=function($){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},M=P.hasFallback,F=M===void 0?!1:M,V=P.params,G=V===void 0?[]:V,K=i[$];if(typeof K=="function"&&(K=K.apply(void 0,DE(G))),K===!0&&(K=void 0),!K){if(K===void 0||K===!1)return K;throw new Error("`".concat($,"` was specified but was not a node, or did not return a node"))}var ue=K;if(typeof K=="string"){try{ue=o.querySelector(K)}catch(de){throw new Error("`".concat($,'` appears to be an invalid selector; error="').concat(de.message,'"'))}if(!ue&&!F)throw new Error("`".concat($,"` as selector refers to no known node"))}return ue},d=function(){var $=u("initialFocus",{hasFallback:!0});if($===!1)return!1;if($===void 0||$&&!jg($,i.tabbableOptions))if(c(o.activeElement)>=0)$=o.activeElement;else{var P=s.tabbableGroups[0],M=P&&P.firstTabbableNode;$=M||u("fallbackFocus")}else $===null&&($=u("fallbackFocus"));if(!$)throw new Error("Your focus-trap needs to have at least one focusable element");return $},f=function(){if(s.containerGroups=s.containers.map(function($){var P=$E($,i.tabbableOptions),M=TE($,i.tabbableOptions),F=P.length>0?P[0]:void 0,V=P.length>0?P[P.length-1]:void 0,G=M.find(function(de){return hc(de)}),K=M.slice().reverse().find(function(de){return hc(de)}),ue=!!P.find(function(de){return yl(de)>0});return{container:$,tabbableNodes:P,focusableNodes:M,posTabIndexesFound:ue,firstTabbableNode:F,lastTabbableNode:V,firstDomTabbableNode:G,lastDomTabbableNode:K,nextTabbableNode:function(he){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ee=P.indexOf(he);return ee<0?ge?M.slice(M.indexOf(he)+1).find(function(fe){return hc(fe)}):M.slice(0,M.indexOf(he)).reverse().find(function(fe){return hc(fe)}):P[ee+(ge?1:-1)]}}}),s.tabbableGroups=s.containerGroups.filter(function($){return $.tabbableNodes.length>0}),s.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(s.containerGroups.find(function($){return $.posTabIndexesFound})&&s.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},h=function($){var P=$.activeElement;if(P)return P.shadowRoot&&P.shadowRoot.activeElement!==null?h(P.shadowRoot):P},g=function($){if($!==!1&&$!==h(document)){if(!$||!$.focus){g(d());return}$.focus({preventScroll:!!i.preventScroll}),s.mostRecentlyFocusedNode=$,RE($)&&$.select()}},v=function($){var P=u("setReturnFocus",{params:[$]});return P||(P===!1?!1:$)},m=function($){var P=$.target,M=$.event,F=$.isBackward,V=F===void 0?!1:F;P=P||oh(M),f();var G=null;if(s.tabbableGroups.length>0){var K=c(P,M),ue=K>=0?s.containerGroups[K]:void 0;if(K<0)V?G=s.tabbableGroups[s.tabbableGroups.length-1].lastTabbableNode:G=s.tabbableGroups[0].firstTabbableNode;else if(V){var de=s.tabbableGroups.findIndex(function(Z){var pe=Z.firstTabbableNode;return P===pe});if(de<0&&(ue.container===P||jg(P,i.tabbableOptions)&&!hc(P,i.tabbableOptions)&&!ue.nextTabbableNode(P,!1))&&(de=K),de>=0){var he=de===0?s.tabbableGroups.length-1:de-1,ge=s.tabbableGroups[he];G=yl(P)>=0?ge.lastTabbableNode:ge.lastDomTabbableNode}else Cd(M)||(G=ue.nextTabbableNode(P,!1))}else{var ee=s.tabbableGroups.findIndex(function(Z){var pe=Z.lastTabbableNode;return P===pe});if(ee<0&&(ue.container===P||jg(P,i.tabbableOptions)&&!hc(P,i.tabbableOptions)&&!ue.nextTabbableNode(P))&&(ee=K),ee>=0){var fe=ee===s.tabbableGroups.length-1?0:ee+1,xe=s.tabbableGroups[fe];G=yl(P)>=0?xe.firstTabbableNode:xe.firstDomTabbableNode}else Cd(M)||(G=ue.nextTabbableNode(P))}}else G=u("fallbackFocus");return G},b=function($){var P=oh($);if(!(c(P,$)>=0)){if(qu(i.clickOutsideDeactivates,$)){a.deactivate({returnFocus:i.returnFocusOnDeactivate});return}qu(i.allowOutsideClick,$)||$.preventDefault()}},y=function($){var P=oh($),M=c(P,$)>=0;if(M||P instanceof Document)M&&(s.mostRecentlyFocusedNode=P);else{$.stopImmediatePropagation();var F,V=!0;if(s.mostRecentlyFocusedNode)if(yl(s.mostRecentlyFocusedNode)>0){var G=c(s.mostRecentlyFocusedNode),K=s.containerGroups[G].tabbableNodes;if(K.length>0){var ue=K.findIndex(function(de){return de===s.mostRecentlyFocusedNode});ue>=0&&(i.isKeyForward(s.recentNavEvent)?ue+1<K.length&&(F=K[ue+1],V=!1):ue-1>=0&&(F=K[ue-1],V=!1))}}else s.containerGroups.some(function(de){return de.tabbableNodes.some(function(he){return yl(he)>0})})||(V=!1);else V=!1;V&&(F=m({target:s.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(s.recentNavEvent)})),g(F||s.mostRecentlyFocusedNode||d())}s.recentNavEvent=void 0},x=function($){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;s.recentNavEvent=$;var M=m({event:$,isBackward:P});M&&(Cd($)&&$.preventDefault(),g(M))},_=function($){(i.isKeyForward($)||i.isKeyBackward($))&&x($,i.isKeyBackward($))},S=function($){FE($)&&qu(i.escapeDeactivates,$)!==!1&&($.preventDefault(),a.deactivate())},N=function($){var P=oh($);c(P,$)>=0||qu(i.clickOutsideDeactivates,$)||qu(i.allowOutsideClick,$)||($.preventDefault(),$.stopImmediatePropagation())},B=function(){if(s.active)return s_.activateTrap(r,a),s.delayInitialFocusTimer=i.delayInitialFocus?a_(function(){g(d())}):g(d()),o.addEventListener("focusin",y,!0),o.addEventListener("mousedown",b,{capture:!0,passive:!1}),o.addEventListener("touchstart",b,{capture:!0,passive:!1}),o.addEventListener("click",N,{capture:!0,passive:!1}),o.addEventListener("keydown",_,{capture:!0,passive:!1}),o.addEventListener("keydown",S),a},k=function(){if(s.active)return o.removeEventListener("focusin",y,!0),o.removeEventListener("mousedown",b,!0),o.removeEventListener("touchstart",b,!0),o.removeEventListener("click",N,!0),o.removeEventListener("keydown",_,!0),o.removeEventListener("keydown",S),a},L=function($){var P=$.some(function(M){var F=Array.from(M.removedNodes);return F.some(function(V){return V===s.mostRecentlyFocusedNode})});P&&g(d())},E=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(L):void 0,I=function(){E&&(E.disconnect(),s.active&&!s.paused&&s.containers.map(function($){E.observe($,{subtree:!0,childList:!0})}))};return a={get active(){return s.active},get paused(){return s.paused},activate:function($){if(s.active)return this;var P=l($,"onActivate"),M=l($,"onPostActivate"),F=l($,"checkCanFocusTrap");F||f(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=o.activeElement,P==null||P();var V=function(){F&&f(),B(),I(),M==null||M()};return F?(F(s.containers.concat()).then(V,V),this):(V(),this)},deactivate:function($){if(!s.active)return this;var P=i_({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},$);clearTimeout(s.delayInitialFocusTimer),s.delayInitialFocusTimer=void 0,k(),s.active=!1,s.paused=!1,I(),s_.deactivateTrap(r,a);var M=l(P,"onDeactivate"),F=l(P,"onPostDeactivate"),V=l(P,"checkCanReturnFocus"),G=l(P,"returnFocus","returnFocusOnDeactivate");M==null||M();var K=function(){a_(function(){G&&g(v(s.nodeFocusedBeforeActivation)),F==null||F()})};return G&&V?(V(v(s.nodeFocusedBeforeActivation)).then(K,K),this):(K(),this)},pause:function($){if(s.paused||!s.active)return this;var P=l($,"onPause"),M=l($,"onPostPause");return s.paused=!0,P==null||P(),k(),I(),M==null||M(),this},unpause:function($){if(!s.paused||!s.active)return this;var P=l($,"onUnpause"),M=l($,"onPostUnpause");return s.paused=!1,P==null||P(),f(),B(),I(),M==null||M(),this},updateContainerElements:function($){var P=[].concat($).filter(Boolean);return s.containers=P.map(function(M){return typeof M=="string"?o.querySelector(M):M}),s.active&&f(),I(),this}},a.updateContainerElements(e),a};function UE(t,e={}){let n;const{immediate:o,...r}=e,i=ze(!1),s=ze(!1),a=f=>n&&n.activate(f),l=f=>n&&n.deactivate(f),c=()=>{n&&(n.pause(),s.value=!0)},u=()=>{n&&(n.unpause(),s.value=!1)},d=A(()=>{const f=y1(t);return(Array.isArray(f)?f:[f]).map(h=>{const g=y1(h);return typeof g=="string"?g:fE(g)}).filter(dE)});return je(d,f=>{f.length&&(n=WE(f,{...r,onActivate(){i.value=!0,e.onActivate&&e.onActivate()},onDeactivate(){i.value=!1,e.onDeactivate&&e.onDeactivate()}}),o&&a())},{flush:"post"}),uE(()=>l()),{hasFocus:i,isPaused:s,activate:a,deactivate:l,pause:c,unpause:u}}const Z4=({element:t,isActive:e,noTrap:n,fallbackFocus:o},r={allowOutsideClick:!0,fallbackFocus:o.ref.value??void 0,escapeDeactivates:!1})=>{const i=ao(zt(e)),s=ao(zt(n)),a=()=>{var u;const d=(u=t.value)==null?void 0:u.querySelectorAll(`a, button, input, select, textarea, [tabindex]:not([tabindex="-1"]):not(.${o.classSelector})`);return!d||d.length===0},l=ze(a());hn(()=>{f7(t,()=>{l.value=a()},{childList:!0,subtree:!0})});const c=UE(t,r);return je(i,async u=>{await wn(),u&&s.value===!1?c.activate():c.deactivate()}),je(s,u=>{u===!0&&c.deactivate()}),{needsFallback:ao(l)}},GE=a4(w7);let rh="";const ul=new Map,Q4=(t,e)=>{const n=ao(zt(t)),o=a3(),r=A(()=>!yt(e)),i=GE(typeof document<"u"?document.body:null,n.value&&r.value);hn(()=>{typeof document>"u"||(ul.set(o,!1),je([n,r],([s,a])=>{const l=window.innerWidth-document.documentElement.clientWidth,c=Array.from(ul.values()).some(f=>f===!0),u=s&&a;ul.set(o,u),u&&!c&&!i.value&&(i.value=!0,l>0&&(rh=document.body.style.paddingRight,document.body.style.paddingRight=`${l+rh}px`));const d=Array.from(ul.values()).some(f=>f===!0);c&&!d&&(ul.set(o,!1),i.value=!1,document.body.style.paddingRight=rh)},{immediate:!0}))}),na(()=>{ul.delete(o),Array.from(ul.values()).some(a=>a===!0)||(document.body.style.paddingRight=rh,i.value=!1)})},qE=["id","aria-labelledby","aria-describedby"],YE=["id"],l_="modal-fallback-focus",c_=1056,jE=le({inheritAttrs:!1,__name:"BModal",props:at({autofocus:{type:Boolean,default:!0},autofocusButton:{default:void 0},backdropFirst:{type:Boolean,default:!1},body:{default:void 0},bodyAttrs:{default:void 0},bodyBgVariant:{default:null},bodyClass:{default:null},bodyScrolling:{type:Boolean,default:!1},bodyTextVariant:{default:null},bodyVariant:{default:null},busy:{type:Boolean,default:!1},buttonSize:{default:"md"},cancelDisabled:{type:Boolean,default:!1},cancelTitle:{default:"Cancel"},cancelVariant:{default:"secondary"},centered:{type:Boolean,default:!1},contentClass:{default:void 0},dialogClass:{default:void 0},footerBgVariant:{default:null},footerBorderVariant:{default:null},footerClass:{default:void 0},footerTextVariant:{default:null},footerVariant:{default:null},fullscreen:{type:[Boolean,String],default:!1},headerBgVariant:{default:null},headerBorderVariant:{default:null},headerClass:{default:void 0},headerCloseClass:{default:void 0},headerCloseLabel:{default:"Close"},headerCloseVariant:{default:"secondary"},headerTextVariant:{default:null},headerVariant:{default:null},noBackdrop:{type:Boolean,default:!1},noFooter:{type:Boolean,default:!1},noHeader:{type:Boolean,default:!1},noHeaderClose:{type:Boolean,default:!1},id:{default:void 0},modalClass:{default:void 0},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},noTrap:{type:Boolean,default:!1},noStacking:{type:Boolean},okDisabled:{type:Boolean,default:!1},okOnly:{type:Boolean,default:!1},okTitle:{default:"OK"},okVariant:{default:"primary"},scrollable:{type:Boolean,default:!1},size:{default:"md"},title:{default:void 0},titleClass:{default:void 0},titleVisuallyHidden:{type:Boolean,default:!1},titleTag:{default:"h5"},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{default:void 0},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:at(["backdrop","cancel","close","esc","ok","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BModal"),i=n,s=ds(),a=So(()=>r.id,"modal"),l=pt(t,"modelValue"),c=mt("_element"),u=mt("_fallbackFocusElement"),d=mt("_okButton"),f=mt("_cancelButton"),h=mt("_closeButton"),g=()=>{r.autofocus!==!1&&(r.autofocusButton==="ok"?V.value=!0:r.autofocusButton==="close"?K.value=!0:r.autofocusButton==="cancel"?G.value=!0:F.value=!0)},v=()=>{g()},{showRef:m,renderRef:b,renderBackdropRef:y,hide:x,show:_,toggle:S,computedNoAnimation:N,transitionProps:B,backdropTransitionProps:k,isLeaving:L,isVisible:E,trapActive:I,contentShowing:C,backdropReady:$,backdropVisible:P}=fm(l,r,i,c,a,{transitionProps:{onAfterEnter:v}}),{needsFallback:M}=Z4({element:c,isActive:I,noTrap:()=>r.noTrap,fallbackFocus:{ref:u,classSelector:l_}});Ms("Escape",()=>{x("esc")},{target:c}),Q4(m,()=>r.bodyScrolling);const{focused:F}=Zi(c,{initialValue:l.value&&r.autofocusButton===void 0&&r.autofocus===!0}),{focused:V}=Zi(d,{initialValue:l.value&&r.autofocusButton==="ok"&&r.autofocus===!0}),{focused:G}=Zi(f,{initialValue:l.value&&r.autofocusButton==="cancel"&&r.autofocus===!0}),{focused:K}=Zi(h,{initialValue:l.value&&r.autofocusButton==="close"&&r.autofocus===!0}),ue=A(()=>!Jc(s["header-close"])),de=A(()=>[r.dialogClass,{"modal-fullscreen":r.fullscreen===!0,[`modal-fullscreen-${r.fullscreen}-down`]:typeof r.fullscreen=="string",[`modal-${r.size}`]:r.size!=="md","modal-dialog-centered":r.centered,"modal-dialog-scrollable":r.scrollable}]),he=zs(()=>({bgVariant:r.bodyBgVariant,textVariant:r.bodyTextVariant,variant:r.bodyVariant})),ge=A(()=>[r.bodyClass,he.value]),ee=zs(()=>({bgVariant:r.headerBgVariant,textVariant:r.headerTextVariant,variant:r.headerVariant,borderVariant:r.headerBorderVariant})),fe=A(()=>[r.headerClass,ee.value]),xe=A(()=>({variant:ue.value?r.headerCloseVariant:void 0,class:r.headerCloseClass})),Z=zs(()=>({bgVariant:r.footerBgVariant,textVariant:r.footerTextVariant,variant:r.footerVariant,borderVariant:r.footerBorderVariant})),pe=A(()=>[r.footerClass,Z.value]),oe=A(()=>[r.titleClass,{"visually-hidden":r.titleVisuallyHidden}]),ve=A(()=>r.cancelDisabled||r.busy),ce=A(()=>r.okDisabled||r.busy),{activePosition:D,activeModalCount:W,stackWithoutSelf:j}=k7(m,l.value);je(j,(Y,X)=>{Y.length>X.length&&m.value===!0&&r.noStacking===!0&&x()});const ne=A(()=>m.value||L.value?c_-(((W==null?void 0:W.value)??0)*2-((D==null?void 0:D.value)??0)*2):c_),ie=A(()=>({"z-index":ne.value})),ae=A(()=>({"z-index":ne.value-1})),te=A(()=>({cancel:()=>{x("cancel")},close:()=>{x("close")},hide:x,ok:()=>{x("ok")},active:m.value,visible:m.value}));return e({hide:x,id:a,show:_,toggle:S}),(Y,X)=>(w(),Q(dm,{to:p(r).teleportTo,disabled:p(r).teleportDisabled},{default:J(()=>[p(b)||p(C)?(w(),Q(Pl,Tt({key:0},p(B),{appear:l.value||p(r).visible,onAfterEnter:v}),{default:J(()=>[sr(T("div",Tt({id:p(a),ref:"_element",class:["modal",[p(r).modalClass,{fade:!p(N),show:p(E)}]],role:"dialog","aria-labelledby":p(r).noHeader?void 0:`${p(a)}-label`,"aria-describedby":`${p(a)}-body`,tabindex:"-1"},Y.$attrs,{style:ie.value,onClick:X[4]||(X[4]=gn(q=>p(x)("backdrop"),["self"]))}),[T("div",{class:Te(["modal-dialog",de.value])},[p(C)?(w(),R("div",{key:0,class:Te(["modal-content",p(r).contentClass])},[p(r).noHeader?se("",!0):(w(),R("div",{key:0,class:Te(["modal-header",fe.value])},[Ae(Y.$slots,"header",Hn(er(te.value)),()=>[(w(),Q(Gt(p(r).titleTag),{id:`${p(a)}-label`,class:Te(["modal-title",oe.value])},{default:J(()=>[Ae(Y.$slots,"title",Hn(er(te.value)),()=>[Xe(be(p(r).title),1)],!0)]),_:3},8,["id","class"])),p(r).noHeaderClose?se("",!0):(w(),R(Ge,{key:0},[ue.value?(w(),Q(Ho,Tt({key:0},xe.value,{onClick:X[0]||(X[0]=q=>p(x)("close"))}),{default:J(()=>[Ae(Y.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Q(D4,Tt({key:1,"aria-label":p(r).headerCloseLabel},xe.value,{onClick:X[1]||(X[1]=q=>p(x)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Tt({id:`${p(a)}-body`,class:["modal-body",ge.value]},p(r).bodyAttrs),[Ae(Y.$slots,"default",Hn(er(te.value)),()=>[Xe(be(p(r).body),1)],!0)],16,YE),p(r).noFooter?se("",!0):(w(),R("div",{key:1,class:Te(["modal-footer",pe.value])},[Ae(Y.$slots,"footer",Hn(er(te.value)),()=>[Ae(Y.$slots,"cancel",Hn(er(te.value)),()=>[p(r).okOnly?se("",!0):(w(),Q(Ho,{key:0,ref:"_cancelButton",disabled:ve.value,size:p(r).buttonSize,variant:p(r).cancelVariant,onClick:X[2]||(X[2]=q=>p(x)("cancel"))},{default:J(()=>[Xe(be(p(r).cancelTitle),1)]),_:1},8,["disabled","size","variant"]))],!0),Ae(Y.$slots,"ok",Hn(er(te.value)),()=>[H(Ho,{ref:"_okButton",disabled:ce.value,size:p(r).buttonSize,variant:p(r).okVariant,onClick:X[3]||(X[3]=q=>p(x)("ok"))},{default:J(()=>[Xe(be(p(r).okTitle),1)]),_:1},8,["disabled","size","variant"])],!0)],!0)],2))],2)):se("",!0)],2),p(M)?(w(),R("div",{key:0,ref:"_fallbackFocusElement",class:Te(l_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):se("",!0)],16,qE),[[jc,p(m)&&(p($)&&p(r).backdropFirst||!p(r).backdropFirst)]])]),_:3},16,["appear"])):se("",!0),p(r).noBackdrop?se("",!0):Ae(Y.$slots,"backdrop",Hn(Tt({key:1},te.value)),()=>[p(y)?(w(),Q(Pl,Hn(Tt({key:0},p(k))),{default:J(()=>[sr(T("div",{class:Te(["modal-backdrop",{fade:!p(N),show:p(P)||p(N)}]),style:Dt(ae.value),onClick:X[5]||(X[5]=q=>p(x)("backdrop"))},null,6),[[jc,p(m)||p(L)&&p(r).backdropFirst&&!p(N)]])]),_:1},16)):se("",!0)],!0)]),_:3},8,["to","disabled"]))}}),XE=hm(jE,[["__scopeId","data-v-93972863"]]),KE=["id","aria-labelledby"],ZE=["id"],u_="offcanvas-fallback-focus",QE=le({inheritAttrs:!1,__name:"BOffcanvas",props:at({noBackdrop:{type:Boolean,default:!1},backdropFirst:{type:Boolean,default:!1},bodyAttrs:{default:void 0},bodyClass:{default:void 0},bodyScrolling:{type:Boolean,default:!1},footerClass:{default:void 0},headerClass:{default:void 0},headerCloseClass:{default:void 0},headerCloseLabel:{default:"Close"},headerCloseVariant:{default:"secondary"},id:{default:void 0},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},noFocus:{type:Boolean,default:!1},noHeader:{type:Boolean,default:!1},noTrap:{type:Boolean,default:!1},noHeaderClose:{type:Boolean,default:!1},placement:{default:"start"},shadow:{type:[String,Boolean],default:!1},title:{default:void 0},responsive:{},width:{default:void 0},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean,default:!1},noFade:{type:Boolean},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:at(["close","esc","backdrop","breakpoint","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const r=Ht(t,"BOffcanvas"),i=n,s=ds(),a=pt(t,"modelValue"),l=So(()=>r.id,"offcanvas"),c=mt("_element"),u=mt("_fallbackFocusElement"),d=()=>{wn(()=>{r.noFocus===!1&&!M.value&&(F.value=!0)})},{showRef:f,renderRef:h,renderBackdropRef:g,hide:v,show:m,toggle:b,computedNoAnimation:y,contentShowing:x,transitionProps:_,backdropReady:S,backdropTransitionProps:N,backdropVisible:B,isVisible:k,buildTriggerableEvent:L,localNoAnimation:E,isLeaving:I,trapActive:C}=fm(a,r,i,c,l,{transitionProps:{onAfterEnter:d,enterToClass:"showing",leaveToClass:"hiding",enterActiveClass:"",leaveActiveClass:"",enterFromClass:"",leaveFromClass:""}}),P=p7(h7).smallerOrEqual(()=>r.responsive??"xs"),M=ze(r.responsive!==void 0&&!P.value);hn(()=>{r.responsive!==void 0&&i("breakpoint",L("breakpoint"),M.value)}),Q4(f,()=>r.bodyScrolling||M.value),Ms("Escape",()=>{v("esc")},{target:c});const{focused:F}=Zi(c,{initialValue:a.value&&r.noFocus===!1&&!M.value}),{needsFallback:V}=Z4({element:c,isActive:C,noTrap:()=>r.noTrap||M.value,fallbackFocus:{classSelector:u_,ref:u}}),G=A(()=>(r.responsive===void 0||!M.value)&&r.noBackdrop===!1&&(f.value===!0||I.value&&r.backdropFirst&&!y.value)),K=A(()=>!Jc(s["header-close"])),ue=A(()=>[{"text-reset":!K.value},r.headerCloseClass]),de=A(()=>({variant:K.value?r.headerCloseVariant:void 0,class:ue.value})),he=A(()=>!Jc(s.footer)),ge=A(()=>[r.responsive===void 0?"offcanvas":`offcanvas-${r.responsive}`,`offcanvas-${r.placement}`,{show:k.value,[`shadow-${r.shadow}`]:!!r.shadow,"no-transition":y.value}]),ee=A(()=>({width:r.width})),fe=A(()=>({visible:f.value,placement:r.placement,hide:v}));return je(P,xe=>{r.responsive!==void 0&&(xe===!0?(E.value=!0,requestAnimationFrame(()=>{M.value=!1}),i("breakpoint",L("breakpoint"),!1),i("hide",L("hide"))):(E.value=!0,requestAnimationFrame(()=>{M.value=!0}),i("breakpoint",L("breakpoint"),!0),i("show",L("show"))))}),e({hide:v,show:m,toggle:b,isOpenByBreakpoint:M}),(xe,Z)=>(w(),Q(dm,{to:p(r).teleportTo,disabled:p(r).teleportDisabled||M.value},{default:J(()=>[p(h)||p(x)||M.value?(w(),Q(Pl,Tt({key:0},p(_),{appear:a.value||p(r).visible}),{default:J(()=>[sr(T("div",Tt({id:p(l),ref:"_element","aria-modal":"true",role:"dialog",class:ge.value,style:ee.value,tabindex:"-1","aria-labelledby":`${p(l)}-offcanvas-label`,"data-bs-backdrop":"false"},xe.$attrs),[p(x)||M.value?(w(),R(Ge,{key:0},[p(r).noHeader?se("",!0):(w(),R("div",{key:0,class:Te(["offcanvas-header",p(r).headerClass])},[Ae(xe.$slots,"header",Hn(er(fe.value)),()=>[T("h5",{id:`${p(l)}-offcanvas-label`,class:"offcanvas-title"},[Ae(xe.$slots,"title",Hn(er(fe.value)),()=>[Xe(be(p(r).title),1)],!0)],8,ZE),p(r).noHeaderClose?se("",!0):(w(),R(Ge,{key:0},[K.value?(w(),Q(Ho,Tt({key:0},de.value,{onClick:Z[0]||(Z[0]=pe=>p(v)("close"))}),{default:J(()=>[Ae(xe.$slots,"header-close",{},void 0,!0)]),_:3},16)):(w(),Q(D4,Tt({key:1,"aria-label":p(r).headerCloseLabel},de.value,{onClick:Z[1]||(Z[1]=pe=>p(v)("close"))}),null,16,["aria-label"]))],64))],!0)],2)),T("div",Tt({class:["offcanvas-body",p(r).bodyClass]},p(r).bodyAttrs),[Ae(xe.$slots,"default",Hn(er(fe.value)),void 0,!0)],16),he.value?(w(),R("div",{key:1,class:Te(p(r).footerClass)},[Ae(xe.$slots,"footer",Hn(er(fe.value)),void 0,!0)],2)):se("",!0)],64)):se("",!0),p(V)?(w(),R("div",{key:1,ref:"_fallbackFocusElement",class:Te(u_),tabindex:"0",style:{width:"0",height:"0",overflow:"hidden"}},null,512)):se("",!0)],16,KE),[[jc,p(f)&&(p(S)&&p(r).backdropFirst||!p(r).backdropFirst)||M.value]])]),_:3},16,["appear"])):se("",!0),p(r).noBackdrop?se("",!0):Ae(xe.$slots,"backdrop",Hn(Tt({key:1},fe.value)),()=>[p(g)?(w(),Q(Pl,Hn(Tt({key:0},p(N))),{default:J(()=>[sr(T("div",{class:Te(["offcanvas-backdrop",{fade:!p(y),show:p(B)||p(y)}]),onClick:Z[2]||(Z[2]=pe=>p(v)("backdrop"))},null,2),[[jc,G.value]])]),_:1},16)):se("",!0)],!0)]),_:3},8,["to","disabled"]))}}),JE=hm(QE,[["__scopeId","data-v-77d852fe"]]),eN="300px",tN=le({__name:"BTableSimple",props:{bordered:{type:Boolean,default:!1},borderless:{type:Boolean,default:!1},borderVariant:{default:null},captionTop:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},fixed:{type:Boolean,default:!1},hover:{type:Boolean,default:!1},id:{default:void 0},noBorderCollapse:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},responsive:{type:[Boolean,String],default:!1},small:{type:Boolean,default:!1},stacked:{type:[Boolean,String],default:!1},stickyHeader:{type:[Boolean,String,Number],default:!1},striped:{type:Boolean,default:!1},stripedColumns:{type:Boolean,default:!1},variant:{default:null},tableAttrs:{default:void 0},tableClass:{default:void 0}},setup(t){const n=Ht(t,"BTableSimple"),o=So(()=>n.id),r=zs(A(()=>({borderVariant:n.borderVariant}))),i=A(()=>[n.tableClass,"table","b-table",r.value,{border:n.outlined,"table-bordered":n.bordered,"table-borderless":n.borderless,"caption-top":n.captionTop,"table-dark":n.dark,"table-hover":n.hover,"b-table-stacked":n.stacked===!0,[`b-table-stacked-${n.stacked}`]:typeof n.stacked=="string","table-striped":n.striped,"table-sm":n.small,[`table-${n.variant}`]:n.variant!==null,"table-striped-columns":n.stripedColumns}]),s=A(()=>({id:o.value,class:i.value,...n.tableAttrs})),a=ND(A(()=>(n.stickyHeader===!0?eN:n.stickyHeader)||NaN)),l=A(()=>n.stickyHeader!==!1),c=A(()=>n.responsive!==!1||l.value),u=A(()=>l.value?{maxHeight:a.value}:void 0),d=A(()=>({"table-responsive":n.responsive===!0,[`table-responsive-${n.responsive}`]:typeof n.responsive=="string","b-table-sticky-header":l.value}));return(f,h)=>c.value?(w(),R("div",{key:0,class:Te(d.value),style:Dt(u.value)},[T("table",Hn(er(s.value)),[Ae(f.$slots,"default")],16)],6)):(w(),R("table",Hn(Tt({key:1},s.value)),[Ae(f.$slots,"default")],16))}}),jd=le({__name:"BTooltip",props:at({interactive:{type:Boolean,default:void 0},boundary:{},boundaryPadding:{},click:{type:Boolean,default:void 0},closeOnHide:{type:Boolean},content:{default:void 0},customClass:{default:void 0},delay:{default:void 0},floatingMiddleware:{default:void 0},hideMargin:{},id:{default:void 0},inline:{type:Boolean,default:void 0},manual:{type:Boolean,default:void 0},noAutoClose:{type:Boolean,default:void 0},noFlip:{type:Boolean,default:void 0},noHide:{type:Boolean,default:void 0},noShift:{type:Boolean,default:void 0},noSize:{type:Boolean},noninteractive:{type:Boolean,default:void 0},offset:{default:void 0},placement:{default:void 0},realtime:{type:Boolean,default:void 0},reference:{default:void 0},strategy:{default:void 0},target:{default:void 0},title:{default:void 0},variant:{default:void 0},teleportDisabled:{type:Boolean,default:void 0},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:void 0},lazy:{type:Boolean,default:void 0},unmountLazy:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},transProps:{},visible:{type:Boolean,default:void 0}},{modelValue:{type:Boolean,default:void 0},modelModifiers:{}}),emits:["update:modelValue"],setup(t,{expose:e}){const o=Ht(t,"BTooltip"),r=ds(),i=pt(t,"modelValue"),s=A(()=>{const{interactive:l,noninteractive:c,...u}=o;return{noninteractive:c!==void 0?c:!l,...u}}),a=mt("_popover");return e({hide:()=>{var l;(l=a.value)==null||l.hide()},show:()=>{var l;(l=a.value)==null||l.show()},toggle:()=>{var l;(l=a.value)==null||l.toggle()}}),(l,c)=>(w(),Q(L4,Tt({ref:"_popover"},s.value,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u),tooltip:""}),ki({_:2},[r.default?{name:"default",fn:J(()=>[Ae(l.$slots,"default")]),key:"0"}:void 0,r.target?{name:"target",fn:J(u=>[Ae(l.$slots,"target",Hn(er(u)))]),key:"1"}:void 0,r.title?{name:"title",fn:J(()=>[Ae(l.$slots,"title")]),key:"2"}:void 0]),1040,["modelValue"]))}}),nN=le({__name:"BTbody",props:{variant:{default:null}},setup(t){const n=Ht(t,"BTbody"),o=A(()=>({[`thead-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tbody",{class:Te(o.value)},[Ae(r.$slots,"default")],2))}}),oN=["scope","colspan","rowspan","data-label"],rN={key:0},d_=le({__name:"BTd",props:{colspan:{default:void 0},rowspan:{default:void 0},stackedHeading:{default:void 0},stickyColumn:{type:Boolean,default:!1},variant:{default:null}},setup(t){const n=Ht(t,"BTd"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=A(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("td",{scope:r.value,class:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading?(w(),R("div",rN,[Ae(i.$slots,"default")])):Ae(i.$slots,"default",{key:1})],10,oN))}}),iN=["scope","colspan","rowspan","data-label"],sN={key:0},f_=le({__name:"BTh",props:{colspan:{default:void 0},rowspan:{default:void 0},stackedHeading:{default:void 0},stickyColumn:{type:Boolean,default:!1},variant:{default:null}},setup(t){const n=Ht(t,"BTh"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null,"b-table-sticky-column":n.stickyColumn,"table-b-table-default":n.stickyColumn&&n.variant===null})),r=A(()=>n.colspan?"colspan":n.rowspan?"rowspan":"col");return(i,s)=>(w(),R("th",{scope:r.value,class:Te(o.value),colspan:p(n).colspan,rowspan:p(n).rowspan,"data-label":p(n).stackedHeading},[p(n).stackedHeading!==void 0?(w(),R("div",sN,[Ae(i.$slots,"default")])):Ae(i.$slots,"default",{key:1})],10,iN))}}),aN=le({__name:"BThead",props:{variant:{default:null}},setup(t){const n=Ht(t,"BThead"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("thead",{class:Te(o.value)},[Ae(r.$slots,"default")],2))}}),h_=le({__name:"BTr",props:{variant:{default:null}},setup(t){const n=Ht(t,"BTr"),o=A(()=>({[`table-${n.variant}`]:n.variant!==null}));return(r,i)=>(w(),R("tr",{class:Te(o.value)},[Ae(r.$slots,"default")],2))}});Object.freeze(Object.keys({bordered:0,borderless:0,borderVariant:0,captionTop:0,dark:0,fixed:0,hover:0,id:0,noBorderCollapse:0,outlined:0,responsive:0,small:0,stacked:0,stickyHeader:0,striped:0,stripedColumns:0,variant:0,tableAttrs:0,tableClass:0}));Object.freeze(Object.keys({align:0,caption:0,detailsTdClass:0,fieldColumnClass:0,fields:0,footClone:0,footRowVariant:0,footVariant:0,headRowVariant:0,headVariant:0,items:0,labelStacked:0,modelValue:0,primaryKey:0,tbodyClass:0,tbodyTrAttrs:0,tbodyTrClass:0,tfootClass:0,tfootTrClass:0,theadClass:0,theadTrClass:0}));const J4={BAccordion:"/components/BAccordion",BAccordionItem:"/components/BAccordion",BAlert:"/components/BAlert",BAvatar:"/components/BAvatar",BAvatarGroup:"/components/BAvatar",BBadge:"/components/BBadge",BBreadcrumb:"/components/BBreadcrumb",BBreadcrumbItem:"/components/BBreadcrumb",BButton:"/components/BButton",BButtonGroup:"/components/BButton",BButtonToolbar:"/components/BButton",BCloseButton:"/components/BButton",BCard:"/components/BCard",BCardBody:"/components/BCard",BCardFooter:"/components/BCard",BCardGroup:"/components/BCard",BCardHeader:"/components/BCard",BCardImg:"/components/BCard",BCardSubtitle:"/components/BCard",BCardText:"/components/BCard",BCardTitle:"/components/BCard",BCarousel:"/components/BCarousel",BCarouselSlide:"/components/BCarousel",BCol:"/components/BContainer",BCollapse:"/components/BCollapse",BContainer:"/components/BContainer",BDropdown:"/components/BDropdown",BDropdownDivider:"/components/BDropdown",BDropdownForm:"/components/BDropdown",BDropdownGroup:"/components/BDropdown",BDropdownHeader:"/components/BDropdown",BDropdownItem:"/components/BDropdown",BDropdownItemButton:"/components/BDropdown",BDropdownText:"/components/BDropdown",BForm:"/components/BForm",BFormCheckbox:"/components/BFormCheckbox",BFormCheckboxGroup:"/components/BFormCheckbox",BFormDatalist:"/components/BForm",BFormFile:"/components/BFormFile",BFormFloatingLabel:"/components/BForm",BFormGroup:"/components/BFormGroup",BFormInput:"/components/BFormInput",BFormInvalidFeedback:"/components/BForm",BFormRadio:"/components/BFormRadio",BFormRadioGroup:"/components/BFormRadio",BFormRow:"/components/BForm",BFormSelect:"/components/BFormSelect",BFormSelectOption:"/components/BFormSelect",BFormSelectOptionGroup:"/components/BFormSelect",BFormSpinbutton:"/components/BFormSpinbutton",BFormTag:"/components/BFormTags",BFormTags:"/components/BFormTags",BFormText:"/components/BForm",BFormTextarea:"/components/BFormTextarea",BFormValidFeedback:"/components/BForm",BImg:"/components/BImg",BInput:"/components/BFormInput",BInputGroup:"/components/BInputGroup",BInputGroupText:"/components/BInputGroup",BListGroup:"/components/BListGroup",BListGroupItem:"/components/BListGroup",BModal:"/components/BModal",BModalOrchestrator:"/components/BModal",BNav:"/components/BNav",BNavForm:"/components/BNav",BNavItem:"/components/BNav",BNavItemDropdown:"/components/BNav",BNavText:"/components/BNav",BNavbar:"/components/BNavbar",BNavbarBrand:"/components/BNavbar",BNavbarNav:"/components/BNavbar",BNavbarToggle:"/components/BNavbar",BOffcanvas:"/components/BOffcanvas",BOverlay:"/components/BOverlay",BPagination:"/components/BPagination",BPlaceholder:"/components/BPlaceholder",BPlaceholderButton:"/components/BPlaceholder",BPlaceholderCard:"/components/BPlaceholder",BPlaceholderTable:"/components/BPlaceholder",BPlaceholderWrapper:"/components/BPlaceholder",BPopover:"/components/BPopover",BProgress:"/components/BProgress",BRow:"/components/BContainer",BSpinner:"/components/BSpinner",BTab:"/components/BTabs",BTabs:"/components/BTabs",BToast:"/components/BToast",BToastOrchestrator:"/components/BToast",BTooltip:"/components/BTooltip",BLink:"/components/BLink",BProgressBar:"/components/BProgress",BTableSimple:"/components/BTable",BTableLite:"/components/BTable",BTable:"/components/BTable",BTbody:"/components/BTable",BTd:"/components/BTable",BTh:"/components/BTable",BThead:"/components/BTable",BTfoot:"/components/BTable",BTr:"/components/BTable",BPopoverOrchestrator:"/components/BPopover"},lN=Object.freeze(Object.keys(J4)),eA={vBColorMode:"/directives/BColorMode",vBModal:"/directives/BModal",vBPopover:"/directives/BPopover",vBScrollspy:"/directives/BScrollspy",vBToggle:"/directives/BToggle",vBTooltip:"/directives/BTooltip"},cN=Object.freeze(Object.keys(eA)),uN={useBreadcrumb:"/composables/useBreadcrumb",useColorMode:"/composables/useColorMode",useModal:"/composables/useModal",useModalController:"/composables/useModalController",useScrollspy:"/composables/useScrollspy",useToastController:"/composables/useToastController",usePopoverController:"/composables/usePopoverController"};Object.freeze(Object.keys(uN));const p_="bootstrap-vue-next",m_=(t,e)=>{const{all:n,...o}=t,r={};n&&e.forEach(s=>{r[s]=n});const i={...r,...o};return Object.entries(i).filter(([s,a])=>!!a&&e.includes(s)).map(([s])=>s)},Xg=new Set,g_=new Set;Object.assign(({aliases:t={},directives:e=!0,components:n=!0}={})=>{const r=m_(typeof n=="boolean"?{all:n}:n,lN).reduce((l,c)=>(l.set(c,`${p_}${J4[c]}`),l),new Map),s=m_(typeof e=="boolean"?{all:e}:e,cN).reduce((l,c)=>{const u=c.toLowerCase().startsWith("v")?c:`v${c}`;return l.set(u,`${p_}${eA[u]}`),l},new Map);return[{type:"component",resolve(l){const c=r.get(l),u=r.get(t[l]);if(u){const d=t[l];return Xg.add(d),{name:d,from:u}}if(c)return Xg.add(l),{name:l,from:c}}},{type:"directive",resolve(l){const c=`v${l}`,u=s.get(c);if(u)return g_.add(c),{name:c,from:u}}}]},{__usedComponents:Xg,__usedDirectives:g_});const dN={install(t,e){const n=(e==null?void 0:e.components)??{};t.provide(Xh,ze(n))}},fN={install(t){const e=ze([]),n=()=>{e.value.splice(0,e.value.length)};t.provide(GP,{items:e,reset:n})}},hN={install(t){const e=ze(new Map),n=()=>{let l=()=>{};return{value:new Promise(u=>{l=u}),resolve:l}},o=l=>[n(),l||Symbol("Modals controller"),!0],r=(l={})=>{var c;const u=zt(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...u.value,_isConfirm:!1,_promise:d,_modelValue:h}}),je(u,g=>{const v=e.value.get(f);v&&e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...v.props,...g}})}),d.value},i=(l={})=>{var c;const u=zt(l.props),[d,f,h]=o((c=u.value)==null?void 0:c.id);return e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...u.value,_isConfirm:!0,_promise:d,_modelValue:h}}),je(u,g=>{const v=e.value.get(f);v&&e.value.set(f,{component:l.component?Me(l.component):void 0,props:{...v.props,...g}})}),d.value},s=l=>{const c=e.value.get(l);c!=null&&c.props&&(c.props={...c.props,_modelValue:!1})},a=l=>{e.value.delete(l)};t.provide(jP,{modals:e,remove:a,show:r,confirm:i,leave:s})}},pN={install(t){const e=ze(new Map),n=A(()=>e.value.size),o=A(()=>[...e.value.values()]),r=A(()=>o.value[o.value.length-1]),i=u=>{e.value.set(u.uid,u)},s=u=>{e.value.delete(u.uid)},a=ze(new Map),l=u=>{a.value.set(u.uid,u)},c=u=>{a.value.delete(u.uid)};t.provide(r4,{countStack:n,lastStack:r,registry:ao(a),stack:o,pushStack:i,removeStack:s,pushRegistry:l,removeRegistry:c})}},mN={install(t){const e=ze(new Map),n=c=>{var u;const d=zt(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Popover controller");return je(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ze(c)?{"onUpdate:modelValue":g=>{var v;(v=h["onUpdate:modelValue"])==null||v.call(h,g),c.value.modelValue=g}}:{}})},{immediate:!0,deep:!0}),Ba(()=>e.value.delete(f),!0),f},o=(c,u)=>{const d=e.value.get(c);d&&e.value.set(c,{...d,...yt(u)})},r=c=>e.value.delete(c),i=ze(new Map),s=c=>{var u;const d=zt(c),f=((u=d.value)==null?void 0:u.id)||Symbol("Tooltip controller");return je(d,h=>{e.value.set(f,{...h,...typeof h.modelValue<"u"&&Ze(c)?{"onUpdate:modelValue":g=>{var v;(v=h["onUpdate:modelValue"])==null||v.call(h,g),c.value.modelValue=g}}:{}})},{immediate:!0,deep:!0}),Ba(()=>i.value.delete(f),!0),f},a=(c,u)=>{const d=i.value.get(c);d&&i.value.set(c,{...d,...yt(u)})},l=c=>i.value.delete(c);t.provide(XP,{popovers:e,tooltips:i,tooltip:s,popover:n,setPopover:o,setTooltip:a,removePopover:r,removeTooltip:l})}},gN={install(t,e){var n,o;const s=typeof(e==null?void 0:e.rtl)=="boolean"?!1:((n=e==null?void 0:e.rtl)==null?void 0:n.rtlInitial)??!1,a=typeof(e==null?void 0:e.rtl)=="boolean"?void 0:((o=e==null?void 0:e.rtl)==null?void 0:o.localeInitial)??void 0,l=ze(s),c=ze(a);t.provide(UP,{isRtl:l,locale:c})}},vN="top-end",bN={install(t){const e=ze([]),n=ze(!1),o=a=>{n.value=a},r=(a={})=>{var l,c,u,d;const f=zt(a.props),h=((l=f.value)==null?void 0:l.id)||Symbol("Toast controller"),g={component:a.component?Me(a.component):void 0,props:{...f.value,pos:((c=f.value)==null?void 0:c.pos)||vN,_modelValue:((u=f.value)==null?void 0:u.value)||5e3,_self:h}};return(((d=f.value)==null?void 0:d.appendToast)!==void 0?f.value.appendToast:n.value)?e.value.push(g):e.value.unshift(g),je(f,v=>{const m=e.value.findIndex(b=>b.props._self===h);m!==-1&&e.value.splice(m,1,{component:a.component?Me(a.component):void 0,props:{...e.value[m].props,...v,_modelValue:(v==null?void 0:v.value)||e.value[m].props._modelValue||5e3}})}),h},i=a=>{e.value=e.value.filter(l=>l.props._self!==a)},s=a=>{const l=e.value.findIndex(c=>c.props._self===a);l!==-1&&e.value.splice(l,1,{component:e.value[l].component?Me(e.value[l].component):void 0,props:{...e.value[l].props,_modelValue:!1}})};t.provide(YP,{_setIsAppend:o,toasts:e,show:r,remove:i,leave:s})}},yN={install(t){const e=ar({}),n=({id:o,value:r,toggle:i,show:s,hide:a})=>(e[o]=A(()=>({value:r.value,toggle:i,show:s,hide:a})),{unregister(){delete e[o]}});n.map=ao(e),t.provide(t4,n)}},xN=(t={})=>({install(e){(t.breadcrumb??!0)&&e.use(fN),(t.modalController??!0)&&e.use(hN),(t.modalManager??!0)&&e.use(pN),((t.rtl??!0)||typeof t.rtl=="object")&&e.use(gN,t),(t.toast??!0)&&e.use(bN),(t.popover??!0)&&e.use(mN),e.use(yN),e.use(dN,t)}});/*!
|
|
31
|
-
* vue-router v4.6.4
|
|
32
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
33
|
-
* @license MIT
|
|
34
|
-
*/const Sc=typeof document<"u";function tA(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function wN(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&tA(t.default)}const Kt=Object.assign;function Kg(t,e){const n={};for(const o in e){const r=e[o];n[o]=$i(r)?r.map(t):t(r)}return n}const $d=()=>{},$i=Array.isArray;function v_(t,e){const n={};for(const o in t)n[o]=o in e?e[o]:t[o];return n}const nA=/#/g,_N=/&/g,kN=/\//g,SN=/=/g,AN=/\?/g,oA=/\+/g,CN=/%5B/g,$N=/%5D/g,rA=/%5E/g,TN=/%60/g,iA=/%7B/g,MN=/%7C/g,sA=/%7D/g,ON=/%20/g;function Ty(t){return t==null?"":encodeURI(""+t).replace(MN,"|").replace(CN,"[").replace($N,"]")}function BN(t){return Ty(t).replace(iA,"{").replace(sA,"}").replace(rA,"^")}function _1(t){return Ty(t).replace(oA,"%2B").replace(ON,"+").replace(nA,"%23").replace(_N,"%26").replace(TN,"`").replace(iA,"{").replace(sA,"}").replace(rA,"^")}function LN(t){return _1(t).replace(SN,"%3D")}function PN(t){return Ty(t).replace(nA,"%23").replace(AN,"%3F")}function DN(t){return PN(t).replace(kN,"%2F")}function Xd(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const EN=/\/$/,NN=t=>t.replace(EN,"");function Zg(t,e,n="/"){let o,r={},i="",s="";const a=e.indexOf("#");let l=e.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(o=e.slice(0,l),i=e.slice(l,a>0?a:e.length),r=t(i.slice(1))),a>=0&&(o=o||e.slice(0,a),s=e.slice(a,e.length)),o=VN(o??e,n),{fullPath:o+i+s,path:o,query:r,hash:Xd(s)}}function IN(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function b_(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function RN(t,e,n){const o=e.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&eu(e.matched[o],n.matched[r])&&aA(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function eu(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function aA(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!FN(t[n],e[n]))return!1;return!0}function FN(t,e){return $i(t)?y_(t,e):$i(e)?y_(e,t):(t==null?void 0:t.valueOf())===(e==null?void 0:e.valueOf())}function y_(t,e){return $i(e)?t.length===e.length&&t.every((n,o)=>n===e[o]):t.length===1&&t[0]===e}function VN(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),o=t.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,s,a;for(s=0;s<o.length;s++)if(a=o[s],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(s).join("/")}const fa={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let k1=(function(t){return t.pop="pop",t.push="push",t})({}),Qg=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function zN(t){if(!t)if(Sc){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),NN(t)}const HN=/^[^#]+#/;function WN(t,e){return t.replace(HN,"#")+e}function UN(t,e){const n=document.documentElement.getBoundingClientRect(),o=t.getBoundingClientRect();return{behavior:e.behavior,left:o.left-n.left-(e.left||0),top:o.top-n.top-(e.top||0)}}const xm=()=>({left:window.scrollX,top:window.scrollY});function GN(t){let e;if("el"in t){const n=t.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;e=UN(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function x_(t,e){return(history.state?history.state.position-e:-1)+t}const S1=new Map;function qN(t,e){S1.set(t,e)}function YN(t){const e=S1.get(t);return S1.delete(t),e}function jN(t){return typeof t=="string"||t&&typeof t=="object"}function lA(t){return typeof t=="string"||typeof t=="symbol"}let yn=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const cA=Symbol("");yn.MATCHER_NOT_FOUND+"",yn.NAVIGATION_GUARD_REDIRECT+"",yn.NAVIGATION_ABORTED+"",yn.NAVIGATION_CANCELLED+"",yn.NAVIGATION_DUPLICATED+"";function tu(t,e){return Kt(new Error,{type:t,[cA]:!0},e)}function xs(t,e){return t instanceof Error&&cA in t&&(e==null||!!(t.type&e))}const XN=["params","query","hash"];function KN(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of XN)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function ZN(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let o=0;o<n.length;++o){const r=n[o].replace(oA," "),i=r.indexOf("="),s=Xd(i<0?r:r.slice(0,i)),a=i<0?null:Xd(r.slice(i+1));if(s in e){let l=e[s];$i(l)||(l=e[s]=[l]),l.push(a)}else e[s]=a}return e}function w_(t){let e="";for(let n in t){const o=t[n];if(n=LN(n),o==null){o!==void 0&&(e+=(e.length?"&":"")+n);continue}($i(o)?o.map(r=>r&&_1(r)):[o&&_1(o)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+n,r!=null&&(e+="="+r))})}return e}function QN(t){const e={};for(const n in t){const o=t[n];o!==void 0&&(e[n]=$i(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return e}const uA=Symbol(""),__=Symbol(""),wm=Symbol(""),My=Symbol(""),A1=Symbol("");function Yu(){let t=[];function e(o){return t.push(o),()=>{const r=t.indexOf(o);r>-1&&t.splice(r,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function JN(t,e,n){const o=()=>{t[e].delete(n)};na(o),c3(o),ay(()=>{t[e].add(n)}),t[e].add(n)}function eI(t){const e=jt(uA,{}).value;e&&JN(e,"leaveGuards",t)}function ba(t,e,n,o,r,i=s=>s()){const s=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,l)=>{const c=f=>{f===!1?l(tu(yn.NAVIGATION_ABORTED,{from:n,to:e})):f instanceof Error?l(f):jN(f)?l(tu(yn.NAVIGATION_GUARD_REDIRECT,{from:e,to:f})):(s&&o.enterCallbacks[r]===s&&typeof f=="function"&&s.push(f),a())},u=i(()=>t.call(o&&o.instances[r],e,n,c));let d=Promise.resolve(u);t.length<3&&(d=d.then(c)),d.catch(f=>l(f))})}function Jg(t,e,n,o,r=i=>i()){const i=[];for(const s of t)for(const a in s.components){let l=s.components[a];if(!(e!=="beforeRouteEnter"&&!s.instances[a]))if(tA(l)){const c=(l.__vccOpts||l)[e];c&&i.push(ba(c,n,o,s,a,r))}else{let c=l();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${s.path}"`);const d=wN(u)?u.default:u;s.mods[a]=u,s.components[a]=d;const f=(d.__vccOpts||d)[e];return f&&ba(f,n,o,s,a,r)()}))}}return i}function tI(t,e){const n=[],o=[],r=[],i=Math.max(e.matched.length,t.matched.length);for(let s=0;s<i;s++){const a=e.matched[s];a&&(t.matched.find(c=>eu(c,a))?o.push(a):n.push(a));const l=t.matched[s];l&&(e.matched.find(c=>eu(c,l))||r.push(l))}return[n,o,r]}/*!
|
|
35
|
-
* vue-router v4.6.4
|
|
36
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
37
|
-
* @license MIT
|
|
38
|
-
*/let nI=()=>location.protocol+"//"+location.host;function dA(t,e){const{pathname:n,search:o,hash:r}=e,i=t.indexOf("#");if(i>-1){let s=r.includes(t.slice(i))?t.slice(i).length:1,a=r.slice(s);return a[0]!=="/"&&(a="/"+a),b_(a,"")}return b_(n,t)+o+r}function oI(t,e,n,o){let r=[],i=[],s=null;const a=({state:f})=>{const h=dA(t,location),g=n.value,v=e.value;let m=0;if(f){if(n.value=h,e.value=f,s&&s===g){s=null;return}m=v?f.position-v.position:0}else o(h);r.forEach(b=>{b(n.value,g,{delta:m,type:k1.pop,direction:m?m>0?Qg.forward:Qg.back:Qg.unknown})})};function l(){s=n.value}function c(f){r.push(f);const h=()=>{const g=r.indexOf(f);g>-1&&r.splice(g,1)};return i.push(h),h}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Kt({},f.state,{scroll:xm()}),"")}}function d(){for(const f of i)f();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:c,destroy:d}}function k_(t,e,n,o=!1,r=!1){return{back:t,current:e,forward:n,replaced:o,position:window.history.length,scroll:r?xm():null}}function rI(t){const{history:e,location:n}=window,o={value:dA(t,n)},r={value:e.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function i(l,c,u){const d=t.indexOf("#"),f=d>-1?(n.host&&document.querySelector("base")?t:t.slice(d))+l:nI()+t+l;try{e[u?"replaceState":"pushState"](c,"",f),r.value=c}catch(h){console.error(h),n[u?"replace":"assign"](f)}}function s(l,c){i(l,Kt({},e.state,k_(r.value.back,l,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=l}function a(l,c){const u=Kt({},r.value,e.state,{forward:l,scroll:xm()});i(u.current,u,!0),i(l,Kt({},k_(o.value,l,null),{position:u.position+1},c),!1),o.value=l}return{location:o,state:r,push:a,replace:s}}function iI(t){t=zN(t);const e=rI(t),n=oI(t,e.state,e.location,e.replace);function o(i,s=!0){s||n.pauseListeners(),history.go(i)}const r=Kt({location:"",base:t,go:o,createHref:WN.bind(null,t)},e,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function sI(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),iI(t)}let wl=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var zn=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(zn||{});const aI={type:wl.Static,value:""},lI=/[a-zA-Z0-9_]/;function cI(t){if(!t)return[[]];if(t==="/")return[[aI]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(h){throw new Error(`ERR (${n})/"${c}": ${h}`)}let n=zn.Static,o=n;const r=[];let i;function s(){i&&r.push(i),i=[]}let a=0,l,c="",u="";function d(){c&&(n===zn.Static?i.push({type:wl.Static,value:c}):n===zn.Param||n===zn.ParamRegExp||n===zn.ParamRegExpEnd?(i.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:wl.Param,value:c,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),c="")}function f(){c+=l}for(;a<t.length;){if(l=t[a++],l==="\\"&&n!==zn.ParamRegExp){o=n,n=zn.EscapeNext;continue}switch(n){case zn.Static:l==="/"?(c&&d(),s()):l===":"?(d(),n=zn.Param):f();break;case zn.EscapeNext:f(),n=o;break;case zn.Param:l==="("?n=zn.ParamRegExp:lI.test(l)?f():(d(),n=zn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case zn.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=zn.ParamRegExpEnd:u+=l;break;case zn.ParamRegExpEnd:d(),n=zn.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:e("Unknown state");break}}return n===zn.ParamRegExp&&e(`Unfinished custom RegExp for param "${c}"`),d(),s(),r}const S_="[^/]+?",uI={sensitive:!1,strict:!1,start:!0,end:!0};var Io=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(Io||{});const dI=/[.+*?^${}()[\]/\\]/g;function fI(t,e){const n=Kt({},uI,e),o=[];let r=n.start?"^":"";const i=[];for(const c of t){const u=c.length?[]:[Io.Root];n.strict&&!c.length&&(r+="/");for(let d=0;d<c.length;d++){const f=c[d];let h=Io.Segment+(n.sensitive?Io.BonusCaseSensitive:0);if(f.type===wl.Static)d||(r+="/"),r+=f.value.replace(dI,"\\$&"),h+=Io.Static;else if(f.type===wl.Param){const{value:g,repeatable:v,optional:m,regexp:b}=f;i.push({name:g,repeatable:v,optional:m});const y=b||S_;if(y!==S_){h+=Io.BonusCustomRegExp;try{`${y}`}catch(_){throw new Error(`Invalid custom RegExp for param "${g}" (${y}): `+_.message)}}let x=v?`((?:${y})(?:/(?:${y}))*)`:`(${y})`;d||(x=m&&c.length<2?`(?:/${x})`:"/"+x),m&&(x+="?"),r+=x,h+=Io.Dynamic,m&&(h+=Io.BonusOptional),v&&(h+=Io.BonusRepeatable),y===".*"&&(h+=Io.BonusWildcard)}u.push(h)}o.push(u)}if(n.strict&&n.end){const c=o.length-1;o[c][o[c].length-1]+=Io.BonusStrict}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const s=new RegExp(r,n.sensitive?"":"i");function a(c){const u=c.match(s),d={};if(!u)return null;for(let f=1;f<u.length;f++){const h=u[f]||"",g=i[f-1];d[g.name]=h&&g.repeatable?h.split("/"):h}return d}function l(c){let u="",d=!1;for(const f of t){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const h of f)if(h.type===wl.Static)u+=h.value;else if(h.type===wl.Param){const{value:g,repeatable:v,optional:m}=h,b=g in c?c[g]:"";if($i(b)&&!v)throw new Error(`Provided param "${g}" is an array but it is not repeatable (* or + modifiers)`);const y=$i(b)?b.join("/"):b;if(!y)if(m)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${g}"`);u+=y}}return u||"/"}return{re:s,score:o,keys:i,parse:a,stringify:l}}function hI(t,e){let n=0;for(;n<t.length&&n<e.length;){const o=e[n]-t[n];if(o)return o;n++}return t.length<e.length?t.length===1&&t[0]===Io.Static+Io.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===Io.Static+Io.Segment?1:-1:0}function fA(t,e){let n=0;const o=t.score,r=e.score;for(;n<o.length&&n<r.length;){const i=hI(o[n],r[n]);if(i)return i;n++}if(Math.abs(r.length-o.length)===1){if(A_(o))return 1;if(A_(r))return-1}return r.length-o.length}function A_(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const pI={strict:!1,end:!0,sensitive:!1};function mI(t,e,n){const o=fI(cI(t.path),n),r=Kt(o,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function gI(t,e){const n=[],o=new Map;e=v_(pI,e);function r(d){return o.get(d)}function i(d,f,h){const g=!h,v=$_(d);v.aliasOf=h&&h.record;const m=v_(e,d),b=[v];if("alias"in d){const _=typeof d.alias=="string"?[d.alias]:d.alias;for(const S of _)b.push($_(Kt({},v,{components:h?h.record.components:v.components,path:S,aliasOf:h?h.record:v})))}let y,x;for(const _ of b){const{path:S}=_;if(f&&S[0]!=="/"){const N=f.record.path,B=N[N.length-1]==="/"?"":"/";_.path=f.record.path+(S&&B+S)}if(y=mI(_,f,m),h?h.alias.push(y):(x=x||y,x!==y&&x.alias.push(y),g&&d.name&&!T_(y)&&s(d.name)),hA(y)&&l(y),v.children){const N=v.children;for(let B=0;B<N.length;B++)i(N[B],y,h&&h.children[B])}h=h||y}return x?()=>{s(x)}:$d}function s(d){if(lA(d)){const f=o.get(d);f&&(o.delete(d),n.splice(n.indexOf(f),1),f.children.forEach(s),f.alias.forEach(s))}else{const f=n.indexOf(d);f>-1&&(n.splice(f,1),d.record.name&&o.delete(d.record.name),d.children.forEach(s),d.alias.forEach(s))}}function a(){return n}function l(d){const f=yI(d,n);n.splice(f,0,d),d.record.name&&!T_(d)&&o.set(d.record.name,d)}function c(d,f){let h,g={},v,m;if("name"in d&&d.name){if(h=o.get(d.name),!h)throw tu(yn.MATCHER_NOT_FOUND,{location:d});m=h.record.name,g=Kt(C_(f.params,h.keys.filter(x=>!x.optional).concat(h.parent?h.parent.keys.filter(x=>x.optional):[]).map(x=>x.name)),d.params&&C_(d.params,h.keys.map(x=>x.name))),v=h.stringify(g)}else if(d.path!=null)v=d.path,h=n.find(x=>x.re.test(v)),h&&(g=h.parse(v),m=h.record.name);else{if(h=f.name?o.get(f.name):n.find(x=>x.re.test(f.path)),!h)throw tu(yn.MATCHER_NOT_FOUND,{location:d,currentLocation:f});m=h.record.name,g=Kt({},f.params,d.params),v=h.stringify(g)}const b=[];let y=h;for(;y;)b.unshift(y.record),y=y.parent;return{name:m,path:v,params:g,matched:b,meta:bI(b)}}t.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:s,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function C_(t,e){const n={};for(const o of e)o in t&&(n[o]=t[o]);return n}function $_(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:vI(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function vI(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const o in t.components)e[o]=typeof n=="object"?n[o]:n;return e}function T_(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function bI(t){return t.reduce((e,n)=>Kt(e,n.meta),{})}function yI(t,e){let n=0,o=e.length;for(;n!==o;){const i=n+o>>1;fA(t,e[i])<0?o=i:n=i+1}const r=xI(t);return r&&(o=e.lastIndexOf(r,o-1)),o}function xI(t){let e=t;for(;e=e.parent;)if(hA(e)&&fA(t,e)===0)return e}function hA({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function M_(t){const e=jt(wm),n=jt(My),o=A(()=>{const l=p(t.to);return e.resolve(l)}),r=A(()=>{const{matched:l}=o.value,{length:c}=l,u=l[c-1],d=n.matched;if(!u||!d.length)return-1;const f=d.findIndex(eu.bind(null,u));if(f>-1)return f;const h=O_(l[c-2]);return c>1&&O_(u)===h&&d[d.length-1].path!==h?d.findIndex(eu.bind(null,l[c-2])):f}),i=A(()=>r.value>-1&&AI(n.params,o.value.params)),s=A(()=>r.value>-1&&r.value===n.matched.length-1&&aA(n.params,o.value.params));function a(l={}){if(SI(l)){const c=e[p(t.replace)?"replace":"push"](p(t.to)).catch($d);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:o,href:A(()=>o.value.href),isActive:i,isExactActive:s,navigate:a}}function wI(t){return t.length===1?t[0]:t}const _I=le({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:M_,setup(t,{slots:e}){const n=ar(M_(t)),{options:o}=jt(wm),r=A(()=>({[B_(t.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[B_(t.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&wI(e.default(n));return t.custom?i:Vt("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),kI=_I;function SI(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function AI(t,e){for(const n in e){const o=e[n],r=t[n];if(typeof o=="string"){if(o!==r)return!1}else if(!$i(r)||r.length!==o.length||o.some((i,s)=>i.valueOf()!==r[s].valueOf()))return!1}return!0}function O_(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const B_=(t,e,n)=>t??e??n,CI=le({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const o=jt(A1),r=A(()=>t.route||o.value),i=jt(__,0),s=A(()=>{let c=p(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=A(()=>r.value.matched[s.value]);gi(__,A(()=>s.value+1)),gi(uA,a),gi(A1,r);const l=ze();return je(()=>[l.value,a.value,t.name],([c,u,d],[f,h,g])=>{u&&(u.instances[d]=c,h&&h!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=h.leaveGuards),u.updateGuards.size||(u.updateGuards=h.updateGuards))),c&&u&&(!h||!eu(u,h)||!f)&&(u.enterCallbacks[d]||[]).forEach(v=>v(c))},{flush:"post"}),()=>{const c=r.value,u=t.name,d=a.value,f=d&&d.components[u];if(!f)return L_(n.default,{Component:f,route:c});const h=d.props[u],g=h?h===!0?c.params:typeof h=="function"?h(c):h:null,m=Vt(f,Kt({},g,e,{onVnodeUnmounted:b=>{b.component.isUnmounted&&(d.instances[u]=null)},ref:l}));return L_(n.default,{Component:m,route:c})||m}}});function L_(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const $I=CI;function TI(t){const e=gI(t.routes,t),n=t.parseQuery||ZN,o=t.stringifyQuery||w_,r=t.history,i=Yu(),s=Yu(),a=Yu(),l=Fe(fa);let c=fa;Sc&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Kg.bind(null,Z=>""+Z),d=Kg.bind(null,DN),f=Kg.bind(null,Xd);function h(Z,pe){let oe,ve;return lA(Z)?(oe=e.getRecordMatcher(Z),ve=pe):ve=Z,e.addRoute(ve,oe)}function g(Z){const pe=e.getRecordMatcher(Z);pe&&e.removeRoute(pe)}function v(){return e.getRoutes().map(Z=>Z.record)}function m(Z){return!!e.getRecordMatcher(Z)}function b(Z,pe){if(pe=Kt({},pe||l.value),typeof Z=="string"){const j=Zg(n,Z,pe.path),ne=e.resolve({path:j.path},pe),ie=r.createHref(j.fullPath);return Kt(j,ne,{params:f(ne.params),hash:Xd(j.hash),redirectedFrom:void 0,href:ie})}let oe;if(Z.path!=null)oe=Kt({},Z,{path:Zg(n,Z.path,pe.path).path});else{const j=Kt({},Z.params);for(const ne in j)j[ne]==null&&delete j[ne];oe=Kt({},Z,{params:d(j)}),pe.params=d(pe.params)}const ve=e.resolve(oe,pe),ce=Z.hash||"";ve.params=u(f(ve.params));const D=IN(o,Kt({},Z,{hash:BN(ce),path:ve.path})),W=r.createHref(D);return Kt({fullPath:D,hash:ce,query:o===w_?QN(Z.query):Z.query||{}},ve,{redirectedFrom:void 0,href:W})}function y(Z){return typeof Z=="string"?Zg(n,Z,l.value.path):Kt({},Z)}function x(Z,pe){if(c!==Z)return tu(yn.NAVIGATION_CANCELLED,{from:pe,to:Z})}function _(Z){return B(Z)}function S(Z){return _(Kt(y(Z),{replace:!0}))}function N(Z,pe){const oe=Z.matched[Z.matched.length-1];if(oe&&oe.redirect){const{redirect:ve}=oe;let ce=typeof ve=="function"?ve(Z,pe):ve;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=y(ce):{path:ce},ce.params={}),Kt({query:Z.query,hash:Z.hash,params:ce.path!=null?{}:Z.params},ce)}}function B(Z,pe){const oe=c=b(Z),ve=l.value,ce=Z.state,D=Z.force,W=Z.replace===!0,j=N(oe,ve);if(j)return B(Kt(y(j),{state:typeof j=="object"?Kt({},ce,j.state):ce,force:D,replace:W}),pe||oe);const ne=oe;ne.redirectedFrom=pe;let ie;return!D&&RN(o,ve,oe)&&(ie=tu(yn.NAVIGATION_DUPLICATED,{to:ne,from:ve}),de(ve,ve,!0,!1)),(ie?Promise.resolve(ie):E(ne,ve)).catch(ae=>xs(ae)?xs(ae,yn.NAVIGATION_GUARD_REDIRECT)?ae:ue(ae):G(ae,ne,ve)).then(ae=>{if(ae){if(xs(ae,yn.NAVIGATION_GUARD_REDIRECT))return B(Kt({replace:W},y(ae.to),{state:typeof ae.to=="object"?Kt({},ce,ae.to.state):ce,force:D}),pe||ne)}else ae=C(ne,ve,!0,W,ce);return I(ne,ve,ae),ae})}function k(Z,pe){const oe=x(Z,pe);return oe?Promise.reject(oe):Promise.resolve()}function L(Z){const pe=ee.values().next().value;return pe&&typeof pe.runWithContext=="function"?pe.runWithContext(Z):Z()}function E(Z,pe){let oe;const[ve,ce,D]=tI(Z,pe);oe=Jg(ve.reverse(),"beforeRouteLeave",Z,pe);for(const j of ve)j.leaveGuards.forEach(ne=>{oe.push(ba(ne,Z,pe))});const W=k.bind(null,Z,pe);return oe.push(W),xe(oe).then(()=>{oe=[];for(const j of i.list())oe.push(ba(j,Z,pe));return oe.push(W),xe(oe)}).then(()=>{oe=Jg(ce,"beforeRouteUpdate",Z,pe);for(const j of ce)j.updateGuards.forEach(ne=>{oe.push(ba(ne,Z,pe))});return oe.push(W),xe(oe)}).then(()=>{oe=[];for(const j of D)if(j.beforeEnter)if($i(j.beforeEnter))for(const ne of j.beforeEnter)oe.push(ba(ne,Z,pe));else oe.push(ba(j.beforeEnter,Z,pe));return oe.push(W),xe(oe)}).then(()=>(Z.matched.forEach(j=>j.enterCallbacks={}),oe=Jg(D,"beforeRouteEnter",Z,pe,L),oe.push(W),xe(oe))).then(()=>{oe=[];for(const j of s.list())oe.push(ba(j,Z,pe));return oe.push(W),xe(oe)}).catch(j=>xs(j,yn.NAVIGATION_CANCELLED)?j:Promise.reject(j))}function I(Z,pe,oe){a.list().forEach(ve=>L(()=>ve(Z,pe,oe)))}function C(Z,pe,oe,ve,ce){const D=x(Z,pe);if(D)return D;const W=pe===fa,j=Sc?history.state:{};oe&&(ve||W?r.replace(Z.fullPath,Kt({scroll:W&&j&&j.scroll},ce)):r.push(Z.fullPath,ce)),l.value=Z,de(Z,pe,oe,W),ue()}let $;function P(){$||($=r.listen((Z,pe,oe)=>{if(!fe.listening)return;const ve=b(Z),ce=N(ve,fe.currentRoute.value);if(ce){B(Kt(ce,{replace:!0,force:!0}),ve).catch($d);return}c=ve;const D=l.value;Sc&&qN(x_(D.fullPath,oe.delta),xm()),E(ve,D).catch(W=>xs(W,yn.NAVIGATION_ABORTED|yn.NAVIGATION_CANCELLED)?W:xs(W,yn.NAVIGATION_GUARD_REDIRECT)?(B(Kt(y(W.to),{force:!0}),ve).then(j=>{xs(j,yn.NAVIGATION_ABORTED|yn.NAVIGATION_DUPLICATED)&&!oe.delta&&oe.type===k1.pop&&r.go(-1,!1)}).catch($d),Promise.reject()):(oe.delta&&r.go(-oe.delta,!1),G(W,ve,D))).then(W=>{W=W||C(ve,D,!1),W&&(oe.delta&&!xs(W,yn.NAVIGATION_CANCELLED)?r.go(-oe.delta,!1):oe.type===k1.pop&&xs(W,yn.NAVIGATION_ABORTED|yn.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),I(ve,D,W)}).catch($d)}))}let M=Yu(),F=Yu(),V;function G(Z,pe,oe){ue(Z);const ve=F.list();return ve.length?ve.forEach(ce=>ce(Z,pe,oe)):console.error(Z),Promise.reject(Z)}function K(){return V&&l.value!==fa?Promise.resolve():new Promise((Z,pe)=>{M.add([Z,pe])})}function ue(Z){return V||(V=!Z,P(),M.list().forEach(([pe,oe])=>Z?oe(Z):pe()),M.reset()),Z}function de(Z,pe,oe,ve){const{scrollBehavior:ce}=t;if(!Sc||!ce)return Promise.resolve();const D=!oe&&YN(x_(Z.fullPath,0))||(ve||!oe)&&history.state&&history.state.scroll||null;return wn().then(()=>ce(Z,pe,D)).then(W=>W&&GN(W)).catch(W=>G(W,Z,pe))}const he=Z=>r.go(Z);let ge;const ee=new Set,fe={currentRoute:l,listening:!0,addRoute:h,removeRoute:g,clearRoutes:e.clearRoutes,hasRoute:m,getRoutes:v,resolve:b,options:t,push:_,replace:S,go:he,back:()=>he(-1),forward:()=>he(1),beforeEach:i.add,beforeResolve:s.add,afterEach:a.add,onError:F.add,isReady:K,install(Z){Z.component("RouterLink",kI),Z.component("RouterView",$I),Z.config.globalProperties.$router=fe,Object.defineProperty(Z.config.globalProperties,"$route",{enumerable:!0,get:()=>p(l)}),Sc&&!ge&&l.value===fa&&(ge=!0,_(r.location).catch(ve=>{}));const pe={};for(const ve in fa)Object.defineProperty(pe,ve,{get:()=>l.value[ve],enumerable:!0});Z.provide(wm,fe),Z.provide(My,zS(pe)),Z.provide(A1,l);const oe=Z.unmount;ee.add(Z),Z.unmount=function(){ee.delete(Z),ee.size<1&&(c=fa,$&&$(),$=null,l.value=fa,ge=!1,V=!1),oe()}}};function xe(Z){return Z.reduce((pe,oe)=>pe.then(()=>L(oe)),Promise.resolve())}return fe}function Oy(){return jt(wm)}function Jl(t){return jt(My)}function Kd(t,e){return Xl()?(Ba(t,e),!0):!1}const ev=new WeakMap,MI=(...t)=>{var e;const n=t[0],o=(e=Bo())===null||e===void 0?void 0:e.proxy,r=o??Xl();if(r==null&&!iy())throw new Error("injectLocal must be called in setup");return r&&ev.has(r)&&n in ev.get(r)?ev.get(r)[n]:jt(...t)},C1=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const OI=t=>t!=null,BI=Object.prototype.toString,LI=t=>BI.call(t)==="[object Object]",Sa=()=>{};function pA(t,e){function n(...o){return new Promise((r,i)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(i)})}return n}function PI(t,e={}){let n,o,r=Sa;const i=l=>{clearTimeout(l),r(),r=Sa};let s;return l=>{const c=yt(t),u=yt(e.maxWait);return n&&i(n),c<=0||u!==void 0&&u<=0?(o&&(i(o),o=void 0),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,s=l,u&&!o&&(o=setTimeout(()=>{n&&i(n),o=void 0,d(s())},u)),n=setTimeout(()=>{o&&i(o),o=void 0,d(l())},c)})}}function DI(...t){let e=0,n,o=!0,r=Sa,i,s,a,l,c;!Ze(t[0])&&typeof t[0]=="object"?{delay:s,trailing:a=!0,leading:l=!0,rejectOnCancel:c=!1}=t[0]:[s,a=!0,l=!0,c=!1]=t;const u=()=>{n&&(clearTimeout(n),n=void 0,r(),r=Sa)};return f=>{const h=yt(s),g=Date.now()-e,v=()=>i=f();return u(),h<=0?(e=Date.now(),v()):(g>h?(e=Date.now(),(l||!o)&&v()):a&&(i=new Promise((m,b)=>{r=c?b:m,n=setTimeout(()=>{e=Date.now(),o=!0,m(v()),u()},Math.max(0,h-g))})),!l&&!n&&(n=setTimeout(()=>o=!0,h)),o=!1,i)}}function P_(t){return t.endsWith("rem")?Number.parseFloat(t)*16:Number.parseFloat(t)}function Td(t){return Array.isArray(t)?t:[t]}function EI(t){return Bo()}function NI(t,e=200,n={}){return pA(PI(e,n),t)}function II(t,e=200,n=!1,o=!0,r=!1){return pA(DI(e,n,o,r),t)}function By(t,e=!0,n){EI()?hn(t,n):e?t():wn(t)}function $1(t,e=1e3,n={}){const{immediate:o=!0,immediateCallback:r=!1}=n;let i=null;const s=Fe(!1);function a(){i&&(clearInterval(i),i=null)}function l(){s.value=!1,a()}function c(){const u=yt(e);u<=0||(s.value=!0,r&&t(),a(),s.value&&(i=setInterval(t,u)))}return o&&C1&&c(),(Ze(e)||typeof e=="function")&&Kd(je(e,()=>{s.value&&C1&&c()})),Kd(l),{isActive:hl(s),pause:l,resume:c}}function RI(t,e,n){return je(t,e,{...n,immediate:!0})}const Xa=C1?window:void 0;function or(t){var e;const n=yt(t);return(e=n==null?void 0:n.$el)!==null&&e!==void 0?e:n}function Ws(...t){const e=(o,r,i,s)=>(o.addEventListener(r,i,s),()=>o.removeEventListener(r,i,s)),n=A(()=>{const o=Td(yt(t[0])).filter(r=>r!=null);return o.every(r=>typeof r!="string")?o:void 0});return RI(()=>{var o,r;return[(o=(r=n.value)===null||r===void 0?void 0:r.map(i=>or(i)))!==null&&o!==void 0?o:[Xa].filter(i=>i!=null),Td(yt(n.value?t[1]:t[0])),Td(p(n.value?t[2]:t[1])),yt(n.value?t[3]:t[2])]},([o,r,i,s],a,l)=>{if(!(o!=null&&o.length)||!(r!=null&&r.length)||!(i!=null&&i.length))return;const c=LI(s)?{...s}:s,u=o.flatMap(d=>r.flatMap(f=>i.map(h=>e(d,f,h,c))));l(()=>{u.forEach(d=>d())})},{flush:"post"})}function FI(t,e,n={}){const{window:o=Xa,ignore:r=[],capture:i=!0,detectIframe:s=!1,controls:a=!1}=n;if(!o)return a?{stop:Sa,cancel:Sa,trigger:Sa}:Sa;let l=!0;const c=m=>yt(r).some(b=>{if(typeof b=="string")return Array.from(o.document.querySelectorAll(b)).some(y=>y===m.target||m.composedPath().includes(y));{const y=or(b);return y&&(m.target===y||m.composedPath().includes(y))}});function u(m){const b=yt(m);return b&&b.$.subTree.shapeFlag===16}function d(m,b){const y=yt(m),x=y.$.subTree&&y.$.subTree.children;return x==null||!Array.isArray(x)?!1:x.some(_=>_.el===b.target||b.composedPath().includes(_.el))}const f=m=>{const b=or(t);if(m.target!=null&&!(!(b instanceof Element)&&u(t)&&d(t,m))&&!(!b||b===m.target||m.composedPath().includes(b))){if("detail"in m&&m.detail===0&&(l=!c(m)),!l){l=!0;return}e(m)}};let h=!1;const g=[Ws(o,"click",m=>{h||(h=!0,setTimeout(()=>{h=!1},0),f(m))},{passive:!0,capture:i}),Ws(o,"pointerdown",m=>{const b=or(t);l=!c(m)&&!!(b&&!m.composedPath().includes(b))},{passive:!0}),s&&Ws(o,"blur",m=>{setTimeout(()=>{var b;const y=or(t);((b=o.document.activeElement)===null||b===void 0?void 0:b.tagName)==="IFRAME"&&!(y!=null&&y.contains(o.document.activeElement))&&e(m)},0)},{passive:!0})].filter(Boolean),v=()=>g.forEach(m=>m());return a?{stop:v,cancel:()=>{l=!1},trigger:m=>{l=!0,f(m),l=!1}}:v}function VI(){const t=Fe(!1),e=Bo();return e&&hn(()=>{t.value=!0},e),t}function Ly(t){const e=VI();return A(()=>(e.value,!!t()))}function zI(t,e,n={}){const{window:o=Xa,...r}=n;let i;const s=Ly(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=je(A(()=>{const d=Td(yt(t)).map(or).filter(OI);return new Set(d)}),d=>{a(),s.value&&d.size&&(i=new MutationObserver(e),d.forEach(f=>i.observe(f,r)))},{immediate:!0,flush:"post"}),c=()=>i==null?void 0:i.takeRecords(),u=()=>{l(),a()};return Kd(u),{isSupported:s,stop:u,takeRecords:c}}function D_(t,e={}){const{immediate:n=!0,fpsLimit:o=null,window:r=Xa,once:i=!1}=e,s=Fe(!1),a=A(()=>{const h=yt(o);return h?1e3/h:null});let l=0,c=null;function u(h){if(!s.value||!r)return;l||(l=h);const g=h-l;if(a.value&&g<a.value){c=r.requestAnimationFrame(u);return}if(l=h,t({delta:g,timestamp:h}),i){s.value=!1,c=null;return}c=r.requestAnimationFrame(u)}function d(){!s.value&&r&&(s.value=!0,l=0,c=r.requestAnimationFrame(u))}function f(){s.value=!1,c!=null&&r&&(r.cancelAnimationFrame(c),c=null)}return n&&d(),Kd(f),{isActive:ao(s),pause:f,resume:d}}const HI=Symbol("vueuse-ssr-width");function WI(){const t=iy()?MI(HI,null):null;return typeof t=="number"?t:void 0}function Py(t,e={}){const{window:n=Xa,ssrWidth:o=WI()}=e,r=Ly(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),i=Fe(typeof o=="number"),s=Fe(),a=Fe(!1),l=c=>{a.value=c.matches};return tm(()=>{if(i.value){i.value=!r.value,a.value=yt(t).split(",").some(c=>{const u=c.includes("not all"),d=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),f=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let h=!!(d||f);return d&&h&&(h=o>=P_(d[1])),f&&h&&(h=o<=P_(f[1])),u?!h:h});return}r.value&&(s.value=n.matchMedia(yt(t)),a.value=s.value.matches)}),Ws(s,"change",l,{passive:!0}),A(()=>a.value)}function ls(t,e,n={}){const{window:o=Xa,...r}=n;let i;const s=Ly(()=>o&&"ResizeObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},l=je(A(()=>{const u=yt(t);return Array.isArray(u)?u.map(d=>or(d)):[or(u)]}),u=>{if(a(),s.value&&o){i=new ResizeObserver(e);for(const d of u)d&&i.observe(d,r)}},{immediate:!0,flush:"post"}),c=()=>{a(),l()};return Kd(c),{isSupported:s,stop:c}}function UI(t,e={}){const{reset:n=!0,windowResize:o=!0,windowScroll:r=!0,immediate:i=!0,updateTiming:s="sync"}=e,a=Fe(0),l=Fe(0),c=Fe(0),u=Fe(0),d=Fe(0),f=Fe(0),h=Fe(0),g=Fe(0);function v(){const b=or(t);if(!b){n&&(a.value=0,l.value=0,c.value=0,u.value=0,d.value=0,f.value=0,h.value=0,g.value=0);return}const y=b.getBoundingClientRect();a.value=y.height,l.value=y.bottom,c.value=y.left,u.value=y.right,d.value=y.top,f.value=y.width,h.value=y.x,g.value=y.y}function m(){s==="sync"?v():s==="next-frame"&&requestAnimationFrame(()=>v())}return ls(t,m),je(()=>or(t),b=>!b&&m()),zI(t,m,{attributeFilter:["style","class"]}),r&&Ws("scroll",m,{capture:!0,passive:!0}),o&&Ws("resize",m,{passive:!0}),By(()=>{i&&m()}),{height:a,bottom:l,left:c,right:u,top:d,width:f,x:h,y:g,update:m}}function GI(t,e={width:0,height:0},n={}){const{window:o=Xa,box:r="content-box"}=n,i=A(()=>{var d;return(d=or(t))===null||d===void 0||(d=d.namespaceURI)===null||d===void 0?void 0:d.includes("svg")}),s=Fe(e.width),a=Fe(e.height),{stop:l}=ls(t,([d])=>{const f=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(o&&i.value){const h=or(t);if(h){const g=h.getBoundingClientRect();s.value=g.width,a.value=g.height}}else if(f){const h=Td(f);s.value=h.reduce((g,{inlineSize:v})=>g+v,0),a.value=h.reduce((g,{blockSize:v})=>g+v,0)}else s.value=d.contentRect.width,a.value=d.contentRect.height},n);By(()=>{const d=or(t);d&&(s.value="offsetWidth"in d?d.offsetWidth:e.width,a.value="offsetHeight"in d?d.offsetHeight:e.height)});const c=je(()=>or(t),d=>{s.value=d?e.width:0,a.value=d?e.height:0});function u(){l(),c()}return{width:s,height:a,stop:u}}function qI(t){if("interval"in t||"immediate"in t){const{interval:e="requestAnimationFrame",immediate:n=!0}=t;return e==="requestAnimationFrame"?o=>D_(o,{immediate:n}):o=>$1(o,e,t)}return D_}function YI(t={}){const{controls:e=!1,scheduler:n=qI(t)}=t,o=ze(new Date),i=n(()=>o.value=new Date);return e?{now:o,...i}:o}const jI=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],XI={justNow:"just now",past:t=>t.match(/\d/)?`${t} ago`:t,future:t=>t.match(/\d/)?`in ${t}`:t,month:(t,e)=>t===1?e?"last month":"next month":`${t} month${t>1?"s":""}`,year:(t,e)=>t===1?e?"last year":"next year":`${t} year${t>1?"s":""}`,day:(t,e)=>t===1?e?"yesterday":"tomorrow":`${t} day${t>1?"s":""}`,week:(t,e)=>t===1?e?"last week":"next week":`${t} week${t>1?"s":""}`,hour:t=>`${t} hour${t>1?"s":""}`,minute:t=>`${t} minute${t>1?"s":""}`,second:t=>`${t} second${t>1?"s":""}`,invalid:""};function KI(t){return t.toISOString().slice(0,10)}function ZI(t){if("updateInterval"in t){const{updateInterval:e=3e4}=t;return n=>$1(n,e)}return e=>$1(e,3e4)}function QI(t,e={}){const{controls:n=!1,scheduler:o=ZI(e)}=e,{now:r,...i}=YI({scheduler:o,controls:!0}),s=A(()=>JI(new Date(yt(t)),e,yt(r)));return n?{timeAgo:s,...i}:s}function JI(t,e={},n=Date.now()){const{max:o,messages:r=XI,fullDateFormatter:i=KI,units:s=jI,showSecond:a=!1,rounding:l="round"}=e,c=typeof l=="number"?m=>+m.toFixed(l):Math[l],u=+n-+t,d=Math.abs(u);function f(m,b){return c(Math.abs(m)/b.value)}function h(m,b){const y=f(m,b),x=m>0,_=g(b.name,y,x);return g(x?"past":"future",_,x)}function g(m,b,y){const x=r[m];return typeof x=="function"?x(b,y):x.replace("{0}",b.toString())}if(d<6e4&&!a)return r.justNow;if(typeof o=="number"&&d>o)return i(new Date(t));if(typeof o=="string"){var v;const m=(v=s.find(b=>b.name===o))===null||v===void 0?void 0:v.max;if(m&&d>m)return i(new Date(t))}for(const[m,b]of s.entries()){if(f(u,b)<=0&&s[m-1])return h(u,s[m-1]);if(d<b.max)return h(u,b)}return r.invalid}function eR(t={}){const{window:e=Xa,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:o=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:i=!0,type:s="inner"}=t,a=Fe(n),l=Fe(o),c=()=>{if(e)if(s==="outer")a.value=e.outerWidth,l.value=e.outerHeight;else if(s==="visual"&&e.visualViewport){const{width:d,height:f,scale:h}=e.visualViewport;a.value=Math.round(d*h),l.value=Math.round(f*h)}else i?(a.value=e.innerWidth,l.value=e.innerHeight):(a.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),By(c);const u={passive:!0};return Ws("resize",c,u),e&&s==="visual"&&e.visualViewport&&Ws(e.visualViewport,"resize",c,u),r&&je(Py("(orientation: portrait)"),()=>c()),{width:a,height:l}}var sn=(t=>(t.BarVertical="bar-vertical",t.BarHorizontal="bar-horizontal",t.BarMulti="bar-multi",t.ColumnStacked="column-stacked",t.BarStacked="bar-stacked",t.BarSplit="bar-split",t.BarGrouped="bar-grouped",t.Line="line",t.LineMulti="line-multi",t.Area="area",t.AreaStacked="area-stacked",t.Donut="donut",t.Pie="pie",t))(sn||{});function Cf(t){const e=new Map,n=ze([]);function o(){n.value=Array.from(e.values())}return gi(t,{register(i,s){e.set(i,s),o()},update(i,s){e.set(i,s),o()},unregister(i){e.delete(i),o()}}),{entries:n}}function mA(t,e){const n=jt(t,null);if(!n)return;const o=Bo();if(!o)return;const r=o.uid;hn(()=>{n.register(r,e())}),je(e,i=>{n.update(r,i)}),Xs(()=>{n.unregister(r)})}const gA=Symbol("ButtonGroupEntries"),vA=Symbol("DropdownEntries"),tR=Symbol("PaletteEntries"),nR=Symbol("IconRailEntries"),oR=Symbol("ToggleEntries"),rR={sm:576,md:768,lg:992,xl:1200,xxl:1400};function bi(t="md"){const e=typeof t=="number"?t:rR[t];return{isNarrow:Py(`(max-width: ${e-1}px)`)}}const iR=le({__name:"ButtonIconCounter",props:{counter:{default:null},variant:{default:"secondary"}},setup(t){return(e,n)=>{const o=Ay;return t.counter!=null?(w(),Q(o,{key:0,variant:t.variant,class:"button-icon-counter text-nowrap",pill:""},{default:J(()=>[Ae(e.$slots,"default",{},()=>[Xe(be(t.counter),1)])]),_:3},8,["variant"])):se("",!0)}}}),sR=le({__name:"AppIcon",props:{name:{default:void 0},size:{default:void 0},scale:{default:1},variant:{default:void 0},hoverVariant:{default:void 0},beat:{type:Boolean},beatDuration:{default:"1s"},fade:{type:Boolean},fadeDuration:{default:"1s"},spin:{type:Boolean},spinReverse:{type:Boolean},spinDuration:{default:"1s"},hover:{type:Boolean}},setup(t){const e=t,n=Fe(!1);function o(){n.value=e.hover}je(()=>e.hover,o,{immediate:!0});const r=A(()=>{let u="currentColor";return e.variant&&(u=`var(--bs-${e.variant}, currentColor)`),n.value&&e.hoverVariant&&(u=`var(--bs-${e.hoverVariant}, ${u})`),u}),i=A(()=>typeof e.size=="string"&&e.size.endsWith("%")),s=A(()=>!["2xs","xs","sm","md","lg","xl","2xl",void 0].includes(e.size)&&!i.value),a=A(()=>["2xs","xs","sm","md","lg","xl","2xl"].includes(e.size??"")),l=A(()=>({"--app-icon-color":r.value,"--app-icon-raw-size":s.value?e.size:void 0,"--app-icon-percent-size":i.value?e.size:void 0,"--app-icon-size":a.value?e.size:void 0,"--app-icon-scale":e.scale??1,"--app-icon-spin-duration":e.spinDuration,"--app-icon-beat-duration":e.beatDuration,"--app-icon-fade-duration":e.fadeDuration})),c=A(()=>({[`app-icon--size-${e.size}`]:a.value,"app-icon--has-size":a.value,"app-icon--raw-size":s.value,"app-icon--percent-size":i.value,"app-icon--hover":n.value,"app-icon--spin":e.spin,"app-icon--spin-reverse":e.spinReverse,"app-icon--beat":e.beat,"app-icon--fade":e.fade}));return(u,d)=>(w(),R("span",{class:Te(["app-icon",p(c)]),style:Dt(p(l)),onMouseenter:d[0]||(d[0]=f=>n.value=!0),onMouseleave:d[1]||(d[1]=f=>n.value=t.hover??!1)},[t.name?(w(),Q(Gt(t.name),{key:0})):Ae(u.$slots,"default",{key:1},void 0,!0)],38))}}),Be=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},$f=Be(sR,[["__scopeId","data-v-eaec91c1"]]),aR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function lR(t,e){return w(),R("svg",aR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 128a104 104 0 0 1-208 0c0-41 23.81-78.36 60.66-95.27a8 8 0 0 1 6.68 14.54C60.15 61.59 40 93.27 40 128a88 88 0 0 0 176 0c0-34.73-20.15-66.41-51.34-80.73a8 8 0 0 1 6.68-14.54C208.19 49.64 232 87 232 128"},null,-1)])])}const cR=Me({name:"ph-circle-notch",render:lR}),uR={key:1,class:"button-icon__label"},dR=le({__name:"ButtonIcon",props:{id:{},iconLeft:{},iconLeftVariant:{},iconLeftHoverVariant:{},iconLeftSize:{default:"1.25em"},iconRight:{},iconRightVariant:{},iconRightHoverVariant:{},iconRightSize:{default:"1.25em"},iconSpinner:{default:()=>cR},hideLabel:{type:Boolean,default:!1},hideTooltip:{type:Boolean,default:!1},label:{},square:{type:Boolean,default:!1},variant:{},size:{},block:{type:Boolean},pill:{type:Boolean},tag:{default:"button"},type:{default:"button"},loading:{type:Boolean},loadingDuration:{default:"1s"},loadingText:{},tooltipLabel:{},tooltipPlacement:{default:"top"},tooltipDelay:{default:()=>({show:0,hide:0})},showTooltipForce:{type:Boolean},hover:{type:Boolean},truncate:{type:Boolean},counter:{default:null},counterVariant:{},counterStyle:{}},emits:["click:icon-right"],setup(t,{emit:e}){let n=0;const o=jt("variant","action"),r=jt("size","md"),i=mt("element"),s=t,a=e;function l(y){a(`click:${y}`)}const c=Fe(!1),u=A(()=>s.id??`button-icon-${++n}`),d=A(()=>({"button-icon--square":s.square,"button-icon--loading":s.loading,"button-icon--truncate":s.truncate,"button-icon--hover":c.value,"button-icon--use-injected-variant":!s.variant,"button-icon--use-injected-size":!s.size})),f=A(()=>s.loading?s.iconSpinner:s.iconLeft),h=A(()=>s.loading?s.iconSpinner:s.iconRight),g=A(()=>s.loading&&s.loadingText?s.loadingText:s.label),v=A(()=>s.tooltipLabel??s.label),m=A(()=>!!v.value&&!s.hideTooltip&&(s.showTooltipForce||s.hideLabel)),b=A(()=>({pill:s.pill,pressed:s.pressed,size:s.size??r,tag:s.tag,type:s.type,variant:s.variant??o}));return(y,x)=>{const _=$f,S=iR,N=jd,B=Ho;return w(),Q(B,Tt(p(b),{id:p(u),ref:"element",class:["button-icon",p(d)],"aria-label":p(v),onMouseenter:x[1]||(x[1]=k=>c.value=!0),onMouseleave:x[2]||(x[2]=k=>c.value=!1)}),{default:J(()=>[Ae(y.$slots,"start",{},void 0,!0),t.iconLeft||!t.iconLeft&&!t.iconRight&&t.loading?(w(),Q(_,{key:0,name:p(f),size:t.iconLeftSize,spin:t.loading,"spin-duration":t.loadingDuration,variant:t.iconLeftVariant,"hover-variant":t.iconLeftHoverVariant,hover:p(c),class:"button-icon__icon-left"},null,8,["name","size","spin","spin-duration","variant","hover-variant","hover"])):se("",!0),t.hideLabel?se("",!0):(w(),R("span",uR,[Ae(y.$slots,"default",Hn(er({labelOrLoadingText:p(g)})),()=>[Xe(be(p(g)),1)],!0)])),t.iconRight?(w(),Q(_,{key:2,name:p(h),size:t.iconRightSize,spin:t.loading,"spin-duration":t.loadingDuration,variant:t.iconRightVariant,"hover-variant":t.iconRightHoverVariant,hover:p(c),class:"button-icon__icon-right",onClick:x[0]||(x[0]=k=>l("icon-right"))},null,8,["name","size","spin","spin-duration","variant","hover-variant","hover"])):se("",!0),t.counter!==null?(w(),Q(S,{key:3,counter:t.counter,variant:t.counterVariant,style:Dt(t.counterStyle)},null,8,["counter","variant","style"])):se("",!0),Ae(y.$slots,"end",{},void 0,!0),p(m)?(w(),Q(N,{key:4,"teleport-to":"body",delay:t.tooltipDelay,"boundary-padding":20,placement:t.tooltipPlacement,target:p(i),title:p(v)},null,8,["delay","placement","target","title"])):se("",!0)]),_:3},16,["id","class","aria-label"])}}}),Qn=Be(dR,[["__scopeId","data-v-7adc8c82"]]),fR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function hR(t,e){return w(),R("svg",fR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 32H88a8 8 0 0 0-8 8v40H40a8 8 0 0 0-8 8v128a8 8 0 0 0 8 8h128a8 8 0 0 0 8-8v-40h40a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8m-56 176H48V96h112Zm48-48h-32V88a8 8 0 0 0-8-8H96V48h112Z"},null,-1)])])}const bA=Me({name:"ph-copy",render:hR}),pR={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function mR(t,e){return w(),R("svg",pR,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 77.66l-128 128a8 8 0 0 1-11.32 0l-56-56a8 8 0 0 1 11.32-11.32L96 188.69L218.34 66.34a8 8 0 0 1 11.32 11.32"},null,-1)])])}const Dy=Me({name:"ph-check",render:mR}),E_=le({__name:"ActionCopyButton",props:{text:{},label:{default:"Copy"},variant:{default:"outline-secondary"},size:{default:"sm"}},setup(t){const e=t,n=Fe(!1);let o;async function r(){try{await globalThis.navigator.clipboard.writeText(e.text),n.value=!0,clearTimeout(o),o=setTimeout(()=>{n.value=!1},1500)}catch{}}return(i,s)=>{const a=Qn;return w(),Q(a,{"icon-left":p(n)?p(Dy):p(bA),label:p(n)?"Copied!":t.label,variant:p(n)?"success":t.variant,size:t.size,onClick:r},null,8,["icon-left","label","variant","size"])}}}),nn=le({__name:"FormControlCheckbox",props:at({label:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue");return(n,o)=>{const r=Hs,i=Mn;return w(),Q(i,{class:"form-control-checkbox"},{default:J(()=>[H(r,{"model-value":e.value,class:"form-control-checkbox__input",switch:"","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s)},{default:J(()=>[Ae(n.$slots,"default",{},()=>[Xe(be(t.label),1)])]),_:3},8,["model-value"]),e.value?Ae(n.$slots,"section",{key:0}):se("",!0)]),_:3})}}});function Ep(t){"@babel/helpers - typeof";return Ep=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},Ep(t)}var gR=/^\s+/,vR=/\s+$/;function nt(t,e){if(t=t||"",e=e||{},t instanceof nt)return t;if(!(this instanceof nt))return new nt(t,e);var n=bR(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}nt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,n,o,r,i,s;return e=t.r/255,n=t.g/255,o=t.b/255,e<=.03928?r=e/12.92:r=Math.pow((e+.055)/1.055,2.4),n<=.03928?i=n/12.92:i=Math.pow((n+.055)/1.055,2.4),o<=.03928?s=o/12.92:s=Math.pow((o+.055)/1.055,2.4),.2126*r+.7152*i+.0722*s},setAlpha:function(t){return this._a=yA(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=I_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=I_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+n+"%, "+o+"%)":"hsva("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var t=N_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=N_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+n+"%, "+o+"%)":"hsla("+e+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(t){return R_(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return _R(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(mn(this._r,255)*100)+"%",g:Math.round(mn(this._g,255)*100)+"%",b:Math.round(mn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(mn(this._r,255)*100)+"%, "+Math.round(mn(this._g,255)*100)+"%, "+Math.round(mn(this._b,255)*100)+"%)":"rgba("+Math.round(mn(this._r,255)*100)+"%, "+Math.round(mn(this._g,255)*100)+"%, "+Math.round(mn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:DR[R_(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+F_(this._r,this._g,this._b,this._a),n=e,o=this._gradientType?"GradientType = 1, ":"";if(t){var r=nt(t);n="#"+F_(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,o=this._a<1&&this._a>=0,r=!e&&o&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return r?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return nt(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(CR,arguments)},brighten:function(){return this._applyModification($R,arguments)},darken:function(){return this._applyModification(TR,arguments)},desaturate:function(){return this._applyModification(kR,arguments)},saturate:function(){return this._applyModification(SR,arguments)},greyscale:function(){return this._applyModification(AR,arguments)},spin:function(){return this._applyModification(MR,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(LR,arguments)},complement:function(){return this._applyCombination(OR,arguments)},monochromatic:function(){return this._applyCombination(PR,arguments)},splitcomplement:function(){return this._applyCombination(BR,arguments)},triad:function(){return this._applyCombination(V_,[3])},tetrad:function(){return this._applyCombination(V_,[4])}};nt.fromRatio=function(t,e){if(Ep(t)=="object"){var n={};for(var o in t)t.hasOwnProperty(o)&&(o==="a"?n[o]=t[o]:n[o]=sd(t[o]));t=n}return nt(t,e)};function bR(t){var e={r:0,g:0,b:0},n=1,o=null,r=null,i=null,s=!1,a=!1;return typeof t=="string"&&(t=RR(t)),Ep(t)=="object"&&(ws(t.r)&&ws(t.g)&&ws(t.b)?(e=yR(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):ws(t.h)&&ws(t.s)&&ws(t.v)?(o=sd(t.s),r=sd(t.v),e=wR(t.h,o,r),s=!0,a="hsv"):ws(t.h)&&ws(t.s)&&ws(t.l)&&(o=sd(t.s),i=sd(t.l),e=xR(t.h,o,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=yA(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function yR(t,e,n){return{r:mn(t,255)*255,g:mn(e,255)*255,b:mn(n,255)*255}}function N_(t,e,n){t=mn(t,255),e=mn(e,255),n=mn(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,s,a=(o+r)/2;if(o==r)i=s=0;else{var l=o-r;switch(s=a>.5?l/(2-o-r):l/(o+r),o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s,l:a}}function xR(t,e,n){var o,r,i;t=mn(t,360),e=mn(e,100),n=mn(n,100);function s(c,u,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)o=r=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;o=s(l,a,t+1/3),r=s(l,a,t),i=s(l,a,t-1/3)}return{r:o*255,g:r*255,b:i*255}}function I_(t,e,n){t=mn(t,255),e=mn(e,255),n=mn(n,255);var o=Math.max(t,e,n),r=Math.min(t,e,n),i,s,a=o,l=o-r;if(s=o===0?0:l/o,o==r)i=0;else{switch(o){case t:i=(e-n)/l+(e<n?6:0);break;case e:i=(n-t)/l+2;break;case n:i=(t-e)/l+4;break}i/=6}return{h:i,s,v:a}}function wR(t,e,n){t=mn(t,360)*6,e=mn(e,100),n=mn(n,100);var o=Math.floor(t),r=t-o,i=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=o%6,c=[n,s,i,i,a,n][l],u=[a,n,n,s,i,i][l],d=[i,i,a,n,n,s][l];return{r:c*255,g:u*255,b:d*255}}function R_(t,e,n,o){var r=[ci(Math.round(t).toString(16)),ci(Math.round(e).toString(16)),ci(Math.round(n).toString(16))];return o&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function _R(t,e,n,o,r){var i=[ci(Math.round(t).toString(16)),ci(Math.round(e).toString(16)),ci(Math.round(n).toString(16)),ci(xA(o))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function F_(t,e,n,o){var r=[ci(xA(o)),ci(Math.round(t).toString(16)),ci(Math.round(e).toString(16)),ci(Math.round(n).toString(16))];return r.join("")}nt.equals=function(t,e){return!t||!e?!1:nt(t).toRgbString()==nt(e).toRgbString()};nt.random=function(){return nt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function kR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s-=e/100,n.s=_m(n.s),nt(n)}function SR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.s+=e/100,n.s=_m(n.s),nt(n)}function AR(t){return nt(t).desaturate(100)}function CR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l+=e/100,n.l=_m(n.l),nt(n)}function $R(t,e){e=e===0?0:e||10;var n=nt(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(e/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(e/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(e/100)))),nt(n)}function TR(t,e){e=e===0?0:e||10;var n=nt(t).toHsl();return n.l-=e/100,n.l=_m(n.l),nt(n)}function MR(t,e){var n=nt(t).toHsl(),o=(n.h+e)%360;return n.h=o<0?360+o:o,nt(n)}function OR(t){var e=nt(t).toHsl();return e.h=(e.h+180)%360,nt(e)}function V_(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=nt(t).toHsl(),o=[nt(t)],r=360/e,i=1;i<e;i++)o.push(nt({h:(n.h+i*r)%360,s:n.s,l:n.l}));return o}function BR(t){var e=nt(t).toHsl(),n=e.h;return[nt(t),nt({h:(n+72)%360,s:e.s,l:e.l}),nt({h:(n+216)%360,s:e.s,l:e.l})]}function LR(t,e,n){e=e||6,n=n||30;var o=nt(t).toHsl(),r=360/n,i=[nt(t)];for(o.h=(o.h-(r*e>>1)+720)%360;--e;)o.h=(o.h+r)%360,i.push(nt(o));return i}function PR(t,e){e=e||6;for(var n=nt(t).toHsv(),o=n.h,r=n.s,i=n.v,s=[],a=1/e;e--;)s.push(nt({h:o,s:r,v:i})),i=(i+a)%1;return s}nt.mix=function(t,e,n){n=n===0?0:n||50;var o=nt(t).toRgb(),r=nt(e).toRgb(),i=n/100,s={r:(r.r-o.r)*i+o.r,g:(r.g-o.g)*i+o.g,b:(r.b-o.b)*i+o.b,a:(r.a-o.a)*i+o.a};return nt(s)};nt.readability=function(t,e){var n=nt(t),o=nt(e);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)};nt.isReadable=function(t,e,n){var o=nt.readability(t,e),r,i;switch(i=!1,r=FR(n),r.level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7;break}return i};nt.mostReadable=function(t,e,n){var o=null,r=0,i,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var c=0;c<e.length;c++)i=nt.readability(t,e[c]),i>r&&(r=i,o=nt(e[c]));return nt.isReadable(t,o,{level:a,size:l})||!s?o:(n.includeFallbackColors=!1,nt.mostReadable(t,["#fff","#000"],n))};var T1=nt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},DR=nt.hexNames=ER(T1);function ER(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function yA(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function mn(t,e){NR(t)&&(t="100%");var n=IR(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function _m(t){return Math.min(1,Math.max(0,t))}function gr(t){return parseInt(t,16)}function NR(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function IR(t){return typeof t=="string"&&t.indexOf("%")!=-1}function ci(t){return t.length==1?"0"+t:""+t}function sd(t){return t<=1&&(t=t*100+"%"),t}function xA(t){return Math.round(parseFloat(t)*255).toString(16)}function z_(t){return gr(t)/255}var ri=(function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+o),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+o),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+o),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function ws(t){return!!ri.CSS_UNIT.exec(t)}function RR(t){t=t.replace(gR,"").replace(vR,"").toLowerCase();var e=!1;if(T1[t])t=T1[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=ri.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=ri.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=ri.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=ri.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=ri.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=ri.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=ri.hex8.exec(t))?{r:gr(n[1]),g:gr(n[2]),b:gr(n[3]),a:z_(n[4]),format:e?"name":"hex8"}:(n=ri.hex6.exec(t))?{r:gr(n[1]),g:gr(n[2]),b:gr(n[3]),format:e?"name":"hex"}:(n=ri.hex4.exec(t))?{r:gr(n[1]+""+n[1]),g:gr(n[2]+""+n[2]),b:gr(n[3]+""+n[3]),a:z_(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=ri.hex3.exec(t))?{r:gr(n[1]+""+n[1]),g:gr(n[2]+""+n[2]),b:gr(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function FR(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}const H_=(t,e,n=!1)=>{if(n)switch(e){case"rgb":return t.toRgb();case"prgb":return t.toPercentageRgb();case"hsl":return t.toHsl();case"hsv":return t.toHsv();default:return null}else{let o=e;e==="hex"&&t.getAlpha()<1&&(o="hex8");let r=t.toString(o);try{r=JSON.parse(r)}catch{}return r}},tv=(t,e)=>!!(Object.prototype.hasOwnProperty.call(t,e)&&typeof t[e]<"u"),ih=t=>typeof t>"u",Ey=["update:tinyColor","update:modelValue","input"];function Ny(t,e,n){let o,r;const i=A({get:()=>{const{modelValue:a,tinyColor:l,value:c}=t,u=l??a??c;return ih(r)&&(ih(c)||(r=nt(c).getFormat()),ih(a)||(r=nt(a).getFormat())),ih(o)&&(typeof c=="object"&&!(c instanceof nt)&&(o=!0),typeof a=="object"&&(o=!0)),nt(u)},set:a=>{s(a)}}),s=a=>{const l=nt(a);if(tv(t,"tinyColor")&&e("update:tinyColor",l),tv(t,"modelValue")){const c=H_(l,r,o);e("update:modelValue",c)}if(tv(t,"value")){const c=H_(l,r,o);e("input",c)}};return i}const wA=t=>{var n,o,r,i;const e={x:0,y:0};return t instanceof MouseEvent&&(e.x=t.pageX,e.y=t.pageY),typeof TouchEvent<"u"&&t instanceof TouchEvent&&(e.x=(n=t.touches)!=null&&n[0]?t.touches[0].pageX:(o=t.changedTouches)!=null&&o[0]?t.changedTouches[0].pageX:0,e.y=(r=t.touches)!=null&&r[0]?t.touches[0].pageY:(i=t.changedTouches)!=null&&i[0]?t.changedTouches[0].pageY:0),e},VR=()=>{const t=window.scrollX||window.pageXOffset||document.documentElement.scrollLeft||0,e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop||0;return{x:t,y:e}},_A=t=>{const{x:e,y:n}=VR(),o=t.getBoundingClientRect();return{x:o.left+e,y:o.top+n}},Iy=t=>t.code==="ArrowUp"||t.keyCode===38?"up":t.code==="ArrowDown"||t.keyCode===40?"down":t.code==="ArrowLeft"||t.keyCode===37?"left":t.code==="ArrowRight"||t.keyCode===39?"right":null;function zR(t){const e=t.toString();return e.indexOf(".")!==-1?e.split(".")[1].length:0}function nv(t,e,n){return Math.min(Math.max(t,e),n)}const kA=(t,e=20)=>{let n,o,r;return(...i)=>{n?(clearTimeout(o),o=setTimeout(()=>{Date.now()-r>=e&&(t(...i),r=Date.now())},Math.max(e-(Date.now()-r),0))):(t(...i),r=Date.now(),n=!0)}},HR=["aria-valuetext"],WR=le({__name:"SaturationSlider",props:{hue:{},tinyColor:{},modelValue:{},value:{}},emits:["change"].concat(Ey),setup(t,{emit:e}){const n=e,o=t,r=ze(0),i=Ny(o,n),s=A(()=>i.value.toHsv()),a=A(()=>o.hue??s.value.h),l=A(()=>`hsl(${a.value}, 100%, 50%)`),c=A(()=>-(s.value.v*100)+1+100+"%"),u=A(()=>s.value.v<=.01?r.value*100+"%":s.value.s*100+"%"),d=ze(null);function f(x){const _=d.value;if(!_)return;const S=_.clientWidth,N=_.clientHeight,{x:B,y:k}=_A(_),{x:L,y:E}=wA(x),I=nv(L-B,0,S),C=nv(E-k,0,N),$=I/S,P=nv(1-C/N,0,1);r.value=$;let M=Math.round($*100),F=Math.round(P*100);M===1&&(M=.01),F===1&&(F=.01),h({h:a.value,s:M,v:F,a:s.value.a})}function h(x){i.value=x}const g=kA(f,20);function v(x){x.preventDefault(),x.type.startsWith("mouse")?(window.addEventListener("mousemove",g),window.addEventListener("mouseup",g),window.addEventListener("mouseup",m)):x.type.startsWith("touch")&&(window.addEventListener("touchmove",g),window.addEventListener("touchend",g),window.addEventListener("touchend",m))}function m(){b()}function b(){window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",g),window.removeEventListener("mouseup",m),window.removeEventListener("touchmove",g),window.removeEventListener("touchend",g),window.removeEventListener("touchend",m)}function y(x){switch(x.preventDefault(),Iy(x)){case"left":{const _=s.value.s-.01;h({...s.value,s:_>=0?_:0});break}case"right":{const _=s.value.s+.01;h({...s.value,s:_>1?1:_});break}case"up":{const _=s.value.v+.01;h({...s.value,v:_>1?1:_});break}case"down":{const _=s.value.v-.01;h({...s.value,v:_<0?0:_});break}}}return na(()=>{b()}),(x,_)=>(w(),R("div",{class:"vc-saturation-slider bg",style:Dt({background:l.value}),ref_key:"containerRef",ref:d,onMousedown:v,onTouchstart:v,role:"application","aria-label":"Saturation and brightness picker"},[_[1]||(_[1]=T("div",{class:"bg white"},null,-1)),_[2]||(_[2]=T("div",{class:"bg black"},null,-1)),T("div",{class:"picker-wrap",style:Dt({top:c.value,left:u.value}),role:"slider",tabindex:"0","aria-valuemin":"0","aria-valuemax":"1","aria-label":"press arrow to change saturation or brightness","aria-valuenow":"?","aria-valuetext":`saturation: ${s.value.s.toFixed(0)}%, brightness: ${s.value.v.toFixed(0)}%`,onKeydown:y},_[0]||(_[0]=[T("div",{class:"picker"},null,-1)]),44,HR)],36))}}),xu=(t,e)=>{const n=t.__vccOpts||t;for(const[o,r]of e)n[o]=r;return n},UR=xu(WR,[["__scopeId","data-v-4d048d6e"]]),M1=t=>typeof t<"u",GR={class:"vc-base-slider"},qR={key:0,class:"background"},YR=["aria-label","aria-valuemax","aria-valuenow"],jR=le({__name:"BaseSlider",props:{direction:{default:"horizontal"},modelValue:{default:0},value:{default:0},max:{default:100},step:{},ariaLabel:{default:"slider"}},emits:["input","update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=A(()=>n.modelValue??n.value),i=A(()=>{let g=r.value/n.max;return n.direction==="vertical"&&(g=1-g),100*g+"%"}),s=ze(null);function a(g){M1(g)&&(o("input",g),o("update:modelValue",g))}function l(g){const{direction:v,max:m}=n,b=s.value;if(!b)return;const y=b.clientWidth,x=b.clientHeight,{x:_,y:S}=_A(b),{x:N,y:B}=wA(g),k=N-_,L=B-S;let E;v==="vertical"?L<0?E=m:L>x?E=0:E=(1-L/x)*m:k<0?E=0:k>y?E=m:E=k/y*m,a(E)}const c=kA(l);function u(g){l(g),g.type.startsWith("mouse")?(window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)):(window.addEventListener("touchmove",c),window.addEventListener("touchend",d))}function d(){f()}function f(){window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",d),window.removeEventListener("touchmove",c),window.removeEventListener("touchend",d)}function h(g){g.preventDefault();const{direction:v,max:m}=n,b=Iy(g),y=n.step??m/100,x=r.value;let _;switch(b){case"left":{if(v!=="horizontal")return;_=x-y<0?0:x-y;break}case"right":{if(v!=="horizontal")return;_=x+y>m?m:x+y;break}case"down":{if(v!=="vertical")return;_=x-y<0?0:x-y;break}case"up":{if(v!=="vertical")return;_=x+y>m?m:x+y;break}}a(_)}return na(()=>{f()}),(g,v)=>(w(),R("div",GR,[g.$slots.background?(w(),R("div",qR,[Ae(g.$slots,"background",{},void 0,!0)])):se("",!0),T("div",{class:Te({slider:!0,horizontal:g.direction==="horizontal",vertical:g.direction==="vertical"}),ref_key:"containerRef",ref:s,onMousedown:u,onTouchstart:u,role:"slider","aria-label":g.ariaLabel,"aria-valuemax":g.max,"aria-valuemin":"0","aria-valuenow":r.value.toFixed(1),tabindex:"0",onKeydown:h},[T("div",{class:"picker-wrap",style:Dt({left:g.direction==="horizontal"?i.value:0,top:g.direction==="vertical"?i.value:0}),role:"presentation"},[Ae(g.$slots,"picker",{},()=>[v[0]||(v[0]=T("div",{class:"picker"},null,-1))],!0)],4)],42,YR)]))}}),XR=xu(jR,[["__scopeId","data-v-972b0fad"]]),KR=le({__name:"HueSlider",props:{direction:{default:"horizontal"},modelValue:{default:0}},emits:["update:modelValue"],setup(t,{emit:e}){W3(u=>({"2f44f39d":r.value}));const n=t,o=e,r=A(()=>`linear-gradient(to ${n.direction==="horizontal"?"right":"top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`),i=A(()=>{const u=Number(n.modelValue);return Number.isNaN(u)?0:u}),s=ze();je(i,(u,d)=>{u!==0&&u-d>0&&(s.value="right"),u!==0&&u-d<0&&(s.value="left")});const a=A(()=>n.direction==="vertical"?i.value===0&&s.value==="right"?0:i.value:n.direction==="horizontal"?i.value===0&&s.value==="right"?360:i.value:0);function l(u){c(Math.round(u))}function c(u){o("update:modelValue",u)}return(u,d)=>(w(),Q(XR,{class:"vc-hue-slider",max:360,step:1,modelValue:a.value,direction:u.direction,"onUpdate:modelValue":l,"aria-label":"Hue"},{background:J(()=>d[0]||(d[0]=[T("div",{class:"gradient"},null,-1)])),picker:J(()=>[Ae(u.$slots,"default",{},void 0,!0)]),_:3},8,["modelValue","direction"]))}}),SA=xu(KR,[["__scopeId","data-v-5367c985"]]),ZR={class:"vc-editable-input"},QR=["value","aria-label"],JR={key:0,class:"vc-input-desc","aria-hidden":"true"},eF=le({__name:"EditableInput",props:{value:{},label:{},desc:{},max:{},min:{},step:{default:1},a11y:{}},emits:["change","blur"],setup(t,{emit:e}){var u;const n=t,o=e,r=((u=n.a11y)==null?void 0:u.label)??n.label,i=`input__label__${r}__${Math.random().toString().slice(2,5)}`;function s(d){const{min:f,max:h}=n;if(M1(h)&&+d>h){o("change",h);return}if(M1(f)&&+d<f){o("change",f);return}o("change",d)}function a(d){var f;s((f=d.target)==null?void 0:f.value)}function l(d){o("blur",d)}function c(d){let f=Number(n.value);if(!isNaN(f)){let h=n.step;const g=zR(h),v=Iy(d);v==="up"&&(s((f+h).toFixed(g)),d.preventDefault()),v==="down"&&(s((f-h).toFixed(g)),d.preventDefault())}}return(d,f)=>(w(),R("div",ZR,[T("input",{class:"vc-input-input",value:n.value,onKeydown:c,onInput:a,onBlur:l,"aria-label":p(r),id:i},null,40,QR),T("label",{for:i,class:"vc-input-label","aria-hidden":"true"},be(n.label),1),d.desc?(w(),R("span",JR,be(d.desc),1)):se("",!0)]))}}),ml=xu(eF,[["__scopeId","data-v-9c267b2b"]]),W_=t=>nt(t).isValid(),AA=le({__name:"HexInput",props:{value:{},label:{},desc:{},a11y:{},type:{default:"hex"},withHash:{type:Boolean,default:!1}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,r={label:n.type==="hex"?"Hex":"Hex with transparency",...n.a11y},i=(c,u="hex")=>{let d="";return u==="hex"&&(d=nt(c).toHexString()),u==="hex8"&&(d=nt(c).toHex8String()),n.withHash!==!0&&(d=d.replace("#","")),d},s=ze(i(n.value,n.type));je(()=>n.value,c=>{nt.equals(c,s.value)||(s.value=i(c,n.type))});const a=c=>{if(!c)return;s.value=c;let u=c.length;c[0]==="#"&&(u=u-1),!(n.type==="hex"&&u%3!==0&&u!==8)&&(n.type==="hex8"&&u!==8||W_(c)&&o("change",c))},l=()=>{let c=s.value.length;s.value[0]==="#"&&(c=c-1),!(W_(s.value)&&(n.type==="hex"&&c===6||n.type==="hex8"&&c===8))&&(s.value=i(n.value,n.type))};return(c,u)=>(w(),Q(ml,{label:n.label,a11y:r,value:s.value,onChange:a,onBlur:l},null,8,["label","value"]))}});function tF(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return t.charAt(Math.floor(Math.random()*t.length))+t.charAt(Math.floor(Math.random()*t.length))}const nF=t=>{const e=ze(0),n=`__from__vc__hue__${tF()}`;return je(t,o=>{if(o[n])return;const r=o.toHsl().h;r===0&&e.value!==0||(e.value=r)},{immediate:!0}),{hueRef:e,updateHueRef:o=>{const r=nt({...t.value.toHsl(),h:o});r[n]=!0,t.value=r,e.value=o}}},oF={class:"title","aria-hidden":"true"},rF={class:"body"},iF={class:"saturation"},sF={class:"hue"},aF={class:"preview"},lF={class:"preview-label","aria-hidden":"true"},cF={class:"preview-swatches"},uF=["aria-label"],dF=["aria-label"],fF={class:"preview-label","aria-hidden":"true"},hF={key:0,class:"actions"},pF=["aria-label"],mF={class:"fields"},gF=["aria-label"];Ey.concat(["ok","cancel","reset"]);const vF={class:"body",role:"listbox",tabindex:"0","aria-label":"Select a color"},bF=["onClick","aria-label","title","aria-selected","onKeydown"],yF=["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],xF=le({__name:"TwitterPicker",props:{width:{default:276},presetColors:{default:()=>yF},triangle:{default:"top-left"},tinyColor:{},modelValue:{},value:{}},emits:Ey,setup(t,{emit:e}){const n=t,o=Ny(n,e),r=A(()=>o.value.toHexString()),i=l=>l.toLowerCase()===r.value.toLowerCase(),s=l=>{o.value=l},a=l=>{o.value=l};return(l,c)=>(w(),R("div",{class:Te(["vc-twitter-picker",{tri_hide:n.triangle==="hide",tri_top_left:n.triangle==="top-left",tri_top_right:n.triangle==="top-right"}]),style:Dt({width:typeof n.width=="number"?`${n.width}px`:n.width}),role:"application","aria-label":"Twitter color picker"},[c[2]||(c[2]=T("div",{class:"triangle_shadow"},null,-1)),c[3]||(c[3]=T("div",{class:"triangle"},null,-1)),T("div",vF,[(w(!0),R(Ge,null,gt(l.presetColors,(u,d)=>(w(),R("span",{key:d,class:"swatch",style:Dt({background:u,boxShadow:`0 0 4px ${i(u)?u:"transparent"}`}),onClick:f=>s(u),role:"option","aria-label":"color:"+u,title:u,"aria-selected":i(u),onKeydown:nr(f=>s(u),["space"]),tabindex:"0"},null,44,bF))),128)),c[0]||(c[0]=T("div",{class:"hash","aria-hidden":"true"},"#",-1)),H(AA,{value:r.value,onChange:a},null,8,["value"]),c[1]||(c[1]=T("div",{class:"clear"},null,-1))])],6))}}),wF=xu(xF,[["__scopeId","data-v-e74ac697"]]),_F=le({__name:"HueSlider",props:{modelValue:{},value:{}},emits:["input","update:modelValue"],setup(t,{emit:e}){W3(a=>({"46ac36b6":s.value}));const n=e,o=t,r=A(()=>o.modelValue??o.value??0),i=a=>{n("input",a),n("update:modelValue",a)},s=A(()=>`hsl(${r.value}, 100%, 50%)`);return(a,l)=>(w(),Q(SA,Tt({class:"vc-hue-wrap"},a.$attrs,{modelValue:r.value,"onUpdate:modelValue":i}),null,16,["modelValue"]))}}),kF=xu(_F,[["__scopeId","data-v-b3ac1ab2"]]),CA=le({__name:"FormControlColorInputPopover",props:at({target:{},manual:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{},open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:modelValue","update:open"],setup(t){const e=pt(t,"modelValue"),n=t,o=pt(t,"open"),r=mt("contentRef");FI(r,()=>{n.manual&&(o.value=!1)},{detectIframe:!0,ignore:()=>[n.target]});const s=A(()=>nt(e.value).toHsv().h);function a(l){const c=nt({h:l,s:1,v:1}).toHexString();e.value=c}return(l,c)=>(w(),Q(p(L4),{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=u=>o.value=u),target:t.target,placement:"bottom","teleport-to":"body",strategy:"fixed",click:!t.manual,manual:t.manual,"custom-class":"color-picker-popover"},{default:J(()=>[T("div",{ref_key:"contentRef",ref:r},[H(p(wF),{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=u=>e.value=u),triangle:"hide",class:"mb-3"},null,8,["modelValue"]),H(p(kF),{"model-value":p(s),class:"color-picker-popover__hue","onUpdate:modelValue":a},null,8,["model-value"])],512)]),_:1},8,["modelValue","target","click","manual"]))}}),SF={class:"form-control-color-input__wrapper"},AF=["id","value"],CF=le({__name:"FormControlColorInput",props:at({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=mt("swatchRef");function o(i){const s=i.target.value.trim();/^#[0-9a-fA-F]{6}$/.test(s)&&(e.value=s)}function r(i){const s=i.target.value.trim();/^#[0-9a-fA-F]{6}$/.test(s)?e.value=s:i.target.value=e.value}return(i,s)=>{const a=CA,l=Mn;return w(),Q(l,{class:"form-control-color-input",label:t.label,"label-for":t.id},{default:J(()=>[T("div",SF,[T("button",{ref_key:"swatchRef",ref:n,type:"button",class:"form-control-color-input__wrapper__swatch",style:Dt({backgroundColor:e.value})},null,4),T("input",{id:t.id,class:"form-control form-control-color-input__wrapper__field",value:e.value,onInput:o,onChange:r},null,40,AF)]),H(a,{modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=c=>e.value=c),target:p(n)},null,8,["modelValue","target"])]),_:1},8,["label","label-for"])}}}),Na=Be(CF,[["__scopeId","data-v-166af452"]]),$F=["data-d","title"],TF=le({__name:"FormControlDirectionPickerHandle",props:{pos:{},label:{},shape:{},active:{type:Boolean}},emits:["select"],setup(t){const e=t,n=A(()=>`direction-picker-handle--${e.shape}`);return(o,r)=>(w(),R("button",{type:"button",class:Te(["direction-picker-handle",[p(n),{"direction-picker-handle--active":t.active}]]),"data-d":t.pos,title:t.label,onClick:r[0]||(r[0]=gn(i=>o.$emit("select"),["stop","prevent"]))},null,10,$F))}}),MF=Be(TF,[["__scopeId","data-v-ef260532"]]),OF={class:"direction-picker-field"},BF=le({__name:"FormControlDirectionPickerField",props:{x:{},y:{}},setup(t){const e=t,n=A(()=>`${e.x*100}%`),o=A(()=>`${e.y*100}%`),r=A(()=>{let i,s;return e.x===0?i="-1px":e.x===1?i="calc(100% - var(--rect-w) + 1px)":i=`calc(var(--rect-pad) + ${e.x} * (100% - 2 * var(--rect-pad) - var(--rect-w)))`,e.y===0?s="-1px":e.y===1?s="calc(100% - var(--rect-h) + 1px)":s=`calc(var(--rect-pad) + ${e.y} * (100% - 2 * var(--rect-pad) - var(--rect-h)))`,{left:i,top:s}});return(i,s)=>(w(),R("div",OF,[T("div",{class:"direction-picker-field__crosshair-h",style:Dt({top:p(o)})},null,4),T("div",{class:"direction-picker-field__crosshair-v",style:Dt({left:p(n)})},null,4),T("div",{class:"direction-picker-field__rect",style:Dt(p(r))},null,4)]))}}),LF=Be(BF,[["__scopeId","data-v-2f06dda2"]]),PF=le({__name:"FormControlDirectionPicker",props:at({label:{},size:{default:"sm"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,o=[{value:"NW",pos:"nw",label:"Top left",shape:"corner",x:0,y:0},{value:"N",pos:"n",label:"Top",shape:"edge-h",x:.5,y:0},{value:"NE",pos:"ne",label:"Top right",shape:"corner",x:1,y:0},{value:"W",pos:"w",label:"Left",shape:"edge-v",x:0,y:.5},{value:"center",pos:"c",label:"Center",shape:"center",x:.5,y:.5},{value:"E",pos:"e",label:"Right",shape:"edge-v",x:1,y:.5},{value:"SW",pos:"sw",label:"Bottom left",shape:"corner",x:0,y:1},{value:"S",pos:"s",label:"Bottom",shape:"edge-h",x:.5,y:1},{value:"SE",pos:"se",label:"Bottom right",shape:"corner",x:1,y:1}],r=A(()=>o.find(s=>s.value===e.value)??o[4]),i=A(()=>`direction-picker__anchor--${n.size}`);return(s,a)=>{const l=LF,c=MF,u=Mn;return w(),Q(u,{class:"direction-picker",label:t.label},{default:J(()=>[T("div",{class:Te(["direction-picker__anchor",p(i)])},[H(l,{x:p(r).x,y:p(r).y},null,8,["x","y"]),(w(),R(Ge,null,gt(o,d=>H(c,{key:d.value,pos:d.pos,label:d.label,shape:d.shape,active:e.value===d.value,onSelect:f=>e.value=d.value},null,8,["pos","label","shape","active","onSelect"])),64))],2)]),_:1},8,["label"])}}}),$A=Be(PF,[["__scopeId","data-v-37d271a9"]]),DF=le({__name:"DisplayColorSwatch",props:{color:{},bordered:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=A(()=>({"display-color-swatch--sm":e.size==="sm","display-color-swatch--bordered":e.bordered}));return(o,r)=>(w(),R("span",{class:Te(["display-color-swatch",p(n)]),style:Dt({backgroundColor:t.color})},null,6))}}),km=Be(DF,[["__scopeId","data-v-9e199d96"]]),EF={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function NF(t,e){return w(),R("svg",EF,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a8 8 0 0 1-8 8h-80v80a8 8 0 0 1-16 0v-80H40a8 8 0 0 1 0-16h80V40a8 8 0 0 1 16 0v80h80a8 8 0 0 1 8 8"},null,-1)])])}const Ry=Me({name:"ph-plus",render:NF}),IF=le({__name:"ButtonAdd",props:{label:{default:"Add"},size:{default:"default"}},emits:["click"],setup(t){return(e,n)=>{const o=Qn;return w(),Q(o,{"icon-left":p(Ry),label:t.label,variant:"outline-secondary",class:Te(["button-add",{"button-add--sm":t.size==="sm"}]),onClick:n[0]||(n[0]=r=>e.$emit("click"))},{default:J(()=>[Ae(e.$slots,"default",{},void 0,!0)]),_:3},8,["icon-left","label","class"])}}}),$l=Be(IF,[["__scopeId","data-v-fec65d28"]]),RF={class:"d-flex flex-wrap gap-1"},FF=["onClick"],VF={class:"form-control-colors-input__tag__hex"},zF=["aria-label","onClick"],HF=le({__name:"FormControlColorsInput",props:at({label:{},id:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=mt("addBtnRef"),o=Fe("#4e79a7"),r=Fe(-1),i=ze(null),s=Fe(!1);function a(d,f){r.value=d,o.value=e.value[d],i.value=f.currentTarget,s.value=!0}function l(){var d;r.value=-1,o.value="#4e79a7",i.value=((d=n.value)==null?void 0:d.$el)??null,s.value=!0}function c(d){const f=[...e.value];f.splice(d,1),e.value=f}function u(d){if(o.value=d,r.value>=0&&r.value<e.value.length){const f=[...e.value];f[r.value]=d,e.value=f}else e.value=[...e.value,d],s.value=!1}return(d,f)=>{const h=km,g=CA,v=Mn;return w(),Q(v,{class:"form-control-colors-input",label:t.label,"label-for":t.id},{default:J(()=>[T("div",RF,[(w(!0),R(Ge,null,gt(e.value,(m,b)=>(w(),R("span",{key:b,class:"form-control-colors-input__tag"},[T("button",{type:"button",class:"form-control-colors-input__tag__swatch-btn",onClick:y=>a(b,y)},[H(h,{color:m,size:"sm"},null,8,["color"])],8,FF),T("span",VF,be(m),1),T("button",{type:"button",class:"form-control-colors-input__tag__remove","aria-label":`Remove ${m}`,onClick:y=>c(b)}," × ",8,zF)]))),128)),H($l,{id:t.id,ref_key:"addBtnRef",ref:n,size:"sm",onClick:l},null,8,["id"])]),H(g,{open:p(s),"onUpdate:open":f[0]||(f[0]=m=>Ze(s)?s.value=m:null),"model-value":p(o),target:p(i),manual:"","onUpdate:modelValue":u},null,8,["open","model-value","target"])]),_:1},8,["label","label-for"])}}}),WF=Be(HF,[["__scopeId","data-v-b39aae3e"]]),UF={class:"form-control-dropdown-item__content"},GF={class:"form-control-dropdown-item__content__text"},qF={key:1,class:"form-control-dropdown-item__content__visual"},YF=["src"],jF=le({__name:"FormControlDropdownItem",props:{label:{},description:{},visual:{},icon:{},active:{type:Boolean},lightLabel:{type:Boolean}},emits:["select"],setup(t){const e=t,n=A(()=>({"form-control-dropdown-item__content__text__label--bold":!e.lightLabel&&e.label&&e.description})),o=A(()=>({"text-white-50":e.active,"text-secondary":!e.active}));return(r,i)=>{const s=I4;return w(),Q(s,{class:"form-control-dropdown-item",active:t.active,"button-class":"form-control-dropdown-item__button",onClick:i[0]||(i[0]=a=>r.$emit("select"))},{default:J(()=>[T("div",UF,[t.icon?(w(),Q(Gt(t.icon),{key:0,class:"form-control-dropdown-item__content__icon"})):se("",!0),T("div",GF,[T("span",{class:Te(["form-control-dropdown-item__content__text__label",p(n)])},be(t.label),3),t.description?(w(),R("small",{key:0,class:Te(["form-control-dropdown-item__content__text__description",p(o)])},be(t.description),3)):se("",!0)]),t.visual?(w(),R("div",qF,[typeof t.visual!="string"?(w(),Q(Gt(t.visual),{key:0,class:"form-control-dropdown-item__content__visual__image bg-body rounded-1"})):(w(),R("img",{key:1,src:t.visual,alt:"",class:"form-control-dropdown-item__content__visual__image"},null,8,YF))])):se("",!0)])]),_:1},8,["active"])}}}),XF=Be(jF,[["__scopeId","data-v-b5a1db22"]]),KF={key:0,class:"form-control-dropdown__toggle__content"},ZF=le({__name:"FormControlDropdown",props:at({label:{default:void 0},id:{default:void 0},options:{default:()=>[]},block:{type:Boolean,default:!1},lightLabel:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},size:{default:"md"},autoClose:{type:[Boolean,String],default:!0},menuClass:{default:void 0},minMenuWidth:{default:0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,{entries:o}=Cf(vA),r=A(()=>o.value.length>0?o.value:n.options),i=mt("elementRef"),s=UI(i),a=mt("dropdownRef");function l(){var v,m;const{id:h=null}=((m=(v=a.value)==null?void 0:v.$el)==null?void 0:m.querySelector(".dropdown-toggle"))??{};if(!h)return;const g=document.getElementById(`${h}-menu`);g&&(g.style.width=`${Math.max(s.width.value,n.minMenuWidth)}px`)}je(s.width,l);const c=A(()=>({"form-control-dropdown--light-label":n.lightLabel})),u=A(()=>({"form-control-dropdown__toggle--block":n.block})),d=A(()=>r.value.find(h=>h.value===e.value));function f(h){var g;e.value=h,(g=a.value)==null||g.hide()}return(h,g)=>{const v=XF,m=Cy,b=Mn;return w(),Q(b,{ref_key:"elementRef",ref:i,class:Te(["form-control-dropdown",p(c)]),label:t.label,"label-for":t.id,size:t.size},{default:J(()=>{var y;return[Ae(h.$slots,"default",{},void 0,!0),H(m,{ref_key:"dropdownRef",ref:a,class:Te(["form-control-dropdown__toggle",p(u)]),size:t.size,"menu-class":t.menuClass??"form-control-dropdown-menu",text:((y=p(d))==null?void 0:y.label)??t.placeholder??"",disabled:t.disabled,"teleport-to":"body",variant:"outline-secondary","auto-close":t.autoClose,onShow:l,onShown:l},{"button-content":J(()=>[Ae(h.$slots,"button-content",{},()=>{var x,_;return[(x=p(d))!=null&&x.icon?(w(),R("span",KF,[(w(),Q(Gt(p(d).icon),{class:"form-control-dropdown__toggle__icon"})),Xe(" "+be(p(d).label),1)])):(w(),R(Ge,{key:1},[Xe(be(((_=p(d))==null?void 0:_.label)??t.placeholder??""),1)],64))]},!0)]),default:J(()=>[Ae(h.$slots,"menu",{hide:()=>{var x;return(x=p(a))==null?void 0:x.hide()}},()=>[(w(!0),R(Ge,null,gt(p(r),x=>(w(),Q(v,{key:x.value,label:x.label,description:x.description,visual:x.visual,icon:x.icon,active:x.value===e.value,"light-label":t.lightLabel,onSelect:_=>f(x.value)},null,8,["label","description","visual","icon","active","light-label","onSelect"]))),128))],!0)]),_:3},8,["size","menu-class","class","text","disabled","auto-close"])]}),_:3},8,["class","label","label-for","size"])}}}),Nn=Be(ZF,[["__scopeId","data-v-5b435452"]]),QF={class:"form-control-button-group__container__buttons__visual bg-body rounded-1"},JF=["src"],eV=le({__name:"FormControlButtonGroup",props:at({label:{},options:{default:()=>[]},block:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,{entries:o}=Cf(gA),r=A(()=>o.value.length>0?o.value:n.options),i=mt("containerRef"),s=Fe(!1),a=A(()=>({"form-control-button-group__container--block":n.block,"form-control-button-group__container--collapsed":s.value})),l=A(()=>({"form-control-button-group__container__buttons--block":n.block})),c=A(()=>r.value.map(d=>({value:d.value,label:d.text,description:d.description,icon:d.icon,visual:d.visual})));function u(){const d=i.value;if(!d)return;const f=d.querySelectorAll(".btn"),h=Array.from(f).some(g=>g.scrollWidth>g.clientWidth+1);s.value=h||d.scrollWidth>d.clientWidth+1}return ls(i,u),(d,f)=>{const h=Nn,g=Qn,v=ID,m=Mn;return w(),Q(m,{class:"form-control-button-group",label:t.label},{default:J(()=>[p(s)?(w(),Q(h,{key:0,modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=b=>e.value=b),options:p(c),block:"","light-label":"",class:"form-control-button-group__dropdown"},null,8,["modelValue","options"])):se("",!0),T("div",{ref_key:"containerRef",ref:i,class:Te(["form-control-button-group__container",p(a)])},[H(v,{class:Te(["form-control-button-group__container__buttons",p(l)])},{default:J(()=>[(w(!0),R(Ge,null,gt(p(r),b=>(w(),Q(g,{key:b.value,"icon-left":b.icon??b.iconLeft,label:b.text,"hide-label":!b.icon&&!!b.iconLeft,"hide-tooltip":!b.description,"tooltip-label":b.description,"show-tooltip-force":!!b.description,variant:e.value===b.value?"primary":"outline-primary",tabindex:p(s)?-1:void 0,onClick:y=>e.value=b.value},ki({_:2},[b.visual?{name:"start",fn:J(()=>[T("div",QF,[typeof b.visual!="string"?(w(),Q(Gt(b.visual),{key:0,class:"form-control-button-group__container__buttons__visual__content"})):(w(),R("img",{key:1,src:b.visual,alt:"",class:"form-control-button-group__container__buttons__visual__content"},null,8,JF))])]),key:"0"}:void 0]),1032,["icon-left","label","hide-label","hide-tooltip","tooltip-label","show-tooltip-force","variant","tabindex","onClick"]))),128))]),_:1},8,["class"])],2),Ae(d.$slots,"default",{},void 0,!0),Ae(d.$slots,`section:${e.value}`,{},void 0,!0)]),_:3},8,["label"])}}}),Cn=Be(eV,[["__scopeId","data-v-dfd21712"]]),sh=le({__name:"FormControlButtonGroupEntry",props:{value:{},text:{},iconLeft:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=ds(),o=n["icon-left"]?Me(le({render:()=>n["icon-left"]()})):void 0;return mA(gA,()=>({value:e.value,text:e.text,iconLeft:e.iconLeft??o,description:e.description,visual:e.visual,icon:e.icon})),(r,i)=>Ae(r.$slots,"default")}}),tV={class:"form-control-slider-input__row"},nV={key:0,class:"form-control-slider-input__row__suffix"},oV=le({__name:"FormControlSliderInput",props:at({label:{},id:{},min:{default:"0"},max:{default:"100"},step:{default:"1"},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue");return(n,o)=>{const r=ra,i=Mn;return w(),Q(i,{class:"form-control-slider-input",label:t.label,"label-for":t.id},{default:J(()=>[T("div",tV,[H(r,{id:t.id,type:"range","model-value":e.value,min:t.min,max:t.max,step:t.step,class:"form-control-slider-input__row__range","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=String(s))},null,8,["id","model-value","min","max","step"]),H(r,{"model-value":e.value,class:"form-control-slider-input__row__number",size:"sm","onUpdate:modelValue":o[1]||(o[1]=s=>e.value=String(s))},null,8,["model-value"]),Ae(n.$slots,"suffix",{},()=>[t.suffix?(w(),R("small",nV,be(t.suffix),1)):se("",!0)],!0)])]),_:3},8,["label","label-for"])}}}),_r=Be(oV,[["__scopeId","data-v-23b8b888"]]),rV={class:"form-control-units-input__row"},iV={class:"form-control-units-input__row__group"},sV=le({__name:"FormControlUnitsInput",props:at({label:{},id:{},units:{},min:{default:"0"},max:{default:"100"},step:{default:"1"},noSlider:{type:Boolean,default:!1},centerRelative:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t;function o(c){const u=c.match(/^(-?\d*\.?\d+)\s*(%|[a-z]+)?$/i);return u?{num:u[1],unit:u[2]||n.units[0]}:{num:"0",unit:n.units[0]}}const r=A(()=>o(e.value).num),i=A(()=>o(e.value).unit),s=A(()=>i.value==="%"?"100":n.max);function a(c){e.value=`${String(c??"")}${i.value}`}function l(c){const u=i.value,d=parseFloat(r.value),f=parseFloat(n.max);let h=d;u!==c&&f>0&&(n.centerRelative?u==="px"&&c==="%"?h=+((d/f-.5)*100).toFixed(1):u==="%"&&c==="px"&&(h=Math.round((d/100+.5)*f)):u==="px"&&c==="%"?h=Math.round(d/f*100):u==="%"&&c==="px"&&(h=Math.round(d/100*f))),e.value=`${h}${c}`}return(c,u)=>{const d=ra,f=zD,h=Cy,g=Mn;return w(),Q(g,{class:"form-control-units-input",label:t.label,"label-for":t.id},{default:J(()=>[T("div",rV,[t.noSlider?se("",!0):(w(),Q(d,{key:0,id:t.id,type:"range","model-value":p(r),min:t.min,max:p(s),step:t.step,class:"form-control-units-input__row__range","onUpdate:modelValue":a},null,8,["id","model-value","min","max","step"])),T("div",iV,[H(d,{"model-value":p(r),class:"form-control-units-input__row__group__number",size:"sm","onUpdate:modelValue":a},null,8,["model-value"]),H(h,{class:"form-control-units-input__row__group__dropdown",text:p(i),size:"sm",variant:"outline-secondary",end:""},{default:J(()=>[(w(!0),R(Ge,null,gt(t.units,v=>(w(),Q(f,{key:v,active:v===p(i),onClick:m=>l(v)},{default:J(()=>[Xe(be(v),1)]),_:2},1032,["active","onClick"]))),128))]),_:1},8,["text"])])])]),_:1},8,["label","label-for"])}}}),Kh=Be(sV,[["__scopeId","data-v-21f940c0"]]),pc=le({__name:"FormControlDropdownEntry",props:{value:{},label:{},description:{},visual:{},icon:{}},setup(t){const e=t,n=ds(),o=n.icon?Me(le({render:()=>n.icon()})):void 0;return mA(vA,()=>({value:e.value,label:e.label,description:e.description,visual:e.visual,icon:e.icon??o})),(r,i)=>Ae(r.$slots,"default")}}),aV={class:"form-control-text-input__row"},lV={key:0,class:"form-control-text-input__row__suffix"},cV=le({__name:"FormControlTextInput",props:at({label:{},id:{},placeholder:{default:void 0},suffix:{default:void 0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue");return(n,o)=>{const r=ra,i=Mn;return w(),Q(i,{class:"form-control-text-input",label:t.label,"label-for":t.id},{default:J(()=>[T("div",aV,[H(r,{id:t.id,"model-value":e.value,placeholder:t.placeholder,class:"form-control-text-input__row__input","onUpdate:modelValue":o[0]||(o[0]=s=>e.value=String(s))},null,8,["id","model-value","placeholder"]),t.suffix?(w(),R("small",lV,be(t.suffix),1)):se("",!0)])]),_:1},8,["label","label-for"])}}}),Sm=Be(cV,[["__scopeId","data-v-f856cd26"]]),uV={class:"display-palette"},dV=le({__name:"DisplayPalette",props:{colors:{},bordered:{type:Boolean}},setup(t){return(e,n)=>{const o=km;return w(),R("span",uV,[(w(!0),R(Ge,null,gt(t.colors,(r,i)=>(w(),Q(o,{key:i,color:r,bordered:t.bordered,size:"sm"},null,8,["color","bordered"]))),128))])}}}),fV=Be(dV,[["__scopeId","data-v-329d58de"]]),hV={class:"form-control-palette__preview pe-1"},pV={class:"form-control-palette__preview__name flex-grow-1"},mV={class:"form-control-palette__item"},gV={class:"flex-grow-1"},vV=le({__name:"FormControlPalette",props:at({label:{default:void 0},id:{default:void 0},palettes:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,{entries:o}=Cf(tR),r=A(()=>o.value.length>0?o.value:n.palettes),i=mt("dropdownRef");function s(){var f;const c=(f=i.value)==null?void 0:f.$el;if(!c)return;const u=c.querySelector(".dropdown-toggle");if(!(u!=null&&u.id))return;const d=document.getElementById(`${u.id}-menu`);d&&(d.style.width=`${u.offsetWidth}px`)}const a=A(()=>r.value.find(c=>c.value===e.value));function l(c){var u;e.value=c,(u=i.value)==null||u.hide()}return(c,u)=>{const d=fV,f=I4,h=Cy,g=Mn;return w(),Q(g,{class:"form-control-palette",label:t.label,"label-for":t.id},{default:J(()=>[Ae(c.$slots,"default",{},void 0,!0),H(h,{ref_key:"dropdownRef",ref:i,class:"form-control-palette__toggle","toggle-class":"d-flex align-items-center","menu-class":["form-control-dropdown-menu"],variant:"outline-secondary","teleport-to":"body",onShown:s},{"button-content":J(()=>{var v;return[T("span",hV,[T("span",pV,be(((v=p(a))==null?void 0:v.label)??""),1),p(a)?(w(),Q(d,{key:0,colors:p(a).colors,bordered:""},null,8,["colors"])):se("",!0)])]}),default:J(()=>[(w(!0),R(Ge,null,gt(p(r),v=>(w(),Q(f,{key:v.value,active:e.value===v.value,onClick:m=>l(v.value)},{default:J(()=>[T("span",mV,[T("span",gV,be(v.label),1),H(d,{colors:v.colors,bordered:""},null,8,["colors"])])]),_:2},1032,["active","onClick"]))),128))]),_:1},512)]),_:3},8,["label","label-for"])}}}),bV=Be(vV,[["__scopeId","data-v-98c9538c"]]);function yV(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Np(t,e){if(!isFinite(t)||t===0)return null;var n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"),o=t.slice(0,n);return[o.length>1?o[0]+o.slice(2):o,+t.slice(n+1)]}function nu(t){return t=Np(Math.abs(t)),t?t[1]:NaN}function xV(t,e){return function(n,o){for(var r=n.length,i=[],s=0,a=t[0],l=0;r>0&&a>0&&(l+a+1>o&&(a=Math.max(1,o-l)),i.push(n.substring(r-=a,r+a)),!((l+=a+1)>o));)a=t[s=(s+1)%t.length];return i.reverse().join(e)}}function wV(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var _V=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ip(t){if(!(e=_V.exec(t)))throw new Error("invalid format: "+t);var e;return new Fy({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]})}Ip.prototype=Fy.prototype;function Fy(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+""}Fy.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 kV(t){e:for(var e=t.length,n=1,o=-1,r;n<e;++n)switch(t[n]){case".":o=r=n;break;case"0":o===0&&(o=n),r=n;break;default:if(!+t[n])break e;o>0&&(o=0);break}return o>0?t.slice(0,o)+t.slice(r+1):t}var Rp;function SV(t,e){var n=Np(t,e);if(!n)return Rp=void 0,t.toPrecision(e);var o=n[0],r=n[1],i=r-(Rp=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,s=o.length;return i===s?o:i>s?o+new Array(i-s+1).join("0"):i>0?o.slice(0,i)+"."+o.slice(i):"0."+new Array(1-i).join("0")+Np(t,Math.max(0,e+i-1))[0]}function U_(t,e){var n=Np(t,e);if(!n)return t+"";var o=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+o:o.length>r+1?o.slice(0,r+1)+"."+o.slice(r+1):o+new Array(r-o.length+2).join("0")}const G_={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:yV,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)=>U_(t*100,e),r:U_,s:SV,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function q_(t){return t}var Y_=Array.prototype.map,j_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function AV(t){var e=t.grouping===void 0||t.thousands===void 0?q_:xV(Y_.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",o=t.currency===void 0?"":t.currency[1]+"",r=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?q_:wV(Y_.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",a=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function c(d,f){d=Ip(d);var h=d.fill,g=d.align,v=d.sign,m=d.symbol,b=d.zero,y=d.width,x=d.comma,_=d.precision,S=d.trim,N=d.type;N==="n"?(x=!0,N="g"):G_[N]||(_===void 0&&(_=12),S=!0,N="g"),(b||h==="0"&&g==="=")&&(b=!0,h="0",g="=");var B=(f&&f.prefix!==void 0?f.prefix:"")+(m==="$"?n:m==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():""),k=(m==="$"?o:/[%p]/.test(N)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),L=G_[N],E=/[defgprs%]/.test(N);_=_===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function I(C){var $=B,P=k,M,F,V;if(N==="c")P=L(C)+P,C="";else{C=+C;var G=C<0||1/C<0;if(C=isNaN(C)?l:L(Math.abs(C),_),S&&(C=kV(C)),G&&+C==0&&v!=="+"&&(G=!1),$=(G?v==="("?v:a:v==="-"||v==="("?"":v)+$,P=(N==="s"&&!isNaN(C)&&Rp!==void 0?j_[8+Rp/3]:"")+P+(G&&v==="("?")":""),E){for(M=-1,F=C.length;++M<F;)if(V=C.charCodeAt(M),48>V||V>57){P=(V===46?r+C.slice(M+1):C.slice(M))+P,C=C.slice(0,M);break}}}x&&!b&&(C=e(C,1/0));var K=$.length+C.length+P.length,ue=K<y?new Array(y-K+1).join(h):"";switch(x&&b&&(C=e(ue+C,ue.length?y-P.length:1/0),ue=""),g){case"<":C=$+C+P+ue;break;case"=":C=$+ue+C+P;break;case"^":C=ue.slice(0,K=ue.length>>1)+$+C+P+ue.slice(K);break;default:C=ue+$+C+P;break}return i(C)}return I.toString=function(){return d+""},I}function u(d,f){var h=Math.max(-8,Math.min(8,Math.floor(nu(f)/3)))*3,g=Math.pow(10,-h),v=c((d=Ip(d),d.type="f",d),{suffix:j_[8+h/3]});return function(m){return v(g*m)}}return{format:c,formatPrefix:u}}var ah,wu,TA;CV({thousands:",",grouping:[3],currency:["$",""]});function CV(t){return ah=AV(t),wu=ah.format,TA=ah.formatPrefix,ah}function $V(t){return Math.max(0,-nu(Math.abs(t)))}function TV(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nu(e)/3)))*3-nu(Math.abs(t)))}function MV(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,nu(e)-nu(t))+1}const MA={prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0};function Vy(t){let e="";return t.negStyle==="paren"&&(e+="("),t.thousandsSep&&(e+=","),t.decimals==="auto"?e+="~":e+=`.${t.decimals}`,e+=t.scale==="%"?"%":"f",e}function ov(t){const e=Vy(t);return t.prefix||t.suffix?`${t.prefix}|${e}|${t.suffix}`:e}function OV(t){const e={...MA};if(!t)return e;let n=t;if(t.includes("|")){const o=t.split("|");e.prefix=o[0]??"",n=o[1]??"",e.suffix=o[2]??""}else e.prefix="",e.suffix="";if(n.startsWith("(")&&(e.negStyle="paren",n=n.slice(1),n.endsWith(")")&&(n=n.slice(0,-1))),e.thousandsSep=n.includes(","),n=n.replace(",",""),n.includes("~"))e.decimals="auto";else{const o=n.match(/\.(\d+)/);o&&(e.decimals=o[1])}return n.endsWith("%")?e.scale="%":e.scale="none",e}function BV(t,e){try{const n=Vy(e),o=wu(n)(Math.abs(t)),r=`${e.prefix}${o}${e.suffix}`;return t<0?e.negStyle==="paren"?`(${r})`:`−${r}`:r}catch{return String(t)}}const LV={class:"form-control-number-format__popover"},PV={class:"form-control-number-format__popover__preview"},DV={class:"form-control-number-format__popover__preview__cell__label"},EV={class:"form-control-number-format__popover__body"},NV={class:"form-control-number-format__popover__body__chips"},IV=["onClick"],RV={class:"form-control-number-format__popover__body__grid-2"},FV={class:"form-control-number-format__popover__body__btn-group"},VV=["onClick"],zV={class:"form-control-number-format__popover__body__btn-group"},HV=["onClick"],WV={class:"form-control-number-format__popover__body__check-row"},UV={class:"form-control-number-format__popover__body__d3-row"},GV={class:"form-control-number-format__popover__body__d3-row__value"},qV=le({__name:"FormControlNumberFormat",props:at({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=["0","1","2","3","auto"],o=[{id:"minus",label:"−1,234"},{id:"paren",label:"(1,234)"}],r=[{value:-1234.5,label:"neg",cls:"form-control-number-format__popover__preview__cell__value--neg"},{value:0,label:"zero",cls:"form-control-number-format__popover__preview__cell__value--zero"},{value:9876543,label:"pos",cls:""}],i=[{label:"1,234",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"1,234.56",config:{prefix:"",suffix:"",decimals:"2",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"1234",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!1}},{label:"12%",config:{prefix:"",suffix:"%",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!1}},{label:"$1,234",config:{prefix:"$",suffix:"",decimals:"0",scale:"none",negStyle:"minus",thousandsSep:!0}},{label:"(1,234)",config:{prefix:"",suffix:"",decimals:"0",scale:"none",negStyle:"paren",thousandsSep:!0}}],s=ar({...MA}),a=Fe(null);je(()=>e.value,m=>{m!==ov(s)&&Object.assign(s,OV(m??""))},{immediate:!0});const l=A(()=>Vy(s)),c=A(()=>e.value||"auto");function u(){a.value=null,e.value=ov(s)}function d(m){s.decimals=m,u()}function f(m){s.negStyle=m,u()}function h(m){Object.assign(s,{...m.config}),a.value=m.label,e.value=ov(s)}function g(m){return BV(m,s)}const v=A(()=>r.map(m=>({...m,formatted:g(m.value)})));return(m,b)=>{const y=Nn;return w(),Q(y,{id:t.id,modelValue:e.value,"onUpdate:modelValue":b[4]||(b[4]=x=>e.value=x),label:t.label,block:t.block,placeholder:"auto","auto-close":"outside","menu-class":"form-control-number-format-menu","min-menu-width":260},{"button-content":J(()=>[T("span",{class:Te(["form-control-number-format__trigger-text",{"text-secondary":!e.value}])},be(p(c)),3)]),menu:J(()=>[T("div",LV,[T("div",PV,[(w(!0),R(Ge,null,gt(p(v),(x,_)=>(w(),R("div",{key:_,class:"form-control-number-format__popover__preview__cell"},[T("div",DV,be(x.label),1),T("div",{class:Te(["form-control-number-format__popover__preview__cell__value",x.cls])},be(x.formatted),3)]))),128))]),T("div",EV,[T("div",null,[b[5]||(b[5]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Presets ",-1)),T("div",NV,[(w(),R(Ge,null,gt(i,x=>T("button",{key:x.label,class:Te(["form-control-number-format__popover__body__chips__chip",{"form-control-number-format__popover__body__chips__chip--active":p(a)===x.label}]),onClick:_=>h(x)},be(x.label),11,IV)),64))])]),b[12]||(b[12]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",RV,[T("div",null,[b[6]||(b[6]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Prefix ",-1)),sr(T("input",{"onUpdate:modelValue":b[0]||(b[0]=x=>p(s).prefix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. $",onInput:u},null,544),[[Ap,p(s).prefix]])]),T("div",null,[b[7]||(b[7]=T("div",{class:"form-control-number-format__popover__body__grid-2__field-label"}," Suffix ",-1)),sr(T("input",{"onUpdate:modelValue":b[1]||(b[1]=x=>p(s).suffix=x),class:"form-control-number-format__popover__body__grid-2__input",placeholder:"e.g. %",onInput:u},null,544),[[Ap,p(s).suffix]])])]),T("div",null,[b[8]||(b[8]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Decimal places ",-1)),T("div",FV,[(w(),R(Ge,null,gt(n,x=>T("button",{key:x,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).decimals===x}]),onClick:_=>d(x)},be(x),11,VV)),64))])]),T("div",null,[b[9]||(b[9]=T("div",{class:"form-control-number-format__popover__body__section-label"}," Negatives ",-1)),T("div",zV,[(w(),R(Ge,null,gt(o,x=>T("button",{key:x.id,class:Te(["form-control-number-format__popover__body__btn-group__btn",{"form-control-number-format__popover__body__btn-group__btn--active":p(s).negStyle===x.id}]),onClick:_=>f(x.id)},be(x.label),11,HV)),64))])]),T("label",WV,[sr(T("input",{"onUpdate:modelValue":b[2]||(b[2]=x=>p(s).thousandsSep=x),type:"checkbox",class:"form-control-number-format__popover__body__check-row__checkbox",onChange:b[3]||(b[3]=x=>u())},null,544),[[U3,p(s).thousandsSep]]),b[10]||(b[10]=T("span",null,"Thousands separator",-1))]),b[13]||(b[13]=T("hr",{class:"form-control-number-format__popover__body__sep"},null,-1)),T("div",UV,[b[11]||(b[11]=T("span",{class:"form-control-number-format__popover__body__d3-row__label"},"d3·fmt",-1)),T("span",GV,be(p(l)),1)])])])]),_:1},8,["id","modelValue","label","block"])}}}),YV=Be(qV,[["__scopeId","data-v-959c1f3d"]]),rv=new Date,iv=new Date;function hs(t,e,n,o){function r(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return r.floor=i=>(t(i=new Date(+i)),i),r.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),r.round=i=>{const s=r(i),a=r.ceil(i);return i-s<a-i?s:a},r.offset=(i,s)=>(e(i=new Date(+i),s==null?1:Math.floor(s)),i),r.range=(i,s,a)=>{const l=[];if(i=r.ceil(i),a=a==null?1:Math.floor(a),!(i<s)||!(a>0))return l;let c;do l.push(c=new Date(+i)),e(i,a),t(i);while(c<i&&i<s);return l},r.filter=i=>hs(s=>{if(s>=s)for(;t(s),!i(s);)s.setTime(s-1)},(s,a)=>{if(s>=s)if(a<0)for(;++a<=0;)for(;e(s,-1),!i(s););else for(;--a>=0;)for(;e(s,1),!i(s););}),n&&(r.count=(i,s)=>(rv.setTime(+i),iv.setTime(+s),t(rv),t(iv),Math.floor(n(rv,iv))),r.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?r.filter(o?s=>o(s)%i===0:s=>r.count(0,s)%i===0):r)),r}const jV=1e3,zy=jV*60,XV=zy*60,Zd=XV*24,OA=Zd*7,Hy=hs(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*zy)/Zd,t=>t.getDate()-1);Hy.range;const Wy=hs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zd,t=>t.getUTCDate()-1);Wy.range;const KV=hs(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zd,t=>Math.floor(t/Zd));KV.range;function ec(t){return hs(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())*zy)/OA)}const BA=ec(0),Fp=ec(1),ZV=ec(2),QV=ec(3),ou=ec(4),JV=ec(5),ez=ec(6);BA.range;Fp.range;ZV.range;QV.range;ou.range;JV.range;ez.range;function tc(t){return hs(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)/OA)}const LA=tc(0),Vp=tc(1),tz=tc(2),nz=tc(3),ru=tc(4),oz=tc(5),rz=tc(6);LA.range;Vp.range;tz.range;nz.range;ru.range;oz.range;rz.range;const Il=hs(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());Il.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:hs(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)});Il.range;const Rl=hs(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());Rl.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:hs(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)});Rl.range;function Zh(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function iz(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function PA(t){let e,n,o;t.length!==2?(e=Zh,n=(a,l)=>Zh(t(a),l),o=(a,l)=>t(a)-l):(e=t===Zh||t===iz?t:sz,n=t,o=t);function r(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<0?c=d+1:u=d}while(c<u)}return c}function i(a,l,c=0,u=a.length){if(c<u){if(e(l,l)!==0)return u;do{const d=c+u>>>1;n(a[d],l)<=0?c=d+1:u=d}while(c<u)}return c}function s(a,l,c=0,u=a.length){const d=r(a,l,c,u-1);return d>c&&o(a[d-1],l)>-o(a[d],l)?d-1:d}return{left:r,center:s,right:i}}function sz(){return 0}function az(t){return t===null?NaN:+t}const lz=PA(Zh),cz=lz.right,uz=PA(az).center;class O1 extends Map{constructor(e,n=hz){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[o,r]of e)this.set(o,r)}get(e){return super.get(X_(this,e))}has(e){return super.has(X_(this,e))}set(e,n){return super.set(dz(this,e),n)}delete(e){return super.delete(fz(this,e))}}function X_({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):n}function dz({_intern:t,_key:e},n){const o=e(n);return t.has(o)?t.get(o):(t.set(o,n),n)}function fz({_intern:t,_key:e},n){const o=e(n);return t.has(o)&&(n=t.get(o),t.delete(o)),n}function hz(t){return t!==null&&typeof t=="object"?t.valueOf():t}function pz(t){return t}function DA(t,e,...n){return mz(t,pz,e,n)}function mz(t,e,n,o){return(function r(i,s){if(s>=o.length)return n(i);const a=new O1,l=o[s++];let c=-1;for(const u of i){const d=l(u,++c,i),f=a.get(d);f?f.push(u):a.set(d,[u])}for(const[u,d]of a)a.set(u,r(d,s));return e(a)})(t,0)}const gz=Math.sqrt(50),vz=Math.sqrt(10),bz=Math.sqrt(2);function zp(t,e,n){const o=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(o)),i=o/Math.pow(10,r),s=i>=gz?10:i>=vz?5:i>=bz?2:1;let a,l,c;return r<0?(c=Math.pow(10,-r)/s,a=Math.round(t*c),l=Math.round(e*c),a/c<t&&++a,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*s,a=Math.round(t/c),l=Math.round(e/c),a*c<t&&++a,l*c>e&&--l),l<a&&.5<=n&&n<2?zp(t,e,n*2):[a,l,c]}function yz(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const o=e<t,[r,i,s]=o?zp(e,t,n):zp(t,e,n);if(!(i>=r))return[];const a=i-r+1,l=new Array(a);if(o)if(s<0)for(let c=0;c<a;++c)l[c]=(i-c)/-s;else for(let c=0;c<a;++c)l[c]=(i-c)*s;else if(s<0)for(let c=0;c<a;++c)l[c]=(r+c)/-s;else for(let c=0;c<a;++c)l[c]=(r+c)*s;return l}function B1(t,e,n){return e=+e,t=+t,n=+n,zp(t,e,n)[2]}function xz(t,e,n){e=+e,t=+t,n=+n;const o=e<t,r=o?B1(e,t,n):B1(t,e,n);return(o?-1:1)*(r<0?1/-r:r)}function Fl(t,e){let n;if(e===void 0)for(const o of t)o!=null&&(n<o||n===void 0&&o>=o)&&(n=o);else{let o=-1;for(let r of t)(r=e(r,++o,t))!=null&&(n<r||n===void 0&&r>=r)&&(n=r)}return n}function wz(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var o=-1,r=Math.max(0,Math.ceil((e-t)/n))|0,i=new Array(r);++o<r;)i[o]=t+o*n;return i}function EA(t,e){let n=0;if(e===void 0)for(let o of t)(o=+o)&&(n+=o);else{let o=-1;for(let r of t)(r=+e(r,++o,t))&&(n+=r)}return n}function sv(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function av(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ju(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function _z(t){var e=t.dateTime,n=t.date,o=t.time,r=t.periods,i=t.days,s=t.shortDays,a=t.months,l=t.shortMonths,c=Xu(r),u=Ku(r),d=Xu(i),f=Ku(i),h=Xu(s),g=Ku(s),v=Xu(a),m=Ku(a),b=Xu(l),y=Ku(l),x={a:V,A:G,b:K,B:ue,c:null,d:t8,e:t8,f:Gz,g:tH,G:oH,H:Hz,I:Wz,j:Uz,L:NA,m:qz,M:Yz,p:de,q:he,Q:r8,s:i8,S:jz,u:Xz,U:Kz,V:Zz,w:Qz,W:Jz,x:null,X:null,y:eH,Y:nH,Z:rH,"%":o8},_={a:ge,A:ee,b:fe,B:xe,c:null,d:n8,e:n8,f:lH,g:bH,G:xH,H:iH,I:sH,j:aH,L:RA,m:cH,M:uH,p:Z,q:pe,Q:r8,s:i8,S:dH,u:fH,U:hH,V:pH,w:mH,W:gH,x:null,X:null,y:vH,Y:yH,Z:wH,"%":o8},S={a:E,A:I,b:C,B:$,c:P,d:J_,e:J_,f:Rz,g:Q_,G:Z_,H:e8,I:e8,j:Dz,L:Iz,m:Pz,M:Ez,p:L,q:Lz,Q:Vz,s:zz,S:Nz,u:$z,U:Tz,V:Mz,w:Cz,W:Oz,x:M,X:F,y:Q_,Y:Z_,Z:Bz,"%":Fz};x.x=N(n,x),x.X=N(o,x),x.c=N(e,x),_.x=N(n,_),_.X=N(o,_),_.c=N(e,_);function N(oe,ve){return function(ce){var D=[],W=-1,j=0,ne=oe.length,ie,ae,te;for(ce instanceof Date||(ce=new Date(+ce));++W<ne;)oe.charCodeAt(W)===37&&(D.push(oe.slice(j,W)),(ae=K_[ie=oe.charAt(++W)])!=null?ie=oe.charAt(++W):ae=ie==="e"?" ":"0",(te=ve[ie])&&(ie=te(ce,ae)),D.push(ie),j=W+1);return D.push(oe.slice(j,W)),D.join("")}}function B(oe,ve){return function(ce){var D=ju(1900,void 0,1),W=k(D,oe,ce+="",0),j,ne;if(W!=ce.length)return null;if("Q"in D)return new Date(D.Q);if("s"in D)return new Date(D.s*1e3+("L"in D?D.L:0));if(ve&&!("Z"in D)&&(D.Z=0),"p"in D&&(D.H=D.H%12+D.p*12),D.m===void 0&&(D.m="q"in D?D.q:0),"V"in D){if(D.V<1||D.V>53)return null;"w"in D||(D.w=1),"Z"in D?(j=av(ju(D.y,0,1)),ne=j.getUTCDay(),j=ne>4||ne===0?Vp.ceil(j):Vp(j),j=Wy.offset(j,(D.V-1)*7),D.y=j.getUTCFullYear(),D.m=j.getUTCMonth(),D.d=j.getUTCDate()+(D.w+6)%7):(j=sv(ju(D.y,0,1)),ne=j.getDay(),j=ne>4||ne===0?Fp.ceil(j):Fp(j),j=Hy.offset(j,(D.V-1)*7),D.y=j.getFullYear(),D.m=j.getMonth(),D.d=j.getDate()+(D.w+6)%7)}else("W"in D||"U"in D)&&("w"in D||(D.w="u"in D?D.u%7:"W"in D?1:0),ne="Z"in D?av(ju(D.y,0,1)).getUTCDay():sv(ju(D.y,0,1)).getDay(),D.m=0,D.d="W"in D?(D.w+6)%7+D.W*7-(ne+5)%7:D.w+D.U*7-(ne+6)%7);return"Z"in D?(D.H+=D.Z/100|0,D.M+=D.Z%100,av(D)):sv(D)}}function k(oe,ve,ce,D){for(var W=0,j=ve.length,ne=ce.length,ie,ae;W<j;){if(D>=ne)return-1;if(ie=ve.charCodeAt(W++),ie===37){if(ie=ve.charAt(W++),ae=S[ie in K_?ve.charAt(W++):ie],!ae||(D=ae(oe,ce,D))<0)return-1}else if(ie!=ce.charCodeAt(D++))return-1}return D}function L(oe,ve,ce){var D=c.exec(ve.slice(ce));return D?(oe.p=u.get(D[0].toLowerCase()),ce+D[0].length):-1}function E(oe,ve,ce){var D=h.exec(ve.slice(ce));return D?(oe.w=g.get(D[0].toLowerCase()),ce+D[0].length):-1}function I(oe,ve,ce){var D=d.exec(ve.slice(ce));return D?(oe.w=f.get(D[0].toLowerCase()),ce+D[0].length):-1}function C(oe,ve,ce){var D=b.exec(ve.slice(ce));return D?(oe.m=y.get(D[0].toLowerCase()),ce+D[0].length):-1}function $(oe,ve,ce){var D=v.exec(ve.slice(ce));return D?(oe.m=m.get(D[0].toLowerCase()),ce+D[0].length):-1}function P(oe,ve,ce){return k(oe,e,ve,ce)}function M(oe,ve,ce){return k(oe,n,ve,ce)}function F(oe,ve,ce){return k(oe,o,ve,ce)}function V(oe){return s[oe.getDay()]}function G(oe){return i[oe.getDay()]}function K(oe){return l[oe.getMonth()]}function ue(oe){return a[oe.getMonth()]}function de(oe){return r[+(oe.getHours()>=12)]}function he(oe){return 1+~~(oe.getMonth()/3)}function ge(oe){return s[oe.getUTCDay()]}function ee(oe){return i[oe.getUTCDay()]}function fe(oe){return l[oe.getUTCMonth()]}function xe(oe){return a[oe.getUTCMonth()]}function Z(oe){return r[+(oe.getUTCHours()>=12)]}function pe(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var ve=N(oe+="",x);return ve.toString=function(){return oe},ve},parse:function(oe){var ve=B(oe+="",!1);return ve.toString=function(){return oe},ve},utcFormat:function(oe){var ve=N(oe+="",_);return ve.toString=function(){return oe},ve},utcParse:function(oe){var ve=B(oe+="",!0);return ve.toString=function(){return oe},ve}}}var K_={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,kz=/^%/,Sz=/[\\^$*+?|[\]().{}]/g;function qt(t,e,n){var o=t<0?"-":"",r=(o?-t:t)+"",i=r.length;return o+(i<n?new Array(n-i+1).join(e)+r:r)}function Az(t){return t.replace(Sz,"\\$&")}function Xu(t){return new RegExp("^(?:"+t.map(Az).join("|")+")","i")}function Ku(t){return new Map(t.map((e,n)=>[e.toLowerCase(),n]))}function Cz(t,e,n){var o=eo.exec(e.slice(n,n+1));return o?(t.w=+o[0],n+o[0].length):-1}function $z(t,e,n){var o=eo.exec(e.slice(n,n+1));return o?(t.u=+o[0],n+o[0].length):-1}function Tz(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.U=+o[0],n+o[0].length):-1}function Mz(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.V=+o[0],n+o[0].length):-1}function Oz(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.W=+o[0],n+o[0].length):-1}function Z_(t,e,n){var o=eo.exec(e.slice(n,n+4));return o?(t.y=+o[0],n+o[0].length):-1}function Q_(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.y=+o[0]+(+o[0]>68?1900:2e3),n+o[0].length):-1}function Bz(t,e,n){var o=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return o?(t.Z=o[1]?0:-(o[2]+(o[3]||"00")),n+o[0].length):-1}function Lz(t,e,n){var o=eo.exec(e.slice(n,n+1));return o?(t.q=o[0]*3-3,n+o[0].length):-1}function Pz(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.m=o[0]-1,n+o[0].length):-1}function J_(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.d=+o[0],n+o[0].length):-1}function Dz(t,e,n){var o=eo.exec(e.slice(n,n+3));return o?(t.m=0,t.d=+o[0],n+o[0].length):-1}function e8(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.H=+o[0],n+o[0].length):-1}function Ez(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.M=+o[0],n+o[0].length):-1}function Nz(t,e,n){var o=eo.exec(e.slice(n,n+2));return o?(t.S=+o[0],n+o[0].length):-1}function Iz(t,e,n){var o=eo.exec(e.slice(n,n+3));return o?(t.L=+o[0],n+o[0].length):-1}function Rz(t,e,n){var o=eo.exec(e.slice(n,n+6));return o?(t.L=Math.floor(o[0]/1e3),n+o[0].length):-1}function Fz(t,e,n){var o=kz.exec(e.slice(n,n+1));return o?n+o[0].length:-1}function Vz(t,e,n){var o=eo.exec(e.slice(n));return o?(t.Q=+o[0],n+o[0].length):-1}function zz(t,e,n){var o=eo.exec(e.slice(n));return o?(t.s=+o[0],n+o[0].length):-1}function t8(t,e){return qt(t.getDate(),e,2)}function Hz(t,e){return qt(t.getHours(),e,2)}function Wz(t,e){return qt(t.getHours()%12||12,e,2)}function Uz(t,e){return qt(1+Hy.count(Il(t),t),e,3)}function NA(t,e){return qt(t.getMilliseconds(),e,3)}function Gz(t,e){return NA(t,e)+"000"}function qz(t,e){return qt(t.getMonth()+1,e,2)}function Yz(t,e){return qt(t.getMinutes(),e,2)}function jz(t,e){return qt(t.getSeconds(),e,2)}function Xz(t){var e=t.getDay();return e===0?7:e}function Kz(t,e){return qt(BA.count(Il(t)-1,t),e,2)}function IA(t){var e=t.getDay();return e>=4||e===0?ou(t):ou.ceil(t)}function Zz(t,e){return t=IA(t),qt(ou.count(Il(t),t)+(Il(t).getDay()===4),e,2)}function Qz(t){return t.getDay()}function Jz(t,e){return qt(Fp.count(Il(t)-1,t),e,2)}function eH(t,e){return qt(t.getFullYear()%100,e,2)}function tH(t,e){return t=IA(t),qt(t.getFullYear()%100,e,2)}function nH(t,e){return qt(t.getFullYear()%1e4,e,4)}function oH(t,e){var n=t.getDay();return t=n>=4||n===0?ou(t):ou.ceil(t),qt(t.getFullYear()%1e4,e,4)}function rH(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+qt(e/60|0,"0",2)+qt(e%60,"0",2)}function n8(t,e){return qt(t.getUTCDate(),e,2)}function iH(t,e){return qt(t.getUTCHours(),e,2)}function sH(t,e){return qt(t.getUTCHours()%12||12,e,2)}function aH(t,e){return qt(1+Wy.count(Rl(t),t),e,3)}function RA(t,e){return qt(t.getUTCMilliseconds(),e,3)}function lH(t,e){return RA(t,e)+"000"}function cH(t,e){return qt(t.getUTCMonth()+1,e,2)}function uH(t,e){return qt(t.getUTCMinutes(),e,2)}function dH(t,e){return qt(t.getUTCSeconds(),e,2)}function fH(t){var e=t.getUTCDay();return e===0?7:e}function hH(t,e){return qt(LA.count(Rl(t)-1,t),e,2)}function FA(t){var e=t.getUTCDay();return e>=4||e===0?ru(t):ru.ceil(t)}function pH(t,e){return t=FA(t),qt(ru.count(Rl(t),t)+(Rl(t).getUTCDay()===4),e,2)}function mH(t){return t.getUTCDay()}function gH(t,e){return qt(Vp.count(Rl(t)-1,t),e,2)}function vH(t,e){return qt(t.getUTCFullYear()%100,e,2)}function bH(t,e){return t=FA(t),qt(t.getUTCFullYear()%100,e,2)}function yH(t,e){return qt(t.getUTCFullYear()%1e4,e,4)}function xH(t,e){var n=t.getUTCDay();return t=n>=4||n===0?ru(t):ru.ceil(t),qt(t.getUTCFullYear()%1e4,e,4)}function wH(){return"+0000"}function o8(){return"%"}function r8(t){return+t}function i8(t){return Math.floor(+t/1e3)}var mc,Qd;_H({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 _H(t){return mc=_z(t),Qd=mc.format,mc.parse,mc.utcFormat,mc.utcParse,mc}const Tf=[{label:"(automatic)",fmt:"(automatic)"},{label:"Year only",fmt:"YYYY",d3:"%Y"},{label:"Short year",fmt:"'YY",d3:"'%y"},{label:"Quarter",fmt:"Q",d3:"%Y Q%q"},{label:"Month abbr.",fmt:"MMM",d3:"%b"},{label:"Month + year",fmt:"MMM 'YY",d3:"%b '%y"},{label:"Full month",fmt:"MMMM",d3:"%B"},{label:"Month + day",fmt:"MMMM D",d3:"%B %-d"},{label:"Full date",fmt:"MMMM D, YYYY",d3:"%B %-d, %Y"},{label:"MM/DD/YYYY",fmt:"MM/DD/YYYY",d3:"%m/%d/%Y"},{label:"DD/MM/YYYY",fmt:"DD/MM/YYYY",d3:"%d/%m/%Y"},{label:"ISO 8601",fmt:"YYYY-MM-DD",d3:"%Y-%m-%d"},{label:"(custom)",fmt:"(custom)"}],VA=[new Date(2015,0,1),new Date(2016,0,1),new Date(2017,0,1)];function zA(t,e){if(t.includes("%q")){const n=Math.floor(e.getMonth()/3)+1;return Qd(t.replace("%q",String(n)))(e)}return Qd(t)(e)}function s8(t){if(t==="(automatic)")return"auto — adapts to data";if(t==="(custom)")return null;const e=Tf.find(n=>n.fmt===t);return e!=null&&e.d3?VA.map(n=>zA(e.d3,n)).join(" · "):null}function kH(t){if(t==="(automatic)")return"";const e=Tf.find(n=>n.fmt===t);return(e==null?void 0:e.d3)??""}function SH(t){if(!t)return"";try{return VA.map(e=>zA(t,e)).join(" · ")}catch{return"(invalid format)"}}function AH(t,e,n){if(!t)return"(automatic)";if(e==="(custom)")return n||"(custom)";const o=Tf.find(r=>r.d3===t);return(o==null?void 0:o.label)??t}function CH(t){if(!t)return{selectedPreset:"(automatic)",customStr:""};const e=Tf.find(n=>n.d3===t);return e?{selectedPreset:e.fmt,customStr:""}:{selectedPreset:"(custom)",customStr:t}}const $H={class:"form-control-date-format__popover"},TH={class:"form-control-date-format__popover__list"},MH=["onClick"],OH={class:"form-control-date-format__popover__list__item__body"},BH={class:"form-control-date-format__popover__list__item__body__label"},LH={key:0,class:"form-control-date-format__popover__list__item__body__ticks"},PH={key:0,class:"form-control-date-format__popover__list__item__check"},DH={key:0,class:"form-control-date-format__popover__custom"},EH={class:"form-control-date-format__popover__custom__preview"},NH={class:"form-control-date-format__popover__custom__preview__value"},IH=le({__name:"FormControlDateFormat",props:at({label:{default:void 0},id:{default:void 0},block:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=Fe("(automatic)"),o=Fe(""),r=A(()=>SH(o.value)),i=A(()=>AH(e.value,n.value,o.value));function s(l,c){n.value=l,l!=="(custom)"&&(e.value=kH(l),c())}function a(){e.value=o.value}return je(()=>e.value,l=>{const c=CH(l);n.value=c.selectedPreset,o.value=c.customStr},{immediate:!0}),(l,c)=>{const u=Nn;return w(),Q(u,{id:t.id,modelValue:e.value,"onUpdate:modelValue":c[1]||(c[1]=d=>e.value=d),label:t.label,block:t.block,placeholder:"(automatic)","auto-close":"outside","menu-class":"form-control-date-format-menu","min-menu-width":260},{"button-content":J(()=>[T("span",{class:Te(["form-control-date-format__trigger-text",{"text-secondary":!e.value}])},be(p(i)),3)]),menu:J(({hide:d})=>[T("div",$H,[T("div",TH,[(w(!0),R(Ge,null,gt(p(Tf),f=>(w(),R("div",{key:f.fmt,class:Te(["form-control-date-format__popover__list__item",{"form-control-date-format__popover__list__item--active":p(n)===f.fmt}]),onClick:h=>s(f.fmt,d)},[T("div",OH,[T("div",BH,be(f.label),1),p(s8)(f.fmt)?(w(),R("div",LH,be(p(s8)(f.fmt)),1)):se("",!0)]),p(n)===f.fmt?(w(),R("span",PH,"✓")):se("",!0)],10,MH))),128))]),p(n)==="(custom)"?(w(),R("div",DH,[c[3]||(c[3]=T("div",{class:"form-control-date-format__popover__custom__section-label"}," Custom d3-time-format string ",-1)),sr(T("input",{"onUpdate:modelValue":c[0]||(c[0]=f=>Ze(o)?o.value=f:null),class:"form-control-date-format__popover__custom__input",placeholder:"e.g. %b %d, %Y",onInput:a},null,544),[[Ap,p(o)]]),T("div",EH,[c[2]||(c[2]=Xe(" Preview: ",-1)),T("span",NH,be(p(o)?p(r):"—"),1)])])):se("",!0)])]),_:1},8,["id","modelValue","label","block"])}}}),RH=Be(IH,[["__scopeId","data-v-710c73d8"]]),FH={class:"display-date"},VH=le({__name:"DisplayDate",props:{value:{},format:{default:"short"}},setup(t){const e=t,n=A(()=>{const o=new Date(e.value);return Number.isNaN(o.getTime())?e.value:e.format==="long"?o.toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})});return(o,r)=>(w(),R("span",FH,be(p(n)),1))}}),zH=Be(VH,[["__scopeId","data-v-7da39ad7"]]),HH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function WH(t,e){return w(),R("svg",HH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m0 192a88 88 0 1 1 88-88a88.1 88.1 0 0 1-88 88m16-40a8 8 0 0 1-8 8a16 16 0 0 1-16-16v-40a8 8 0 0 1 0-16a16 16 0 0 1 16 16v40a8 8 0 0 1 8 8m-32-92a12 12 0 1 1 12 12a12 12 0 0 1-12-12"},null,-1)])])}const L1=Me({name:"ph-info",render:WH}),UH={class:"display-contrast-badge__ratio"},GH=le({__name:"DisplayContrastBadge",props:{level:{},ratio:{}},setup(t){const e=t,n=mt("badgeRef"),o=A(()=>({"display-contrast-badge--aaa":e.level==="AAA","display-contrast-badge--aa":e.level==="AA","display-contrast-badge--fail":e.level==="Fail"})),r=A(()=>{switch(e.level){case"AAA":return"WCAG AAA — Ratio ≥ 7:1. Enhanced contrast, meets the highest accessibility standard.";case"AA":return"WCAG AA — Ratio ≥ 4.5:1. Minimum contrast for normal text. Sufficient for most users.";default:return"Below WCAG AA — Ratio < 4.5:1. Insufficient contrast. May be hard to read for some users."}});return(i,s)=>(w(),R("span",{ref_key:"badgeRef",ref:n,class:Te(["display-contrast-badge",p(o)])},[Xe(be(t.level)+" ",1),T("span",UH,be(t.ratio),1),H(p(L1),{class:"display-contrast-badge__info"}),H(p(jd),{"teleport-to":"body",target:p(n),title:p(r),placement:"top"},null,8,["target","title"])],2))}}),a8=Be(GH,[["__scopeId","data-v-2ff89f6d"]]),qH={[sn.BarVertical]:"Columns",[sn.BarHorizontal]:"Bars",[sn.BarMulti]:"Grouped Columns",[sn.ColumnStacked]:"Stacked Columns",[sn.BarStacked]:"Stacked Bars",[sn.BarSplit]:"Split Bars",[sn.BarGrouped]:"Grouped Bars",[sn.Line]:"Line",[sn.LineMulti]:"Lines",[sn.Area]:"Area",[sn.AreaStacked]:"Areas",[sn.Donut]:"Donut",[sn.Pie]:"Pie"};function HA(t){return qH[t]??t}const YH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function jH(t,e){return w(),R("svg",YH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 200h-8V40a8 8 0 0 0-8-8h-56a8 8 0 0 0-8 8v40H96a8 8 0 0 0-8 8v40H48a8 8 0 0 0-8 8v64h-8a8 8 0 0 0 0 16h192a8 8 0 0 0 0-16M160 48h40v152h-40Zm-56 48h40v104h-40Zm-48 48h32v56H56Z"},null,-1)])])}const Ns=Me({name:"ph-chart-bar",render:jH}),XH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function KH(t,e){return w(),R("svg",XH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 96h-40V56a8 8 0 0 0-8-8H56v-8a8 8 0 0 0-16 0v176a8 8 0 0 0 16 0v-8h88a8 8 0 0 0 8-8v-40h72a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8m-56-32v32H56V64Zm-32 128H56v-32h80Zm80-48H56v-32h160Z"},null,-1)])])}const ad=Me({name:"ph-chart-bar-horizontal",render:KH}),ZH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function QH(t,e){return w(),R("svg",ZH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 208a8 8 0 0 1-8 8H32a8 8 0 0 1-8-8V48a8 8 0 0 1 16 0v108.69l50.34-50.35a8 8 0 0 1 11.32 0L128 132.69L180.69 80H160a8 8 0 0 1 0-16h40a8 8 0 0 1 8 8v40a8 8 0 0 1-16 0V91.31l-58.34 58.35a8 8 0 0 1-11.32 0L96 123.31l-56 56V200h184a8 8 0 0 1 8 8"},null,-1)])])}const ld=Me({name:"ph-chart-line-up",render:QH}),JH={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function eW(t,e){return w(),R("svg",JH,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M100 116.43a8 8 0 0 0 4-6.93v-72A8 8 0 0 0 93.34 30a104.06 104.06 0 0 0-67.61 117a8 8 0 0 0 4.52 5.81a7.9 7.9 0 0 0 3.35.74a8 8 0 0 0 4-1.07ZM88 49.62v55.26l-47.88 27.63C40 131 40 129.48 40 128a88.12 88.12 0 0 1 48-78.38M128 24a8 8 0 0 0-8 8v91.82l-78.81 45.91a8 8 0 0 0-2.87 11A104 104 0 1 0 128 24m0 192a88.47 88.47 0 0 1-71.49-36.68l75.52-44a8 8 0 0 0 4-6.92V40.36A88 88 0 0 1 128 216"},null,-1)])])}const WA=Me({name:"ph-chart-pie-slice",render:eW}),tW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nW(t,e){return w(),R("svg",tW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a8 8 0 0 0-8 8v56a8 8 0 0 0 8 8a32 32 0 1 1-27.72 16a8 8 0 0 0-2.93-10.93l-48.5-28A8 8 0 0 0 37.92 76A104 104 0 1 0 128 24M48.09 91.1L83 111.26A48.1 48.1 0 0 0 80 128c0 1.53.08 3 .22 4.52L41.28 143a88.16 88.16 0 0 1 6.81-51.9m-2.67 67.31l39-10.44A48.1 48.1 0 0 0 120 175.32v40.31a88.2 88.2 0 0 1-74.58-57.22M136 215.63v-40.31a48 48 0 0 0 0-94.65V40.36a88 88 0 0 1 0 175.27"},null,-1)])])}const oW=Me({name:"ph-chart-donut",render:nW}),rW=le({__name:"DisplayChartTypeBadge",props:{chartType:{},theme:{default:"light"}},setup(t){const e=t,n=A(()=>HA(e.chartType)),o=A(()=>e.theme==="dark"?"dark":"light"),r={[sn.BarVertical]:Ns,[sn.BarHorizontal]:ad,[sn.BarMulti]:Ns,[sn.ColumnStacked]:Ns,[sn.BarStacked]:ad,[sn.BarSplit]:ad,[sn.BarGrouped]:ad,[sn.Line]:ld,[sn.LineMulti]:ld,[sn.Area]:ld,[sn.AreaStacked]:ld,[sn.Donut]:oW,[sn.Pie]:WA},i=A(()=>r[e.chartType]??Ns);return(s,a)=>(w(),Q(p(Ay),{variant:p(o),pill:"",class:"display-chart-type-badge"},{default:J(()=>[(w(),Q(Gt(p(i)),{class:"display-chart-type-badge__icon"})),Xe(" "+be(p(n)),1)]),_:1},8,["variant"]))}}),iW=Be(rW,[["__scopeId","data-v-cb8f5582"]]),sW={class:"section-card"},aW={key:0,class:"section-card__label"},lW={key:1,class:"section-card__body"},cW=le({__name:"SectionCard",props:{label:{}},setup(t){return(e,n)=>(w(),R("div",sW,[t.label?(w(),R("div",aW,be(t.label),1)):se("",!0),Ae(e.$slots,"header",{},void 0,!0),e.$slots.default?(w(),R("div",lW,[Ae(e.$slots,"default",{},void 0,!0)])):se("",!0)]))}}),Md=Be(cW,[["__scopeId","data-v-804cd08f"]]),uW={},dW={class:"settings-section-description"};function fW(t,e){return w(),R("p",dW,[Ae(t.$slots,"default",{},void 0,!0)])}const hW=Be(uW,[["render",fW],["__scopeId","data-v-9caa49e3"]]),pW={},mW={class:"settings-section-title"};function gW(t,e){return w(),R("h6",mW,[Ae(t.$slots,"default",{},void 0,!0)])}const vW=Be(pW,[["render",gW],["__scopeId","data-v-c5961a9d"]]),bW={class:"settings-section-icon"},yW=le({__name:"SettingsSectionIcon",props:{icon:{}},setup(t){return(e,n)=>{const o=$f;return w(),R("div",bW,[H(o,{name:t.icon},null,8,["name"])])}}}),xW=Be(yW,[["__scopeId","data-v-e8122360"]]),wW={class:"settings-section"},_W={class:"settings-section__header"},kW={class:"settings-section__header__text"},SW={key:1,class:"settings-section__body"},AW=le({__name:"SettingsSection",props:{title:{},icon:{default:void 0},description:{default:void 0}},setup(t){return(e,n)=>{const o=xW,r=vW,i=hW;return w(),R("section",wW,[T("div",_W,[t.icon?(w(),Q(o,{key:0,icon:t.icon},null,8,["icon"])):se("",!0),T("div",kW,[H(r,null,{default:J(()=>[Xe(be(t.title),1)]),_:1})])]),e.$slots.description||t.description?(w(),Q(i,{key:0},{default:J(()=>[Ae(e.$slots,"description",{},()=>[Xe(be(t.description),1)],!0)]),_:3})):se("",!0),e.$slots.default?(w(),R("div",SW,[Ae(e.$slots,"default",{},void 0,!0)])):se("",!0)])}}}),zo=Be(AW,[["__scopeId","data-v-91596f42"]]),CW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function $W(t,e){return w(),R("svg",CW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M205.66 194.34a8 8 0 0 1-11.32 11.32L128 139.31l-66.34 66.35a8 8 0 0 1-11.32-11.32L116.69 128L50.34 61.66a8 8 0 0 1 11.32-11.32L128 116.69l66.34-66.35a8 8 0 0 1 11.32 11.32L139.31 128Z"},null,-1)])])}const UA=Me({name:"ph-x",render:$W}),TW=le({__name:"ButtonClose",emits:["click"],setup(t){return(e,n)=>{const o=Qn;return w(),Q(o,{"icon-left":p(UA),label:"Close","hide-label":"",square:"",variant:"link",size:"sm",class:"button-panel-action",onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left"])}}}),GA=Be(TW,[["__scopeId","data-v-d6bb5d7b"]]),MW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function OW(t,e){return w(),R("svg",MW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M240 56v48a8 8 0 0 1-8 8h-48a8 8 0 0 1 0-16h27.4l-26.59-24.36l-.25-.24a80 80 0 1 0-1.67 114.78a8 8 0 0 1 11 11.63A95.44 95.44 0 0 1 128 224h-1.32a96 96 0 1 1 69.07-164L224 85.8V56a8 8 0 1 1 16 0"},null,-1)])])}const BW=Me({name:"ph-arrow-clockwise",render:OW}),LW=le({__name:"ButtonRedo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Qn;return w(),Q(o,{"icon-left":p(BW),label:"Redo","hide-label":"",square:"",variant:"outline-secondary",size:"sm",disabled:t.disabled,onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left","disabled"])}}}),PW={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function DW(t,e){return w(),R("svg",PW,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a96 96 0 0 1-94.71 96H128a95.38 95.38 0 0 1-65.9-26.2a8 8 0 0 1 11-11.63a80 80 0 1 0-1.67-114.78a3 3 0 0 1-.26.25L44.59 96H72a8 8 0 0 1 0 16H24a8 8 0 0 1-8-8V56a8 8 0 0 1 16 0v29.8L60.25 60A96 96 0 0 1 224 128"},null,-1)])])}const EW=Me({name:"ph-arrow-counter-clockwise",render:DW}),NW=le({__name:"ButtonUndo",props:{disabled:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>{const o=Qn;return w(),Q(o,{"icon-left":p(EW),label:"Undo","hide-label":"",square:"",variant:"outline-secondary",size:"sm",disabled:t.disabled,onClick:n[0]||(n[0]=r=>e.$emit("click"))},null,8,["icon-left","disabled"])}}}),IW={class:"feedback-empty-state"},RW={class:"feedback-empty-state__message"},FW=le({__name:"FeedbackEmptyState",props:{message:{}},setup(t){return(e,n)=>(w(),R("div",IW,[T("p",RW,[Ae(e.$slots,"default",{},()=>[Xe(be(t.message),1)],!0)])]))}}),VW=Be(FW,[["__scopeId","data-v-dab82b40"]]),zW={key:0,class:"layout-bottom-drawer__header"},HW={class:"layout-bottom-drawer__header__title"},WW={class:"layout-bottom-drawer__body"},UW=80,GW=le({__name:"LayoutBottomDrawer",props:at({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=Fe(0),o=Fe(!1),r=A(()=>({"layout-bottom-drawer--dragging":o.value}));let i=0,s=!1;function a(d){i=d.clientY,n.value=0,s=!1,document.addEventListener("pointermove",l),document.addEventListener("pointerup",c,{once:!0}),document.addEventListener("pointercancel",c,{once:!0})}function l(d){const f=d.clientY-i;!o.value&&Math.abs(f)>4&&(o.value=!0),o.value&&(s=!0,n.value=Math.max(0,f))}function c(){document.removeEventListener("pointermove",l),document.removeEventListener("pointercancel",c),o.value&&n.value>=UW?e.value=!1:s||(e.value=!1),n.value=0,o.value=!1}const u=A(()=>n.value>0?{transform:`translateY(${n.value}px)`}:{});return(d,f)=>(w(),R(Ge,null,[H(Pl,{name:"drawer"},{default:J(()=>[e.value?(w(),R("div",{key:0,class:Te(["layout-bottom-drawer",p(r)]),style:Dt(p(u))},[T("div",{class:"layout-bottom-drawer__handle",onPointerdown:a},[...f[1]||(f[1]=[T("div",{class:"layout-bottom-drawer__handle__bar"},null,-1)])],32),t.title?(w(),R("div",zW,[T("h2",HW,be(t.title),1)])):se("",!0),T("div",WW,[Ae(d.$slots,"default",{},void 0,!0)])],6)):se("",!0)]),_:3}),e.value?(w(),R("div",{key:0,class:"layout-bottom-drawer__backdrop",onClick:f[0]||(f[0]=h=>e.value=!1)})):se("",!0)],64))}}),qA=Be(GW,[["__scopeId","data-v-6b9a0111"]]),qW={class:"layout-panel"},YW={class:"layout-panel__header"},jW={class:"layout-panel__header__title"},XW={key:0,class:"layout-panel__header__actions"},KW={key:0,class:"layout-panel__toolbar"},ZW={class:"layout-panel__body"},QW={key:1,class:"layout-panel__footer"},JW=le({__name:"LayoutPanel",props:{title:{}},setup(t){return(e,n)=>(w(),R("div",qW,[T("div",YW,[T("h2",jW,be(t.title),1),e.$slots.actions?(w(),R("div",XW,[Ae(e.$slots,"actions",{},void 0,!0)])):se("",!0)]),e.$slots.toolbar?(w(),R("div",KW,[Ae(e.$slots,"toolbar",{},void 0,!0)])):se("",!0),T("div",ZW,[Ae(e.$slots,"default",{},void 0,!0)]),e.$slots.footer?(w(),R("div",QW,[Ae(e.$slots,"footer",{},void 0,!0)])):se("",!0)]))}}),eU=Be(JW,[["__scopeId","data-v-5b00db3c"]]),tU=["aria-label"],nU=["disabled","aria-current","onClick"],oU={class:"navigation-segmented-control__option__label"},rU=le({__name:"NavigationSegmentedControl",props:{items:{},ariaLabel:{default:void 0},size:{default:"md"}},emits:["select"],setup(t,{emit:e}){const n=t,o=e,r=A(()=>`navigation-segmented-control--${n.size}`);function i(s){s.disabled||o("select",s.key)}return(s,a)=>(w(),R("nav",{class:Te(["navigation-segmented-control",p(r)]),"aria-label":t.ariaLabel},[Ae(s.$slots,"default",{},void 0,!0),(w(!0),R(Ge,null,gt(t.items,l=>(w(),R("button",{key:l.key,class:Te(["navigation-segmented-control__option",{"navigation-segmented-control__option--active":l.active,"navigation-segmented-control__option--disabled":l.disabled}]),disabled:l.disabled,"aria-current":l.active?"true":void 0,type:"button",onClick:c=>i(l)},[l.icon?(w(),Q(Gt(l.icon),{key:0,class:"navigation-segmented-control__option__icon"})):se("",!0),T("span",oU,be(l.text),1)],10,nU))),128))],10,tU))}}),YA=Be(rU,[["__scopeId","data-v-7aaaef48"]]),iU=["aria-selected","aria-disabled","tabindex","title","onClick","onKeydown"],sU={key:0,class:"navigation-stepper-tabs__step__icon","aria-hidden":"true"},aU={class:"navigation-stepper-tabs__step__label"},lU={key:0,class:"navigation-stepper-tabs__sep","aria-hidden":"true"},cU=le({__name:"NavigationStepperTabs",props:at({steps:{},disabledSteps:{default:()=>[]},layout:{default:"inline"},separator:{type:Boolean,default:!0}},{currentStep:{required:!0},currentStepModifiers:{}}),emits:["update:currentStep"],setup(t){const e=t,n=pt(t,"currentStep");function o(l){return l<n.value?"done":l===n.value?"current":"pending"}function r(l){return e.disabledSteps.includes(l)}function i(l,c){return o(c)==="done"?Dy:l.icon}function s(l){r(l)||(n.value=l)}function a(l,c){var v;const u=[];for(let m=0;m<e.steps.length;m++)r(m)||u.push(m);if(u.length===0)return;const d=u.indexOf(c);let f=null;switch(l.key){case"ArrowRight":f=u[(d+1)%u.length];break;case"ArrowLeft":f=u[(d-1+u.length)%u.length];break;case"Home":f=u[0];break;case"End":f=u[u.length-1];break;default:return}if(l.preventDefault(),f===null)return;const h=l.currentTarget.closest('[role="tablist"]');if(!h)return;(v=h.querySelectorAll('[role="tab"]')[f])==null||v.focus()}return(l,c)=>(w(),R("div",{class:Te(["navigation-stepper-tabs",`navigation-stepper-tabs--${t.layout}`]),role:"tablist","aria-label":"Progress"},[(w(!0),R(Ge,null,gt(t.steps,(u,d)=>(w(),R(Ge,{key:u.key??d},[T("button",{type:"button",role:"tab","aria-selected":d===n.value?"true":"false","aria-disabled":r(d)||void 0,tabindex:r(d)?-1:0,class:Te(["navigation-stepper-tabs__step",`navigation-stepper-tabs__step--${o(d)}`,{"navigation-stepper-tabs__step--disabled":r(d)}]),title:u.label,onClick:f=>s(d),onKeydown:f=>a(f,d)},[i(u,d)?(w(),R("span",sU,[(w(),Q(Gt(i(u,d))))])):se("",!0),T("span",aU,be(u.label),1)],42,iU),t.layout==="inline"&&t.separator&&d<t.steps.length-1?(w(),R("span",lU,"›")):se("",!0)],64))),128))],2))}}),uU=Be(cU,[["__scopeId","data-v-3dbb5c62"]]),dU=le({__name:"NavigationToggle",props:at({options:{default:()=>[]},size:{default:"md"}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,{entries:o}=Cf(oR),r=A(()=>o.value.length>0?o.value:n.options),i=A(()=>r.value.map(a=>({key:a.value,text:a.text,icon:a.icon,active:a.value===e.value,disabled:a.disabled})));function s(a){e.value=a}return(a,l)=>(w(),Q(YA,{items:p(i),size:t.size,onSelect:s},{default:J(()=>[Ae(a.$slots,"default")]),_:3},8,["items","size"]))}}),fU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function hU(t,e){return w(),R("svg",fU,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32M40 112a72 72 0 1 1 72 72a72.08 72.08 0 0 1-72-72"},null,-1)])])}const Uy=Me({name:"ph-magnifying-glass",render:hU}),pU=["aria-label"],mU={key:0,class:"navigation-command-bar__placeholder"},gU={key:1,class:"navigation-command-bar__kbd"},vU=le({__name:"NavigationCommandBar",props:{placeholder:{},shortcutLabel:{},collapsed:{type:Boolean,default:!1}},emits:["click"],setup(t){return(e,n)=>(w(),R("button",{type:"button",class:Te(["navigation-command-bar",{"navigation-command-bar--collapsed":t.collapsed}]),"aria-label":t.placeholder,onClick:n[0]||(n[0]=o=>e.$emit("click"))},[H(p(Uy),{class:"navigation-command-bar__icon","aria-hidden":"true"}),t.collapsed?se("",!0):(w(),R("span",mU,be(t.placeholder),1)),t.shortcutLabel&&!t.collapsed?(w(),R("span",gU,be(t.shortcutLabel),1)):se("",!0)],10,pU))}}),bU=Be(vU,[["__scopeId","data-v-469a4437"]]),yU={class:"navigation-icon-rail"},xU={key:0,class:"navigation-icon-rail__footer"},wU=le({__name:"NavigationIconRail",props:at({items:{default:()=>[]}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=t,{entries:o}=Cf(nR),r=A(()=>o.value.length>0?o.value:n.items);function i(s){return{"navigation-icon-rail__button--active":e.value===s}}return(s,a)=>{const l=Qn;return w(),R("nav",yU,[Ae(s.$slots,"default",{},void 0,!0),(w(!0),R(Ge,null,gt(p(r),c=>(w(),Q(l,{key:c.value,"icon-left":c.icon,label:c.tooltip,"tooltip-placement":"left","hide-label":"",square:"",size:"lg",variant:"link",class:Te(["navigation-icon-rail__button",i(c.value)]),"aria-pressed":e.value===c.value,onClick:u=>e.value=c.value},null,8,["icon-left","label","class","aria-pressed","onClick"]))),128)),a[0]||(a[0]=T("div",{class:"navigation-icon-rail__spacer"},null,-1)),s.$slots.footer?(w(),R("div",xU,[Ae(s.$slots,"footer",{},void 0,!0)])):se("",!0)])}}}),_U=Be(wU,[["__scopeId","data-v-0286a414"]]),kU={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function SU(t,e){return w(),R("svg",kU,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8"},null,-1)])])}const Hp=Me({name:"ph-arrow-square-out",render:SU}),AU=["aria-label"],CU={key:0,class:"navigation-sidebar__header"},$U={class:"navigation-sidebar__body"},TU=le({__name:"NavigationSidebar",props:{ariaLabel:{default:"Sidebar"}},setup(t){return(e,n)=>(w(),R("nav",{class:"navigation-sidebar","aria-label":t.ariaLabel},[e.$slots.header?(w(),R("div",CU,[Ae(e.$slots,"header",{},void 0,!0)])):se("",!0),T("div",$U,[Ae(e.$slots,"default",{},void 0,!0)])],8,AU))}}),MU=Be(TU,[["__scopeId","data-v-007c1edf"]]),OU={class:"navigation-sidebar-group"},BU={key:0,class:"navigation-sidebar-group__eyebrow"},LU={class:"navigation-sidebar-group__items"},PU=le({__name:"NavigationSidebarGroup",props:{eyebrow:{}},setup(t){return(e,n)=>(w(),R("div",OU,[t.eyebrow?(w(),R("div",BU,be(t.eyebrow),1)):se("",!0),T("div",LU,[Ae(e.$slots,"default",{},void 0,!0)])]))}}),lv=Be(PU,[["__scopeId","data-v-794922fc"]]),DU=["href"],EU={class:"navigation-sidebar-item__icon"},NU={class:"navigation-sidebar-item__label"},IU={class:"navigation-sidebar-item__external","aria-hidden":"true"},RU=["href","aria-current","onClick"],FU={class:"navigation-sidebar-item__icon"},VU={class:"navigation-sidebar-item__label"},zU={key:0,class:"navigation-sidebar-item__count"},HU=le({__name:"NavigationSidebarItem",props:{to:{default:void 0},href:{default:void 0},label:{},active:{type:Boolean,default:!1},count:{default:void 0}},setup(t){const e=t,n=A(()=>e.href!==void 0);if(e.to===void 0&&e.href===void 0)throw new Error("NavigationSidebarItem requires either `to` or `href`.");if(e.to!==void 0&&e.href!==void 0)throw new Error("NavigationSidebarItem accepts `to` or `href`, not both.");function o(r){return{"navigation-sidebar-item":!0,"navigation-sidebar-item--active":e.active||r}}return(r,i)=>{const s=im("router-link");return p(n)?(w(),R("a",{key:0,href:t.href,class:Te(o(!1)),target:"_blank",rel:"noopener noreferrer"},[T("span",EU,[Ae(r.$slots,"icon",{},void 0,!0)]),T("span",NU,be(t.label),1),T("span",IU,[H(p(Hp))])],10,DU)):(w(),Q(s,{key:1,to:t.to,custom:""},{default:J(({navigate:a,href:l,isActive:c})=>[T("a",{href:l,class:Te(o(c)),"aria-current":c||t.active?"page":void 0,onClick:a},[T("span",FU,[Ae(r.$slots,"icon",{},void 0,!0)]),T("span",VU,be(t.label),1),t.count!==void 0?(w(),R("span",zU,be(t.count),1)):se("",!0)],10,RU)]),_:3},8,["to"]))}}}),Zu=Be(HU,[["__scopeId","data-v-d6b18bde"]]),WU=["href","aria-label","onClick"],UU=["src","alt"],GU={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},qU={key:2,class:"navigation-workspace-switcher__name"},YU=["aria-label"],jU=["src","alt"],XU={key:1,class:"navigation-workspace-switcher__badge","aria-hidden":"true"},KU={key:2,class:"navigation-workspace-switcher__name"},ZU=le({__name:"NavigationWorkspaceSwitcher",props:{name:{},logoSrc:{default:void 0},hideName:{type:Boolean,default:!1},to:{default:void 0}},emits:["click"],setup(t){const e=t,n=A(()=>e.name.trim().charAt(0).toUpperCase());return(o,r)=>{const i=im("router-link");return t.to?(w(),Q(i,{key:0,to:t.to,custom:""},{default:J(({navigate:s,href:a})=>[T("a",{href:a,class:"navigation-workspace-switcher","aria-label":t.name,onClick:s},[t.logoSrc?(w(),R("img",{key:0,src:t.logoSrc,alt:t.name,class:"navigation-workspace-switcher__logo"},null,8,UU)):(w(),R("span",GU,be(n.value),1)),t.hideName?se("",!0):(w(),R("span",qU,be(t.name),1))],8,WU)]),_:1},8,["to"])):(w(),R("button",{key:1,type:"button",class:"navigation-workspace-switcher","aria-label":t.name,onClick:r[0]||(r[0]=s=>o.$emit("click"))},[t.logoSrc?(w(),R("img",{key:0,src:t.logoSrc,alt:t.name,class:"navigation-workspace-switcher__logo"},null,8,jU)):(w(),R("span",XU,be(n.value),1)),t.hideName?se("",!0):(w(),R("span",KU,be(t.name),1))],8,YU))}}}),jA=Be(ZU,[["__scopeId","data-v-c9a99b92"]]),QU={class:"list-item-row__label"},JU=le({__name:"ListItemRow",props:{label:{},active:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"list-item-row--active":e.active}));return(o,r)=>(w(),R("div",{class:Te(["list-item-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click",i))},[Ae(o.$slots,"leading",{},void 0,!0),T("span",QU,be(t.label),1),Ae(o.$slots,"actions",{},void 0,!0)],2))}}),XA=Be(JU,[["__scopeId","data-v-51fbb4a2"]]),eG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function tG(t,e){return w(),R("svg",eG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 48h-40v-8a24 24 0 0 0-24-24h-48a24 24 0 0 0-24 24v8H40a8 8 0 0 0 0 16h8v144a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16V64h8a8 8 0 0 0 0-16M96 40a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v8H96Zm96 168H64V64h128Zm-80-104v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0m48 0v64a8 8 0 0 1-16 0v-64a8 8 0 0 1 16 0"},null,-1)])])}const KA=Me({name:"ph-trash",render:tG}),nG={class:"list-item-actions"},oG=le({__name:"ListItemActions",props:{actions:{default:()=>["duplicate","remove"]}},emits:["duplicate","remove"],setup(t){return(e,n)=>{const o=Ho,r=$f;return w(),R("div",nG,[t.actions.includes("duplicate")?(w(),Q(o,{key:0,variant:"link",size:"sm",class:"list-item-actions__btn text-body-secondary",title:"Duplicate",onClick:n[0]||(n[0]=gn(i=>e.$emit("duplicate"),["stop"]))},{default:J(()=>[...n[2]||(n[2]=[T("span",{"aria-hidden":"true"},"⧉",-1)])]),_:1})):se("",!0),t.actions.includes("remove")?(w(),Q(o,{key:1,variant:"link",size:"sm",class:"list-item-actions__btn text-danger",title:"Remove",onClick:n[1]||(n[1]=gn(i=>e.$emit("remove"),["stop"]))},{default:J(()=>[H(r,{name:p(KA)},null,8,["name"])]),_:1})):se("",!0)])}}}),rG=Be(oG,[["__scopeId","data-v-29b731f9"]]),iG={class:"border rounded overflow-hidden bg-body-tertiary p-2"},sG={class:"d-flex gap-1 mb-2"},Gy=le({__name:"ListSelectPanel",props:at({items:{},maxHeight:{default:"220px"},onItemClick:{type:Function,default:void 0}},{selected:{required:!0},selectedModifiers:{}}),emits:["update:selected"],setup(t){const e=pt(t,"selected"),n=t;function o(l,c,u){n.onItemClick?n.onItemClick(l,c,u):r(l)}function r(l){e.value.indexOf(l)>=0?e.value=e.value.filter(u=>u!==l):e.value=[...e.value,l]}function i(){e.value=[...n.items]}function s(){e.value=[]}function a(){e.value=n.items.filter(l=>!e.value.includes(l))}return(l,c)=>{const u=XA;return w(),R("div",iG,[T("div",sG,[H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:i},{default:J(()=>[...c[0]||(c[0]=[Xe(" All ",-1)])]),_:1}),H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:s},{default:J(()=>[...c[1]||(c[1]=[Xe(" None ",-1)])]),_:1}),H(p(Ho),{variant:"outline-secondary",size:"sm",onClick:a},{default:J(()=>[...c[2]||(c[2]=[Xe(" Invert ",-1)])]),_:1})]),T("div",{style:Dt({maxHeight:t.maxHeight,overflowY:"auto"})},[(w(!0),R(Ge,null,gt(t.items,(d,f)=>(w(),Q(u,{key:d,label:d,active:e.value.includes(d),onClick:h=>o(d,f,h)},ki({_:2},[l.$slots["item-leading"]?{name:"leading",fn:J(()=>[Ae(l.$slots,"item-leading",{item:d,index:f})]),key:"0"}:void 0,l.$slots["item-actions"]?{name:"actions",fn:J(()=>[Ae(l.$slots,"item-actions",{item:d,index:f})]),key:"1"}:void 0]),1032,["label","active","onClick"]))),128))],4)])}}}),aG=["data-bs-theme"],lG=["src"],cG={class:"gallery-card__meta"},uG={key:0,class:"gallery-card__meta__subtitle"},dG={key:1,class:"gallery-card__meta__footer"},fG=le({__name:"GalleryCard",props:{title:{},subtitle:{},thumbSrc:{},selected:{type:Boolean},layout:{},forceLightThumb:{type:Boolean},serifTitle:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"gallery-card--selected":e.selected,"gallery-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["gallery-card",p(n)]),role:"button",tabindex:"0",onClick:r[1]||(r[1]=i=>o.$emit("click")),onKeydown:[r[2]||(r[2]=nr(i=>o.$emit("click"),["enter"])),r[3]||(r[3]=nr(gn(i=>o.$emit("click"),["prevent"]),["space"]))]},[T("div",{class:"gallery-card__thumb","data-bs-theme":t.forceLightThumb?"light":void 0},[t.thumbSrc?(w(),R("img",{key:0,src:t.thumbSrc,alt:"",class:"gallery-card__thumb__img"},null,8,lG)):se("",!0),o.$slots.actions?(w(),R("div",{key:1,class:"gallery-card__thumb__actions",onClick:r[0]||(r[0]=gn(()=>{},["stop"]))},[Ae(o.$slots,"actions",{},void 0,!0)])):se("",!0)],8,aG),T("div",cG,[T("div",{class:Te(["gallery-card__meta__title",{"bc-display":t.serifTitle}])},be(t.title),3),t.subtitle?(w(),R("div",uG,be(t.subtitle),1)):se("",!0),o.$slots.footer?(w(),R("div",dG,[Ae(o.$slots,"footer",{},void 0,!0)])):se("",!0)])],34))}}),hG=Be(fG,[["__scopeId","data-v-48e157d8"]]),pG=le({__name:"GalleryGrid",props:{layout:{default:"grid"}},setup(t){const e=t,n=A(()=>({"gallery-grid--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["gallery-grid",p(n)])},[Ae(o.$slots,"default",{},void 0,!0)],2))}}),mG=Be(pG,[["__scopeId","data-v-7c69b740"]]),gG={class:"scene-timeline-item__label"},vG=["innerHTML"],bG={key:1,class:"scene-timeline-item__name"},yG=le({__name:"SceneTimelineItem",props:{name:{},index:{},active:{type:Boolean,default:!1},thumbnail:{default:null},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("button",{class:Te(["scene-timeline-item",{"scene-timeline-item--active":t.active}]),type:"button",onClick:n[1]||(n[1]=o=>e.$emit("select"))},[t.removable?(w(),R("span",{key:0,class:"scene-timeline-item__remove",role:"button","aria-label":"Remove scene",onClick:n[0]||(n[0]=gn(o=>e.$emit("remove"),["stop"]))}," × ")):se("",!0),T("span",gG,"Scene "+be(t.index+1),1),T("span",{class:"scene-timeline-item__preview",innerHTML:t.thumbnail},null,8,vG),t.name?(w(),R("span",bG,be(t.name),1)):se("",!0)],2))}}),xG=Be(yG,[["__scopeId","data-v-e9323b3b"]]),wG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _G(t,e){return w(),R("svg",wG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M240 128a15.74 15.74 0 0 1-7.6 13.51L88.32 229.65a16 16 0 0 1-16.2.3A15.86 15.86 0 0 1 64 216.13V39.87a15.86 15.86 0 0 1 8.12-13.82a16 16 0 0 1 16.2.3l144.08 88.14A15.74 15.74 0 0 1 240 128"},null,-1)])])}const kG=Me({name:"ph-play-fill",render:_G}),SG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function AG(t,e){return w(),R("svg",SG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 48v160a16 16 0 0 1-16 16h-40a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h40a16 16 0 0 1 16 16M96 32H56a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16"},null,-1)])])}const CG=Me({name:"ph-pause-fill",render:AG}),$G={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function TG(t,e){return w(),R("svg",$G,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M165.66 202.34a8 8 0 0 1-11.32 11.32l-80-80a8 8 0 0 1 0-11.32l80-80a8 8 0 0 1 11.32 11.32L91.31 128Z"},null,-1)])])}const ZA=Me({name:"ph-caret-left",render:TG}),MG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function OG(t,e){return w(),R("svg",MG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m181.66 133.66l-80 80a8 8 0 0 1-11.32-11.32L164.69 128L90.34 53.66a8 8 0 0 1 11.32-11.32l80 80a8 8 0 0 1 0 11.32"},null,-1)])])}const QA=Me({name:"ph-caret-right",render:OG}),BG={class:"scene-timeline-controls"},LG=["disabled"],PG=["aria-label","disabled"],DG=["disabled"],EG={key:0,class:"scene-timeline-controls__counter"},NG=le({__name:"SceneTimelineControls",props:at({total:{},playing:{type:Boolean,default:!1},hideCounter:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:at(["play","pause"],["update:activeIndex"]),setup(t){const e=pt(t,"activeIndex"),n=t,o=A(()=>n.total===0),r=A(()=>e.value<0?1:e.value+1),i=A(()=>n.total===0?0:e.value<=0?n.total-1:e.value-1),s=A(()=>n.total===0||e.value>=n.total-1?0:e.value+1);return(a,l)=>{const c=$f;return w(),R("div",BG,[T("button",{class:"scene-timeline-controls__nav-btn",type:"button","aria-label":"Previous scene",disabled:p(o),onClick:l[0]||(l[0]=u=>e.value=p(i))},[H(c,{name:p(ZA),size:"1em"},null,8,["name"])],8,LG),T("button",{class:"scene-timeline-controls__play-btn",type:"button","aria-label":t.playing?"Pause":"Play",disabled:p(o),onClick:l[1]||(l[1]=u=>t.playing?a.$emit("pause"):a.$emit("play"))},[H(c,{name:t.playing?p(CG):p(kG),size:"1em"},null,8,["name"])],8,PG),T("button",{class:"scene-timeline-controls__nav-btn",type:"button","aria-label":"Next scene",disabled:p(o),onClick:l[2]||(l[2]=u=>e.value=p(s))},[H(c,{name:p(QA),size:"1em"},null,8,["name"])],8,DG),!p(o)&&!t.hideCounter?(w(),R("span",EG,be(p(r))+" / "+be(t.total),1)):se("",!0)])}}}),qy=Be(NG,[["__scopeId","data-v-469c0735"]]),IG={class:"scene-timeline__items"},RG={class:"scene-timeline__items__add"},FG=le({__name:"SceneTimeline",props:at({scenes:{},playing:{type:Boolean,default:!1},floating:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:at(["add","remove","play","pause"],["update:activeIndex"]),setup(t){const e=pt(t,"activeIndex");return(n,o)=>{const r=qy,i=xG,s=$l;return w(),R("div",{class:Te(["scene-timeline",{"scene-timeline--floating":t.floating}])},[H(r,{"active-index":e.value,"onUpdate:activeIndex":o[0]||(o[0]=a=>e.value=a),total:t.scenes.length,playing:t.playing,onPlay:o[1]||(o[1]=a=>n.$emit("play")),onPause:o[2]||(o[2]=a=>n.$emit("pause"))},null,8,["active-index","total","playing"]),T("div",IG,[(w(!0),R(Ge,null,gt(t.scenes,a=>(w(),Q(i,{key:a.index,name:a.name,index:a.index,active:a.index===e.value,thumbnail:a.thumbnail??null,removable:a.removable??!0,onSelect:l=>e.value=a.index,onRemove:l=>n.$emit("remove",a.index)},null,8,["name","index","active","thumbnail","removable","onSelect","onRemove"]))),128)),T("div",RG,[H(s,{onClick:o[3]||(o[3]=a=>n.$emit("add"))})])])],2)}}}),VG=Be(FG,[["__scopeId","data-v-a0977ad2"]]),zG={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function HG(t,e){return w(),R("svg",zG,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M213.66 165.66a8 8 0 0 1-11.32 0L128 91.31l-74.34 74.35a8 8 0 0 1-11.32-11.32l80-80a8 8 0 0 1 11.32 0l80 80a8 8 0 0 1 0 11.32"},null,-1)])])}const WG=Me({name:"ph-caret-up",render:HG}),UG={class:"scene-timeline-compact"},GG=["title"],qG={class:"scene-timeline-compact__counter"},YG=le({__name:"SceneTimelineCompact",props:at({scenes:{},playing:{type:Boolean,default:!1},expanded:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:at(["play","pause","expand"],["update:activeIndex"]),setup(t){const e=pt(t,"activeIndex"),n=t,o=A(()=>e.value<0?null:n.scenes.find(a=>a.index===e.value)??null),r=A(()=>{var a;return((a=o.value)==null?void 0:a.name)||" "}),i=A(()=>n.scenes.length),s=A(()=>e.value<0||i.value===0?1:Math.max(1,Math.min(i.value,e.value+1)));return(a,l)=>(w(),R("div",UG,[H(qy,{"active-index":e.value,"onUpdate:activeIndex":l[0]||(l[0]=c=>e.value=c),total:p(i),playing:t.playing,"hide-counter":"",onPlay:l[1]||(l[1]=c=>a.$emit("play")),onPause:l[2]||(l[2]=c=>a.$emit("pause"))},null,8,["active-index","total","playing"]),T("div",{class:"scene-timeline-compact__name",title:p(r)},be(p(r)),9,GG),T("div",qG,be(p(s))+" of "+be(p(i)),1),H(Qn,{class:"scene-timeline-compact__expand","icon-left":p(WG),label:"Show scenes","hide-label":"",square:"",variant:"link",size:"sm","aria-expanded":t.expanded,onClick:l[3]||(l[3]=c=>a.$emit("expand"))},null,8,["icon-left","aria-expanded"])]))}}),jG=Be(YG,[["__scopeId","data-v-6874749a"]]),XG=["aria-current"],KG=["innerHTML"],ZG={key:1,class:"scene-list-item__thumb scene-list-item__thumb--empty","aria-hidden":"true"},QG={class:"scene-list-item__body"},JG={class:"scene-list-item__label"},eq={key:0,class:"scene-list-item__name"},tq={key:1,class:"scene-list-item__hint"},nq=le({__name:"SceneListItem",props:{index:{},name:{},thumbnail:{},hint:{},active:{type:Boolean,default:!1},removable:{type:Boolean,default:!0}},emits:["select","remove"],setup(t){return(e,n)=>(w(),R("li",{class:Te(["scene-list-item-row",{"scene-list-item-row--active":t.active}])},[T("button",{type:"button",class:Te(["scene-list-item",{"scene-list-item--active":t.active}]),"aria-current":t.active?"true":void 0,onClick:n[0]||(n[0]=o=>e.$emit("select"))},[t.thumbnail?(w(),R("span",{key:0,class:"scene-list-item__thumb",innerHTML:t.thumbnail},null,8,KG)):(w(),R("span",ZG)),T("span",QG,[T("span",JG,"SCENE "+be(t.index),1),t.name?(w(),R("span",eq,be(t.name),1)):se("",!0),t.hint?(w(),R("span",tq,be(t.hint),1)):se("",!0)])],10,XG),t.removable?(w(),R("button",{key:0,type:"button",class:"scene-list-item__remove","aria-label":"Remove scene",onClick:n[1]||(n[1]=gn(o=>e.$emit("remove"),["stop"]))},[H(p(UA))])):se("",!0)],2))}}),oq=Be(nq,[["__scopeId","data-v-4d17a115"]]),rq={class:"scene-list"},iq={class:"scene-list__items",role:"list"},sq=le({__name:"SceneList",props:at({scenes:{},playing:{type:Boolean,default:!1}},{activeIndex:{default:-1},activeIndexModifiers:{}}),emits:at(["add","remove","play","pause"],["update:activeIndex"]),setup(t,{emit:e}){const n=pt(t,"activeIndex"),o=e;function r(s){n.value=s}function i(s){o("remove",s)}return(s,a)=>(w(),R("div",rq,[H(qy,{"active-index":n.value,"onUpdate:activeIndex":a[0]||(a[0]=l=>n.value=l),total:t.scenes.length,playing:t.playing,onPlay:a[1]||(a[1]=l=>s.$emit("play")),onPause:a[2]||(a[2]=l=>s.$emit("pause"))},null,8,["active-index","total","playing"]),T("ul",iq,[(w(!0),R(Ge,null,gt(t.scenes,l=>(w(),Q(oq,{key:l.index,index:l.index,name:l.name,thumbnail:l.thumbnail??null,hint:l.hint??null,active:l.index===n.value,removable:l.removable??!0,onSelect:c=>r(l.index),onRemove:c=>i(l.index)},null,8,["index","name","thumbnail","hint","active","removable","onSelect","onRemove"]))),128))]),T("button",{type:"button",class:"scene-list__add",onClick:a[3]||(a[3]=l=>s.$emit("add"))}," + Add scene ")]))}}),aq=Be(sq,[["__scopeId","data-v-a9466f90"]]),lq={class:"bc-scene-player bc-scene-player--progress-bar","data-scene-player":""},cq=["aria-label"],uq={key:0,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},dq={key:1,width:"10",height:"10",viewBox:"0 0 12 12",fill:"currentColor"},fq={class:"bc-scene-player__segments"},hq=["aria-label","aria-current","onClick"],pq={class:"bc-scene-player__counter"},mq=le({__name:"ScenePlayerProgressBar",props:at({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:at(["play","pause"],["update:current"]),setup(t){const e=pt(t,"current");return(n,o)=>(w(),R("div",lq,[T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[0]||(o[0]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",uq,[...o[1]||(o[1]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",dq,[...o[2]||(o[2]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,cq),T("div",fq,[(w(!0),R(Ge,null,gt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__segments__segment",{"bc-scene-player__segments__segment--active":r===e.value,"bc-scene-player__segments__segment--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,hq))),128))]),T("span",pq,be(e.value)+"/"+be(t.total),1)]))}}),JA=Be(mq,[["__scopeId","data-v-be507f24"]]),gq=["disabled"],vq=["aria-label"],bq={key:0,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},yq={key:1,width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor"},xq={class:"bc-scene-player__dots"},wq=["aria-label","aria-current","onClick"],_q=["disabled"],kq=le({__name:"ScenePlayerDotStepper",props:at({total:{},playing:{type:Boolean,default:!1},position:{default:"center"}},{current:{required:!0},currentModifiers:{}}),emits:at(["play","pause","previous","next"],["update:current"]),setup(t){const e=pt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--dot-stepper",`bc-scene-player--${t.position}`]),"data-scene-player":""},[T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=r=>n.$emit("previous"))},[...o[3]||(o[3]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,gq),T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[1]||(o[1]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",bq,[...o[4]||(o[4]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",yq,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,vq),T("div",xq,[(w(!0),R(Ge,null,gt(t.total,r=>(w(),R("button",{key:r,type:"button",class:Te(["bc-scene-player__dots__dot",{"bc-scene-player__dots__dot--active":r===e.value,"bc-scene-player__dots__dot--completed":r<e.value}]),"aria-label":`Scene ${r} of ${t.total}`,"aria-current":r===e.value?"step":void 0,onClick:i=>e.value=r},null,10,wq))),128))]),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:e.value>=t.total,"aria-label":"Next scene",onClick:o[2]||(o[2]=r=>n.$emit("next"))},[...o[6]||(o[6]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,_q)],2))}}),eC=Be(kq,[["__scopeId","data-v-3499fe9e"]]),Sq={key:0,class:"bc-scene-player__counter"},Aq=["disabled"],Cq=["aria-label"],$q={key:0,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},Tq={key:1,width:"9",height:"9",viewBox:"0 0 12 12",fill:"currentColor"},Mq=["disabled"],Oq={key:1,class:"bc-scene-player__counter bc-scene-player__counter--end"},Bq=le({__name:"ScenePlayerMinimalArrows",props:at({total:{},playing:{type:Boolean,default:!1},position:{default:"center"},wrap:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},order:{default:"counter-first"}},{current:{required:!0},currentModifiers:{}}),emits:at(["play","pause","previous","next"],["update:current"]),setup(t){const e=pt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--minimal-arrows",`bc-scene-player--${t.position}`]),"data-scene-player":""},[t.showCounter&&t.order==="counter-first"?(w(),R("span",Sq,be(e.value)+"/"+be(t.total),1)):se("",!0),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:!t.wrap&&e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=r=>n.$emit("previous"))},[...o[3]||(o[3]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M6.5 2L3.5 5l3 3"})],-1)])],8,Aq),T("button",{type:"button",class:"bc-scene-player__play-btn","aria-label":t.playing?"Pause":"Play",onClick:o[1]||(o[1]=r=>t.playing?n.$emit("pause"):n.$emit("play"))},[t.playing?(w(),R("svg",$q,[...o[4]||(o[4]=[T("rect",{x:"1.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1),T("rect",{x:"7.5",y:"1",width:"3",height:"10",rx:"0.8"},null,-1)])])):(w(),R("svg",Tq,[...o[5]||(o[5]=[T("path",{d:"M2.5 1v10l8-5z"},null,-1)])]))],8,Cq),T("button",{type:"button",class:"bc-scene-player__nav-btn",disabled:!t.wrap&&e.value>=t.total,"aria-label":"Next scene",onClick:o[2]||(o[2]=r=>n.$emit("next"))},[...o[6]||(o[6]=[T("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M3.5 2L6.5 5l-3 3"})],-1)])],8,Mq),t.showCounter&&t.order==="controls-first"?(w(),R("span",Oq,be(e.value)+"/"+be(t.total),1)):se("",!0)],2))}}),tC=Be(Bq,[["__scopeId","data-v-74dd9698"]]),Lq={class:"bc-scene-player__btn-group"},Pq=["disabled"],Dq=["disabled"],Eq={class:"bc-scene-player__counter"},Nq=le({__name:"ScenePlayerButtons",props:at({total:{},playing:{type:Boolean,default:!1},position:{default:"left"}},{current:{required:!0},currentModifiers:{}}),emits:at(["play","pause","previous","next"],["update:current"]),setup(t){const e=pt(t,"current");return(n,o)=>(w(),R("div",{class:Te(["bc-scene-player bc-scene-player--buttons",`bc-scene-player--${t.position}`]),"data-scene-player":""},[T("div",Lq,[T("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn",{"bc-scene-player__btn-group__btn--disabled":e.value<=1}]),disabled:e.value<=1,"aria-label":"Previous scene",onClick:o[0]||(o[0]=gn(r=>n.$emit("previous"),["stop"]))},[...o[2]||(o[2]=[T("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M5.5 1.5L1.5 6l4 4.5"})],-1),Xe(" Back ",-1)])],10,Pq),T("button",{type:"button",class:Te(["bc-scene-player__btn-group__btn bc-scene-player__btn-group__btn--next",{"bc-scene-player__btn-group__btn--disabled":e.value>=t.total}]),disabled:e.value>=t.total,"aria-label":"Next scene",onClick:o[1]||(o[1]=gn(r=>n.$emit("next"),["stop"]))},[...o[3]||(o[3]=[Xe(" Next ",-1),T("svg",{width:"8",height:"12",viewBox:"0 0 8 12",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[T("path",{d:"M2.5 1.5L6.5 6l-4 4.5"})],-1)])],10,Dq)]),T("span",Eq,be(e.value)+" / "+be(t.total),1)],2))}}),P1=Be(Nq,[["__scopeId","data-v-9b2f8f87"]]),Iq=Lo("theme",()=>{const t=Fe("light"),e=Py("(prefers-color-scheme: dark)"),n=A(()=>t.value==="dark"||t.value==="auto"&&e.value?"dark":"light");je(n,r=>{document.documentElement.setAttribute("data-bs-theme",r)},{immediate:!0});function o(){const r=["light","dark","auto"],i=r.indexOf(t.value);t.value=r[(i+1)%r.length]}return{theme:t,resolvedTheme:n,cycleTheme:o}},{persist:{key:"bc-theme",pick:["theme"]}});function Mf(){const t=Iq(),{theme:e,resolvedTheme:n}=Mt(t);return{theme:e,resolvedTheme:n,cycleTheme:t.cycleTheme}}function Rq(){return typeof navigator>"u"?!1:/Mac|iPhone|iPod|iPad/i.test(navigator.platform)}function nC(t){const e=t.toUpperCase(),n=Rq(),o=n?`⌘ ${e}`:`Ctrl ${e}`,r=n?`Meta+${e}`:`Control+${e}`;function i(a){return a.key.toLowerCase()!==t.toLowerCase()?!1:n?a.metaKey&&!a.ctrlKey:a.ctrlKey&&!a.metaKey}function s(){typeof document>"u"||document.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:`Key${e}`,metaKey:n,ctrlKey:!n,bubbles:!0}))}return{keyLabel:o,keys:r,matches:i,trigger:s}}const Fq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Vq(t,e){return w(),R("svg",Fq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M120 40V16a8 8 0 0 1 16 0v24a8 8 0 0 1-16 0m72 88a64 64 0 1 1-64-64a64.07 64.07 0 0 1 64 64m-16 0a48 48 0 1 0-48 48a48.05 48.05 0 0 0 48-48M58.34 69.66a8 8 0 0 0 11.32-11.32l-16-16a8 8 0 0 0-11.32 11.32Zm0 116.68l-16 16a8 8 0 0 0 11.32 11.32l16-16a8 8 0 0 0-11.32-11.32M192 72a8 8 0 0 0 5.66-2.34l16-16a8 8 0 0 0-11.32-11.32l-16 16A8 8 0 0 0 192 72m5.66 114.34a8 8 0 0 0-11.32 11.32l16 16a8 8 0 0 0 11.32-11.32ZM48 128a8 8 0 0 0-8-8H16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8m80 80a8 8 0 0 0-8 8v24a8 8 0 0 0 16 0v-24a8 8 0 0 0-8-8m112-88h-24a8 8 0 0 0 0 16h24a8 8 0 0 0 0-16"},null,-1)])])}const zq=Me({name:"ph-sun",render:Vq}),Hq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Wq(t,e){return w(),R("svg",Hq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M233.54 142.23a8 8 0 0 0-8-2a88.08 88.08 0 0 1-109.8-109.8a8 8 0 0 0-10-10a104.84 104.84 0 0 0-52.91 37A104 104 0 0 0 136 224a103.1 103.1 0 0 0 62.52-20.88a104.84 104.84 0 0 0 37-52.91a8 8 0 0 0-1.98-7.98m-44.64 48.11A88 88 0 0 1 65.66 67.11a89 89 0 0 1 31.4-26A106 106 0 0 0 96 56a104.11 104.11 0 0 0 104 104a106 106 0 0 0 14.92-1.06a89 89 0 0 1-26.02 31.4"},null,-1)])])}const Uq=Me({name:"ph-moon",render:Wq}),Gq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function qq(t,e){return w(),R("svg",Gq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24m8 16.37a86.4 86.4 0 0 1 16 3v169.3a86.4 86.4 0 0 1-16 3Zm32 9.26a87.8 87.8 0 0 1 16 10.54v135.66a87.8 87.8 0 0 1-16 10.54ZM40 128a88.11 88.11 0 0 1 80-87.63v175.26A88.11 88.11 0 0 1 40 128m160 50.54V77.46a87.82 87.82 0 0 1 0 101.08"},null,-1)])])}const Yq=Me({name:"ph-circle-half",render:qq}),jq={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xq(t,e){return w(),R("svg",jq,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 128a8 8 0 0 1-8 8H40a8 8 0 0 1 0-16h176a8 8 0 0 1 8 8M40 72h176a8 8 0 0 0 0-16H40a8 8 0 0 0 0 16m176 112H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const oC=Me({name:"ph-list",render:Xq}),rC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048.042969%2090.607422'%20width='48.042969'%20height='90.607422'%3e%3ctitle%3eBlueprint%20Chart%3c/title%3e%3cpath%20fill='%234B90CF'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%201%2023.072266%2034.779297%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%2023.34375%2034.810547%20A%2028%2028%200%200%201%2026.171875%2035.292969%20A%2028%2028%200%200%200%2023.34375%2034.810547%20z%20M%2016.570312%2034.84375%20A%2028%2028%200%200%200%2015.474609%2035.033203%20A%2028%2028%200%200%201%2016.570312%2034.84375%20z%20M%2026.390625%2035.341797%20A%2028%2028%200%200%201%2029.316406%2036.189453%20A%2028%2028%200%200%200%2026.390625%2035.341797%20z%20M%2013.128906%2035.511719%20A%2028%2028%200%200%200%2011.904297%2035.873047%20A%2028%2028%200%200%201%2013.128906%2035.511719%20z%20M%2029.373047%2036.210938%20A%2028%2028%200%200%201%2032.103516%2037.347656%20A%2028%2028%200%200%200%2029.373047%2036.210938%20z%20M%209.7832031%2036.609375%20A%2028%2028%200%200%200%208.5820312%2037.117188%20A%2028%2028%200%200%201%209.7832031%2036.609375%20z%20M%2032.392578%2037.486328%20A%2028%2028%200%200%201%2034.939453%2038.90625%20A%2028%2028%200%200%200%2032.392578%2037.486328%20z%20M%206.5742188%2038.128906%20A%2028%2028%200%200%200%205.4511719%2038.765625%20A%2028%2028%200%200%201%206.5742188%2038.128906%20z%20M%2035.041016%2038.966797%20A%2028%2028%200%200%201%2037.523438%2040.738281%20A%2028%2028%200%200%200%2035.041016%2038.966797%20z%20M%203.5273438%2040.080078%20A%2028%2028%200%200%200%202.5761719%2040.771484%20A%2028%2028%200%200%201%203.5273438%2040.080078%20z%20M%2037.658203%2040.851562%20A%2028%2028%200%200%201%2039.804688%2042.783203%20A%2028%2028%200%200%200%2037.658203%2040.851562%20z%20M%2040.011719%2042.990234%20A%2028%2028%200%200%201%2042.013672%2045.251953%20A%2028%2028%200%200%200%2040.011719%2042.990234%20z%20M%2042.013672%2045.251953%20A%2028%2028%200%200%201%2020.042969%2056%20A%2028%2028%200%200%201%2014.232422%2055.3125%20A%2016%2016%200%200%201%2016%2062.607422%20A%2016%2016%200%200%201%200%2078.607422%20L%200%2082.121094%20A%2028%2028%200%200%200%2020.042969%2090.607422%20A%2028%2028%200%200%200%2048.042969%2062.607422%20A%2028%2028%200%200%200%2042.013672%2045.251953%20z%20M%201.3007812%2046.667969%20A%2016%2016%200%200%201%201.6191406%2046.697266%20A%2016%2016%200%200%200%201.3007812%2046.667969%20z%20M%204.2558594%2047.189453%20A%2016%2016%200%200%201%204.4355469%2047.242188%20A%2016%2016%200%200%200%204.2558594%2047.189453%20z%20'/%3e%3cpath%20fill='%23163A65'%20d='M%206.0637516%2038.376047%20A%2028%2028%200%200%201%2020.042969%2034.615234%20A%2028%2028%200%200%201%2042.013672%2045.259765%20A%2028%2028%200%200%200%2048.042969%2028.007812%20A%2028%2028%200%200%200%2020.042969%200.0078125%20A%2028%2028%200%200%200%200%208.4941407%20L%200%2016.007812%20A%2012%2012%200%200%201%2012%2028.007812%20A%2012%2012%200%200%201%206.0613693%2038.364443%20'/%3e%3cpath%20fill='%23A3C9E8'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%200%205.0878906%2038.970703%20A%2028%2028%200%200%201%206.0644531%2038.376953%20L%206.0605469%2038.365234%20A%2012%2012%200%200%201%200%2040.007812%20L%200%2043.09375%20L%200%2043.101562%20L%200%2046.607422%20A%2016%2016%200%200%201%202.8847656%2046.873047%20A%2016%2016%200%200%201%202.9199219%2046.878906%20A%2016%2016%200%200%201%205.7011719%2047.662109%20A%2016%2016%200%200%201%205.7324219%2047.673828%20A%2016%2016%200%200%201%208.3300781%2048.955078%20A%2016%2016%200%200%201%208.3398438%2048.958984%20A%2016%2016%200%200%201%208.3457031%2048.962891%20A%2016%2016%200%200%201%2010.662109%2050.6875%20A%2016%2016%200%200%201%2010.697266%2050.71875%20A%2016%2016%200%200%201%2012.660156%2052.837891%20A%2016%2016%200%200%201%2012.667969%2052.845703%20A%2016%2016%200%200%201%2012.673828%2052.855469%20A%2016%2016%200%200%201%2014.228516%2055.306641%20A%2016%2016%200%200%201%2014.232422%2055.3125%20A%2028%2028%200%200%200%2020.042969%2056%20A%2028%2028%200%200%200%2042.013672%2045.251953%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%204.7695312%2039.177734%20A%2028%2028%200%200%200%202.5390625%2040.798828%20A%2028%2028%200%200%201%204.7695312%2039.177734%20z%20M%202.1816406%2041.091797%20A%2028%2028%200%200%200%200.11914062%2042.984375%20A%2028%2028%200%200%201%202.1816406%2041.091797%20z%20'/%3e%3c/svg%3e",iC="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048.042969%2090.607422'%20width='48.042969'%20height='90.607422'%3e%3ctitle%3eBlueprint%20Chart%3c/title%3e%3cpath%20fill='%234B90CF'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%201%2023.072266%2034.779297%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%2023.34375%2034.810547%20A%2028%2028%200%200%201%2026.171875%2035.292969%20A%2028%2028%200%200%200%2023.34375%2034.810547%20z%20M%2016.570312%2034.84375%20A%2028%2028%200%200%200%2015.474609%2035.033203%20A%2028%2028%200%200%201%2016.570312%2034.84375%20z%20M%2026.390625%2035.341797%20A%2028%2028%200%200%201%2029.316406%2036.189453%20A%2028%2028%200%200%200%2026.390625%2035.341797%20z%20M%2013.128906%2035.511719%20A%2028%2028%200%200%200%2011.904297%2035.873047%20A%2028%2028%200%200%201%2013.128906%2035.511719%20z%20M%2029.373047%2036.210938%20A%2028%2028%200%200%201%2032.103516%2037.347656%20A%2028%2028%200%200%200%2029.373047%2036.210938%20z%20M%209.7832031%2036.609375%20A%2028%2028%200%200%200%208.5820312%2037.117188%20A%2028%2028%200%200%201%209.7832031%2036.609375%20z%20M%2032.392578%2037.486328%20A%2028%2028%200%200%201%2034.939453%2038.90625%20A%2028%2028%200%200%200%2032.392578%2037.486328%20z%20M%206.5742188%2038.128906%20A%2028%2028%200%200%200%205.4511719%2038.765625%20A%2028%2028%200%200%201%206.5742188%2038.128906%20z%20M%2035.041016%2038.966797%20A%2028%2028%200%200%201%2037.523438%2040.738281%20A%2028%2028%200%200%200%2035.041016%2038.966797%20z%20M%203.5273438%2040.080078%20A%2028%2028%200%200%200%202.5761719%2040.771484%20A%2028%2028%200%200%201%203.5273438%2040.080078%20z%20M%2037.658203%2040.851562%20A%2028%2028%200%200%201%2039.804688%2042.783203%20A%2028%2028%200%200%200%2037.658203%2040.851562%20z%20M%2040.011719%2042.990234%20A%2028%2028%200%200%201%2042.013672%2045.251953%20A%2028%2028%200%200%200%2040.011719%2042.990234%20z%20M%2042.013672%2045.251953%20A%2028%2028%200%200%201%2020.042969%2056%20A%2028%2028%200%200%201%2014.232422%2055.3125%20A%2016%2016%200%200%201%2016%2062.607422%20A%2016%2016%200%200%201%200%2078.607422%20L%200%2082.121094%20A%2028%2028%200%200%200%2020.042969%2090.607422%20A%2028%2028%200%200%200%2048.042969%2062.607422%20A%2028%2028%200%200%200%2042.013672%2045.251953%20z%20M%201.3007812%2046.667969%20A%2016%2016%200%200%201%201.6191406%2046.697266%20A%2016%2016%200%200%200%201.3007812%2046.667969%20z%20M%204.2558594%2047.189453%20A%2016%2016%200%200%201%204.4355469%2047.242188%20A%2016%2016%200%200%200%204.2558594%2047.189453%20z%20'/%3e%3cpath%20fill='%23163A65'%20d='M%206.0637516%2038.376047%20A%2028%2028%200%200%201%2020.042969%2034.615234%20A%2028%2028%200%200%201%2042.013672%2045.259765%20A%2028%2028%200%200%200%2048.042969%2028.007812%20A%2028%2028%200%200%200%2020.042969%200.0078125%20A%2028%2028%200%200%200%200%208.4941407%20L%200%2016.007812%20A%2012%2012%200%200%201%2012%2028.007812%20A%2012%2012%200%200%201%206.0613693%2038.364443%20'/%3e%3cpath%20fill='%23A3C9E8'%20d='M%2020.042969%2034.607422%20A%2028%2028%200%200%200%205.0878906%2038.970703%20A%2028%2028%200%200%201%206.0644531%2038.376953%20L%206.0605469%2038.365234%20A%2012%2012%200%200%201%200%2040.007812%20L%200%2043.09375%20L%200%2043.101562%20L%200%2046.607422%20A%2016%2016%200%200%201%202.8847656%2046.873047%20A%2016%2016%200%200%201%202.9199219%2046.878906%20A%2016%2016%200%200%201%205.7011719%2047.662109%20A%2016%2016%200%200%201%205.7324219%2047.673828%20A%2016%2016%200%200%201%208.3300781%2048.955078%20A%2016%2016%200%200%201%208.3398438%2048.958984%20A%2016%2016%200%200%201%208.3457031%2048.962891%20A%2016%2016%200%200%201%2010.662109%2050.6875%20A%2016%2016%200%200%201%2010.697266%2050.71875%20A%2016%2016%200%200%201%2012.660156%2052.837891%20A%2016%2016%200%200%201%2012.667969%2052.845703%20A%2016%2016%200%200%201%2012.673828%2052.855469%20A%2016%2016%200%200%201%2014.228516%2055.306641%20A%2016%2016%200%200%201%2014.232422%2055.3125%20A%2028%2028%200%200%200%2020.042969%2056%20A%2028%2028%200%200%200%2042.013672%2045.251953%20A%2028%2028%200%200%200%2020.042969%2034.607422%20z%20M%204.7695312%2039.177734%20A%2028%2028%200%200%200%202.5390625%2040.798828%20A%2028%2028%200%200%201%204.7695312%2039.177734%20z%20M%202.1816406%2041.091797%20A%2028%2028%200%200%200%200.11914062%2042.984375%20A%2028%2028%200%200%201%202.1816406%2041.091797%20z%20'/%3e%3c/svg%3e",Kq={class:"layout-navbar"},Zq={class:"layout-navbar__lead d-xl-none"},Qq=le({__name:"LayoutNavbar",props:{sidebarOpen:{type:Boolean}},emits:["searchClick","toggleSidebar"],setup(t){const{theme:e,cycleTheme:n,resolvedTheme:o}=Mf(),{isNarrow:r}=bi(),i=nC("k"),s={light:zq,dark:Uq,auto:Yq},a=A(()=>s[e.value]),l=A(()=>r.value?"Search…":"Search or jump to…"),c=A(()=>o.value==="dark"?iC:rC);return(u,d)=>(w(),R("header",Kq,[T("div",Zq,[H(p(Qn),{"icon-left":p(oC),label:"Open navigation","hide-label":"",square:"",size:"sm",variant:"outline-secondary","aria-haspopup":"dialog","aria-expanded":t.sidebarOpen?"true":"false","aria-controls":"layout-sidebar-offcanvas",onClick:d[0]||(d[0]=f=>u.$emit("toggleSidebar"))},null,8,["icon-left","aria-expanded"]),H(p(jA),{name:"Blueprint Chart","logo-src":c.value,to:"/"},null,8,["logo-src"])]),H(p(bU),{placeholder:l.value,"shortcut-label":p(i).keyLabel,collapsed:p(r),class:"layout-navbar__search",onClick:d[1]||(d[1]=f=>u.$emit("searchClick"))},null,8,["placeholder","shortcut-label","collapsed"]),d[2]||(d[2]=T("div",{class:"layout-navbar__spacer"},null,-1)),H(p(Qn),{"icon-left":a.value,label:"Toggle theme","hide-label":"",square:"",variant:"outline-secondary",size:"sm",class:"layout-navbar__theme",onClick:p(n)},null,8,["icon-left","onClick"])]))}}),Jq=Be(Qq,[["__scopeId","data-v-06653289"]]);var Le=(t=>(t.BarVertical="bar-vertical",t.BarHorizontal="bar-horizontal",t.BarMulti="bar-multi",t.ColumnStacked="column-stacked",t.BarStacked="bar-stacked",t.BarSplit="bar-split",t.BarGrouped="bar-grouped",t.Line="line",t.LineMulti="line-multi",t.Area="area",t.AreaStacked="area-stacked",t.Donut="donut",t.Pie="pie",t.VerticalBar="vertical-bar",t.HorizontalBar="horizontal-bar",t))(Le||{}),si=(t=>(t.Left="left",t.Right="right",t))(si||{}),iu=(t=>(t.Linear="linear",t.Log="log",t))(iu||{}),Un=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t.None="none",t))(Un||{}),rn=(t=>(t.Auto="auto",t.Inside="inside",t.Outside="outside",t.Off="off",t))(rn||{}),Od=(t=>(t.Auto="auto",t.Horizontal="horizontal",t.Vertical="vertical",t))(Od||{}),Pn=(t=>(t.NW="NW",t.N="N",t.NE="NE",t.E="E",t.SE="SE",t.S="S",t.SW="SW",t.W="W",t.Center="center",t))(Pn||{}),Ao=(t=>(t.Direct="direct",t.CurveLeft="curve-left",t.CurveRight="curve-right",t.Elbow="elbow",t))(Ao||{}),Wp=(t=>(t.Solid="solid",t.Dotted="dotted",t.Dashed="dashed",t))(Wp||{}),Pt=(t=>(t.Point="point",t.Range="range",t.Free="free",t))(Pt||{}),sC=(t=>(t.Hide="hide",t.Show="show",t))(sC||{}),aC=(t=>(t.Start="start",t.Center="center",t.End="end",t))(aC||{}),Kn=(t=>(t.Vertical="vertical",t.Horizontal="horizontal",t))(Kn||{}),vr=(t=>(t.Circle="circle",t.Square="square",t.Diamond="diamond",t.Triangle="triangle",t.TriangleDown="triangleDown",t.Cross="cross",t.Star="star",t))(vr||{}),yr=(t=>(t.All="all",t.First="first",t.Last="last",t.FirstLast="firstLast",t))(yr||{}),Ro=(t=>(t.Filled="filled",t.Hollow="hollow",t))(Ro||{}),Jt=(t=>(t.Ascending="ascending",t.Descending="descending",t.None="none",t))(Jt||{}),ui=(t=>(t.Total="total",t.WithinGroups="within-groups",t.None="none",t))(ui||{}),Ac=(t=>(t.Top="top",t.Bottom="bottom",t.Left="left",t.Right="right",t))(Ac||{}),Is=(t=>(t.Start="start",t.Middle="middle",t.End="end",t))(Is||{}),xt=(t=>(t.Inside="inside",t.Outside="outside",t.Auto="auto",t))(xt||{}),Co=(t=>(t.Both="both",t.Vertical="vertical",t.Horizontal="horizontal",t))(Co||{}),di=(t=>(t.Solid="solid",t.Dashed="dashed",t.Dotted="dotted",t))(di||{}),Tl=(t=>(t.Normal="normal",t.Percent="percent",t))(Tl||{}),Qe=(t=>(t.Colors="colors",t.Boolean="boolean",t.Select="select",t.Text="text",t.NumberFormat="numberFormat",t.DateFormat="dateFormat",t))(Qe||{}),$o=(t=>(t.Off="",t.Auto="auto",t.Outside="outside",t.Inside="inside",t))($o||{}),ii=(t=>(t.Linear="linear",t.MonotoneX="monotoneX",t.Step="step",t.StepBefore="stepBefore",t.StepAfter="stepAfter",t.Basis="basis",t.Cardinal="cardinal",t.CatmullRom="catmullRom",t))(ii||{});function eY(t){return t}var Qh=1,Jh=2,D1=3,cd=4,l8=1e-6;function tY(t){return"translate("+t+",0)"}function nY(t){return"translate(0,"+t+")"}function oY(t){return e=>+t(e)}function rY(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function iY(){return!this.__axis}function Am(t,e){var n=[],o=null,r=null,i=6,s=6,a=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,c=t===Qh||t===cd?-1:1,u=t===cd||t===Jh?"x":"y",d=t===Qh||t===D1?tY:nY;function f(h){var g=o??(e.ticks?e.ticks.apply(e,n):e.domain()),v=r??(e.tickFormat?e.tickFormat.apply(e,n):eY),m=Math.max(i,0)+a,b=e.range(),y=+b[0]+l,x=+b[b.length-1]+l,_=(e.bandwidth?rY:oY)(e.copy(),l),S=h.selection?h.selection():h,N=S.selectAll(".domain").data([null]),B=S.selectAll(".tick").data(g,e).order(),k=B.exit(),L=B.enter().append("g").attr("class","tick"),E=B.select("line"),I=B.select("text");N=N.merge(N.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),B=B.merge(L),E=E.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",c*i)),I=I.merge(L.append("text").attr("fill","currentColor").attr(u,c*m).attr("dy",t===Qh?"0em":t===D1?"0.71em":"0.32em")),h!==S&&(N=N.transition(h),B=B.transition(h),E=E.transition(h),I=I.transition(h),k=k.transition(h).attr("opacity",l8).attr("transform",function(C){return isFinite(C=_(C))?d(C+l):this.getAttribute("transform")}),L.attr("opacity",l8).attr("transform",function(C){var $=this.parentNode.__axis;return d(($&&isFinite($=$(C))?$:_(C))+l)})),k.remove(),N.attr("d",t===cd||t===Jh?s?"M"+c*s+","+y+"H"+l+"V"+x+"H"+c*s:"M"+l+","+y+"V"+x:s?"M"+y+","+c*s+"V"+l+"H"+x+"V"+c*s:"M"+y+","+l+"H"+x),B.attr("opacity",1).attr("transform",function(C){return d(_(C)+l)}),E.attr(u+"2",c*i),I.attr(u,c*m).text(v),S.filter(iY).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Jh?"start":t===cd?"end":"middle"),S.each(function(){this.__axis=_})}return f.scale=function(h){return arguments.length?(e=h,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),f):n.slice()},f.tickValues=function(h){return arguments.length?(o=h==null?null:Array.from(h),f):o&&o.slice()},f.tickFormat=function(h){return arguments.length?(r=h,f):r},f.tickSize=function(h){return arguments.length?(i=s=+h,f):i},f.tickSizeInner=function(h){return arguments.length?(i=+h,f):i},f.tickSizeOuter=function(h){return arguments.length?(s=+h,f):s},f.tickPadding=function(h){return arguments.length?(a=+h,f):a},f.offset=function(h){return arguments.length?(l=+h,f):l},f}function sY(t){return Am(Qh,t)}function c8(t){return Am(Jh,t)}function aY(t){return Am(D1,t)}function u8(t){return Am(cd,t)}var lY={value:()=>{}};function Yy(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new ep(n)}function ep(t){this._=t}function cY(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}ep.prototype=Yy.prototype={constructor:ep,on:function(t,e){var n=this._,o=cY(t+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(t=o[i]).type)&&(r=uY(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(r=(t=o[i]).type)n[r]=d8(n[r],t.name,e);else if(e==null)for(r in n)n[r]=d8(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ep(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};function uY(t,e){for(var n=0,o=t.length,r;n<o;++n)if((r=t[n]).name===e)return r.value}function d8(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=lY,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var E1="http://www.w3.org/1999/xhtml";const f8={svg:"http://www.w3.org/2000/svg",xhtml:E1,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cm(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),f8.hasOwnProperty(e)?{space:f8[e],local:t}:t}function dY(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===E1&&e.documentElement.namespaceURI===E1?e.createElement(t):e.createElementNS(n,t)}}function fY(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lC(t){var e=Cm(t);return(e.local?fY:dY)(e)}function hY(){}function jy(t){return t==null?hY:function(){return this.querySelector(t)}}function pY(t){typeof t!="function"&&(t=jy(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=new Array(s),l,c,u=0;u<s;++u)(l=i[u])&&(c=t.call(l,l.__data__,u,i))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new $r(o,this._parents)}function mY(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function gY(){return[]}function cC(t){return t==null?gY:function(){return this.querySelectorAll(t)}}function vY(t){return function(){return mY(t.apply(this,arguments))}}function bY(t){typeof t=="function"?t=vY(t):t=cC(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var s=e[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(o.push(t.call(l,l.__data__,c,s)),r.push(l));return new $r(o,r)}function uC(t){return function(){return this.matches(t)}}function dC(t){return function(e){return e.matches(t)}}var yY=Array.prototype.find;function xY(t){return function(){return yY.call(this.children,t)}}function wY(){return this.firstElementChild}function _Y(t){return this.select(t==null?wY:xY(typeof t=="function"?t:dC(t)))}var kY=Array.prototype.filter;function SY(){return Array.from(this.children)}function AY(t){return function(){return kY.call(this.children,t)}}function CY(t){return this.selectAll(t==null?SY:AY(typeof t=="function"?t:dC(t)))}function $Y(t){typeof t!="function"&&(t=uC(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new $r(o,this._parents)}function fC(t){return new Array(t.length)}function TY(){return new $r(this._enter||this._groups.map(fC),this._parents)}function Up(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Up.prototype={constructor:Up,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function MY(t){return function(){return t}}function OY(t,e,n,o,r,i){for(var s=0,a,l=e.length,c=i.length;s<c;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Up(t,i[s]);for(;s<l;++s)(a=e[s])&&(r[s]=a)}function BY(t,e,n,o,r,i,s){var a,l,c=new Map,u=e.length,d=i.length,f=new Array(u),h;for(a=0;a<u;++a)(l=e[a])&&(f[a]=h=s.call(l,l.__data__,a,e)+"",c.has(h)?r[a]=l:c.set(h,l));for(a=0;a<d;++a)h=s.call(t,i[a],a,i)+"",(l=c.get(h))?(o[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Up(t,i[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(f[a])===l&&(r[a]=l)}function LY(t){return t.__data__}function PY(t,e){if(!arguments.length)return Array.from(this,LY);var n=e?BY:OY,o=this._parents,r=this._groups;typeof t!="function"&&(t=MY(t));for(var i=r.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var u=o[c],d=r[c],f=d.length,h=DY(t.call(u,u&&u.__data__,c,o)),g=h.length,v=a[c]=new Array(g),m=s[c]=new Array(g),b=l[c]=new Array(f);n(u,d,v,m,b,h,e);for(var y=0,x=0,_,S;y<g;++y)if(_=v[y]){for(y>=x&&(x=y+1);!(S=m[x])&&++x<g;);_._next=S||null}}return s=new $r(s,o),s._enter=a,s._exit=l,s}function DY(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function EY(){return new $r(this._exit||this._groups.map(fC),this._parents)}function NY(t,e,n){var o=this.enter(),r=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function IY(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=n[l],u=o[l],d=c.length,f=a[l]=new Array(d),h,g=0;g<d;++g)(h=c[g]||u[g])&&(f[g]=h);for(;l<r;++l)a[l]=n[l];return new $r(a,this._parents)}function RY(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function FY(t){t||(t=VY);function e(d,f){return d&&f?t(d.__data__,f.__data__):!d-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,l=r[i]=new Array(a),c,u=0;u<a;++u)(c=s[u])&&(l[u]=c);l.sort(e)}return new $r(r,this._parents).order()}function VY(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function zY(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function HY(){return Array.from(this)}function WY(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function UY(){let t=0;for(const e of this)++t;return t}function GY(){return!this.node()}function qY(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r=e[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&t.call(a,a.__data__,i,r);return this}function YY(t){return function(){this.removeAttribute(t)}}function jY(t){return function(){this.removeAttributeNS(t.space,t.local)}}function XY(t,e){return function(){this.setAttribute(t,e)}}function KY(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ZY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function QY(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function JY(t,e){var n=Cm(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?jY:YY:typeof e=="function"?n.local?QY:ZY:n.local?KY:XY)(n,e))}function hC(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ej(t){return function(){this.style.removeProperty(t)}}function tj(t,e,n){return function(){this.style.setProperty(t,e,n)}}function nj(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function oj(t,e,n){return arguments.length>1?this.each((e==null?ej:typeof e=="function"?nj:tj)(t,e,n??"")):su(this.node(),t)}function su(t,e){return t.style.getPropertyValue(e)||hC(t).getComputedStyle(t,null).getPropertyValue(e)}function rj(t){return function(){delete this[t]}}function ij(t,e){return function(){this[t]=e}}function sj(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function aj(t,e){return arguments.length>1?this.each((e==null?rj:typeof e=="function"?sj:ij)(t,e)):this.node()[t]}function pC(t){return t.trim().split(/^|\s+/)}function Xy(t){return t.classList||new mC(t)}function mC(t){this._node=t,this._names=pC(t.getAttribute("class")||"")}mC.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 gC(t,e){for(var n=Xy(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function vC(t,e){for(var n=Xy(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function lj(t){return function(){gC(this,t)}}function cj(t){return function(){vC(this,t)}}function uj(t,e){return function(){(e.apply(this,arguments)?gC:vC)(this,t)}}function dj(t,e){var n=pC(t+"");if(arguments.length<2){for(var o=Xy(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?uj:e?lj:cj)(n,e))}function fj(){this.textContent=""}function hj(t){return function(){this.textContent=t}}function pj(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function mj(t){return arguments.length?this.each(t==null?fj:(typeof t=="function"?pj:hj)(t)):this.node().textContent}function gj(){this.innerHTML=""}function vj(t){return function(){this.innerHTML=t}}function bj(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function yj(t){return arguments.length?this.each(t==null?gj:(typeof t=="function"?bj:vj)(t)):this.node().innerHTML}function xj(){this.nextSibling&&this.parentNode.appendChild(this)}function wj(){return this.each(xj)}function _j(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kj(){return this.each(_j)}function Sj(t){var e=typeof t=="function"?t:lC(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Aj(){return null}function Cj(t,e){var n=typeof t=="function"?t:lC(t),o=e==null?Aj:typeof e=="function"?e:jy(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function $j(){var t=this.parentNode;t&&t.removeChild(this)}function Tj(){return this.each($j)}function Mj(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Oj(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Bj(t){return this.select(t?Oj:Mj)}function Lj(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Pj(t){return function(e){t.call(this,e,this.__data__)}}function Dj(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function Ej(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,r=e.length,i;n<r;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function Nj(t,e,n){return function(){var o=this.__on,r,i=Pj(e);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=e;return}}this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Ij(t,e,n){var o=Dj(t+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(r=0,u=a[l];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=e?Nj:Ej,r=0;r<i;++r)this.each(a(o[r],e,n));return this}function bC(t,e,n){var o=hC(t),r=o.CustomEvent;typeof r=="function"?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function Rj(t,e){return function(){return bC(this,t,e)}}function Fj(t,e){return function(){return bC(this,t,e.apply(this,arguments))}}function Vj(t,e){return this.each((typeof e=="function"?Fj:Rj)(t,e))}function*zj(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var yC=[null];function $r(t,e){this._groups=t,this._parents=e}function _u(){return new $r([[document.documentElement]],yC)}function Hj(){return this}$r.prototype=_u.prototype={constructor:$r,select:pY,selectAll:bY,selectChild:_Y,selectChildren:CY,filter:$Y,data:PY,enter:TY,exit:EY,join:NY,merge:IY,selection:Hj,order:RY,sort:FY,call:zY,nodes:HY,node:WY,size:UY,empty:GY,each:qY,attr:JY,style:oj,property:aj,classed:dj,text:mj,html:yj,raise:wj,lower:kj,append:Sj,insert:Cj,remove:Tj,clone:Bj,datum:Lj,on:Ij,dispatch:Vj,[Symbol.iterator]:zj};function Se(t){return typeof t=="string"?new $r([[document.querySelector(t)]],[document.documentElement]):new $r([[t]],yC)}function Wj(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Uj(t,e){if(t=Wj(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}function Ky(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function xC(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Of(){}var Jd=.7,Gp=1/Jd,Ic="\\s*([+-]?\\d+)\\s*",ef="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",os="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gj=/^#([0-9a-f]{3,8})$/,qj=new RegExp(`^rgb\\(${Ic},${Ic},${Ic}\\)$`),Yj=new RegExp(`^rgb\\(${os},${os},${os}\\)$`),jj=new RegExp(`^rgba\\(${Ic},${Ic},${Ic},${ef}\\)$`),Xj=new RegExp(`^rgba\\(${os},${os},${os},${ef}\\)$`),Kj=new RegExp(`^hsl\\(${ef},${os},${os}\\)$`),Zj=new RegExp(`^hsla\\(${ef},${os},${os},${ef}\\)$`),h8={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ky(Of,Vl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:p8,formatHex:p8,formatHex8:Qj,formatHsl:Jj,formatRgb:m8,toString:m8});function p8(){return this.rgb().formatHex()}function Qj(){return this.rgb().formatHex8()}function Jj(){return wC(this).formatHsl()}function m8(){return this.rgb().formatRgb()}function Vl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Gj.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?g8(e):n===3?new rr(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?lh(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?lh(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=qj.exec(t))?new rr(e[1],e[2],e[3],1):(e=Yj.exec(t))?new rr(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=jj.exec(t))?lh(e[1],e[2],e[3],e[4]):(e=Xj.exec(t))?lh(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Kj.exec(t))?y8(e[1],e[2]/100,e[3]/100,1):(e=Zj.exec(t))?y8(e[1],e[2]/100,e[3]/100,e[4]):h8.hasOwnProperty(t)?g8(h8[t]):t==="transparent"?new rr(NaN,NaN,NaN,0):null}function g8(t){return new rr(t>>16&255,t>>8&255,t&255,1)}function lh(t,e,n,o){return o<=0&&(t=e=n=NaN),new rr(t,e,n,o)}function eX(t){return t instanceof Of||(t=Vl(t)),t?(t=t.rgb(),new rr(t.r,t.g,t.b,t.opacity)):new rr}function N1(t,e,n,o){return arguments.length===1?eX(t):new rr(t,e,n,o??1)}function rr(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}Ky(rr,N1,xC(Of,{brighter(t){return t=t==null?Gp:Math.pow(Gp,t),new rr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Jd:Math.pow(Jd,t),new rr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new rr(Ml(this.r),Ml(this.g),Ml(this.b),qp(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:v8,formatHex:v8,formatHex8:tX,formatRgb:b8,toString:b8}));function v8(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}`}function tX(){return`#${_l(this.r)}${_l(this.g)}${_l(this.b)}${_l((isNaN(this.opacity)?1:this.opacity)*255)}`}function b8(){const t=qp(this.opacity);return`${t===1?"rgb(":"rgba("}${Ml(this.r)}, ${Ml(this.g)}, ${Ml(this.b)}${t===1?")":`, ${t})`}`}function qp(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ml(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function _l(t){return t=Ml(t),(t<16?"0":"")+t.toString(16)}function y8(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ai(t,e,n,o)}function wC(t){if(t instanceof ai)return new ai(t.h,t.s,t.l,t.opacity);if(t instanceof Of||(t=Vl(t)),!t)return new ai;if(t instanceof ai)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,r=Math.min(e,n,o),i=Math.max(e,n,o),s=NaN,a=i-r,l=(i+r)/2;return a?(e===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-e)/a+2:s=(e-n)/a+4,a/=l<.5?i+r:2-i-r,s*=60):a=l>0&&l<1?0:s,new ai(s,a,l,t.opacity)}function nX(t,e,n,o){return arguments.length===1?wC(t):new ai(t,e,n,o??1)}function ai(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}Ky(ai,nX,xC(Of,{brighter(t){return t=t==null?Gp:Math.pow(Gp,t),new ai(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Jd:Math.pow(Jd,t),new ai(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,o=n+(n<.5?n:1-n)*e,r=2*n-o;return new rr(cv(t>=240?t-240:t+120,r,o),cv(t,r,o),cv(t<120?t+240:t-120,r,o),this.opacity)},clamp(){return new ai(x8(this.h),ch(this.s),ch(this.l),qp(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=qp(this.opacity);return`${t===1?"hsl(":"hsla("}${x8(this.h)}, ${ch(this.s)*100}%, ${ch(this.l)*100}%${t===1?")":`, ${t})`}`}}));function x8(t){return t=(t||0)%360,t<0?t+360:t}function ch(t){return Math.max(0,Math.min(1,t||0))}function cv(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 Zy=t=>()=>t;function oX(t,e){return function(n){return t+n*e}}function rX(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function iX(t){return(t=+t)==1?_C:function(e,n){return n-e?rX(e,n,t):Zy(isNaN(e)?n:e)}}function _C(t,e){var n=e-t;return n?oX(t,n):Zy(isNaN(t)?e:t)}const Yp=(function t(e){var n=iX(e);function o(r,i){var s=n((r=N1(r)).r,(i=N1(i)).r),a=n(r.g,i.g),l=n(r.b,i.b),c=_C(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=l(u),r.opacity=c(u),r+""}}return o.gamma=t,o})(1);function sX(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=t[r]*(1-i)+e[r]*i;return o}}function aX(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function lX(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=Qy(t[s],e[s]);for(;s<n;++s)i[s]=e[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function cX(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function ro(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Bd(t,e){var n={},o={},r;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(r in e)r in t?n[r]=Qy(t[r],e[r]):o[r]=e[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var I1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uv=new RegExp(I1.source,"g");function uX(t){return function(){return t}}function dX(t){return function(e){return t(e)+""}}function kC(t,e){var n=I1.lastIndex=uv.lastIndex=0,o,r,i,s=-1,a=[],l=[];for(t=t+"",e=e+"";(o=I1.exec(t))&&(r=uv.exec(e));)(i=r.index)>n&&(i=e.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:ro(o,r)})),n=uv.lastIndex;return n<e.length&&(i=e.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?dX(l[0].x):uX(e):(e=l.length,function(c){for(var u=0,d;u<e;++u)a[(d=l[u]).i]=d.x(c);return a.join("")})}function Qy(t,e){var n=typeof e,o;return e==null||n==="boolean"?Zy(e):(n==="number"?ro:n==="string"?(o=Vl(e))?(e=o,Yp):kC:e instanceof Vl?Yp:e instanceof Date?cX:aX(e)?sX:Array.isArray(e)?lX:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Bd:ro)(t,e)}function fX(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var w8=180/Math.PI,R1={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function SC(t,e,n,o,r,i){var s,a,l;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(l=t*n+e*o)&&(n-=t*l,o-=e*l),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,l/=a),t*o<e*n&&(t=-t,e=-e,l=-l,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*w8,skewX:Math.atan(l)*w8,scaleX:s,scaleY:a}}var uh;function hX(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?R1:SC(e.a,e.b,e.c,e.d,e.e,e.f)}function pX(t){return t==null||(uh||(uh=document.createElementNS("http://www.w3.org/2000/svg","g")),uh.setAttribute("transform",t),!(t=uh.transform.baseVal.consolidate()))?R1:(t=t.matrix,SC(t.a,t.b,t.c,t.d,t.e,t.f))}function AC(t,e,n,o){function r(c){return c.length?c.pop()+" ":""}function i(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push("translate(",null,e,null,n);g.push({i:v-4,x:ro(c,d)},{i:v-2,x:ro(u,f)})}else(d||f)&&h.push("translate("+d+e+f+n)}function s(c,u,d,f){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:ro(c,u)})):u&&d.push(r(d)+"rotate("+u+o)}function a(c,u,d,f){c!==u?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:ro(c,u)}):u&&d.push(r(d)+"skewX("+u+o)}function l(c,u,d,f,h,g){if(c!==d||u!==f){var v=h.push(r(h)+"scale(",null,",",null,")");g.push({i:v-4,x:ro(c,d)},{i:v-2,x:ro(u,f)})}else(d!==1||f!==1)&&h.push(r(h)+"scale("+d+","+f+")")}return function(c,u){var d=[],f=[];return c=t(c),u=t(u),i(c.translateX,c.translateY,u.translateX,u.translateY,d,f),s(c.rotate,u.rotate,d,f),a(c.skewX,u.skewX,d,f),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,d,f),c=u=null,function(h){for(var g=-1,v=f.length,m;++g<v;)d[(m=f[g]).i]=m.x(h);return d.join("")}}}var mX=AC(hX,"px, ","px)","deg)"),gX=AC(pX,", ",")",")"),au=0,ud=0,Qu=0,CC=1e3,jp,dd,Xp=0,zl=0,$m=0,tf=typeof performance=="object"&&performance.now?performance:Date,$C=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Jy(){return zl||($C(vX),zl=tf.now()+$m)}function vX(){zl=0}function Kp(){this._call=this._time=this._next=null}Kp.prototype=TC.prototype={constructor:Kp,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Jy():+n)+(e==null?0:+e),!this._next&&dd!==this&&(dd?dd._next=this:jp=this,dd=this),this._call=t,this._time=n,F1()},stop:function(){this._call&&(this._call=null,this._time=1/0,F1())}};function TC(t,e,n){var o=new Kp;return o.restart(t,e,n),o}function bX(){Jy(),++au;for(var t=jp,e;t;)(e=zl-t._time)>=0&&t._call.call(void 0,e),t=t._next;--au}function _8(){zl=(Xp=tf.now())+$m,au=ud=0;try{bX()}finally{au=0,xX(),zl=0}}function yX(){var t=tf.now(),e=t-Xp;e>CC&&($m-=e,Xp=t)}function xX(){for(var t,e=jp,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:jp=n);dd=t,F1(o)}function F1(t){if(!au){ud&&(ud=clearTimeout(ud));var e=t-zl;e>24?(t<1/0&&(ud=setTimeout(_8,t-tf.now()-$m)),Qu&&(Qu=clearInterval(Qu))):(Qu||(Xp=tf.now(),Qu=setInterval(yX,CC)),au=1,$C(_8))}}function k8(t,e,n){var o=new Kp;return e=e==null?0:+e,o.restart(r=>{o.stop(),t(r+e)},e,n),o}var wX=Yy("start","end","cancel","interrupt"),_X=[],MC=0,S8=1,V1=2,tp=3,A8=4,z1=5,np=6;function Tm(t,e,n,o,r,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;kX(t,n,{name:e,index:o,group:r,on:wX,tween:_X,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:MC})}function e2(t,e){var n=Pi(t,e);if(n.state>MC)throw new Error("too late; already scheduled");return n}function ps(t,e){var n=Pi(t,e);if(n.state>tp)throw new Error("too late; already running");return n}function Pi(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function kX(t,e,n){var o=t.__transition,r;o[e]=n,n.timer=TC(i,0,n.time);function i(c){n.state=S8,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var u,d,f,h;if(n.state!==S8)return l();for(u in o)if(h=o[u],h.name===n.name){if(h.state===tp)return k8(s);h.state===A8?(h.state=np,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[u]):+u<e&&(h.state=np,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[u])}if(k8(function(){n.state===tp&&(n.state=A8,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=V1,n.on.call("start",t,t.__data__,n.index,n.group),n.state===V1){for(n.state=tp,r=new Array(f=n.tween.length),u=0,d=-1;u<f;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(r[++d]=h);r.length=d+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=z1,1),d=-1,f=r.length;++d<f;)r[d].call(t,u);n.state===z1&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=np,n.timer.stop(),delete o[e];for(var c in o)return;delete t.__transition}}function SX(t,e){var n=t.__transition,o,r,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((o=n[s]).name!==e){i=!1;continue}r=o.state>V1&&o.state<z1,o.state=np,o.timer.stop(),o.on.call(r?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[s]}i&&delete t.__transition}}function AX(t){return this.each(function(){SX(this,t)})}function CX(t,e){var n,o;return function(){var r=ps(this,t),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===e){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function $X(t,e,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=ps(this,t),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:e,value:n},l=0,c=r.length;l<c;++l)if(r[l].name===e){r[l]=a;break}l===c&&r.push(a)}i.tween=r}}function TX(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=Pi(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===t)return s.value;return null}return this.each((e==null?CX:$X)(n,t,e))}function t2(t,e,n){var o=t._id;return t.each(function(){var r=ps(this,o);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return Pi(r,o).value[e]}}function OC(t,e){var n;return(typeof e=="number"?ro:e instanceof Vl?Yp:(n=Vl(e))?(e=n,Yp):kC)(t,e)}function MX(t){return function(){this.removeAttribute(t)}}function OX(t){return function(){this.removeAttributeNS(t.space,t.local)}}function BX(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttribute(t);return s===r?null:s===o?i:i=e(o=s,n)}}function LX(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===o?i:i=e(o=s,n)}}function PX(t,e,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a)))}}function DX(t,e,n){var o,r,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),l=a+"",s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a)))}}function EX(t,e){var n=Cm(t),o=n==="transform"?gX:OC;return this.attrTween(t,typeof e=="function"?(n.local?DX:PX)(n,o,t2(this,"attr."+t,e)):e==null?(n.local?OX:MX)(n):(n.local?LX:BX)(n,o,e))}function NX(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function IX(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function RX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&IX(t,i)),n}return r._value=e,r}function FX(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&NX(t,i)),n}return r._value=e,r}function VX(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=Cm(t);return this.tween(n,(o.local?RX:FX)(o,e))}function zX(t,e){return function(){e2(this,t).delay=+e.apply(this,arguments)}}function HX(t,e){return e=+e,function(){e2(this,t).delay=e}}function WX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zX:HX)(e,t)):Pi(this.node(),e).delay}function UX(t,e){return function(){ps(this,t).duration=+e.apply(this,arguments)}}function GX(t,e){return e=+e,function(){ps(this,t).duration=e}}function qX(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?UX:GX)(e,t)):Pi(this.node(),e).duration}function YX(t,e){if(typeof e!="function")throw new Error;return function(){ps(this,t).ease=e}}function jX(t){var e=this._id;return arguments.length?this.each(YX(e,t)):Pi(this.node(),e).ease}function XX(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;ps(this,t).ease=n}}function KX(t){if(typeof t!="function")throw new Error;return this.each(XX(this._id,t))}function ZX(t){typeof t!="function"&&(t=uC(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],l,c=0;c<s;++c)(l=i[c])&&t.call(l,l.__data__,c,i)&&a.push(l);return new Ks(o,this._parents,this._name,this._id)}function QX(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var l=e[a],c=n[a],u=l.length,d=s[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||c[h])&&(d[h]=f);for(;a<o;++a)s[a]=e[a];return new Ks(s,this._parents,this._name,this._id)}function JX(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function eK(t,e,n){var o,r,i=JX(e)?e2:ps;return function(){var s=i(this,t),a=s.on;a!==o&&(r=(o=a).copy()).on(e,n),s.on=r}}function tK(t,e){var n=this._id;return arguments.length<2?Pi(this.node(),n).on.on(t):this.each(eK(n,t,e))}function nK(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function oK(){return this.on("end.remove",nK(this._id))}function rK(t){var e=this._name,n=this._id;typeof t!="function"&&(t=jy(t));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],l=a.length,c=i[s]=new Array(l),u,d,f=0;f<l;++f)(u=a[f])&&(d=t.call(u,u.__data__,f,a))&&("__data__"in u&&(d.__data__=u.__data__),c[f]=d,Tm(c[f],e,n,f,c,Pi(u,n)));return new Ks(i,this._parents,e,n)}function iK(t){var e=this._name,n=this._id;typeof t!="function"&&(t=cC(t));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var l=o[a],c=l.length,u,d=0;d<c;++d)if(u=l[d]){for(var f=t.call(u,u.__data__,d,l),h,g=Pi(u,n),v=0,m=f.length;v<m;++v)(h=f[v])&&Tm(h,e,n,v,f,g);i.push(f),s.push(u)}return new Ks(i,s,e,n)}var sK=_u.prototype.constructor;function aK(){return new sK(this._groups,this._parents)}function lK(t,e){var n,o,r;return function(){var i=su(this,t),s=(this.style.removeProperty(t),su(this,t));return i===s?null:i===n&&s===o?r:r=e(n=i,o=s)}}function BC(t){return function(){this.style.removeProperty(t)}}function cK(t,e,n){var o,r=n+"",i;return function(){var s=su(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}function uK(t,e,n){var o,r,i;return function(){var s=su(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),su(this,t))),s===l?null:s===o&&l===r?i:(r=l,i=e(o=s,a))}}function dK(t,e){var n,o,r,i="style."+e,s="end."+i,a;return function(){var l=ps(this,t),c=l.on,u=l.value[i]==null?a||(a=BC(e)):void 0;(c!==n||r!==u)&&(o=(n=c).copy()).on(s,r=u),l.on=o}}function fK(t,e,n){var o=(t+="")=="transform"?mX:OC;return e==null?this.styleTween(t,lK(t,o)).on("end.style."+t,BC(t)):typeof e=="function"?this.styleTween(t,uK(t,o,t2(this,"style."+t,e))).each(dK(this._id,t)):this.styleTween(t,cK(t,o,e),n).on("end.style."+t,null)}function hK(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function pK(t,e,n){var o,r;function i(){var s=e.apply(this,arguments);return s!==r&&(o=(r=s)&&hK(t,s,n)),o}return i._value=e,i}function mK(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,pK(t,e,n??""))}function gK(t){return function(){this.textContent=t}}function vK(t){return function(){var e=t(this);this.textContent=e??""}}function bK(t){return this.tween("text",typeof t=="function"?vK(t2(this,"text",t)):gK(t==null?"":t+""))}function yK(t){return function(e){this.textContent=t.call(this,e)}}function xK(t){var e,n;function o(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&yK(r)),e}return o._value=t,o}function wK(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,xK(t))}function _K(){for(var t=this._name,e=this._id,n=PC(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var u=Pi(l,e);Tm(l,t,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ks(o,this._parents,t,n)}function kK(){var t,e,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--r===0&&i()}};n.each(function(){var c=ps(this,o),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),r===0&&i()})}var SK=0;function Ks(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function LC(t){return _u().transition(t)}function PC(){return++SK}var _s=_u.prototype;Ks.prototype=LC.prototype={constructor:Ks,select:rK,selectAll:iK,selectChild:_s.selectChild,selectChildren:_s.selectChildren,filter:ZX,merge:QX,selection:aK,transition:_K,call:_s.call,nodes:_s.nodes,node:_s.node,size:_s.size,empty:_s.empty,each:_s.each,on:tK,attr:EX,attrTween:VX,style:fK,styleTween:mK,text:bK,textTween:wK,remove:oK,tween:TX,delay:WX,duration:qX,ease:jX,easeVarying:KX,end:kK,[Symbol.iterator]:_s[Symbol.iterator]};function dh(t){return--t*t*t+1}function Zp(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var AK={time:null,delay:0,duration:250,ease:Zp};function CK(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 $K(t){var e,n;t instanceof Ks?(e=t._id,t=t._name):(e=PC(),(n=AK).time=Jy(),t=t==null?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&Tm(l,t,e,c,s,n||CK(l,e));return new Ks(o,this._parents,t,e)}_u.prototype.interrupt=AX;_u.prototype.transition=$K;const H1=Math.PI,W1=2*H1,gl=1e-6,TK=W1-gl;function DC(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function MK(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return DC;const n=10**e;return function(o){this._+=o[0];for(let r=1,i=o.length;r<i;++r)this._+=Math.round(arguments[r]*n)/n+o[r]}}class OK{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?DC:MK(e)}moveTo(e,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,n){this._append`L${this._x1=+e},${this._y1=+n}`}quadraticCurveTo(e,n,o,r){this._append`Q${+e},${+n},${this._x1=+o},${this._y1=+r}`}bezierCurveTo(e,n,o,r,i,s){this._append`C${+e},${+n},${+o},${+r},${this._x1=+i},${this._y1=+s}`}arcTo(e,n,o,r,i){if(e=+e,n=+n,o=+o,r=+r,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,a=this._y1,l=o-e,c=r-n,u=s-e,d=a-n,f=u*u+d*d;if(this._x1===null)this._append`M${this._x1=e},${this._y1=n}`;else if(f>gl)if(!(Math.abs(d*l-c*u)>gl)||!i)this._append`L${this._x1=e},${this._y1=n}`;else{let h=o-s,g=r-a,v=l*l+c*c,m=h*h+g*g,b=Math.sqrt(v),y=Math.sqrt(f),x=i*Math.tan((H1-Math.acos((v+f-m)/(2*b*y)))/2),_=x/y,S=x/b;Math.abs(_-1)>gl&&this._append`L${e+_*u},${n+_*d}`,this._append`A${i},${i},0,0,${+(d*h>u*g)},${this._x1=e+S*l},${this._y1=n+S*c}`}}arc(e,n,o,r,i,s){if(e=+e,n=+n,o=+o,s=!!s,o<0)throw new Error(`negative radius: ${o}`);let a=o*Math.cos(r),l=o*Math.sin(r),c=e+a,u=n+l,d=1^s,f=s?r-i:i-r;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>gl||Math.abs(this._y1-u)>gl)&&this._append`L${c},${u}`,o&&(f<0&&(f=f%W1+W1),f>TK?this._append`A${o},${o},0,1,${d},${e-a},${n-l}A${o},${o},0,1,${d},${this._x1=c},${this._y1=u}`:f>gl&&this._append`A${o},${o},0,${+(f>=H1)},${d},${this._x1=e+o*Math.cos(i)},${this._y1=n+o*Math.sin(i)}`)}rect(e,n,o,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${o=+o}v${+r}h${-o}Z`}toString(){return this._}}function Mm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const C8=Symbol("implicit");function n2(){var t=new O1,e=[],n=[],o=C8;function r(i){let s=t.get(i);if(s===void 0){if(o!==C8)return o;t.set(i,s=e.push(i)-1)}return n[s%n.length]}return r.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new O1;for(const s of i)t.has(s)||t.set(s,e.push(s)-1);return r},r.range=function(i){return arguments.length?(n=Array.from(i),r):n.slice()},r.unknown=function(i){return arguments.length?(o=i,r):o},r.copy=function(){return n2(e,n).unknown(o)},Mm.apply(r,arguments),r}function Jn(){var t=n2().unknown(void 0),e=t.domain,n=t.range,o=0,r=1,i,s,a=!1,l=0,c=0,u=.5;delete t.unknown;function d(){var f=e().length,h=r<o,g=h?r:o,v=h?o:r;i=(v-g)/Math.max(1,f-l+c*2),a&&(i=Math.floor(i)),g+=(v-g-i*(f-l))*u,s=i*(1-l),a&&(g=Math.round(g),s=Math.round(s));var m=wz(f).map(function(b){return g+i*b});return n(h?m.reverse():m)}return t.domain=function(f){return arguments.length?(e(f),d()):e()},t.range=function(f){return arguments.length?([o,r]=f,o=+o,r=+r,d()):[o,r]},t.rangeRound=function(f){return[o,r]=f,o=+o,r=+r,a=!0,d()},t.bandwidth=function(){return s},t.step=function(){return i},t.round=function(f){return arguments.length?(a=!!f,d()):a},t.padding=function(f){return arguments.length?(l=Math.min(1,c=+f),d()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),d()):l},t.paddingOuter=function(f){return arguments.length?(c=+f,d()):c},t.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),d()):u},t.copy=function(){return Jn(e(),[o,r]).round(a).paddingInner(l).paddingOuter(c).align(u)},Mm.apply(d(),arguments)}function EC(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return EC(e())},t}function Om(){return EC(Jn.apply(null,arguments).paddingInner(1))}function BK(t){return function(){return t}}function LK(t){return+t}var $8=[0,1];function Cc(t){return t}function U1(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:BK(isNaN(e)?NaN:.5)}function PK(t,e){var n;return t>e&&(n=t,t=e,e=n),function(o){return Math.max(t,Math.min(e,o))}}function DK(t,e,n){var o=t[0],r=t[1],i=e[0],s=e[1];return r<o?(o=U1(r,o),i=n(s,i)):(o=U1(o,r),i=n(i,s)),function(a){return i(o(a))}}function EK(t,e,n){var o=Math.min(t.length,e.length)-1,r=new Array(o),i=new Array(o),s=-1;for(t[o]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<o;)r[s]=U1(t[s],t[s+1]),i[s]=n(e[s],e[s+1]);return function(a){var l=cz(t,a,1,o)-1;return i[l](r[l](a))}}function NC(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function IC(){var t=$8,e=$8,n=Qy,o,r,i,s=Cc,a,l,c;function u(){var f=Math.min(t.length,e.length);return s!==Cc&&(s=PK(t[0],t[f-1])),a=f>2?EK:DK,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?i:(l||(l=a(t.map(o),e,n)))(o(s(f)))}return d.invert=function(f){return s(r((c||(c=a(e,t.map(o),ro)))(f)))},d.domain=function(f){return arguments.length?(t=Array.from(f,LK),u()):t.slice()},d.range=function(f){return arguments.length?(e=Array.from(f),u()):e.slice()},d.rangeRound=function(f){return e=Array.from(f),n=fX,u()},d.clamp=function(f){return arguments.length?(s=f?!0:Cc,u()):s!==Cc},d.interpolate=function(f){return arguments.length?(n=f,u()):n},d.unknown=function(f){return arguments.length?(i=f,d):i},function(f,h){return o=f,r=h,u()}}function NK(){return IC()(Cc,Cc)}function IK(t,e,n,o){var r=xz(t,e,n),i;switch(o=Ip(o??",f"),o.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return o.precision==null&&!isNaN(i=TV(r,s))&&(o.precision=i),TA(o,s)}case"":case"e":case"g":case"p":case"r":{o.precision==null&&!isNaN(i=MV(r,Math.max(Math.abs(t),Math.abs(e))))&&(o.precision=i-(o.type==="e"));break}case"f":case"%":{o.precision==null&&!isNaN(i=$V(r))&&(o.precision=i-(o.type==="%")*2);break}}return wu(o)}function RC(t){var e=t.domain;return t.ticks=function(n){var o=e();return yz(o[0],o[o.length-1],n??10)},t.tickFormat=function(n,o){var r=e();return IK(r[0],r[r.length-1],n??10,o)},t.nice=function(n){n==null&&(n=10);var o=e(),r=0,i=o.length-1,s=o[r],a=o[i],l,c,u=10;for(a<s&&(c=s,s=a,a=c,c=r,r=i,i=c);u-- >0;){if(c=B1(s,a,n),c===l)return o[r]=s,o[i]=a,e(o);if(c>0)s=Math.floor(s/c)*c,a=Math.ceil(a/c)*c;else if(c<0)s=Math.ceil(s*c)/c,a=Math.floor(a*c)/c;else break;l=c}return t},t}function On(){var t=NK();return t.copy=function(){return NC(t,On())},Mm.apply(t,arguments),RC(t)}function T8(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function M8(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function RK(t){var e=1,n=t(T8(e),M8(e));return n.constant=function(o){return arguments.length?t(T8(e=+o),M8(e)):e},RC(n)}function Ka(){var t=RK(IC());return t.copy=function(){return NC(t,Ka()).constant(t.constant())},Mm.apply(t,arguments)}function $t(t){return function(){return t}}const O8=Math.abs,po=Math.atan2,$s=Math.cos,FK=Math.max,dv=Math.min,Qo=Math.sin,To=Math.sqrt,mo=1e-12,Ia=Math.PI,Qp=Ia/2,Ta=2*Ia;function VK(t){return t>1?0:t<-1?Ia:Math.acos(t)}function B8(t){return t>=1?Qp:t<=-1?-Qp:Math.asin(t)}function Bm(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const o=Math.floor(n);if(!(o>=0))throw new RangeError(`invalid digits: ${n}`);e=o}return t},()=>new OK(e)}function zK(t){return t.innerRadius}function HK(t){return t.outerRadius}function WK(t){return t.startAngle}function UK(t){return t.endAngle}function GK(t){return t&&t.padAngle}function qK(t,e,n,o,r,i,s,a){var l=n-t,c=o-e,u=s-r,d=a-i,f=d*l-u*c;if(!(f*f<mo))return f=(u*(e-i)-d*(t-r))/f,[t+f*l,e+f*c]}function fh(t,e,n,o,r,i,s){var a=t-n,l=e-o,c=(s?i:-i)/To(a*a+l*l),u=c*l,d=-c*a,f=t+u,h=e+d,g=n+u,v=o+d,m=(f+g)/2,b=(h+v)/2,y=g-f,x=v-h,_=y*y+x*x,S=r-i,N=f*v-g*h,B=(x<0?-1:1)*To(FK(0,S*S*_-N*N)),k=(N*x-y*B)/_,L=(-N*y-x*B)/_,E=(N*x+y*B)/_,I=(-N*y+x*B)/_,C=k-m,$=L-b,P=E-m,M=I-b;return C*C+$*$>P*P+M*M&&(k=E,L=I),{cx:k,cy:L,x01:-u,y01:-d,x11:k*(r/S-1),y11:L*(r/S-1)}}function YK(){var t=zK,e=HK,n=$t(0),o=null,r=WK,i=UK,s=GK,a=null,l=Bm(c);function c(){var u,d,f=+t.apply(this,arguments),h=+e.apply(this,arguments),g=r.apply(this,arguments)-Qp,v=i.apply(this,arguments)-Qp,m=O8(v-g),b=v>g;if(a||(a=u=l()),h<f&&(d=h,h=f,f=d),!(h>mo))a.moveTo(0,0);else if(m>Ta-mo)a.moveTo(h*$s(g),h*Qo(g)),a.arc(0,0,h,g,v,!b),f>mo&&(a.moveTo(f*$s(v),f*Qo(v)),a.arc(0,0,f,v,g,b));else{var y=g,x=v,_=g,S=v,N=m,B=m,k=s.apply(this,arguments)/2,L=k>mo&&(o?+o.apply(this,arguments):To(f*f+h*h)),E=dv(O8(h-f)/2,+n.apply(this,arguments)),I=E,C=E,$,P;if(L>mo){var M=B8(L/f*Qo(k)),F=B8(L/h*Qo(k));(N-=M*2)>mo?(M*=b?1:-1,_+=M,S-=M):(N=0,_=S=(g+v)/2),(B-=F*2)>mo?(F*=b?1:-1,y+=F,x-=F):(B=0,y=x=(g+v)/2)}var V=h*$s(y),G=h*Qo(y),K=f*$s(S),ue=f*Qo(S);if(E>mo){var de=h*$s(x),he=h*Qo(x),ge=f*$s(_),ee=f*Qo(_),fe;if(m<Ia)if(fe=qK(V,G,ge,ee,de,he,K,ue)){var xe=V-fe[0],Z=G-fe[1],pe=de-fe[0],oe=he-fe[1],ve=1/Qo(VK((xe*pe+Z*oe)/(To(xe*xe+Z*Z)*To(pe*pe+oe*oe)))/2),ce=To(fe[0]*fe[0]+fe[1]*fe[1]);I=dv(E,(f-ce)/(ve-1)),C=dv(E,(h-ce)/(ve+1))}else I=C=0}B>mo?C>mo?($=fh(ge,ee,V,G,h,C,b),P=fh(de,he,K,ue,h,C,b),a.moveTo($.cx+$.x01,$.cy+$.y01),C<E?a.arc($.cx,$.cy,C,po($.y01,$.x01),po(P.y01,P.x01),!b):(a.arc($.cx,$.cy,C,po($.y01,$.x01),po($.y11,$.x11),!b),a.arc(0,0,h,po($.cy+$.y11,$.cx+$.x11),po(P.cy+P.y11,P.cx+P.x11),!b),a.arc(P.cx,P.cy,C,po(P.y11,P.x11),po(P.y01,P.x01),!b))):(a.moveTo(V,G),a.arc(0,0,h,y,x,!b)):a.moveTo(V,G),!(f>mo)||!(N>mo)?a.lineTo(K,ue):I>mo?($=fh(K,ue,de,he,f,-I,b),P=fh(V,G,ge,ee,f,-I,b),a.lineTo($.cx+$.x01,$.cy+$.y01),I<E?a.arc($.cx,$.cy,I,po($.y01,$.x01),po(P.y01,P.x01),!b):(a.arc($.cx,$.cy,I,po($.y01,$.x01),po($.y11,$.x11),!b),a.arc(0,0,f,po($.cy+$.y11,$.cx+$.x11),po(P.cy+P.y11,P.cx+P.x11),b),a.arc(P.cx,P.cy,I,po(P.y11,P.x11),po(P.y01,P.x01),!b))):a.arc(0,0,f,S,_,b)}if(a.closePath(),u)return a=null,u+""||null}return c.centroid=function(){var u=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,d=(+r.apply(this,arguments)+ +i.apply(this,arguments))/2-Ia/2;return[$s(d)*u,Qo(d)*u]},c.innerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:$t(+u),c):t},c.outerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:$t(+u),c):e},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:$t(+u),c):n},c.padRadius=function(u){return arguments.length?(o=u==null?null:typeof u=="function"?u:$t(+u),c):o},c.startAngle=function(u){return arguments.length?(r=typeof u=="function"?u:$t(+u),c):r},c.endAngle=function(u){return arguments.length?(i=typeof u=="function"?u:$t(+u),c):i},c.padAngle=function(u){return arguments.length?(s=typeof u=="function"?u:$t(+u),c):s},c.context=function(u){return arguments.length?(a=u??null,c):a},c}function Lm(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function FC(t){this._context=t}FC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(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;default:this._context.lineTo(t,e);break}}};function ku(t){return new FC(t)}function VC(t){return t[0]}function zC(t){return t[1]}function Ti(t,e){var n=$t(!0),o=null,r=ku,i=null,s=Bm(a);t=typeof t=="function"?t:t===void 0?VC:$t(t),e=typeof e=="function"?e:e===void 0?zC:$t(e);function a(l){var c,u=(l=Lm(l)).length,d,f=!1,h;for(o==null&&(i=r(h=s())),c=0;c<=u;++c)!(c<u&&n(d=l[c],c,l))===f&&((f=!f)?i.lineStart():i.lineEnd()),f&&i.point(+t(d,c,l),+e(d,c,l));if(h)return i=null,h+""||null}return a.x=function(l){return arguments.length?(t=typeof l=="function"?l:$t(+l),a):t},a.y=function(l){return arguments.length?(e=typeof l=="function"?l:$t(+l),a):e},a.defined=function(l){return arguments.length?(n=typeof l=="function"?l:$t(!!l),a):n},a.curve=function(l){return arguments.length?(r=l,o!=null&&(i=r(o)),a):r},a.context=function(l){return arguments.length?(l==null?o=i=null:i=r(o=l),a):o},a}function Zs(t,e,n){var o=null,r=$t(!0),i=null,s=ku,a=null,l=Bm(c);t=typeof t=="function"?t:t===void 0?VC:$t(+t),e=typeof e=="function"?e:$t(e===void 0?0:+e),n=typeof n=="function"?n:n===void 0?zC:$t(+n);function c(d){var f,h,g,v=(d=Lm(d)).length,m,b=!1,y,x=new Array(v),_=new Array(v);for(i==null&&(a=s(y=l())),f=0;f<=v;++f){if(!(f<v&&r(m=d[f],f,d))===b)if(b=!b)h=f,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),g=f-1;g>=h;--g)a.point(x[g],_[g]);a.lineEnd(),a.areaEnd()}b&&(x[f]=+t(m,f,d),_[f]=+e(m,f,d),a.point(o?+o(m,f,d):x[f],n?+n(m,f,d):_[f]))}if(y)return a=null,y+""||null}function u(){return Ti().defined(r).curve(s).context(i)}return c.x=function(d){return arguments.length?(t=typeof d=="function"?d:$t(+d),o=null,c):t},c.x0=function(d){return arguments.length?(t=typeof d=="function"?d:$t(+d),c):t},c.x1=function(d){return arguments.length?(o=d==null?null:typeof d=="function"?d:$t(+d),c):o},c.y=function(d){return arguments.length?(e=typeof d=="function"?d:$t(+d),n=null,c):e},c.y0=function(d){return arguments.length?(e=typeof d=="function"?d:$t(+d),c):e},c.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:$t(+d),c):n},c.lineX0=c.lineY0=function(){return u().x(t).y(e)},c.lineY1=function(){return u().x(t).y(n)},c.lineX1=function(){return u().x(o).y(e)},c.defined=function(d){return arguments.length?(r=typeof d=="function"?d:$t(!!d),c):r},c.curve=function(d){return arguments.length?(s=d,i!=null&&(a=s(i)),c):s},c.context=function(d){return arguments.length?(d==null?i=a=null:a=s(i=d),c):i},c}function jK(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function XK(t){return t}function KK(){var t=XK,e=jK,n=null,o=$t(0),r=$t(Ta),i=$t(0);function s(a){var l,c=(a=Lm(a)).length,u,d,f=0,h=new Array(c),g=new Array(c),v=+o.apply(this,arguments),m=Math.min(Ta,Math.max(-Ta,r.apply(this,arguments)-v)),b,y=Math.min(Math.abs(m)/c,i.apply(this,arguments)),x=y*(m<0?-1:1),_;for(l=0;l<c;++l)(_=g[h[l]=l]=+t(a[l],l,a))>0&&(f+=_);for(e!=null?h.sort(function(S,N){return e(g[S],g[N])}):n!=null&&h.sort(function(S,N){return n(a[S],a[N])}),l=0,d=f?(m-c*x)/f:0;l<c;++l,v=b)u=h[l],_=g[u],b=v+(_>0?_*d:0)+x,g[u]={data:a[u],index:l,value:_,startAngle:v,endAngle:b,padAngle:y};return g}return s.value=function(a){return arguments.length?(t=typeof a=="function"?a:$t(+a),s):t},s.sortValues=function(a){return arguments.length?(e=a,n=null,s):e},s.sort=function(a){return arguments.length?(n=a,e=null,s):n},s.startAngle=function(a){return arguments.length?(o=typeof a=="function"?a:$t(+a),s):o},s.endAngle=function(a){return arguments.length?(r=typeof a=="function"?a:$t(+a),s):r},s.padAngle=function(a){return arguments.length?(i=typeof a=="function"?a:$t(+a),s):i},s}const o2={draw(t,e){const n=To(e/Ia);t.moveTo(n,0),t.arc(0,0,n,0,Ta)}},ZK={draw(t,e){const n=To(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},HC=To(1/3),QK=HC*2,JK={draw(t,e){const n=To(e/QK),o=n*HC;t.moveTo(0,-n),t.lineTo(o,0),t.lineTo(0,n),t.lineTo(-o,0),t.closePath()}},eZ={draw(t,e){const n=To(e),o=-n/2;t.rect(o,o,n,n)}},tZ=.8908130915292852,WC=Qo(Ia/10)/Qo(7*Ia/10),nZ=Qo(Ta/10)*WC,oZ=-$s(Ta/10)*WC,rZ={draw(t,e){const n=To(e*tZ),o=nZ*n,r=oZ*n;t.moveTo(0,-n),t.lineTo(o,r);for(let i=1;i<5;++i){const s=Ta*i/5,a=$s(s),l=Qo(s);t.lineTo(l*n,-a*n),t.lineTo(a*o-l*r,l*o+a*r)}t.closePath()}},fv=To(3),UC={draw(t,e){const n=-To(e/(fv*3));t.moveTo(0,n*2),t.lineTo(-fv*n,-n),t.lineTo(fv*n,-n),t.closePath()}},iZ=To(3),sZ={draw(t,e){const n=To(e)*.6824,o=n/2,r=n*iZ/2;t.moveTo(0,-n),t.lineTo(r,o),t.lineTo(-r,o),t.closePath()}};function aZ(t,e){let n=null,o=Bm(r);t=typeof t=="function"?t:$t(t||o2),e=typeof e=="function"?e:$t(e===void 0?64:+e);function r(){let i;if(n||(n=i=o()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),i)return n=null,i+""||null}return r.type=function(i){return arguments.length?(t=typeof i=="function"?i:$t(i),r):t},r.size=function(i){return arguments.length?(e=typeof i=="function"?i:$t(+i),r):e},r.context=function(i){return arguments.length?(n=i??null,r):n},r}function L8(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 GC(t){this._context=t}GC.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:L8(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:L8(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function lZ(t){return new GC(t)}function P8(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 r2(t,e){this._context=t,this._k=(1-e)/6}r2.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:P8(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:P8(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 cZ=(function t(e){function n(o){return new r2(o,e)}return n.tension=function(o){return t(+o)},n})(0);function uZ(t,e,n){var o=t._x1,r=t._y1,i=t._x2,s=t._y2;if(t._l01_a>mo){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);o=(o*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>mo){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);i=(i*c+t._x1*t._l23_2a-e*t._l12_2a)/u,s=(s*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(o,r,i,s,t._x2,t._y2)}function qC(t,e){this._context=t,this._alpha=e}qC.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,o=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+o*o,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:uZ(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 dZ=(function t(e){function n(o){return e?new qC(o,e):new r2(o,0)}return n.alpha=function(o){return t(+o)},n})(.5);function D8(t){return t<0?-1:1}function E8(t,e,n){var o=t._x1-t._x0,r=e-t._x1,i=(t._y1-t._y0)/(o||r<0&&-0),s=(n-t._y1)/(r||o<0&&-0),a=(i*r+s*o)/(o+r);return(D8(i)+D8(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(a))||0}function N8(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function hv(t,e,n){var o=t._x0,r=t._y0,i=t._x1,s=t._y1,a=(i-o)/3;t._context.bezierCurveTo(o+a,r+a*e,i-a,s-a*n,i,s)}function Jp(t){this._context=t}Jp.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:hv(this,this._t0,N8(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,hv(this,N8(this,n=E8(this,t,e)),n);break;default:hv(this,this._t0,n=E8(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};Object.create(Jp.prototype).point=function(t,e){Jp.prototype.point.call(this,e,t)};function i2(t){return new Jp(t)}function Pm(t,e){this._context=t,this._t=e}Pm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=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 fZ(t){return new Pm(t,.5)}function hZ(t){return new Pm(t,0)}function pZ(t){return new Pm(t,1)}function e0(t,e){if((s=t.length)>1)for(var n=1,o,r,i=t[e[0]],s,a=i.length;n<s;++n)for(r=i,i=t[e[n]],o=0;o<a;++o)i[o][1]+=i[o][0]=isNaN(r[o][1])?r[o][0]:r[o][1]}function t0(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function mZ(t,e){return t[e]}function gZ(t){const e=[];return e.key=t,e}function YC(){var t=$t([]),e=t0,n=e0,o=mZ;function r(i){var s=Array.from(t.apply(this,arguments),gZ),a,l=s.length,c=-1,u;for(const d of i)for(a=0,++c;a<l;++a)(s[a][c]=[0,+o(d,s[a].key,c,i)]).data=d;for(a=0,u=Lm(e(s));a<l;++a)s[u[a]].index=a;return n(s,u),s}return r.keys=function(i){return arguments.length?(t=typeof i=="function"?i:$t(Array.from(i)),r):t},r.value=function(i){return arguments.length?(o=typeof i=="function"?i:$t(+i),r):o},r.order=function(i){return arguments.length?(e=i==null?t0:typeof i=="function"?i:$t(Array.from(i)),r):e},r.offset=function(i){return arguments.length?(n=i??e0,r):n},r}function vZ(t,e){if((o=t.length)>0){for(var n,o,r=0,i=t[0].length,s;r<i;++r){for(s=n=0;n<o;++n)s+=t[n][r][1]||0;if(s)for(n=0;n<o;++n)t[n][r][1]/=s}e0(t,e)}}function bZ(t,e){if((l=t.length)>0)for(var n,o=0,r,i,s,a,l,c=t[e[0]].length;o<c;++o)for(s=a=0,n=0;n<l;++n)(i=(r=t[e[n]][o])[1]-r[0])>0?(r[0]=s,r[1]=s+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)}function fd(t,e,n){this.k=t,this.x=e,this.y=n}fd.prototype={constructor:fd,scale:function(t){return t===1?this:new fd(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new fd(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+")"}};fd.prototype;function G1(t,e){if(!t)throw new Error(`[d3-blueprint] ${e}`)}class yZ{constructor(){bn(this,"properties",new Map)}define(e,n){G1(!this.properties.has(e),`config "${e}" is already defined`);const{defaultValue:o,getter:r,setter:i}=n,s=i?i(o):o;return this.properties.set(e,{value:s,getter:r,setter:i}),this}get(e){const n=this.getProperty(e),{value:o,getter:r}=n;return r?r(o):o}set(e,n){const o=this.getProperty(e);return o.value=o.setter?o.setter(n):n,this}setBatch(e){for(const[n,o]of Object.entries(e))this.set(n,o);return this}getAll(){const e={};for(const[n]of this.properties)e[n]=this.get(n);return e}has(e){return this.properties.has(e)}getProperty(e){const n=this.properties.get(e);return G1(n,`config "${e}" is not defined`),n}}const q1=["update","enter","merge","exit"],jC=new Set([...q1,...q1.map(t=>`${t}:transition`)]);function xZ(t){return jC.has(t)}function I8(t){G1(xZ(t),`"${t}" is not a valid lifecycle event. Expected one of: ${[...jC].join(", ")}`)}function wZ(t,e,n){const o=t.exit(),r={update:t,enter:e,merge:e.merge(t),exit:o};return q1.map(i=>{const s=r[i],a=n.get(i)??[],l=n.get(`${i}:transition`)??[];return{name:i,selection:s,handlers:a,transitionHandlers:l}})}function _Z(t,e){for(const n of e)n(t)}function kZ(t,e){return e.map(n=>{const o=t.transition();return n(o),SZ(o)})}function SZ(t){return t.end().then(()=>{},()=>{})}class AZ{constructor(e,n){bn(this,"base");bn(this,"dataBindFn");bn(this,"insertFn");bn(this,"handlers",new Map);if(this.base=e,this.dataBindFn=n.dataBind,this.insertFn=n.insert,n.events)for(const[o,r]of Object.entries(n.events))r&&this.on(o,r)}on(e,n){I8(e);const o=this.handlers.get(e)??[];return o.push(n),this.handlers.set(e,o),this}off(e,n){if(I8(e),!n)return this.handlers.delete(e),this;const o=this.handlers.get(e);if(o){const r=o.indexOf(n);r!==-1&&o.splice(r,1)}return this}draw(e){const n=this.dataBindFn(this.base,e),o=n.enter(),r=this.insertFn(o),i=wZ(n,r,this.handlers),s=[];for(const a of i){_Z(a.selection,a.handlers);const l=kZ(a.selection,a.transitionHandlers);s.push(...l)}return Promise.all(s).then(()=>{})}}function CZ(t,e,n,o){if(n&&o){const i=new AZ(n,o);return t.set(e,i),i}const r=t.get(e);if(!r)throw new Error(`[d3-blueprint] layer "${e}" is not defined`);return r}function $Z(t,e,n,o){return typeof n=="string"&&o===void 0?t.get(n):typeof n=="string"?(t.set(n,o),e):(t.setBatch(n),e)}function TZ(t,e){const n=[];for(const o of t.values())n.push(o.draw(e));return n}function MZ(t,e){const n=[];for(const o of t.values()){const r=o.draw(e);r&&n.push(r)}return n}const OZ=["preDraw","postDraw","postTransition"];class co{constructor(e){bn(this,"base");bn(this,"layers",new Map);bn(this,"attachments",new Map);bn(this,"configs",new yZ);bn(this,"dispatcher");bn(this,"attached",new Proxy({},{get:(e,n)=>{const o=this.attachments.get(n);if(!o)throw new Error(`[d3-blueprint] attachment "${n}" is not defined`);return o},has:(e,n)=>this.attachments.has(n)}));this.base=e,this.dispatcher=Yy(...OZ),this.initialize()}initialize(){}transform(e){return e}preDraw(e){}postDraw(e){}postTransition(e){}layer(e,n,o){return CZ(this.layers,e,n,o)}attach(e,n,o){if(o!==void 0){const r=n;this.attachments.set(e,new r(o))}else this.attachments.set(e,n);return this}config(e,n){return $Z(this.configs,this,e,n)}configDefine(e,n){return this.configs.define(e,n),this}on(e,n){return this.dispatcher.on(e,n),this}off(e){return this.dispatcher.on(e,null),this}use(e,n){const o=n||e.name||"plugin";if(e.install(this),e.preDraw&&this.on(`preDraw.${o}`,r=>e.preDraw(this,r)),e.postDraw&&this.on(`postDraw.${o}`,r=>e.postDraw(this,r)),e.postTransition&&this.on(`postTransition.${o}`,r=>e.postTransition(this,r)),e.destroy){const r=this.destroy.bind(this);this.destroy=()=>{e.destroy(this),r()}}return this}async draw(e){const n=this.transform(e);this.preDraw(n),this.dispatcher.call("preDraw",this,n);const o=TZ(this.layers,n),r=MZ(this.attachments,n);this.postDraw(n),this.dispatcher.call("postDraw",this,n),await Promise.all([...o,...r]),this.postTransition(n),this.dispatcher.call("postTransition",this,n)}destroy(){this.layers.clear(),this.attachments.clear()}}class BZ extends co{initialize(){const e=this.base.append("div").attr("class","bc-frame"),n=e.append("div").attr("class","bc-frame-header");e.append("div").attr("class","bc-frame-body"),e.append("p").attr("class","bc-frame-note");const o=e.append("div").attr("class","bc-frame-footer").style("display","flex").style("justify-content","space-between").style("align-items","center").style("flex-wrap","wrap").style("gap","0.25rem 1rem"),r=o.append("div").attr("class","bc-frame-footer-left").style("display","flex").style("flex-wrap","wrap").style("gap","0.25rem 0.75rem"),i=o.append("div").attr("class","bc-frame-footer-right").style("display","flex").style("align-items","center");this.layer("headerItems",n,{dataBind:(s,a)=>s.selectAll(".bc-frame-header-item").data(a.headerItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).text(a=>a.text)},merge:s=>{s.attr("class",a=>a.className).text(a=>a.text)},exit:s=>{s.remove()}}}),this.layer("footerLeftItems",r,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerLeftItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.prefix){const l=document.createElement("span");l.className="bc-frame-source-prefix",l.textContent=a.prefix,this.appendChild(l)}if(a.href){const l=document.createElement("a");l.className="bc-frame-source-link",l.href=a.href,l.textContent=a.text,this.appendChild(l)}else this.appendChild(document.createTextNode(a.text))})},exit:s=>{s.remove()}}}),this.layer("footerRightItems",i,{dataBind:(s,a)=>s.selectAll(".bc-frame-footer-item").data(a.footerRightItems,l=>l.className),insert:s=>s.append(a=>document.createElement(a.tag)),events:{enter:s=>{s.attr("class",a=>a.className).each(function(a){if(a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},merge:s=>{s.attr("class",a=>a.className).each(function(a){if(this.textContent="",a.html){const c=document.createRange().createContextualFragment(a.html);this.appendChild(c)}else this.textContent=a.text}),s.filter(a=>!!a.href).attr("href",a=>a.href),s.filter(a=>!!a.target).attr("target",a=>a.target),s.filter(a=>!!a.rel).attr("rel",a=>a.rel)},exit:s=>{s.remove()}}})}}function LZ(t){const e=[];return t.title&&e.push({tag:"h3",className:"bc-frame-title",text:t.title}),t.description&&e.push({tag:"p",className:"bc-frame-description",text:t.description}),e}function PZ(t){const e=[];return t.byline&&e.push({tag:"span",className:"bc-frame-byline",text:t.byline}),t.source&&e.push({tag:"span",className:"bc-frame-source",text:t.source,prefix:"Source: ",href:t.sourceUrl||void 0}),e}const DZ='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48.042969 90.607422" width="10" height="18" style="vertical-align:-3px;margin-right:3px"><path fill="currentColor" opacity="0.55" d="M 20.042969 34.607422 A 28 28 0 0 1 23.072266 34.779297 A 28 28 0 0 0 20.042969 34.607422 z M 23.34375 34.810547 A 28 28 0 0 1 26.171875 35.292969 A 28 28 0 0 0 23.34375 34.810547 z M 16.570312 34.84375 A 28 28 0 0 0 15.474609 35.033203 A 28 28 0 0 1 16.570312 34.84375 z M 26.390625 35.341797 A 28 28 0 0 1 29.316406 36.189453 A 28 28 0 0 0 26.390625 35.341797 z M 13.128906 35.511719 A 28 28 0 0 0 11.904297 35.873047 A 28 28 0 0 1 13.128906 35.511719 z M 29.373047 36.210938 A 28 28 0 0 1 32.103516 37.347656 A 28 28 0 0 0 29.373047 36.210938 z M 9.7832031 36.609375 A 28 28 0 0 0 8.5820312 37.117188 A 28 28 0 0 1 9.7832031 36.609375 z M 32.392578 37.486328 A 28 28 0 0 1 34.939453 38.90625 A 28 28 0 0 0 32.392578 37.486328 z M 6.5742188 38.128906 A 28 28 0 0 0 5.4511719 38.765625 A 28 28 0 0 1 6.5742188 38.128906 z M 35.041016 38.966797 A 28 28 0 0 1 37.523438 40.738281 A 28 28 0 0 0 35.041016 38.966797 z M 3.5273438 40.080078 A 28 28 0 0 0 2.5761719 40.771484 A 28 28 0 0 1 3.5273438 40.080078 z M 37.658203 40.851562 A 28 28 0 0 1 39.804688 42.783203 A 28 28 0 0 0 37.658203 40.851562 z M 40.011719 42.990234 A 28 28 0 0 1 42.013672 45.251953 A 28 28 0 0 0 40.011719 42.990234 z M 42.013672 45.251953 A 28 28 0 0 1 20.042969 56 A 28 28 0 0 1 14.232422 55.3125 A 16 16 0 0 1 16 62.607422 A 16 16 0 0 1 0 78.607422 L 0 82.121094 A 28 28 0 0 0 20.042969 90.607422 A 28 28 0 0 0 48.042969 62.607422 A 28 28 0 0 0 42.013672 45.251953 z M 1.3007812 46.667969 A 16 16 0 0 1 1.6191406 46.697266 A 16 16 0 0 0 1.3007812 46.667969 z M 4.2558594 47.189453 A 16 16 0 0 1 4.4355469 47.242188 A 16 16 0 0 0 4.2558594 47.189453 z "/><path fill="currentColor" opacity="0.85" d="M 6.0637516 38.376047 A 28 28 0 0 1 20.042969 34.615234 A 28 28 0 0 1 42.013672 45.259765 A 28 28 0 0 0 48.042969 28.007812 A 28 28 0 0 0 20.042969 0.0078125 A 28 28 0 0 0 0 8.4941407 L 0 16.007812 A 12 12 0 0 1 12 28.007812 A 12 12 0 0 1 6.0613693 38.364443 "/><path fill="currentColor" d="M 20.042969 34.607422 A 28 28 0 0 0 5.0878906 38.970703 A 28 28 0 0 1 6.0644531 38.376953 L 6.0605469 38.365234 A 12 12 0 0 1 0 40.007812 L 0 43.09375 L 0 43.101562 L 0 46.607422 A 16 16 0 0 1 2.8847656 46.873047 A 16 16 0 0 1 2.9199219 46.878906 A 16 16 0 0 1 5.7011719 47.662109 A 16 16 0 0 1 5.7324219 47.673828 A 16 16 0 0 1 8.3300781 48.955078 A 16 16 0 0 1 8.3398438 48.958984 A 16 16 0 0 1 8.3457031 48.962891 A 16 16 0 0 1 10.662109 50.6875 A 16 16 0 0 1 10.697266 50.71875 A 16 16 0 0 1 12.660156 52.837891 A 16 16 0 0 1 12.667969 52.845703 A 16 16 0 0 1 12.673828 52.855469 A 16 16 0 0 1 14.228516 55.306641 A 16 16 0 0 1 14.232422 55.3125 A 28 28 0 0 0 20.042969 56 A 28 28 0 0 0 42.013672 45.251953 A 28 28 0 0 0 20.042969 34.607422 z M 4.7695312 39.177734 A 28 28 0 0 0 2.5390625 40.798828 A 28 28 0 0 1 4.7695312 39.177734 z M 2.1816406 41.091797 A 28 28 0 0 0 0.11914062 42.984375 A 28 28 0 0 1 2.1816406 41.091797 z "/></svg>';function EZ(){return[{tag:"a",className:"bc-frame-credit",text:"Blueprint Chart",html:DZ+"Blueprint Chart",href:"/",target:"_blank",rel:"noopener noreferrer"}]}function Xr(t,e){if(e===null)return{wrapper:t,header:t,body:t,footer:t};const n=e??{};new BZ(Se(t)).draw({headerItems:LZ(n),footerLeftItems:PZ(n),footerRightItems:EZ()});const r=t.querySelector(".bc-frame"),i=r.querySelector(".bc-frame-header"),s=r.querySelector(".bc-frame-body"),a=r.querySelector(".bc-frame-note"),l=r.querySelector(".bc-frame-footer");if(n.padding&&r.style.setProperty("--bc-frame-padding",n.padding),n.transparentBackground&&r.style.setProperty("--bc-frame-bg","transparent"),n.note?a.textContent=n.note:a.style.display="none",t.isConnected){const c=getComputedStyle(t),u=c.aspectRatio&&c.aspectRatio!=="auto"&&c.aspectRatio!=="",d=c.display==="flex"&&c.flexDirection==="column";if(u||d){const f=i.offsetHeight,h=l.offsetHeight,g=a.style.display!=="none"?a.offsetHeight:0;r.classList.add("bc-frame--constrained"),s.dataset.headerH=String(f);const v=t;s.dataset.footerH=String(v.__bcFooterH??h+g),requestAnimationFrame(()=>{v.__bcFooterH=l.offsetHeight+(a.style.display!=="none"?a.offsetHeight:0)})}}return{wrapper:r,header:i,body:s,footer:l}}function R8(t){return t&&(t.startsWith("(")&&t.endsWith(")")?t.slice(0,-1):t)}function NZ(t){if(!t)return{prefix:"",d3Spec:"",suffix:""};if(t.includes("|")){const e=t.split("|");return{prefix:e[0]??"",d3Spec:R8(e[1]??""),suffix:e[2]??""}}return{prefix:"",d3Spec:R8(t),suffix:""}}function Ra(t){if(!t)return null;const{prefix:e,d3Spec:n,suffix:o}=NZ(t);if(!n)return null;const r=wu(n);return!e&&!o?r:i=>`${e}${r(i)}${o}`}function Dm(t,e){return!Number.isFinite(e)||e<=0?"0%":`${Math.round(t/e*100)}%`}function Di(t,e){if(!t)return;const n=t.stableTop??t.top,o=e.stableTop??e.top;return{dx:t.left-e.left,dy:n-o}}const IZ={top:12,right:20,bottom:24,left:50},XC=600,KC=400;class RZ extends co{initialize(){this.configDefine("totalWidth",{defaultValue:XC}),this.configDefine("totalHeight",{defaultValue:KC}),this.layer("svg",this.base,{dataBind:(e,n)=>e.selectAll("svg").data(n),insert:e=>e.append("svg"),events:{enter:e=>{const n=this.config("totalWidth"),o=this.config("totalHeight");e.attr("width",n).attr("height",o).append("g").attr("transform",r=>`translate(${r.left},${r.top})`)}}})}}const FZ=400,F8=2,n0=2,o0=9;function nc(t,e,n,o){const r=Math.min(0,...t),i=Math.max(0,...t),s=(e==null?void 0:e.min)??r,a=(e==null?void 0:e.max)??i,l=o==="log"?Ka().domain([s,a]).nice():On().domain([s,a]).nice(),c=l.ticks(),u=n?Ra(n)??l.tickFormat():l.tickFormat(),d=c.map(h=>u(h));if(d.length===0)return 0;try{const g=document.createElement("canvas").getContext("2d");if(g){g.font="10px sans-serif";let v=0;for(const m of d){const b=g.measureText(m).width;b>v&&(v=b)}return Math.ceil(v)+n0+o0}}catch{}return Math.max(...d.map(h=>h.length))*6+n0+o0}function Em(t){if(t.length===0)return 0;try{const o=document.createElement("canvas").getContext("2d");if(o){o.font="10px sans-serif";let r=0;for(const i of t){const s=o.measureText(i).width;s>r&&(r=s)}return Math.ceil(r)+n0+o0}}catch{}return Math.max(...t.map(n=>n.length))*6+n0+o0}function Ei(t,e,n,o,r,i){const s={},a=r??50,l=o??"left",c=e??"auto",u=c==="auto"?t>0&&t<FZ?"inside":"outside":c,d=u==="inside",f=u==="off";return l==="right"?(s.left=0,d?s.right=F8:f?s.right=0:s.right=a):(s.right=i!==!1?15:0,d?s.left=F8:f?s.left=0:s.left=a),d&&(s.top=35),(i===!1||n==="inside"||n==="off")&&(s.bottom=5),s}function lr(t){const e=t.getBoundingClientRect(),n=getComputedStyle(t);return{width:e.width-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),height:e.height-(parseFloat(n.paddingTop)||0)-(parseFloat(n.paddingBottom)||0)}}function Kr(t,e){const n={...IZ,...e},o=t.closest(".bc-frame--constrained")!=null;if(o){const f=parseFloat(t.dataset.headerH||"0"),h=parseFloat(t.dataset.footerH||"0"),g=n.top;n.top=f+g,n.bottom+=h,n.stableTop=g}const r=lr(t),i=r.width>0?r.width:XC,s=r.height>0?r.height:KC,a=i-n.left-n.right,l=s-n.top-n.bottom,c=new RZ(Se(t));c.config({totalWidth:i,totalHeight:s}),c.draw([n]);const u=t.querySelector("svg"),d=u.querySelector("g");return o&&(u.setAttribute("viewBox",`0 0 ${i} ${s}`),u.setAttribute("preserveAspectRatio","none"),u.removeAttribute("width"),u.removeAttribute("height"),u.style.width="100%",u.style.height="100%",u.style.display="block"),{svg:u,chartArea:d,width:a,height:l,margin:n}}function oc(t){return typeof window>"u"||typeof window.matchMedia!="function"?t:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:t}const Su=500;let ZC=0;function Zr(t){ZC=t?Su:0}function kt(){return oc(ZC)}function Wo(t,e,n,o){if(e.length===0)return;if(n===0&&o===0){e.forEach(s=>t.appendChild(s));return}const r=document.createElementNS("http://www.w3.org/2000/svg","g");r.setAttribute("transform",`translate(${n},${o})`),e.forEach(s=>r.appendChild(s)),t.appendChild(r);const i=kt();if(i>0)Se(r).transition().duration(i).attrTween("transform",()=>{const s=ro(n,0),a=ro(o,0);return l=>`translate(${s(l)},${a(l)})`}).on("end",()=>{for(;r.firstChild;)t.appendChild(r.firstChild);r.remove()});else{for(;r.firstChild;)t.appendChild(r.firstChild);r.remove()}}function Or(t,e){const n=oc(Su);n<=0||typeof t.animate!="function"||t.animate([{opacity:0},{opacity:1}],{duration:n,easing:"ease-in-out"})}function Br(t,e){const n=oc(Su);if(t.querySelectorAll("[data-bc-fade-overlay]").forEach(r=>{typeof r.getAnimations=="function"&&r.getAnimations().forEach(i=>i.cancel()),r.remove()}),n<=0||t.children.length===0)return null;const o=document.createElement("div");return o.style.position="absolute",o.style.inset="0",o.style.pointerEvents="none",o.style.display="flex",o.style.flexDirection="column",o.dataset.bcFadeOverlay="true",Array.from(t.childNodes).forEach(r=>{o.appendChild(r.cloneNode(!0))}),o.querySelectorAll(".bc-axis-vertical, .bc-axis-horizontal").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame-footer, .bc-frame-note").forEach(r=>{r.remove()}),o.querySelectorAll("[data-bc-fade-overlay], .bc-frame--fade-snapshot").forEach(r=>{r.remove()}),o.querySelectorAll(".bc-frame").forEach(r=>{r.classList.remove("bc-frame"),r.classList.add("bc-frame--fade-snapshot")}),o}function Lr(t,e,n){const o=oc(Su);if(getComputedStyle(t).position==="static"&&(t.style.position="relative"),t.appendChild(e),o>0&&typeof e.animate=="function"){const i=e.animate([{opacity:1},{opacity:0}],{duration:o,easing:"ease-in-out"});i.onfinish=()=>e.remove()}else e.remove()}const V8=30;class VZ extends co{initialize(){this.configDefine("scale",{defaultValue:On()}),this.configDefine("direction",{defaultValue:si.Left}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:Un.Dashed}),this.configDefine("gridWidth",{defaultValue:0}),this.configDefine("height",{defaultValue:0}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("labelPosition",{defaultValue:rn.Auto}),this.configDefine("topPadding",{defaultValue:0}),this.configDefine("tickFormat",{defaultValue:null});const e=this.base.append("g");this.layer("axis",e,{dataBind:(n,o)=>n.selectAll(".bc-axis-vertical").data(o),insert:n=>n.append("g").attr("class","bc-axis bc-axis-vertical"),events:{"merge:transition":n=>{const o=this.config("scale"),r=this.config("direction"),i=this.config("showAxis"),s=this.config("showTicks"),a=this.config("labelPosition"),l=this.config("gridWidth"),c=this.config("height"),u=r===si.Right?c8(o):u8(o);s||u.tickSizeOuter(0);const d=this.config("ticks");if(d)u.tickValues(d);else if(c>0){const v=Math.max(2,Math.floor(c/V8));u.ticks(v)}const f=this.config("tickFormat");if(f)u.tickFormat(f);else{const v=this.config("numberFormat"),m=v?Ra(v):null;m&&u.tickFormat(m)}const h=kt(),g=n.node();if(g){h>0?n.duration(h).call(u):Se(g).call(u),i||Se(g).select(".domain").remove(),s||Se(g).selectAll(".tick line").attr("opacity",0);const m=a===rn.Auto?l>0&&l<400?rn.Inside:rn.Outside:a;if(m===rn.Inside){const b=i?4:0,y=h>0?n.selectAll(".tick text"):Se(g).selectAll(".tick text");r===si.Right?y.attr("x",-b).attr("dy","-0.4em").attr("text-anchor","end"):y.attr("x",b).attr("dy","-0.4em").attr("text-anchor","start")}else m===rn.Off&&Se(g).selectAll(".tick text").attr("opacity",0)}},exit:n=>{n.remove()},enter:n=>{const o=this.config("scale"),r=this.config("direction"),i=this.config("labelPosition"),s=this.config("gridWidth"),a=this.config("height"),l=this.config("topPadding"),c=r===si.Right?c8(o):u8(o);this.config("showTicks")||c.tickSizeOuter(0);const u=this.config("ticks");if(u)c.tickValues(u);else if(a>0){const m=Math.max(2,Math.floor(a/V8));c.ticks(m)}const d=this.config("tickFormat");if(d)c.tickFormat(d);else{const m=this.config("numberFormat"),b=m?Ra(m):null;b&&c.tickFormat(b)}n.call(c);const f=this.config("showAxis"),h=this.config("showTicks");f||n.select(".domain").remove();const v=i===rn.Auto?s>0&&s<400?rn.Inside:rn.Outside:i;if(v===rn.Inside){const m=f?4:0;if(r===si.Right?n.selectAll(".tick text").attr("x",-m).attr("dy","-0.4em").attr("text-anchor","end"):n.selectAll(".tick text").attr("x",m).attr("dy","-0.4em").attr("text-anchor","start"),h?n.selectAll(".tick line").attr("x2",r===si.Right?-6:6):n.selectAll(".tick line").remove(),l>0&&f){const b=n.select(".domain");if(!b.empty()){const y=b.attr("d"),x=y.replace(/V[\d.]+/,`V${-l}`);x!==y&&b.attr("d",x)}}}else h||n.selectAll(".tick line").remove(),v===rn.Off&&n.selectAll(".tick text").remove()}}})}postDraw(){const e=this.config("gridStyle"),n=this.config("gridWidth"),o=this.config("direction"),r=this.base.select(".bc-axis-vertical").node();if(r&&e!==Un.None&&n>0){const i=o===si.Right?-n:n;zZ(r,e,i)}}}function zZ(t,e,n){var a;const o=((a=t.ownerSVGElement)==null?void 0:a.parentElement)??document.documentElement,i=getComputedStyle(o).getPropertyValue("--bc-grid-color").trim()||"#ccc";Se(t).selectAll(".tick").each(function(){const c=Se(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",n).attr("y1",0).attr("y2",0).attr("stroke",i).attr("stroke-width",1);e===Un.Dashed?c.attr("stroke-dasharray","4,4"):e===Un.Dotted&&c.attr("stroke-dasharray","1,3")})}function QC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var op={exports:{}},HZ=op.exports,z8;function WZ(){return z8||(z8=1,(function(t,e){(function(n,o){t.exports=o()})(HZ,(function(){var n=1e3,o=6e4,r=36e5,i="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",f="quarter",h="year",g="date",v="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var M=["th","st","nd","rd"],F=P%100;return"["+P+(M[(F-20)%10]||M[F]||M[0])+"]"}},x=function(P,M,F){var V=String(P);return!V||V.length>=M?P:""+Array(M+1-V.length).join(F)+P},_={s:x,z:function(P){var M=-P.utcOffset(),F=Math.abs(M),V=Math.floor(F/60),G=F%60;return(M<=0?"+":"-")+x(V,2,"0")+":"+x(G,2,"0")},m:function P(M,F){if(M.date()<F.date())return-P(F,M);var V=12*(F.year()-M.year())+(F.month()-M.month()),G=M.clone().add(V,d),K=F-G<0,ue=M.clone().add(V+(K?-1:1),d);return+(-(V+(F-G)/(K?G-ue:ue-G))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:h,w:u,d:c,D:g,h:l,m:a,s,ms:i,Q:f}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},S="en",N={};N[S]=y;var B="$isDayjsObject",k=function(P){return P instanceof C||!(!P||!P[B])},L=function P(M,F,V){var G;if(!M)return S;if(typeof M=="string"){var K=M.toLowerCase();N[K]&&(G=K),F&&(N[K]=F,G=K);var ue=M.split("-");if(!G&&ue.length>1)return P(ue[0])}else{var de=M.name;N[de]=M,G=de}return!V&&G&&(S=G),G||!V&&S},E=function(P,M){if(k(P))return P.clone();var F=typeof M=="object"?M:{};return F.date=P,F.args=arguments,new C(F)},I=_;I.l=L,I.i=k,I.w=function(P,M){return E(P,{locale:M.$L,utc:M.$u,x:M.$x,$offset:M.$offset})};var C=(function(){function P(F){this.$L=L(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[B]=!0}var M=P.prototype;return M.parse=function(F){this.$d=(function(V){var G=V.date,K=V.utc;if(G===null)return new Date(NaN);if(I.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var ue=G.match(m);if(ue){var de=ue[2]-1||0,he=(ue[7]||"0").substring(0,3);return K?new Date(Date.UTC(ue[1],de,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,he)):new Date(ue[1],de,ue[3]||1,ue[4]||0,ue[5]||0,ue[6]||0,he)}}return new Date(G)})(F),this.init()},M.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},M.$utils=function(){return I},M.isValid=function(){return this.$d.toString()!==v},M.isSame=function(F,V){var G=E(F);return this.startOf(V)<=G&&G<=this.endOf(V)},M.isAfter=function(F,V){return E(F)<this.startOf(V)},M.isBefore=function(F,V){return this.endOf(V)<E(F)},M.$g=function(F,V,G){return I.u(F)?this[V]:this.set(G,F)},M.unix=function(){return Math.floor(this.valueOf()/1e3)},M.valueOf=function(){return this.$d.getTime()},M.startOf=function(F,V){var G=this,K=!!I.u(V)||V,ue=I.p(F),de=function(oe,ve){var ce=I.w(G.$u?Date.UTC(G.$y,ve,oe):new Date(G.$y,ve,oe),G);return K?ce:ce.endOf(c)},he=function(oe,ve){return I.w(G.toDate()[oe].apply(G.toDate("s"),(K?[0,0,0,0]:[23,59,59,999]).slice(ve)),G)},ge=this.$W,ee=this.$M,fe=this.$D,xe="set"+(this.$u?"UTC":"");switch(ue){case h:return K?de(1,0):de(31,11);case d:return K?de(1,ee):de(0,ee+1);case u:var Z=this.$locale().weekStart||0,pe=(ge<Z?ge+7:ge)-Z;return de(K?fe-pe:fe+(6-pe),ee);case c:case g:return he(xe+"Hours",0);case l:return he(xe+"Minutes",1);case a:return he(xe+"Seconds",2);case s:return he(xe+"Milliseconds",3);default:return this.clone()}},M.endOf=function(F){return this.startOf(F,!1)},M.$set=function(F,V){var G,K=I.p(F),ue="set"+(this.$u?"UTC":""),de=(G={},G[c]=ue+"Date",G[g]=ue+"Date",G[d]=ue+"Month",G[h]=ue+"FullYear",G[l]=ue+"Hours",G[a]=ue+"Minutes",G[s]=ue+"Seconds",G[i]=ue+"Milliseconds",G)[K],he=K===c?this.$D+(V-this.$W):V;if(K===d||K===h){var ge=this.clone().set(g,1);ge.$d[de](he),ge.init(),this.$d=ge.set(g,Math.min(this.$D,ge.daysInMonth())).$d}else de&&this.$d[de](he);return this.init(),this},M.set=function(F,V){return this.clone().$set(F,V)},M.get=function(F){return this[I.p(F)]()},M.add=function(F,V){var G,K=this;F=Number(F);var ue=I.p(V),de=function(ee){var fe=E(K);return I.w(fe.date(fe.date()+Math.round(ee*F)),K)};if(ue===d)return this.set(d,this.$M+F);if(ue===h)return this.set(h,this.$y+F);if(ue===c)return de(1);if(ue===u)return de(7);var he=(G={},G[a]=o,G[l]=r,G[s]=n,G)[ue]||1,ge=this.$d.getTime()+F*he;return I.w(ge,this)},M.subtract=function(F,V){return this.add(-1*F,V)},M.format=function(F){var V=this,G=this.$locale();if(!this.isValid())return G.invalidDate||v;var K=F||"YYYY-MM-DDTHH:mm:ssZ",ue=I.z(this),de=this.$H,he=this.$m,ge=this.$M,ee=G.weekdays,fe=G.months,xe=G.meridiem,Z=function(ve,ce,D,W){return ve&&(ve[ce]||ve(V,K))||D[ce].slice(0,W)},pe=function(ve){return I.s(de%12||12,ve,"0")},oe=xe||function(ve,ce,D){var W=ve<12?"AM":"PM";return D?W.toLowerCase():W};return K.replace(b,(function(ve,ce){return ce||(function(D){switch(D){case"YY":return String(V.$y).slice(-2);case"YYYY":return I.s(V.$y,4,"0");case"M":return ge+1;case"MM":return I.s(ge+1,2,"0");case"MMM":return Z(G.monthsShort,ge,fe,3);case"MMMM":return Z(fe,ge);case"D":return V.$D;case"DD":return I.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return Z(G.weekdaysMin,V.$W,ee,2);case"ddd":return Z(G.weekdaysShort,V.$W,ee,3);case"dddd":return ee[V.$W];case"H":return String(de);case"HH":return I.s(de,2,"0");case"h":return pe(1);case"hh":return pe(2);case"a":return oe(de,he,!0);case"A":return oe(de,he,!1);case"m":return String(he);case"mm":return I.s(he,2,"0");case"s":return String(V.$s);case"ss":return I.s(V.$s,2,"0");case"SSS":return I.s(V.$ms,3,"0");case"Z":return ue}return null})(ve)||ue.replace(":","")}))},M.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},M.diff=function(F,V,G){var K,ue=this,de=I.p(V),he=E(F),ge=(he.utcOffset()-this.utcOffset())*o,ee=this-he,fe=function(){return I.m(ue,he)};switch(de){case h:K=fe()/12;break;case d:K=fe();break;case f:K=fe()/3;break;case u:K=(ee-ge)/6048e5;break;case c:K=(ee-ge)/864e5;break;case l:K=ee/r;break;case a:K=ee/o;break;case s:K=ee/n;break;default:K=ee}return G?K:I.a(K)},M.daysInMonth=function(){return this.endOf(d).$D},M.$locale=function(){return N[this.$L]},M.locale=function(F,V){if(!F)return this.$L;var G=this.clone(),K=L(F,V,!0);return K&&(G.$L=K),G},M.clone=function(){return I.w(this.$d,this)},M.toDate=function(){return new Date(this.valueOf())},M.toJSON=function(){return this.isValid()?this.toISOString():null},M.toISOString=function(){return this.$d.toISOString()},M.toString=function(){return this.$d.toUTCString()},P})(),$=C.prototype;return E.prototype=$,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",h],["$D",g]].forEach((function(P){$[P[1]]=function(M){return this.$g(M,P[0],P[1])}})),E.extend=function(P,M){return P.$i||(P(M,C,E),P.$i=!0),E},E.locale=L,E.isDayjs=k,E.unix=function(P){return E(1e3*P)},E.en=N[S],E.Ls=N,E.p={},E}))})(op)),op.exports}var UZ=WZ();const Rc=QC(UZ);var rp={exports:{}},GZ=rp.exports,H8;function qZ(){return H8||(H8=1,(function(t,e){(function(n,o){t.exports=o()})(GZ,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},o=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},c=function(m){return(m=+m)+(m>68?1900:2e3)},u=function(m){return function(b){this[m]=+b}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=(function(b){if(!b||b==="Z")return 0;var y=b.match(/([+-]|\d\d)/g),x=60*y[1]+(+y[2]||0);return x===0?0:y[0]==="+"?-x:x})(m)}],f=function(m){var b=l[m];return b&&(b.indexOf?b:b.s.concat(b.f))},h=function(m,b){var y,x=l.meridiem;if(x){for(var _=1;_<=24;_+=1)if(m.indexOf(x(_,0,b))>-1){y=_>12;break}}else y=m===(b?"pm":"PM");return y},g={A:[a,function(m){this.afternoon=h(m,!1)}],a:[a,function(m){this.afternoon=h(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[i,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,u("seconds")],ss:[s,u("seconds")],m:[s,u("minutes")],mm:[s,u("minutes")],H:[s,u("hours")],h:[s,u("hours")],HH:[s,u("hours")],hh:[s,u("hours")],D:[s,u("day")],DD:[i,u("day")],Do:[a,function(m){var b=l.ordinal,y=m.match(/\d+/);if(this.day=y[0],b)for(var x=1;x<=31;x+=1)b(x).replace(/\[|\]/g,"")===m&&(this.day=x)}],w:[s,u("week")],ww:[i,u("week")],M:[s,u("month")],MM:[i,u("month")],MMM:[a,function(m){var b=f("months"),y=(f("monthsShort")||b.map((function(x){return x.slice(0,3)}))).indexOf(m)+1;if(y<1)throw new Error;this.month=y%12||y}],MMMM:[a,function(m){var b=f("months").indexOf(m)+1;if(b<1)throw new Error;this.month=b%12||b}],Y:[/[+-]?\d+/,u("year")],YY:[i,function(m){this.year=c(m)}],YYYY:[/\d{4}/,u("year")],Z:d,ZZ:d};function v(m){var b,y;b=m,y=l&&l.formats;for(var x=(m=b.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(E,I,C){var $=C&&C.toUpperCase();return I||y[C]||n[C]||y[$].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(P,M,F){return M||F.slice(1)}))}))).match(o),_=x.length,S=0;S<_;S+=1){var N=x[S],B=g[N],k=B&&B[0],L=B&&B[1];x[S]=L?{regex:k,parser:L}:N.replace(/^\[|\]$/g,"")}return function(E){for(var I={},C=0,$=0;C<_;C+=1){var P=x[C];if(typeof P=="string")$+=P.length;else{var M=P.regex,F=P.parser,V=E.slice($),G=M.exec(V)[0];F.call(I,G),E=E.replace(G,"")}}return(function(K){var ue=K.afternoon;if(ue!==void 0){var de=K.hours;ue?de<12&&(K.hours+=12):de===12&&(K.hours=0),delete K.afternoon}})(I),I}}return function(m,b,y){y.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(c=m.parseTwoDigitYear);var x=b.prototype,_=x.parse;x.parse=function(S){var N=S.date,B=S.utc,k=S.args;this.$u=B;var L=k[1];if(typeof L=="string"){var E=k[2]===!0,I=k[3]===!0,C=E||I,$=k[2];I&&($=k[2]),l=this.$locale(),!E&&$&&(l=y.Ls[$]),this.$d=(function(V,G,K,ue){try{if(["x","X"].indexOf(G)>-1)return new Date((G==="X"?1e3:1)*V);var de=v(G)(V),he=de.year,ge=de.month,ee=de.day,fe=de.hours,xe=de.minutes,Z=de.seconds,pe=de.milliseconds,oe=de.zone,ve=de.week,ce=new Date,D=ee||(he||ge?1:ce.getDate()),W=he||ce.getFullYear(),j=0;he&&!ge||(j=ge>0?ge-1:ce.getMonth());var ne,ie=fe||0,ae=xe||0,te=Z||0,Y=pe||0;return oe?new Date(Date.UTC(W,j,D,ie,ae,te,Y+60*oe.offset*1e3)):K?new Date(Date.UTC(W,j,D,ie,ae,te,Y)):(ne=new Date(W,j,D,ie,ae,te,Y),ve&&(ne=ue(ne).week(ve).toDate()),ne)}catch{return new Date("")}})(N,L,B,y),this.init(),$&&$!==!0&&(this.$L=this.locale($).$L),C&&N!=this.format(L)&&(this.$d=new Date("")),l={}}else if(L instanceof Array)for(var P=L.length,M=1;M<=P;M+=1){k[1]=L[M-1];var F=y.apply(this,k);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}M===P&&(this.$d=new Date(""))}else _.call(this,S)}}}))})(rp)),rp.exports}var YZ=qZ();const jZ=QC(YZ);Rc.extend(jZ);const JC=["YYYY-MM-DDTHH:mm:ss","YYYY-MM-DD HH:mm","YYYY-MM-DD","YYYY/MM/DD","MM/DD/YYYY","M/D/YYYY","M/D/YY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY","MMMM D, YYYY","MMM YYYY","MMMM YYYY","YYYY-MM","YYYY/MM","YYYY"];function XZ(t){return t.includes("HH")||t.includes("mm")||t.includes("ss")?"datetime":t.includes("DD")||new RegExp("(?<![MA-Z])D(?!D)").test(t)?"day":t==="YYYY"?"year":t.includes("MM")||t.includes("MMM")||t.includes("MMMM")||t.includes("M/")?"month":"day"}function r0(t){return new Date(Date.UTC(t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()))}function KZ(t){const e=t.trim();if(!e)return null;if(/^\d{4}$/.test(e)){const n=Rc(e,"YYYY",!0);return n.isValid()?r0(n):null}for(const n of JC){if(n==="YYYY")continue;const o=Rc(e,n,!0);if(o.isValid())return r0(o)}return null}function nf(t){const e=t.trim();if(!e)return;const n=KZ(e);if(n)return n.getTime();const o=parseFloat(e);if(!isNaN(o))return o}function Nm(t){if(t.length===0)return null;const e=[];let n=null;const o=t[0].trim();if(!o)return null;if(/^\d{4}$/.test(o)){for(const i of t){const s=i.trim();if(!/^\d{4}$/.test(s))return null;const a=Rc(s,"YYYY",!0);if(!a.isValid())return null;e.push(r0(a))}return{dates:e,granularity:"year"}}const r=[];for(const i of JC)i!=="YYYY"&&Rc(o,i,!0).isValid()&&r.push(i);if(r.length===0)return null;for(const i of r){const s=[];let a=!0;for(const l of t){const c=Rc(l.trim(),i,!0);if(!c.isValid()){a=!1;break}s.push(r0(c))}if(a){n=i,e.push(...s);break}}return n?{dates:e,granularity:XZ(n)}:null}const ZZ=60,Ld=10,s2=1.3,QZ=12,JZ=3,eQ=14,tQ=10;function nQ(t,e,n=JZ){if(t==="")return[""];if(t.length*Ld<=e)return[t];const o=t.split(/\s+/).filter(Boolean);if(o.length===0)return null;const r=[];let i="";for(const s of o){if(s.length*Ld>e)return null;const a=i?`${i} ${s}`:s;if(a.length*Ld<=e)i=a;else if(r.push(i),i=s,r.length>=n)return null}return i&&r.push(i),r.length>n?null:r}const oQ={year:"%Y",month:"%b %Y",day:"%b %-d, %Y",datetime:"%b %-d, %Y %H:%M"};function rQ(t){return typeof t.step=="function"}function e5(t,e){const n=Nm(e);if(t&&t.includes("%")){if(n){const o=Qd(t),r=new Map;return e.forEach((i,s)=>r.set(i,n.dates[s])),i=>{if(i instanceof Date)return o(i);const s=r.get(String(i));return s?o(s):String(i)}}return null}if(t)return Ra(t)??wu(t);if(n){const o=Qd(oQ[n.granularity]??"%Y-%m-%d"),r=new Map;return e.forEach((i,s)=>r.set(i,n.dates[s])),i=>{if(i instanceof Date)return o(i);const s=r.get(String(i));return s?o(s):String(i)}}return null}function Bf(t,e){let n=0;for(const o of t){const i=(e?e(o):o).length*Ld;i>n&&(n=i)}return n}function iQ(t,e,n){if(t.length<=1)return t;const o=n?Bf(t,n):t.reduce((c,u)=>Math.max(c,u.length),0)*Ld,r=Math.max(16,Math.ceil(o)+8),i=Math.max(2,Math.floor(e/r));if(t.length<=i)return t;const s=Math.ceil(t.length/i),a=t.filter((c,u)=>u%s===0),l=t[t.length-1];return a[a.length-1]!==l&&a.push(l),a}function sQ(t,e,n,o){if(t.length<=1||e<=0||n==="horizontal")return!1;if(n==="vertical")return!0;if(Nm(t))return!1;const r=Bf(t,o??null),i=e/t.length;return r>i*s2}function aQ(t,e){if(t.length===0)return 0;const n=Bf(t,e??null);return Math.ceil(n)+QZ}function lQ(t){let e=1;for(const n of t)n.length>e&&(e=n.length);return e<=1?0:e*eQ+tQ}function a2(t,e,n={},o=24){if(t.length===0||e<=0||n.labelPosition==="off"||n.labelPosition==="inside")return;const r=n.tickFormat?n.tickFormat:e5(n.numberFormat??null,t),i=n.labelRotation??"auto";if(!(i!=="vertical"&&Nm(t)!==null)&&t.length>1){const u=e/t.length*s2,f=Bf(t,r)>u;if(i!=="vertical"&&f){const h=t5(t,u,r);if(h){const g=lQ(Array.from(h.values()));return g>o?g:void 0}}}if(!sQ(t,e,i,r))return;const l=aQ(t,r);return l>o?l:void 0}function t5(t,e,n){const o=new Map;let r=!1;for(const i of t){const s=n?n(i):i,a=nQ(s,e);if(a===null)return null;o.set(i,a),a.length>1&&(r=!0)}return r?o:null}function cQ(t,e){t.selectAll(".tick").each(function(){const n=Se(this),o=n.datum(),r=o instanceof Date?o.toISOString():String(o),i=e.get(r);if(!i||i.length<=1)return;const s=n.select("text");s.empty()||(s.attr("dy",null).text(null),i.forEach((a,l)=>{s.append("tspan").attr("x",0).attr("dy",l===0?"0.71em":"1em").text(a)}))})}class uQ extends co{initialize(){this.configDefine("scale",{defaultValue:Jn()}),this.configDefine("height",{defaultValue:0}),this.configDefine("tickPosition",{defaultValue:"below"}),this.configDefine("showAxis",{defaultValue:!0}),this.configDefine("showTicks",{defaultValue:!1}),this.configDefine("gridStyle",{defaultValue:"dashed"}),this.configDefine("ticks",{defaultValue:null}),this.configDefine("numberFormat",{defaultValue:null}),this.configDefine("width",{defaultValue:0}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("labelPosition",{defaultValue:"auto"}),this.configDefine("labelRotation",{defaultValue:"auto"}),this.configDefine("zeroY",{defaultValue:null}),this.configDefine("tickFormat",{defaultValue:null});const e=this.base.append("g");this.layer("axis",e,{dataBind:(n,o)=>n.selectAll(".bc-axis-horizontal").data(o),insert:n=>n.append("g").attr("class","bc-axis bc-axis-horizontal"),events:{"merge:transition":n=>{this.applyAxis(n,"merge")},exit:n=>{n.remove()},enter:n=>{this.applyAxis(n,"enter")}}})}applyAxis(e,n){const o=this.config("scale"),r=this.config("scale"),i=this.config("tickPosition"),s=this.config("height"),a=this.config("labelPosition"),l=this.config("labelRotation"),c=this.config("width"),u=this.config("numberFormat"),d=this.config("labels"),f=this.config("tickFormat"),h=i==="above"?sY(o):aY(o);this.config("showTicks")||h.tickSizeOuter(0);const g=f||e5(u,d);g&&h.tickFormat(g);const v=rQ(r),m=v?r.domain():[],b=v&&l!=="vertical"&&Nm(m)!==null;let y=null,x=!1;if(v&&!b&&m.length>1&&c>0){const I=c/m.length*s2,$=Bf(m,g)>I;l==="vertical"?x=!0:$&&(y=t5(m,I,g),!y&&l==="auto"&&(x=!0))}let _=this.config("ticks");if(!_&&c>0)if(v){if(b){const E=iQ(m,c,g);E.length<m.length&&(_=E)}}else{const E=Math.max(2,Math.floor(c/ZZ));h.ticks(E)}_&&h.tickValues(_);const S=i==="above"?0:s,N=e.node(),B=n==="merge"?kt():0;if(n==="merge"){if(!N)return;B>0?(e.attr("transform",`translate(0,${S})`),e.duration(B).call(h)):Se(N).attr("transform",`translate(0,${S})`).call(h)}else e.attr("transform",`translate(0,${S})`),e.call(h);const k=B>0?e:N?Se(N):e;if(!this.config("showAxis"))k.select(".domain").remove();else if(n==="enter"){const E=this.config("zeroY");if(E!=null){const I=E-(i==="above"?0:s);k.select(".domain").attr("transform",`translate(0,${I})`)}}this.config("showTicks")||k.selectAll(".tick line").remove();const L=a==="auto"?"outside":a;L==="off"?k.selectAll(".tick text").remove():L==="inside"&&k.selectAll(".tick text").attr("y",0).attr("dy","-0.6em"),x&&L!=="off"?k.selectAll(".tick text").attr("transform","rotate(-90)").attr("text-anchor","end").attr("x",i==="above"?9:-9).attr("y",0).attr("dy","0.32em"):k.selectAll(".tick text").attr("transform",null),y&&L!=="off"&&cQ(k,y)}postDraw(){const e=this.config("gridStyle"),n=this.config("height"),o=this.base.select(".bc-axis-horizontal").node();o&&e!=="none"&&n>0&&dQ(o,e,n)}}function dQ(t,e,n){var a;const o=((a=t.ownerSVGElement)==null?void 0:a.parentElement)??document.documentElement,i=getComputedStyle(o).getPropertyValue("--bc-grid-color").trim()||"#ccc";Se(t).selectAll(".tick").each(function(){const c=Se(this).append("line").attr("class","bc-grid-line").attr("x1",0).attr("x2",0).attr("y1",0).attr("y2",-n).attr("stroke",i).attr("stroke-width",1);e==="dashed"?c.attr("stroke-dasharray","4,4"):e==="dotted"&&c.attr("stroke-dasharray","1,3")})}const n5=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],fQ=200,W8=.2;class hQ extends co{initialize(){this.configDefine("colors",{defaultValue:n5}),this.configDefine("yOffset",{defaultValue:-10}),this.configDefine("layout",{defaultValue:"horizontal"}),this.configDefine("valueSuffixes",{defaultValue:[]}),this.configDefine("maxWidth",{defaultValue:0});const e=this.base.append("g").attr("class","bc-legend"),n=o=>{var f,h;const r=this.config("colors"),i=this.config("layout"),s=this.config("valueSuffixes"),a=((h=(f=this.base.node())==null?void 0:f.ownerSVGElement)==null?void 0:h.parentElement)??document.documentElement,l=getComputedStyle(a).getPropertyValue("--bc-text-color").trim()||"#555",c=this.config("maxWidth");let u=0,d=0;o.each(function(g,v){const m=Se(this),b=s[v],x=16+(b?g.length+1+b.length:g.length)*7+12;i==="horizontal"&&c>0&&u>0&&u+x>c&&(u=0,d+=20),m.attr("transform",`translate(${u},${d})`).attr("data-series",g).style("cursor","default");let _=m.select("rect");_.empty()&&(_=m.append("rect").attr("width",12).attr("height",12)),_.attr("fill",r[v%r.length]);let S=m.select("text");S.empty()&&(S=m.append("text").attr("x",16).attr("y",10).attr("font-size","12px")),S.attr("fill",l),S.selectAll("tspan").remove(),b?(S.text(null),S.append("tspan").attr("font-weight","bold").text(g),S.append("tspan").text(` ${b}`)):S.text(g),i==="vertical"?d+=20:u+=x})};this.layer("items",e,{dataBind:(o,r)=>o.selectAll(".bc-legend-item").data(r,i=>i),insert:o=>o.append("g").attr("class","bc-legend-item"),events:{enter:n,update:n}})}preDraw(){const e=this.config("yOffset");this.base.select(".bc-legend").attr("transform",`translate(0,${e})`)}}function pQ(t){const e=Se(t).selectAll(".bc-legend-item");if(e.empty())return;let n=null,o=null;function r(s){o=s,e.each(function(){const l=Se(this),c=l.attr("data-series")===s;l.transition().duration(150).style("opacity",c?1:W8)}),Se(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).each(function(){const l=Se(this),c=l.attr("data-series")===s,u=this.classList.contains("bc-direct-label")||this.classList.contains("bc-value-label");l.transition().duration(150).style("opacity",c?1:u?0:W8)})}function i(){o=null,e.transition().duration(150).style("opacity",1),Se(t).selectAll("[data-series]").filter(function(){return!this.closest(".bc-legend")}).transition().duration(150).style("opacity",null)}e.on("mouseenter.bcHighlight",null).on("mouseleave.bcHighlight",null).on("mouseenter.bcHighlight",function(){const s=Se(this).attr("data-series")??"";n&&clearTimeout(n),n=setTimeout(()=>r(s),oc(fQ))}).on("mouseleave.bcHighlight",()=>{n&&(clearTimeout(n),n=null),o!==null&&i()})}function Za(t,e,n=n5,o=-10,r="top",i="start",s=0,a=0,l=0,c=[],u={}){const d=r==="left"||r==="right"?"vertical":"horizontal",f=new hQ(Se(t));f.config({colors:n,yOffset:o,layout:d,valueSuffixes:c,maxWidth:s}),f.draw(e);const h=t.querySelector(".bc-legend");if(h){let g=0,v=0;const m=e.map((S,N)=>{const B=c[N];return B?S.length+1+B.length:S.length});if(d==="horizontal"){const S=m.map(L=>16+L*7+12);let N=1,B=0,k=0;for(const L of S)s>0&&B>0&&B+L>s?(k=Math.max(k,B),N++,B=L):B+=L;k=Math.max(k,B),g=k,v=N*20}else g=Math.max(...m)*7+16+8,v=e.length*20;const b=u.left??0,y=u.right??0;let x=l,_=o;d==="horizontal"?i==="middle"?x+=-b+(s+b+y-g)/2:i==="end"?x+=s+y-g:x+=-b:i==="middle"?_+=(a-v)/2:i==="end"&&(_+=a-v),h.setAttribute("transform",`translate(${x},${_})`)}return pQ(t),h}const o5=[{name:"Blueprint",label:"Blueprint",colors:["#2563A0","#D4A63A","#C94044","#2D8659","#4B90CF","#163A65"]},{name:"JosefAlbers",label:"Albers",colors:["#c00559","#de1f6c","#f3a20d","#f07a13","#de6716"]},{name:"Durorthod",label:"Amber",colors:["#2c0c00","#803c15","#c6782c","#ffa91d","#fff3ad"]},{name:"X41",label:"Berry",colors:["#411f6b","#623976","#be3979","#db928a","#e2c6a6"]},{name:"Bright",label:"Bright",colors:["#462255","#ff8811","#9dd9d2","#046e8f","#d44d5c"]},{name:"Cancri",label:"Cancri",colors:["#343854","#8c384d","#cf2438","#d95e31","#f0c742","#f8f0e5"]},{name:"Ceres",label:"Ceres",colors:["#181d20","#4a5f71","#6f8ba0","#f8f9fa"]},{name:"MarcChagall",label:"Chagall",colors:["#3f6f76","#69b7ce","#c65840","#f4ce4b","#62496f"]},{name:"Pelewensis",label:"Coral",colors:["#e2b000","#f7f656","#2449a2","#809098","#0d1115"]},{name:"Deathmasks",label:"Deathmasks",colors:["#926159","#87876e","#c7d2d8","#62b7c8","#43535c","#23313c"]},{name:"Leucosternon",label:"Deep Sea",colors:["#071140","#0e34b2","#207cf5","#9ec8ff","#fbfb53"]},{name:"Deelite",label:"Deelite",colors:["#48448e","#8ccc58","#fc4d97","#b82578"]},{name:"X10",label:"Dusk",colors:["#2a2432","#4f3855","#846d86","#efefcf","#d5b77d","#a89e5e"]},{name:"Vitrixerand",label:"Earth",colors:["#281b27","#723f27","#9b6044","#b5804c","#facd9a"]},{name:"Egypt",label:"Egypt",colors:["#dd5129","#0f7ba2","#43b284","#fab255"]},{name:"ElectronicNight",label:"Electric Night",colors:["#cb54d6","#3e45c4","#21191a","#362f78","#57b4ae"]},{name:"LutjanusSebae",label:"Emperor",colors:["#e5e9ea","#a2bac5","#ce3d21","#992216","#490d07"]},{name:"Enara",label:"Enara",colors:["#262626","#3d5983","#5a8a54","#cfb023"]},{name:"Camo871",label:"Fiesta",colors:["#ffff14","#fea31d","#ce2d41","#3a3fa3"]},{name:"Folklore",label:"Folklore",colors:["#272727","#5c5c5c","#bababa","#f8f8f8"]},{name:"Fritsch",label:"Fritsch",colors:["#0f8d7b","#8942bd","#1e1a1a","#eadd17"]},{name:"AgSunset",label:"Glow",colors:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"]},{name:"Harvey",label:"Harvey",colors:["#c6d4d6","#274c4f","#a4432d","#b17c51"]},{name:"Heep",label:"Heep",colors:["#466e9a","#e84d45","#21201c","#a1baac"]},{name:"Imperator",label:"Imperator",colors:["#04093a","#0527b4","#555dfe","#faf830","#b8980f"]},{name:"Klimt",label:"Klimt",colors:["#df9ed4","#c93f55","#eacc62","#469d76","#3c4b99","#924099"]},{name:"KnickCity",label:"Knick City",colors:["#0c2340","#ff6720","#707372","#c8c9c7"]},{name:"London",label:"London",colors:["#bd241e","#e56b1e","#ffcd22","#15274d"]},{name:"Lover",label:"Lover",colors:["#b8396b","#ffd1d7","#fff5cc","#76bae0","#b28f81","#54483e"]},{name:"Maya",label:"Maya",colors:["#3d5a80","#98c1d9","#e0fbfc","#ee6c4d","#293241"]},{name:"X24",label:"Mocha",colors:["#2b1917","#7e5945","#bc927b","#f1e6e1"]},{name:"Camo873",label:"Neon",colors:["#132f8a","#5a56c8","#fc7ead","#ffca3e"]},{name:"NetsCity",label:"Nets City",colors:["#010101","#ffb81c","#da291c","#004c97","#418fde"]},{name:"Nodoubt",label:"No Doubt",colors:["#385581","#6dbac6","#dac190","#c9052c"]},{name:"ClaesOldenburg",label:"Oldenburg",colors:["#95b1c9","#263656","#698946","#f8d440","#c82720"]},{name:"Peacesells",label:"Peace Sells",colors:["#9a5155","#483943","#ecc463","#a497b2"]},{name:"PabloPicasso",label:"Picasso",colors:["#4e7989","#a9011b","#e4a826","#80944e","#dcd6b2"]},{name:"Bifasciatum",label:"Reef",colors:["#080214","#16407b","#2b7ff9","#b1fcfc","#6cbe50"]},{name:"SiameseDream",label:"Siamese Dream",colors:["#f0e9e0","#2f1f16","#a34d2c","#cd8e40"]},{name:"X115",label:"Sienna",colors:["#001a29","#633633","#834a39","#e3b571","#eee6a6"]},{name:"Sixers",label:"Sixers",colors:["#888b8d","#e4d5d3","#003da5","#d50032"]},{name:"SolLeWitt",label:"Sol LeWitt",colors:["#0a71b6","#f9c40a","#190506","#eb5432","#eaf2f0"]},{name:"Sunset",label:"Sunset",colors:["#41476b","#675478","#9e6374","#c67b6f","#de9b71","#efbc82","#fbdfa2"]},{name:"Sunset2",label:"Sunset II",colors:["#1d457f","#61599d","#c36377","#eb7f54","#f2af4a"]},{name:"Sunset3",label:"Sunset III",colors:["#390e40","#701c34","#a63228","#c7662a","#eba42b"]},{name:"Pal9",label:"Tropical",colors:["#273b5b","#c1c243","#e73e26","#2e6657","#e8f5b3","#24a99c"]},{name:"Salvelinus",label:"Trout",colors:["#e6452e","#e49a36","#f9dd4c","#5b4a4c","#01040e"]},{name:"TheovanDoesburg",label:"Van Doesburg",colors:["#bd748f","#3d578e","#bfab68","#dad7d0","#272928"]},{name:"Wizards",label:"Wizards",colors:["#c8102e","#0c2340","#8d9093","#c8c9c7"]},{name:"FrancescoXanto",label:"Xanto",colors:["#2c6aa5","#d9ae2c","#ddc655","#d88c27","#64894d"]},{name:"Zeppelin",label:"Zeppelin",colors:["#efdb15","#739c9c","#0d484c","#c71a08"]}],mQ=Object.fromEntries(o5.map(t=>[t.name,t.colors]));function r5(t){if(!t)return;const e=mQ[t];return e?[...e]:void 0}function i5(){return o5}function Im(t,e){if(!e||e.min===void 0&&e.max===void 0)return t.map((o,r)=>r);const n=[];for(let o=0;o<t.length;o++){const r=nf(t[o]);if(r===void 0){n.push(o);continue}e.min!==void 0&&r<e.min||e.max!==void 0&&r>e.max||n.push(o)}return n}const of=60;function rc(t){const e=Number.isFinite(t)?Math.max(0,Math.min(100,t)):of;return e/(e+100)}function Au(t,e,n){let o=0,r=0,i=1/0,s=!0,a=!1;for(const u of t)Number.isFinite(u)&&(a=!0,u<o&&(o=u),u>r&&(r=u),u<=0?s=!1:u<i&&(i=u));n===iu.Log&&a&&s&&(o=i);let l=(e==null?void 0:e.min)??o,c=(e==null?void 0:e.max)??r;if(l>c&&([l,c]=[c,l]),l===c)if(l===0)c=1;else{const u=Math.abs(l)*.1;l=l-u,c=c+u}return[l,c]}function gQ(t){return typeof t.step=="function"}const hh=new WeakMap;class Pr{constructor(e){bn(this,"vGroup",null);bn(this,"hGroup",null);bn(this,"vChart",null);bn(this,"hChart",null);bn(this,"container");bn(this,"initialized",!1);this.container=e}static for(e){let n=hh.get(e);return n||(n=new Pr(e),hh.set(e,n)),n}static clear(e){hh.delete(e)}detach(){var e,n;(e=this.vGroup)!=null&&e.parentNode&&(Se(this.vGroup).interrupt().selectAll("*").interrupt(),this.vGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.vGroup.remove()),(n=this.hGroup)!=null&&n.parentNode&&(Se(this.hGroup).interrupt().selectAll("*").interrupt(),this.hGroup.querySelectorAll(".bc-grid-line").forEach(o=>o.remove()),this.hGroup.remove())}attach(e,n){if(!this.initialized)this.vGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.vGroup.setAttribute("class","bc-axis-service-v"),this.hGroup=document.createElementNS("http://www.w3.org/2000/svg","g"),this.hGroup.setAttribute("class","bc-axis-service-h"),e.appendChild(this.vGroup),e.appendChild(this.hGroup),this.vChart=new VZ(Se(this.vGroup)),this.hChart=new uQ(Se(this.hGroup)),this.initialized=!0;else{for(const r of[this.vGroup,this.hGroup])Se(r).selectAll(".tick").interrupt();e.appendChild(this.vGroup),e.appendChild(this.hGroup);const o=1;if(n&&(Math.abs(n.dx)>=o||Math.abs(n.dy)>=o)){const{dx:r,dy:i}=n;for(const s of[this.vGroup,this.hGroup]){s.setAttribute("transform",`translate(${r},${i})`);const a=kt();a>0?Se(s).transition().duration(a).attrTween("transform",()=>{const l=ro(r,0),c=ro(i,0);return u=>`translate(${l(u)},${c(u)})`}):s.removeAttribute("transform")}}}}update(e){const n=e.order??"vertical-first";n==="horizontal-first"?(this.updateHorizontal(e.horizontal),this.updateVertical(e.vertical)):(this.updateVertical(e.vertical),this.updateHorizontal(e.horizontal)),n==="horizontal-first"?this.hGroup&&this.vGroup&&this.hGroup.parentNode&&this.hGroup.parentNode.insertBefore(this.hGroup,this.vGroup):this.vGroup&&this.hGroup&&this.vGroup.parentNode&&this.vGroup.parentNode.insertBefore(this.vGroup,this.hGroup)}updateVertical(e){if(!this.vChart||!this.vGroup)return;if(!e){this.vGroup.style.display="none";return}this.vGroup.style.display="";const n=e.options;this.vChart.config({scale:e.scale,direction:n.direction??"left",showAxis:n.showAxis??!0,showTicks:n.showTicks??!1,gridStyle:n.gridStyle??"dashed",gridWidth:n.gridWidth??0,height:e.height,ticks:n.ticks??null,numberFormat:n.numberFormat??null,labelPosition:n.labelPosition??"auto",topPadding:n.topPadding??0,tickFormat:n.tickFormat??null}),this.vChart.draw([{placeholder:!0}]);const o=this.vGroup.querySelector(".bc-axis-vertical");o&&(n.direction??"left")==="right"?o.setAttribute("transform",`translate(${n.gridWidth??0},0)`):o&&o.removeAttribute("transform")}updateHorizontal(e){if(!this.hChart||!this.hGroup)return;if(!e){this.hGroup.style.display="none";return}this.hGroup.style.display="";const n=e.options,o=e.scale,r=gQ(o)?o.domain():[];this.hChart.config({scale:o,height:e.height,tickPosition:n.tickPosition??"below",showAxis:n.showAxis??!0,showTicks:n.showTicks??!1,gridStyle:n.gridStyle??"dashed",ticks:n.ticks??null,numberFormat:n.numberFormat??null,width:n.width??0,labels:r,labelPosition:n.labelPosition??"auto",labelRotation:n.labelRotation??"auto",zeroY:n.zeroY??null,tickFormat:n.tickFormat??null}),this.hChart.draw([{placeholder:!0}])}destroy(){this.detach(),this.vChart=null,this.hChart=null,this.vGroup=null,this.hGroup=null,this.initialized=!1,hh.delete(this.container)}}const Y1=Math.min,Fc=Math.max,i0=Math.round,rs=t=>({x:t,y:t}),vQ={left:"right",right:"left",bottom:"top",top:"bottom"},bQ={start:"end",end:"start"};function U8(t,e,n){return Fc(t,Y1(e,n))}function Rm(t,e){return typeof t=="function"?t(e):t}function Hl(t){return t.split("-")[0]}function Fm(t){return t.split("-")[1]}function s5(t){return t==="x"?"y":"x"}function a5(t){return t==="y"?"height":"width"}const yQ=new Set(["top","bottom"]);function Aa(t){return yQ.has(Hl(t))?"y":"x"}function l5(t){return s5(Aa(t))}function xQ(t,e,n){n===void 0&&(n=!1);const o=Fm(t),r=l5(t),i=a5(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=s0(s)),[s,s0(s)]}function wQ(t){const e=s0(t);return[j1(t),e,j1(e)]}function j1(t){return t.replace(/start|end/g,e=>bQ[e])}const G8=["left","right"],q8=["right","left"],_Q=["top","bottom"],kQ=["bottom","top"];function SQ(t,e,n){switch(t){case"top":case"bottom":return n?e?q8:G8:e?G8:q8;case"left":case"right":return e?_Q:kQ;default:return[]}}function AQ(t,e,n,o){const r=Fm(t);let i=SQ(Hl(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(j1)))),i}function s0(t){return t.replace(/left|right|bottom|top/g,e=>vQ[e])}function CQ(t){return{top:0,right:0,bottom:0,left:0,...t}}function $Q(t){return typeof t!="number"?CQ(t):{top:t,right:t,bottom:t,left:t}}function a0(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Y8(t,e,n){let{reference:o,floating:r}=t;const i=Aa(e),s=l5(e),a=a5(s),l=Hl(e),c=i==="y",u=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,f=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:u,y:o.y-r.height};break;case"bottom":h={x:u,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Fm(e)){case"start":h[s]-=f*(n&&c?-1:1);break;case"end":h[s]+=f*(n&&c?-1:1);break}return h}async function TQ(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Rm(e,t),g=$Q(h),m=a[f?d==="floating"?"reference":"floating":d],b=a0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(m)))==null||n?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},S=a0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(b.top-S.top+g.top)/_.y,bottom:(S.bottom-b.bottom+g.bottom)/_.y,left:(b.left-S.left+g.left)/_.x,right:(S.right-b.right+g.right)/_.x}}const MQ=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:d}=Y8(c,o,l),f=o,h={},g=0;for(let m=0;m<a.length;m++){var v;const{name:b,fn:y}=a[m],{x,y:_,data:S,reset:N}=await y({x:u,y:d,initialPlacement:o,placement:f,strategy:r,middlewareData:h,rects:c,platform:{...s,detectOverflow:(v=s.detectOverflow)!=null?v:TQ},elements:{reference:t,floating:e}});u=x??u,d=_??d,h={...h,[b]:{...h[b],...S}},N&&g<=50&&(g++,typeof N=="object"&&(N.placement&&(f=N.placement),N.rects&&(c=N.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):N.rects),{x:u,y:d}=Y8(c,f,l)),m=-1)}return{x:u,y:d,placement:f,strategy:r,middlewareData:h}},OQ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...m}=Rm(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Hl(r),y=Aa(a),x=Hl(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=f||(x||!v?[s0(a)]:wQ(a)),N=g!=="none";!f&&N&&S.push(...AQ(a,v,g,_));const B=[a,...S],k=await l.detectOverflow(e,m),L=[];let E=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push(k[b]),d){const P=xQ(r,s,_);L.push(k[P[0]],k[P[1]])}if(E=[...E,{placement:r,overflows:L}],!L.every(P=>P<=0)){var I,C;const P=(((I=i.flip)==null?void 0:I.index)||0)+1,M=B[P];if(M&&(!(d==="alignment"?y!==Aa(M):!1)||E.every(G=>Aa(G.placement)===y?G.overflows[0]>0:!0)))return{data:{index:P,overflows:E},reset:{placement:M}};let F=(C=E.filter(V=>V.overflows[0]<=0).sort((V,G)=>V.overflows[1]-G.overflows[1])[0])==null?void 0:C.placement;if(!F)switch(h){case"bestFit":{var $;const V=($=E.filter(G=>{if(N){const K=Aa(G.placement);return K===y||K==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(K=>K>0).reduce((K,ue)=>K+ue,0)]).sort((G,K)=>G[1]-K[1])[0])==null?void 0:$[0];V&&(F=V);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}},BQ=new Set(["left","top"]);async function LQ(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=Hl(n),a=Fm(n),l=Aa(n)==="y",c=BQ.has(s)?-1:1,u=i&&l?-1:1,d=Rm(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:f*c}:{x:f*c,y:h*u}}const PQ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=e,l=await LQ(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},DQ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r,platform:i}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...c}=Rm(t,e),u={x:n,y:o},d=await i.detectOverflow(e,c),f=Aa(Hl(r)),h=s5(f);let g=u[h],v=u[f];if(s){const b=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=g+d[b],_=g-d[y];g=U8(x,g,_)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=v+d[b],_=v-d[y];v=U8(x,v,_)}const m=l.fn({...e,[h]:g,[f]:v});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[h]:s,[f]:a}}}}}};function Vm(){return typeof window<"u"}function Cu(t){return c5(t)?(t.nodeName||"").toLowerCase():"#document"}function Ar(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ia(t){var e;return(e=(c5(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function c5(t){return Vm()?t instanceof Node||t instanceof Ar(t).Node:!1}function Mi(t){return Vm()?t instanceof Element||t instanceof Ar(t).Element:!1}function cs(t){return Vm()?t instanceof HTMLElement||t instanceof Ar(t).HTMLElement:!1}function j8(t){return!Vm()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ar(t).ShadowRoot}const EQ=new Set(["inline","contents"]);function Lf(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=Oi(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!EQ.has(r)}const NQ=new Set(["table","td","th"]);function IQ(t){return NQ.has(Cu(t))}const RQ=[":popover-open",":modal"];function zm(t){return RQ.some(e=>{try{return t.matches(e)}catch{return!1}})}const FQ=["transform","translate","scale","rotate","perspective"],VQ=["transform","translate","scale","rotate","perspective","filter"],zQ=["paint","layout","strict","content"];function l2(t){const e=c2(),n=Mi(t)?Oi(t):t;return FQ.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||VQ.some(o=>(n.willChange||"").includes(o))||zQ.some(o=>(n.contain||"").includes(o))}function HQ(t){let e=Fa(t);for(;cs(e)&&!lu(e);){if(l2(e))return e;if(zm(e))return null;e=Fa(e)}return null}function c2(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const WQ=new Set(["html","body","#document"]);function lu(t){return WQ.has(Cu(t))}function Oi(t){return Ar(t).getComputedStyle(t)}function Hm(t){return Mi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fa(t){if(Cu(t)==="html")return t;const e=t.assignedSlot||t.parentNode||j8(t)&&t.host||ia(t);return j8(e)?e.host:e}function u5(t){const e=Fa(t);return lu(e)?t.ownerDocument?t.ownerDocument.body:t.body:cs(e)&&Lf(e)?e:u5(e)}function d5(t,e,n){var o;e===void 0&&(e=[]);const r=u5(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=Ar(r);return i?(X1(s),e.concat(s,s.visualViewport||[],Lf(r)?r:[],[])):e.concat(r,d5(r,[]))}function X1(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function f5(t){const e=Oi(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=cs(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,a=i0(n)!==i||i0(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function h5(t){return Mi(t)?t:t.contextElement}function Vc(t){const e=h5(t);if(!cs(e))return rs(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=f5(e);let s=(i?i0(n.width):n.width)/o,a=(i?i0(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const UQ=rs(0);function p5(t){const e=Ar(t);return!c2()||!e.visualViewport?UQ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function GQ(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Ar(t)?!1:e}function rf(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=h5(t);let s=rs(1);e&&(o?Mi(o)&&(s=Vc(o)):s=Vc(t));const a=GQ(i,n,o)?p5(i):rs(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(i){const f=Ar(i),h=o&&Mi(o)?Ar(o):o;let g=f,v=X1(g);for(;v&&o&&h!==g;){const m=Vc(v),b=v.getBoundingClientRect(),y=Oi(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=b.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=x,c+=_,g=Ar(v),v=X1(g)}}return a0({width:u,height:d,x:l,y:c})}function Wm(t,e){const n=Hm(t).scrollLeft;return e?e.left+n:rf(ia(t)).left+n}function m5(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Wm(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function qQ(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=ia(o),a=e?zm(e.floating):!1;if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=rs(1);const u=rs(0),d=cs(o);if((d||!d&&!i)&&((Cu(o)!=="body"||Lf(s))&&(l=Hm(o)),cs(o))){const h=rf(o);c=Vc(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}const f=s&&!d&&!i?m5(s,l):rs(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}}function YQ(t){return Array.from(t.getClientRects())}function jQ(t){const e=ia(t),n=Hm(t),o=t.ownerDocument.body,r=Fc(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=Fc(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Wm(t);const a=-n.scrollTop;return Oi(o).direction==="rtl"&&(s+=Fc(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const X8=25;function XQ(t,e){const n=Ar(t),o=ia(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,l=0;if(r){i=r.width,s=r.height;const u=c2();(!u||u&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}const c=Wm(o);if(c<=0){const u=o.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(o.clientWidth-d.clientWidth-h);g<=X8&&(i-=g)}else c<=X8&&(i+=c);return{width:i,height:s,x:a,y:l}}const KQ=new Set(["absolute","fixed"]);function ZQ(t,e){const n=rf(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=cs(t)?Vc(t):rs(1),s=t.clientWidth*i.x,a=t.clientHeight*i.y,l=r*i.x,c=o*i.y;return{width:s,height:a,x:l,y:c}}function K8(t,e,n){let o;if(e==="viewport")o=XQ(t,n);else if(e==="document")o=jQ(ia(t));else if(Mi(e))o=ZQ(e,n);else{const r=p5(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return a0(o)}function g5(t,e){const n=Fa(t);return n===e||!Mi(n)||lu(n)?!1:Oi(n).position==="fixed"||g5(n,e)}function QQ(t,e){const n=e.get(t);if(n)return n;let o=d5(t,[]).filter(a=>Mi(a)&&Cu(a)!=="body"),r=null;const i=Oi(t).position==="fixed";let s=i?Fa(t):t;for(;Mi(s)&&!lu(s);){const a=Oi(s),l=l2(s);!l&&a.position==="fixed"&&(r=null),(i?!l&&!r:!l&&a.position==="static"&&!!r&&KQ.has(r.position)||Lf(s)&&!l&&g5(t,s))?o=o.filter(u=>u!==s):r=a,s=Fa(s)}return e.set(t,o),o}function JQ(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?zm(e)?[]:QQ(e,this._c):[].concat(n),o],a=s[0],l=s.reduce((c,u)=>{const d=K8(e,u,r);return c.top=Fc(d.top,c.top),c.right=Y1(d.right,c.right),c.bottom=Y1(d.bottom,c.bottom),c.left=Fc(d.left,c.left),c},K8(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function eJ(t){const{width:e,height:n}=f5(t);return{width:e,height:n}}function tJ(t,e,n){const o=cs(e),r=ia(e),i=n==="fixed",s=rf(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=rs(0);function c(){l.x=Wm(r)}if(o||!o&&!i)if((Cu(e)!=="body"||Lf(r))&&(a=Hm(e)),o){const h=rf(e,!0,i,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else r&&c();i&&!o&&r&&c();const u=r&&!o&&!i?m5(r,a):rs(0),d=s.left+a.scrollLeft-l.x-u.x,f=s.top+a.scrollTop-l.y-u.y;return{x:d,y:f,width:s.width,height:s.height}}function pv(t){return Oi(t).position==="static"}function Z8(t,e){if(!cs(t)||Oi(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ia(t)===n&&(n=n.ownerDocument.body),n}function v5(t,e){const n=Ar(t);if(zm(t))return n;if(!cs(t)){let r=Fa(t);for(;r&&!lu(r);){if(Mi(r)&&!pv(r))return r;r=Fa(r)}return n}let o=Z8(t,e);for(;o&&IQ(o)&&pv(o);)o=Z8(o,e);return o&&lu(o)&&pv(o)&&!l2(o)?n:o||HQ(t)||n}const nJ=async function(t){const e=this.getOffsetParent||v5,n=this.getDimensions,o=await n(t.floating);return{reference:tJ(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oJ(t){return Oi(t).direction==="rtl"}const rJ={convertOffsetParentRelativeRectToViewportRelativeRect:qQ,getDocumentElement:ia,getClippingRect:JQ,getOffsetParent:v5,getElementRects:nJ,getClientRects:YQ,getDimensions:eJ,getScale:Vc,isElement:Mi,isRTL:oJ},b5=PQ,y5=DQ,x5=OQ,w5=(t,e,n)=>{const o=new Map,r={platform:rJ,...n},i={...r.platform,_c:o};return MQ(t,e,{...r,platform:i})},_5="bc-tooltip";function iJ(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
39
|
-
.${_5} {
|
|
40
|
-
position: absolute;
|
|
41
|
-
pointer-events: none;
|
|
42
|
-
background: var(--bs-body-bg, #fff);
|
|
43
|
-
color: var(--bs-body-color, #212529);
|
|
44
|
-
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
45
|
-
border-radius: 4px;
|
|
46
|
-
padding: 6px 10px;
|
|
47
|
-
font-size: 13px;
|
|
48
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
49
|
-
z-index: 9999;
|
|
50
|
-
display: none;
|
|
51
|
-
}
|
|
52
|
-
`,document.head.appendChild(t)}function sJ(t){const e=t?Ra(t):null,n=o=>typeof o=="number"&&e?e(o):String(o);return o=>{if(o&&typeof o=="object"){if("data"in o&&typeof o.data=="number")return n(o.data);const r=o;if("label"in r&&"value"in r)return`${r.label}: ${n(r.value)}`;if("series"in r&&"value"in r)return`${r.series}: ${n(r.value)}`;if("value"in r)return n(r.value)}return String(o)}}function Qa(t){const e=(t==null?void 0:t.format)??sJ(t==null?void 0:t.numberFormat);let n=null;const o=[];return{name:"tooltip",install(){iJ(),n=document.createElement("div"),n.className=_5,document.body.appendChild(n)},postDraw(r){r.base.selectAll(".bc-bar, .bc-dot, .bc-arc").each(function(){const a=this,l=()=>{if(!n)return;const u=Se(a).datum();n.textContent=e(u),n.style.display="block",w5(a,n,{placement:"top",middleware:[b5(8),x5(),y5()]}).then(({x:d,y:f})=>{n&&(n.style.left=`${d}px`,n.style.top=`${f}px`)})},c=()=>{n&&(n.style.display="none")};a.addEventListener("mouseenter",l),a.addEventListener("mouseleave",c),o.push(()=>{a.removeEventListener("mouseenter",l),a.removeEventListener("mouseleave",c)})})},destroy(){for(const r of o)r();o.length=0,n&&(n.remove(),n=null)}}}function aJ(t){switch(t){case di.Solid:return"none";case di.Dotted:return"2,2";case di.Dashed:default:return"4,3"}}function ic(t){const e=(t==null?void 0:t.color)??"#999",n=(t==null?void 0:t.dashArray)??aJ(t==null?void 0:t.style),o=(t==null?void 0:t.direction)??Co.Both,r=(t==null?void 0:t.orientation)??Kn.Vertical,i=[];return{name:"crosshair",install(){},postDraw(s){const a=s.base,l=(t==null?void 0:t.width)??0,c=(t==null?void 0:t.height)??0,u=o===Co.Both||o===Co.Vertical,d=o===Co.Both||o===Co.Horizontal,f=u?a.append("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",c).attr("stroke",e).attr("stroke-width",1).style("stroke-dasharray",n).attr("pointer-events","none").style("display","none"):null,h=d?a.append("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",l).attr("stroke",e).attr("stroke-width",1).style("stroke-dasharray",n).attr("pointer-events","none").style("display","none"):null;a.selectAll(".bc-dot, .bc-bar").each(function(){const v=this,m=()=>{const y=Se(v);let x,_;if(v.tagName==="circle")x=parseFloat(y.attr("cx")),_=parseFloat(y.attr("cy"));else{const S=parseFloat(y.attr("x")),N=parseFloat(y.attr("width")),B=parseFloat(y.attr("y")),k=parseFloat(y.attr("height"));r===Kn.Horizontal?(x=S+N,_=B+k/2):(x=S+N/2,_=B)}f&&f.attr("x1",x).attr("x2",x).style("display",null),h&&h.attr("y1",_).attr("y2",_).style("display",null)},b=()=>{f&&f.style("display","none"),h&&h.style("display","none")};v.addEventListener("mouseenter",m),v.addEventListener("mouseleave",b),i.push(()=>{v.removeEventListener("mouseenter",m),v.removeEventListener("mouseleave",b)})})},destroy(){for(const s of i)s();i.length=0}}}function u2(t){const e=t.querySelector(".bc-annotation-line");if(!(!e||!e.hasAttribute("data-line-style")))return{style:e.getAttribute("data-line-style"),fromX:parseFloat(e.getAttribute("data-line-from-x")||"0"),fromY:parseFloat(e.getAttribute("data-line-from-y")||"0"),toX:parseFloat(e.getAttribute("data-line-to-x")||"0"),toY:parseFloat(e.getAttribute("data-line-to-y")||"0"),departVertical:e.getAttribute("data-line-depart-vertical")==="true"}}function cr(t){const e=new Map,n=t.querySelectorAll("g[data-annotation-id]");for(const o of n){const r=o.getAttribute("data-annotation-id"),i=u2(o);try{const s=o.getBBox();e.set(r,{id:r,element:o,rect:{x:s.x,y:s.y,width:s.width,height:s.height},line:i})}catch{e.set(r,{id:r,element:o,rect:{x:0,y:0,width:0,height:0},line:i})}}return e}const Va={N:{dx:0,dy:-1},NE:{dx:.707,dy:-.707},E:{dx:1,dy:0},SE:{dx:.707,dy:.707},S:{dx:0,dy:1},SW:{dx:-.707,dy:.707},W:{dx:-1,dy:0},NW:{dx:-.707,dy:-.707},center:{dx:0,dy:0}},Q8={N:{nx:0,ny:-1},NE:{nx:1,ny:-1},E:{nx:1,ny:0},SE:{nx:1,ny:1},S:{nx:0,ny:1},SW:{nx:-1,ny:1},W:{nx:-1,ny:0},NW:{nx:-1,ny:-1},center:{nx:0,ny:0}};Pn.N+"",Pn.W,Pn.NE+"",Pn.NW,Pn.E+"",Pn.N,Pn.SE+"",Pn.NE,Pn.S+"",Pn.E,Pn.SW+"",Pn.SE,Pn.W+"",Pn.S,Pn.NW+"",Pn.SW,Pn.Center+"",Pn.Center;function lJ(t,e){const n=Va[t]??Va.NW;return{dx:n.dx*e,dy:n.dy*e}}function d2(t){return"step"in t&&!("bandwidth"in t)}function k5(t){if("bandwidth"in t||d2(t))return!1;const e=t.domain();return e.length>0&&e[0]instanceof Date}function S5(t,e){if("bandwidth"in t){const n=t;return(n(e)??0)+n.bandwidth()/2}return d2(t)?t(e)??0:k5(t)?t(new Date(e)):t(Number(e))}function J8(t,e){const n=(e.left+e.right)/2,o=(e.top+e.bottom)/2,r=Q8[t]??Q8.N;return{x:n+r.nx*(e.right-e.left)/2,y:o+r.ny*(e.bottom-e.top)/2}}function cJ(t,e,n,o,r){if("bandwidth"in e){const c=e,u=c(t.label)??0,d=c.bandwidth(),f=n(t.value),h=n(0);return r==="horizontal"?J8(o,{left:h,right:f,top:u,bottom:u+d}):J8(o,{left:u,right:u+d,top:f,bottom:h})}const i=S5(e,t.label),s=n(t.value),a=2,l=Va[o]??Va.N;return{x:i+l.dx*a,y:s+l.dy*a}}function uJ(t,e,n,o=4){const r=t.x+t.width/2,i=t.y+t.height/2;if(e===r&&n===i)return{x:r,y:i};const s=e>=t.x&&e<=t.x+t.width,a=n>=t.y&&n<=t.y+t.height,l=[];if(s&&(n<i?l.push({x:r,y:t.y-o,dist:Math.abs(i-n)}):l.push({x:r,y:t.y+t.height+o,dist:Math.abs(n-i)})),a&&(e>r?l.push({x:t.x+t.width+o,y:i,dist:Math.abs(e-r)}):l.push({x:t.x-o,y:i,dist:Math.abs(r-e)})),l.length>0){l.sort((g,v)=>g.dist-v.dist);const{x:f,y:h}=l[0];return{x:f,y:h}}const c=[{x:r,y:t.y-o},{x:r,y:t.y+t.height+o},{x:t.x+t.width+o,y:i},{x:t.x-o,y:i}];let u=c[0],d=(u.x-e)**2+(u.y-n)**2;for(let f=1;f<c.length;f++){const h=(c[f].x-e)**2+(c[f].y-n)**2;h<d&&(u=c[f],d=h)}return u}function f2(t,e){if(!t)return"bc-arrow";const n=e??"#666",o=`bc-arrow-${n.replace(/[^a-zA-Z0-9]/g,"")}`;return t.querySelector(`#${o}`)||(Se(t).select("defs").empty()?Se(t).append("defs"):Se(t).select("defs")).append("marker").attr("id",o).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",8).attr("markerHeight",8).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 1 1 L 9 5 L 1 9").attr("fill","none").attr("stroke",n).attr("stroke-width",1.5).attr("stroke-linecap","round").attr("stroke-linejoin","round"),o}function dJ(t){switch(t){case Wp.Dotted:return"2,3";case Wp.Dashed:return"5,4";default:return""}}function fJ(t,e,n,o={}){const r=t.append("circle").attr("class","bc-annotation-circle").attr("cx",e).attr("cy",n).attr("r",o.size??4).attr("fill","none").attr("stroke",o.color??"#666").attr("stroke-width",1.5),i=dJ(o.style??Wp.Solid);i&&r.attr("stroke-dasharray",i)}const e6=1/Math.tan(40*Math.PI/180);function hJ(t,e,n){if(n){const i=e.y>=t.y?1:-1,s=Math.max(Math.abs(e.y-t.y)-Math.abs(e.x-t.x)*e6,12);return{x:t.x,y:t.y+i*s}}const o=e.x>=t.x?1:-1,r=Math.max(Math.abs(e.x-t.x)-Math.abs(e.y-t.y)*e6,12);return{x:t.x+o*r,y:t.y}}function pJ(t,e,n){const o=hJ(t,e,n);return`M ${t.x} ${t.y} L ${o.x} ${o.y} L ${e.x} ${e.y}`}function mJ(t,e,n,o=Ao.Direct,r={}){var l;let i;switch(o){case Ao.CurveLeft:case Ao.CurveRight:{const c=n.x-e.x,u=n.y-e.y,f=Math.sqrt(c*c+u*u)*.8,h=o===Ao.CurveRight?1:0;i=`M ${e.x} ${e.y} A ${f} ${f} 0 0 ${h} ${n.x} ${n.y}`;break}case Ao.Elbow:{i=pJ(e,n,r.departVertical??!1);break}default:i=`M ${e.x} ${e.y} L ${n.x} ${n.y}`}const s=r.color??"#666",a=t.append("path").attr("class","bc-annotation-line").attr("d",i).attr("fill","none").attr("stroke",s).attr("stroke-width",r.lineWeight??1).attr("pathLength","1").attr("data-line-style",o).attr("data-line-from-x",String(e.x)).attr("data-line-from-y",String(e.y)).attr("data-line-to-x",String(n.x)).attr("data-line-to-y",String(n.y)).attr("data-line-depart-vertical",String(r.departVertical??!1));if(r.showArrow===!0){const c=((l=t.node())==null?void 0:l.ownerSVGElement)??null,u=f2(c,s);a.attr("marker-end",`url(#${u})`)}}function h2(t,e,n,o,r={}){const i=r.textAnchor??"middle",s=r.textOutline!==!1,a=t.append("text").attr("class","bc-annotation-text").attr("x",n).attr("y",o).attr("text-anchor",i).attr("font-size","12px").attr("fill",r.textColor??"currentColor");s&&a.attr("stroke",r.backgroundColor??"#fff").attr("stroke-width",3).attr("paint-order","stroke");const l=e.split(`
|
|
53
|
-
`);if(l.length>1||r.maxWidth&&r.maxWidth>0)if(r.maxWidth&&r.maxWidth>0)gJ(a,e,r.maxWidth);else for(let c=0;c<l.length;c++)a.append("tspan").attr("x",a.attr("x")).attr("dy",c===0?"0":"1.2em").text(l[c]);else a.text(e)}function gJ(t,e,n){const o=e.split(/\s+/);let r="",i=0;for(const s of o){const a=r?`${r} ${s}`:s;r&&a.length*7>n?(t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(r),r=s,i++):r=a}r&&t.append("tspan").attr("x",t.attr("x")).attr("dy",i===0?"0":"1.2em").text(r)}function ph(t,e,n=aC.Center){if("bandwidth"in e){const o=e,r=o(String(t))??0,i=o.bandwidth(),s=o.step()-i;return n==="start"?r-s/2:n==="end"?r+i+s/2:r+i/2}if(d2(e)){const o=e(String(t))??0,r=e.step()/2;return n==="start"?o-r:n==="end"?o+r:o}return k5(e)?e(new Date(String(t))):e(Number(t))}function mh(t,e){return e(Number(t))}function t6(t,e){if(typeof t=="number")return e/2+t/100*e;const n=String(t);return n.endsWith("%")?e/2+parseFloat(n)/100*e:parseFloat(n)||0}function p2(t,e){if(t==null)return;if(typeof t=="number")return t||void 0;const n=String(t);return n.endsWith("%")?parseFloat(n)/100*e:parseFloat(n)||void 0}function vJ(t){return t<-4?"end":t>4?"start":"middle"}function n6(t,e,n){if("bandwidth"in e){const o=e;return{x:(o(t.label)??0)+o.bandwidth()/2,y:n(t.value)}}return{x:S5(e,t.label),y:n(t.value)}}function A5(t,e,n,o){const r="target"in e?e.target:void 0;if(!r)return;const i=n.data.find(x=>x.label===r);if(!i)return;const s=t.append("g").attr("data-annotation-index",String(o));e.id&&s.attr("data-annotation-id",e.id);const a=e,l=a.anchorDirection??Pn.N,c=cJ(i,n.scaleX,n.scaleY,l,n.orientation);let u,d;const f=e;if(f.dx!=null||f.dy!=null){const{x,y:_}=n6(i,n.scaleX,n.scaleY);u=x+(Number(f.dx)||40),d=_+(Number(f.dy)||-40)}else if(f.direction!=null&&f.textOffsetX==null){const{x,y:_}=n6(i,n.scaleX,n.scaleY),S=f.direction,N=f.anchorDistance??60,B=lJ(S,N);u=x+B.dx,d=_+B.dy}else u=c.x+(a.textOffsetX??-42),d=c.y+(a.textOffsetY??-42);const h=e.circleColor??"#666",g=e;g.showCircle&&fJ(s,c.x,c.y,{size:g.circleSize,style:g.circleStyle,color:h});const v=Math.max(4,Math.min(u,n.width-4)),m=Math.max(4,Math.min(d,n.height-4));if(e.text){const x=vJ(u-c.x);h2(s,e.text,v,m-4,{textColor:e.textColor,maxWidth:p2(e.maxWidth,n.width),textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline})}if(f.dx!=null||f.dy!=null?a.showLine!==!1:a.showLine===!0||a.showArrow===!0){let x={x:v,y:m},_=!1;const S=s.select(".bc-annotation-text").node();if(S)try{const L=S.getBBox();if(L.width>0&&L.height>0){x=uJ(L,c.x,c.y);const E=L.x+L.width/2;_=Math.abs(x.x-E)<1}}catch{}const N=a.showCircle?(a.circleSize??4)+(a.lineTargetDistance??5):a.lineTargetDistance??0;let B=c.x,k=c.y;if(N>0){const L=c.x-x.x,E=c.y-x.y,I=Math.sqrt(L*L+E*E);if(I>0){const C=c.x-L/I*N,$=c.y-E/I*N,P=Va[l]??Va.N;B=Math.abs(P.dx)>.01?C:c.x,k=Math.abs(P.dy)>.01?$:c.y}}mJ(s,x,{x:B,y:k},a.lineStyle??Ao.Direct,{showArrow:a.showArrow,lineWeight:a.lineWeight,color:h,departVertical:_})}}function C5(t,e,n,o,r){if(e.kind!==Pt.Range)return;const i=t.append("g").attr("data-annotation-index",String(o));e.id&&i.attr("data-annotation-id",e.id);const s=e.orientation??Kn.Vertical;let a,l,c,u;if(n.orientation===Kn.Horizontal)if(s===Kn.Vertical){const d=ph(e.start,n.scaleX,e.startAnchor),f=ph(e.end,n.scaleX,e.endAnchor);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}else{const d=mh(e.start,n.scaleY),f=mh(e.end,n.scaleY);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else if(s===Kn.Vertical){const d=ph(e.start,n.scaleX,e.startAnchor),f=ph(e.end,n.scaleX,e.endAnchor);a=Math.min(d,f),c=Math.abs(f-d),l=0,u=n.height}else{const d=mh(e.start,n.scaleY),f=mh(e.end,n.scaleY);l=Math.min(d,f),u=Math.abs(f-d),a=0,c=n.width}if(i.append("rect").attr("class","bc-annotation-range").attr("x",a).attr("y",l).attr("width",c).attr("height",u).attr("fill",e.bgColor??"#ccc").attr("opacity",(e.bgOpacity??20)/100),e.text){const d=s===Kn.Vertical?c:u,f=p2(e.maxWidth,n.width)??Math.max(d,50),h=e.direction??"center",g=4,v=Va[h]??Va.center,m=.5+v.dx*.5,b=.5+v.dy*.5,y=Math.max(g,Math.min(a+c*m,n.width-g));let x="middle";m<.25?x="start":m>.75&&(x="end");const S=l+g+12,N=r?r.append("g").attr("data-annotation-index",String(o)):i;if(h2(N,e.text,y,S,{textColor:e.textColor,maxWidth:f,textAnchor:x,backgroundColor:n.backgroundColor,textOutline:e.textOutline}),b>.25){const B=N.select(".bc-annotation-text").node();if(B)try{const k=B.getBBox();let L=0;b>.75?L=l+u-g-(k.y+k.height):L=l+u/2-(k.y+k.height/2),Math.abs(L)>.5&&B.setAttribute("transform",`translate(0, ${L})`)}catch{}}}}function $5(t,e,n,o){if(e.kind!=="free")return;const r=t.append("g").attr("data-annotation-index",String(o));e.id&&r.attr("data-annotation-id",e.id);const i=t6(e.x,n.width),s=t6(e.y,n.height);if(e.text){h2(r,e.text,i,s,{textColor:e.textColor,maxWidth:p2(e.maxWidth,n.width),textAnchor:"middle",backgroundColor:n.backgroundColor,textOutline:e.textOutline});const a=r.select(".bc-annotation-text").node();if(a)try{const l=a.getBBox(),c=s-(l.y+l.height/2);Math.abs(c)>.5&&a.setAttribute("transform",`translate(0, ${c})`)}catch{}}}function K1(t,e,n,o){const r=n+.45*(t-n);return`M ${t} ${e} L ${r} ${e} L ${n} ${o}`}function bJ(t,e){const n=t.hasAttribute("marker-end"),o=u2(t.parentElement);if(n&&o){const r=Se(t),i=t.getAttribute("d"),s=`M ${o.fromX} ${o.fromY} L ${o.fromX} ${o.fromY}`;if(r.attr("d",s),o.style===Ao.Elbow){const a={tipX:o.toX,tipY:o.toY,calloutX:o.fromX,calloutY:o.fromY},l={tipX:o.fromX,tipY:o.fromY,calloutX:o.fromX,calloutY:o.fromY};r.transition().duration(e).ease(dh).attrTween("d",()=>{const c=Bd(l,a);return u=>{const d=c(u);return K1(d.calloutX,d.calloutY,d.tipX,d.tipY)}})}else if(o.style===Ao.CurveLeft||o.style===Ao.CurveRight){const a={x:o.fromX,y:o.fromY},l={x:o.toX,y:o.toY},c=l.x-a.x,u=l.y-a.y,d=Math.sqrt(c*c+u*u),f=d*.8,h=o.style===Ao.CurveRight?1:0,g=d/2,v=g<f?Math.sqrt(f*f-g*g):0,m=(a.x+l.x)/2,b=(a.y+l.y)/2,y=d>0?-u/d:0,x=d>0?c/d:0,_=h===1?1:-1,S=m+_*v*y,N=b+_*v*x,B=Math.atan2(a.y-N,a.x-S);let L=Math.atan2(l.y-N,l.x-S)-B;h===1&&L<=0&&(L+=2*Math.PI),h===0&&L>=0&&(L-=2*Math.PI),r.transition().duration(e).ease(dh).attrTween("d",()=>E=>{if(E>=.98)return i;const I=B+E*L,C=S+f*Math.cos(I),$=N+f*Math.sin(I);return`M ${a.x} ${a.y} A ${f} ${f} 0 0 ${h} ${C} ${$}`})}else r.transition().duration(e).ease(dh).attrTween("d",()=>{const a=ro(o.fromX,o.toX),l=ro(o.fromY,o.toY);return c=>`M ${o.fromX} ${o.fromY} L ${a(c)} ${l(c)}`})}else t.setAttribute("stroke-dasharray","1"),t.setAttribute("stroke-dashoffset","1"),Se(t).transition().duration(e).ease(dh).attr("stroke-dashoffset","0").on("end",()=>{t.removeAttribute("stroke-dasharray"),t.removeAttribute("stroke-dashoffset")})}const gh=1;function yJ(t,e){return t.style!==e.style||t.departVertical!==e.departVertical?!1:Math.abs(t.fromX-e.fromX)<=gh&&Math.abs(t.fromY-e.fromY)<=gh&&Math.abs(t.toX-e.toX)<=gh&&Math.abs(t.toY-e.toY)<=gh}function xJ(t,e,n){const o=u2(t.parentElement);if(!o||yJ(e,o))return;const r=Se(t);if(e.style===Ao.Elbow&&o.style===Ao.Elbow){const i={tipX:e.toX,tipY:e.toY,calloutX:e.fromX,calloutY:e.fromY},s={tipX:o.toX,tipY:o.toY,calloutX:o.fromX,calloutY:o.fromY};r.attr("d",K1(i.calloutX,i.calloutY,i.tipX,i.tipY)),r.transition().duration(n).ease(Zp).attrTween("d",()=>{const a=Bd(i,s);return l=>{const c=a(l);return K1(c.calloutX,c.calloutY,c.tipX,c.tipY)}})}else{const i={x:e.fromX,y:e.fromY},s={x:e.toX,y:e.toY},a={x:o.fromX,y:o.fromY},l={x:o.toX,y:o.toY},c=t.getAttribute("d"),u=`M ${i.x} ${i.y} L ${s.x} ${s.y}`;r.attr("d",u),r.transition().duration(n).ease(Zp).attrTween("d",()=>{const d=Bd(i,a),f=Bd(s,l);return h=>{if(h>=.98)return c;const g=d(h),v=f(h);if(o.style===Ao.Direct||e.style===Ao.Direct)return`M ${g.x} ${g.y} L ${v.x} ${v.y}`;const m=v.x-g.x,b=v.y-g.y,x=Math.sqrt(m*m+b*b)*.8,_=o.style===Ao.CurveRight?1:0;return`M ${g.x} ${g.y} A ${x} ${x} 0 0 ${_} ${v.x} ${v.y}`}})}}function T5(t,e,n,o){if(o<=0)return;const r=[...t.querySelectorAll("g[data-annotation-id]"),...e.querySelectorAll("g[data-annotation-id]")],i=new Set;for(const s of r){const a=s.getAttribute("data-annotation-id");i.add(a);const l=n.get(a);if(l){const c=s.querySelector(".bc-annotation-line");c&&l.line&&xJ(c,l.line,o);try{const u=s.getBBox(),d=l.rect.x-u.x,f=l.rect.y-u.y;if(Math.abs(d)>.5||Math.abs(f)>.5){const h=s.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const g of h){const v=g;v.style.transition="none",v.setAttribute("transform",`translate(${d}, ${f})`),v.getBoundingClientRect(),v.style.transition=`transform ${o}ms ease`,v.setAttribute("transform","translate(0, 0)")}}}catch{}}else{const c=s.querySelector(".bc-annotation-line");c&&bJ(c,o);const u=s.querySelectorAll(".bc-annotation-text, .bc-annotation-circle");for(const d of u){const f=d;f.style.opacity="0",f.getBoundingClientRect(),f.style.transition=`opacity ${o}ms ease`,f.style.opacity="1"}}}for(const[s,a]of n)if(!i.has(s)){const l=a.element.cloneNode(!0);t.appendChild(l),l.style.opacity="1",l.getBoundingClientRect(),l.style.transition=`opacity ${o}ms ease`,l.style.opacity="0",setTimeout(()=>l.remove(),o)}}function M5(t){if(!t)return;const e=parseFloat(t.getAttribute("width")||"0"),n=parseFloat(t.getAttribute("height")||"0");if(!e||!n)return;const o=t.getBBox();if(o.width===0&&o.height===0)return;const r=8,i=o.x,s=o.y,a=o.x+o.width,l=o.y+o.height,c=i<0?i-r:0,u=s<0?s-r:0,d=a>e?a+r:e,f=l>n?l+r:n;(c<0||u<0||d>e||f>n)&&Se(t).attr("viewBox",`${c} ${u} ${d-c} ${f-u}`).attr("preserveAspectRatio","xMidYMid meet")}function Um(t,e,n){const o=t.ownerSVGElement??t;Se(o).style("overflow","visible"),f2(o);const r=Se(t);let i;if(n.transition)if(n.priorAnnotations&&n.priorAnnotations.size>0)i=n.priorAnnotations;else{const l=t.querySelector(".bc-annotations"),c=t.querySelector(".bc-annotations-range");if(l||c){if(i=new Map,l)for(const[u,d]of cr(l))i.set(u,d);if(c)for(const[u,d]of cr(c))i.set(u,d)}}t.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(l=>l.remove());const s=r.insert("g",":first-child").attr("class","bc-annotations-range"),a=r.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(n.width)).attr("data-ctx-height",String(n.height));for(let l=0;l<e.length;l++){const c=e[l];switch(c.kind??Pt.Point){case Pt.Point:A5(a,c,n,l);break;case Pt.Range:C5(s,c,n,l,a);break;case Pt.Free:$5(a,c,n,l);break}}if(n.transition){const l=oc(Su);T5(a.node(),s.node(),i??new Map,l)}M5(o)}function $u(t,e){return{name:"annotations",install(){},postDraw(n){var f;const o=n.base,r=((f=o.node())==null?void 0:f.ownerSVGElement)??o.node();r&&Se(r).style("overflow","visible"),f2(r);const i=o.node(),s=i==null?void 0:i.parentNode,a=s&&s!==r?Se(s):o,l=a.node();let c;if(e.transition){if(e.priorAnnotations&&e.priorAnnotations.size>0)c=e.priorAnnotations;else if(l){const h=l.querySelector(".bc-annotations"),g=l.querySelector(".bc-annotations-range");if(h||g){if(c=new Map,h)for(const[v,m]of cr(h))c.set(v,m);if(g)for(const[v,m]of cr(g))c.set(v,m)}}}l&&l.querySelectorAll(".bc-annotations, .bc-annotations-range").forEach(h=>h.remove());const u=a.insert("g",":first-child").attr("class","bc-annotations-range"),d=a.append("g").attr("class","bc-annotations").attr("data-ctx-width",String(e.width)).attr("data-ctx-height",String(e.height));for(let h=0;h<t.length;h++){const g=t[h];switch(g.kind??Pt.Point){case Pt.Point:A5(d,g,e,h);break;case Pt.Range:C5(u,g,e,h,d);break;case Pt.Free:$5(d,g,e,h);break}}if(e.transition){const h=oc(Su);T5(d.node(),u.node(),c??new Map,h)}M5(r)}}}const{min:wJ,max:_J}=Math,Ol=(t,e=0,n=1)=>wJ(_J(e,t),n),m2=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=Ol(t[e],0,255)):e===3&&(t[e]=Ol(t[e],0,1));return t},O5={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])O5[`[object ${t}]`]=t.toLowerCase();function Bt(t){return O5[Object.prototype.toString.call(t)]||"object"}const Ct=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Bt(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),Tu=t=>{if(t.length<2)return null;const e=t.length-1;return Bt(t[e])=="string"?t[e].toLowerCase():null},{PI:Gm,min:B5,max:L5}=Math,Hr=t=>Math.round(t*100)/100,Z1=t=>Math.round(t*100)/100,Os=Gm*2,mv=Gm/3,kJ=Gm/180,SJ=180/Gm;function P5(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const _t={format:{},autodetect:[]};class Ve{constructor(...e){const n=this;if(Bt(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let o=Tu(e),r=!1;if(!o){r=!0,_t.sorted||(_t.autodetect=_t.autodetect.sort((i,s)=>s.p-i.p),_t.sorted=!0);for(let i of _t.autodetect)if(o=i.test(...e),o)break}if(_t.format[o]){const i=_t.format[o].apply(null,r?e:e.slice(0,-1));n._rgb=m2(i)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Bt(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const AJ="3.2.0",ot=(...t)=>new Ve(...t);ot.version=AJ;const cu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},CJ=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,$J=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,D5=t=>{if(t.match(CJ)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,o=e>>8&255,r=e&255;return[n,o,r,1]}if(t.match($J)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,o=e>>16&255,r=e>>8&255,i=Math.round((e&255)/255*100)/100;return[n,o,r,i]}throw new Error(`unknown hex color: ${t}`)},{round:vh}=Math,E5=(...t)=>{let[e,n,o,r]=Ct(t,"rgba"),i=Tu(t)||"auto";r===void 0&&(r=1),i==="auto"&&(i=r<1?"rgba":"rgb"),e=vh(e),n=vh(n),o=vh(o);let a="000000"+(e<<16|n<<8|o).toString(16);a=a.substr(a.length-6);let l="0"+vh(r*255).toString(16);switch(l=l.substr(l.length-2),i.toLowerCase()){case"rgba":return`#${a}${l}`;case"argb":return`#${l}${a}`;default:return`#${a}`}};Ve.prototype.name=function(){const t=E5(this._rgb,"rgb");for(let e of Object.keys(cu))if(cu[e]===t)return e.toLowerCase();return t};_t.format.named=t=>{if(t=t.toLowerCase(),cu[t])return D5(cu[t]);throw new Error("unknown color name: "+t)};_t.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&cu[t.toLowerCase()])return"named"}});Ve.prototype.alpha=function(t,e=!1){return t!==void 0&&Bt(t)==="number"?e?(this._rgb[3]=t,this):new Ve([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};Ve.prototype.clipped=function(){return this._rgb._clipped||!1};const is={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},TJ=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function Rs(t){const e=TJ.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);is.labWhitePoint=t,is.Xn=e[0],is.Zn=e[1]}function sf(){return is.labWhitePoint}const g2=(...t)=>{t=Ct(t,"lab");const[e,n,o]=t,[r,i,s]=MJ(e,n,o),[a,l,c]=N5(r,i,s);return[a,l,c,t.length>3?t[3]:1]},MJ=(t,e,n)=>{const{kE:o,kK:r,kKE:i,Xn:s,Yn:a,Zn:l}=is,c=(t+16)/116,u=.002*e+c,d=c-.005*n,f=u*u*u,h=d*d*d,g=f>o?f:(116*u-16)/r,v=t>i?Math.pow((t+16)/116,3):t/r,m=h>o?h:(116*d-16)/r,b=g*s,y=v*a,x=m*l;return[b,y,x]},gv=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},N5=(t,e,n)=>{const{MtxAdaptMa:o,MtxAdaptMaI:r,MtxXYZ2RGB:i,RefWhiteRGB:s,Xn:a,Yn:l,Zn:c}=is,u=a*o.m00+l*o.m10+c*o.m20,d=a*o.m01+l*o.m11+c*o.m21,f=a*o.m02+l*o.m12+c*o.m22,h=s.X*o.m00+s.Y*o.m10+s.Z*o.m20,g=s.X*o.m01+s.Y*o.m11+s.Z*o.m21,v=s.X*o.m02+s.Y*o.m12+s.Z*o.m22,m=(t*o.m00+e*o.m10+n*o.m20)*(h/u),b=(t*o.m01+e*o.m11+n*o.m21)*(g/d),y=(t*o.m02+e*o.m12+n*o.m22)*(v/f),x=m*r.m00+b*r.m10+y*r.m20,_=m*r.m01+b*r.m11+y*r.m21,S=m*r.m02+b*r.m12+y*r.m22,N=gv(x*i.m00+_*i.m10+S*i.m20),B=gv(x*i.m01+_*i.m11+S*i.m21),k=gv(x*i.m02+_*i.m12+S*i.m22);return[N*255,B*255,k*255]},v2=(...t)=>{const[e,n,o,...r]=Ct(t,"rgb"),[i,s,a]=I5(e,n,o),[l,c,u]=OJ(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function OJ(t,e,n){const{Xn:o,Yn:r,Zn:i,kE:s,kK:a}=is,l=t/o,c=e/r,u=n/i,d=l>s?Math.pow(l,1/3):(a*l+16)/116,f=c>s?Math.pow(c,1/3):(a*c+16)/116,h=u>s?Math.pow(u,1/3):(a*u+16)/116;return[116*f-16,500*(d-f),200*(f-h)]}function vv(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const I5=(t,e,n)=>{t=vv(t/255),e=vv(e/255),n=vv(n/255);const{MtxRGB2XYZ:o,MtxAdaptMa:r,MtxAdaptMaI:i,Xn:s,Yn:a,Zn:l,As:c,Bs:u,Cs:d}=is;let f=t*o.m00+e*o.m10+n*o.m20,h=t*o.m01+e*o.m11+n*o.m21,g=t*o.m02+e*o.m12+n*o.m22;const v=s*r.m00+a*r.m10+l*r.m20,m=s*r.m01+a*r.m11+l*r.m21,b=s*r.m02+a*r.m12+l*r.m22;let y=f*r.m00+h*r.m10+g*r.m20,x=f*r.m01+h*r.m11+g*r.m21,_=f*r.m02+h*r.m12+g*r.m22;return y*=v/c,x*=m/u,_*=b/d,f=y*i.m00+x*i.m10+_*i.m20,h=y*i.m01+x*i.m11+_*i.m21,g=y*i.m02+x*i.m12+_*i.m22,[f,h,g]};Ve.prototype.lab=function(){return v2(this._rgb)};const BJ=(...t)=>new Ve(...t,"lab");Object.assign(ot,{lab:BJ,getLabWhitePoint:sf,setLabWhitePoint:Rs});_t.format.lab=g2;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"lab"),Bt(t)==="array"&&t.length===3)return"lab"}});Ve.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=is.Kn*t,new Ve(n,"lab").alpha(e.alpha(),!0)};Ve.prototype.brighten=function(t=1){return this.darken(-t)};Ve.prototype.darker=Ve.prototype.darken;Ve.prototype.brighter=Ve.prototype.brighten;Ve.prototype.get=function(t){const[e,n]=t.split("."),o=this[e]();if(n){const r=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(r>-1)return o[r];throw new Error(`unknown channel ${n} in mode ${e}`)}else return o};const{pow:LJ}=Math,PJ=1e-7,DJ=20;Ve.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Bt(t)==="number"){if(t===0)return new Ve([0,0,0,this._rgb[3]],"rgb");if(t===1)return new Ve([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),o=DJ;const r=(s,a)=>{const l=s.interpolate(a,.5,e),c=l.luminance();return Math.abs(t-c)<PJ||!o--?l:c>t?r(s,l):r(l,a)},i=(n>t?r(new Ve([0,0,0]),this):r(this,new Ve([255,255,255]))).rgb();return new Ve([...i,this._rgb[3]])}return EJ(...this._rgb.slice(0,3))};const EJ=(t,e,n)=>(t=bv(t),e=bv(e),n=bv(n),.2126*t+.7152*e+.0722*n),bv=t=>(t/=255,t<=.03928?t/12.92:LJ((t+.055)/1.055,2.4)),Mo={},uu=(t,e,n=.5,...o)=>{let r=o[0]||"lrgb";if(!Mo[r]&&!o.length&&(r=Object.keys(Mo)[0]),!Mo[r])throw new Error(`interpolation mode ${r} is not defined`);return Bt(t)!=="object"&&(t=new Ve(t)),Bt(e)!=="object"&&(e=new Ve(e)),Mo[r](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};Ve.prototype.mix=Ve.prototype.interpolate=function(t,e=.5,...n){return uu(this,t,e,...n)};Ve.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new Ve([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:NJ,cos:IJ}=Math,R5=(...t)=>{let[e,n,o]=Ct(t,"lch");return isNaN(o)&&(o=0),o=o*kJ,[e,IJ(o)*n,NJ(o)*n]},b2=(...t)=>{t=Ct(t,"lch");const[e,n,o]=t,[r,i,s]=R5(e,n,o),[a,l,c]=g2(r,i,s);return[a,l,c,t.length>3?t[3]:1]},RJ=(...t)=>{const e=P5(Ct(t,"hcl"));return b2(...e)},{sqrt:FJ,atan2:VJ,round:zJ}=Math,F5=(...t)=>{const[e,n,o]=Ct(t,"lab"),r=FJ(n*n+o*o);let i=(VJ(o,n)*SJ+360)%360;return zJ(r*1e4)===0&&(i=Number.NaN),[e,r,i]},y2=(...t)=>{const[e,n,o,...r]=Ct(t,"rgb"),[i,s,a]=v2(e,n,o),[l,c,u]=F5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};Ve.prototype.lch=function(){return y2(this._rgb)};Ve.prototype.hcl=function(){return P5(y2(this._rgb))};const HJ=(...t)=>new Ve(...t,"lch"),WJ=(...t)=>new Ve(...t,"hcl");Object.assign(ot,{lch:HJ,hcl:WJ});_t.format.lch=b2;_t.format.hcl=RJ;["lch","hcl"].forEach(t=>_t.autodetect.push({p:2,test:(...e)=>{if(e=Ct(e,t),Bt(e)==="array"&&e.length===3)return t}}));Ve.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=is.Kn*t,n[1]<0&&(n[1]=0),new Ve(n,"lch").alpha(e.alpha(),!0)};Ve.prototype.desaturate=function(t=1){return this.saturate(-t)};Ve.prototype.set=function(t,e,n=!1){const[o,r]=t.split("."),i=this[o]();if(r){const s=o.indexOf(r)-(o.substr(0,2)==="ok"?2:0);if(s>-1){if(Bt(e)=="string")switch(e.charAt(0)){case"+":i[s]+=+e;break;case"-":i[s]+=+e;break;case"*":i[s]*=+e.substr(1);break;case"/":i[s]/=+e.substr(1);break;default:i[s]=+e}else if(Bt(e)==="number")i[s]=e;else throw new Error("unsupported value for Color.set");const a=new Ve(i,o);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${r} in mode ${o}`)}else return i};Ve.prototype.tint=function(t=.5,...e){return uu(this,"white",t,...e)};Ve.prototype.shade=function(t=.5,...e){return uu(this,"black",t,...e)};const UJ=(t,e,n)=>{const o=t._rgb,r=e._rgb;return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"rgb")};Mo.rgb=UJ;const{sqrt:yv,pow:gc}=Math,GJ=(t,e,n)=>{const[o,r,i]=t._rgb,[s,a,l]=e._rgb;return new Ve(yv(gc(o,2)*(1-n)+gc(s,2)*n),yv(gc(r,2)*(1-n)+gc(a,2)*n),yv(gc(i,2)*(1-n)+gc(l,2)*n),"rgb")};Mo.lrgb=GJ;const qJ=(t,e,n)=>{const o=t.lab(),r=e.lab();return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"lab")};Mo.lab=qJ;const Mu=(t,e,n,o)=>{let r,i;o==="hsl"?(r=t.hsl(),i=e.hsl()):o==="hsv"?(r=t.hsv(),i=e.hsv()):o==="hcg"?(r=t.hcg(),i=e.hcg()):o==="hsi"?(r=t.hsi(),i=e.hsi()):o==="lch"||o==="hcl"?(o="hcl",r=t.hcl(),i=e.hcl()):o==="oklch"&&(r=t.oklch().reverse(),i=e.oklch().reverse());let s,a,l,c,u,d;(o.substr(0,1)==="h"||o==="oklch")&&([s,l,u]=r,[a,c,d]=i);let f,h,g,v;return!isNaN(s)&&!isNaN(a)?(a>s&&a-s>180?v=a-(s+360):a<s&&s-a>180?v=a+360-s:v=a-s,h=s+n*v):isNaN(s)?isNaN(a)?h=Number.NaN:(h=a,(u==1||u==0)&&o!="hsv"&&(f=c)):(h=s,(d==1||d==0)&&o!="hsv"&&(f=l)),f===void 0&&(f=l+n*(c-l)),g=u+n*(d-u),o==="oklch"?new Ve([g,f,h],o):new Ve([h,f,g],o)},V5=(t,e,n)=>Mu(t,e,n,"lch");Mo.lch=V5;Mo.hcl=V5;const YJ=t=>{if(Bt(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,o=t&255;return[e,n,o,1]}throw new Error("unknown num color: "+t)},jJ=(...t)=>{const[e,n,o]=Ct(t,"rgb");return(e<<16)+(n<<8)+o};Ve.prototype.num=function(){return jJ(this._rgb)};const XJ=(...t)=>new Ve(...t,"num");Object.assign(ot,{num:XJ});_t.format.num=YJ;_t.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Bt(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const KJ=(t,e,n)=>{const o=t.num(),r=e.num();return new Ve(o+n*(r-o),"num")};Mo.num=KJ;const{floor:ZJ}=Math,QJ=(...t)=>{t=Ct(t,"hcg");let[e,n,o]=t,r,i,s;o=o*255;const a=n*255;if(n===0)r=i=s=o;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const l=ZJ(e),c=e-l,u=o*(1-n),d=u+a*(1-c),f=u+a*c,h=u+a;switch(l){case 0:[r,i,s]=[h,f,u];break;case 1:[r,i,s]=[d,h,u];break;case 2:[r,i,s]=[u,h,f];break;case 3:[r,i,s]=[u,d,h];break;case 4:[r,i,s]=[f,u,h];break;case 5:[r,i,s]=[h,u,d];break}}return[r,i,s,t.length>3?t[3]:1]},JJ=(...t)=>{const[e,n,o]=Ct(t,"rgb"),r=B5(e,n,o),i=L5(e,n,o),s=i-r,a=s*100/255,l=r/(255-s)*100;let c;return s===0?c=Number.NaN:(e===i&&(c=(n-o)/s),n===i&&(c=2+(o-e)/s),o===i&&(c=4+(e-n)/s),c*=60,c<0&&(c+=360)),[c,a,l]};Ve.prototype.hcg=function(){return JJ(this._rgb)};const eee=(...t)=>new Ve(...t,"hcg");ot.hcg=eee;_t.format.hcg=QJ;_t.autodetect.push({p:1,test:(...t)=>{if(t=Ct(t,"hcg"),Bt(t)==="array"&&t.length===3)return"hcg"}});const tee=(t,e,n)=>Mu(t,e,n,"hcg");Mo.hcg=tee;const{cos:vc}=Math,nee=(...t)=>{t=Ct(t,"hsi");let[e,n,o]=t,r,i,s;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(s=(1-n)/3,r=(1+n*vc(Os*e)/vc(mv-Os*e))/3,i=1-(s+r)):e<2/3?(e-=1/3,r=(1-n)/3,i=(1+n*vc(Os*e)/vc(mv-Os*e))/3,s=1-(r+i)):(e-=2/3,i=(1-n)/3,s=(1+n*vc(Os*e)/vc(mv-Os*e))/3,r=1-(i+s)),r=Ol(o*r*3),i=Ol(o*i*3),s=Ol(o*s*3),[r*255,i*255,s*255,t.length>3?t[3]:1]},{min:oee,sqrt:ree,acos:iee}=Math,see=(...t)=>{let[e,n,o]=Ct(t,"rgb");e/=255,n/=255,o/=255;let r;const i=oee(e,n,o),s=(e+n+o)/3,a=s>0?1-i/s:0;return a===0?r=NaN:(r=(e-n+(e-o))/2,r/=ree((e-n)*(e-n)+(e-o)*(n-o)),r=iee(r),o>n&&(r=Os-r),r/=Os),[r*360,a,s]};Ve.prototype.hsi=function(){return see(this._rgb)};const aee=(...t)=>new Ve(...t,"hsi");ot.hsi=aee;_t.format.hsi=nee;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"hsi"),Bt(t)==="array"&&t.length===3)return"hsi"}});const lee=(t,e,n)=>Mu(t,e,n,"hsi");Mo.hsi=lee;const Q1=(...t)=>{t=Ct(t,"hsl");const[e,n,o]=t;let r,i,s;if(n===0)r=i=s=o*255;else{const a=[0,0,0],l=[0,0,0],c=o<.5?o*(1+n):o+n-o*n,u=2*o-c,d=e/360;a[0]=d+1/3,a[1]=d,a[2]=d-1/3;for(let f=0;f<3;f++)a[f]<0&&(a[f]+=1),a[f]>1&&(a[f]-=1),6*a[f]<1?l[f]=u+(c-u)*6*a[f]:2*a[f]<1?l[f]=c:3*a[f]<2?l[f]=u+(c-u)*(2/3-a[f])*6:l[f]=u;[r,i,s]=[l[0]*255,l[1]*255,l[2]*255]}return t.length>3?[r,i,s,t[3]]:[r,i,s,1]},z5=(...t)=>{t=Ct(t,"rgba");let[e,n,o]=t;e/=255,n/=255,o/=255;const r=B5(e,n,o),i=L5(e,n,o),s=(i+r)/2;let a,l;return i===r?(a=0,l=Number.NaN):a=s<.5?(i-r)/(i+r):(i-r)/(2-i-r),e==i?l=(n-o)/(i-r):n==i?l=2+(o-e)/(i-r):o==i&&(l=4+(e-n)/(i-r)),l*=60,l<0&&(l+=360),t.length>3&&t[3]!==void 0?[l,a,s,t[3]]:[l,a,s]};Ve.prototype.hsl=function(){return z5(this._rgb)};const cee=(...t)=>new Ve(...t,"hsl");ot.hsl=cee;_t.format.hsl=Q1;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"hsl"),Bt(t)==="array"&&t.length===3)return"hsl"}});const uee=(t,e,n)=>Mu(t,e,n,"hsl");Mo.hsl=uee;const{floor:dee}=Math,fee=(...t)=>{t=Ct(t,"hsv");let[e,n,o]=t,r,i,s;if(o*=255,n===0)r=i=s=o;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=dee(e),l=e-a,c=o*(1-n),u=o*(1-n*l),d=o*(1-n*(1-l));switch(a){case 0:[r,i,s]=[o,d,c];break;case 1:[r,i,s]=[u,o,c];break;case 2:[r,i,s]=[c,o,d];break;case 3:[r,i,s]=[c,u,o];break;case 4:[r,i,s]=[d,c,o];break;case 5:[r,i,s]=[o,c,u];break}}return[r,i,s,t.length>3?t[3]:1]},{min:hee,max:pee}=Math,mee=(...t)=>{t=Ct(t,"rgb");let[e,n,o]=t;const r=hee(e,n,o),i=pee(e,n,o),s=i-r;let a,l,c;return c=i/255,i===0?(a=Number.NaN,l=0):(l=s/i,e===i&&(a=(n-o)/s),n===i&&(a=2+(o-e)/s),o===i&&(a=4+(e-n)/s),a*=60,a<0&&(a+=360)),[a,l,c]};Ve.prototype.hsv=function(){return mee(this._rgb)};const gee=(...t)=>new Ve(...t,"hsv");ot.hsv=gee;_t.format.hsv=fee;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"hsv"),Bt(t)==="array"&&t.length===3)return"hsv"}});const vee=(t,e,n)=>Mu(t,e,n,"hsv");Mo.hsv=vee;function l0(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(s=>[s]));let o=e[0].length,r=e[0].map((s,a)=>e.map(l=>l[a])),i=t.map(s=>r.map(a=>Array.isArray(s)?s.reduce((l,c,u)=>l+c*(a[u]||0),0):a.reduce((l,c)=>l+c*s,0)));return n===1&&(i=i[0]),o===1?i.map(s=>s[0]):i}const x2=(...t)=>{t=Ct(t,"lab");const[e,n,o,...r]=t,[i,s,a]=bee([e,n,o]),[l,c,u]=N5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]};function bee(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=l0(n,t);return l0(e,o.map(r=>r**3))}const w2=(...t)=>{const[e,n,o,...r]=Ct(t,"rgb"),i=I5(e,n,o);return[...yee(i),...r.length>0&&r[0]<1?[r[0]]:[]]};function yee(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=l0(e,t);return l0(n,o.map(r=>Math.cbrt(r)))}Ve.prototype.oklab=function(){return w2(this._rgb)};const xee=(...t)=>new Ve(...t,"oklab");Object.assign(ot,{oklab:xee});_t.format.oklab=x2;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"oklab"),Bt(t)==="array"&&t.length===3)return"oklab"}});const wee=(t,e,n)=>{const o=t.oklab(),r=e.oklab();return new Ve(o[0]+n*(r[0]-o[0]),o[1]+n*(r[1]-o[1]),o[2]+n*(r[2]-o[2]),"oklab")};Mo.oklab=wee;const _ee=(t,e,n)=>Mu(t,e,n,"oklch");Mo.oklch=_ee;const{pow:xv,sqrt:wv,PI:_v,cos:o6,sin:r6,atan2:kee}=Math,See=(t,e="lrgb",n=null)=>{const o=t.length;n||(n=Array.from(new Array(o)).map(()=>1));const r=o/n.reduce(function(d,f){return d+f});if(n.forEach((d,f)=>{n[f]*=r}),t=t.map(d=>new Ve(d)),e==="lrgb")return Aee(t,n);const i=t.shift(),s=i.get(e),a=[];let l=0,c=0;for(let d=0;d<s.length;d++)if(s[d]=(s[d]||0)*n[0],a.push(isNaN(s[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(s[d])){const f=s[d]/180*_v;l+=o6(f)*n[0],c+=r6(f)*n[0]}let u=i.alpha()*n[0];t.forEach((d,f)=>{const h=d.get(e);u+=d.alpha()*n[f+1];for(let g=0;g<s.length;g++)if(!isNaN(h[g]))if(a[g]+=n[f+1],e.charAt(g)==="h"){const v=h[g]/180*_v;l+=o6(v)*n[f+1],c+=r6(v)*n[f+1]}else s[g]+=h[g]*n[f+1]});for(let d=0;d<s.length;d++)if(e.charAt(d)==="h"){let f=kee(c/a[d],l/a[d])/_v*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;s[d]=f}else s[d]=s[d]/a[d];return u/=o,new Ve(s,e).alpha(u>.99999?1:u,!0)},Aee=(t,e)=>{const n=t.length,o=[0,0,0,0];for(let r=0;r<t.length;r++){const i=t[r],s=e[r]/n,a=i._rgb;o[0]+=xv(a[0],2)*s,o[1]+=xv(a[1],2)*s,o[2]+=xv(a[2],2)*s,o[3]+=a[3]*s}return o[0]=wv(o[0]),o[1]=wv(o[1]),o[2]=wv(o[2]),o[3]>.9999999&&(o[3]=1),new Ve(m2(o))},{pow:Cee}=Math;function c0(t){let e="rgb",n=ot("#ccc"),o=0,r=[0,1],i=[0,1],s=[],a=[0,0],l=!1,c=[],u=!1,d=0,f=1,h=!1,g={},v=!0,m=1;const b=function(k){if(k=k||["#fff","#000"],k&&Bt(k)==="string"&&ot.brewer&&ot.brewer[k.toLowerCase()]&&(k=ot.brewer[k.toLowerCase()]),Bt(k)==="array"){k.length===1&&(k=[k[0],k[0]]),k=k.slice(0);for(let L=0;L<k.length;L++)k[L]=ot(k[L]);s.length=0;for(let L=0;L<k.length;L++)s.push(L/(k.length-1))}return N(),c=k},y=function(k){if(l!=null){const L=l.length-1;let E=0;for(;E<L&&k>=l[E];)E++;return E-1}return 0};let x=k=>k,_=k=>k;const S=function(k,L){let E,I;if(L==null&&(L=!1),isNaN(k)||k===null)return n;L?I=k:l&&l.length>2?I=y(k)/(l.length-2):f!==d?I=(k-d)/(f-d):I=1,I=_(I),L||(I=x(I)),m!==1&&(I=Cee(I,m)),I=a[0]+I*(1-a[0]-a[1]),I=Ol(I,0,1);const C=Math.floor(I*1e4);if(v&&g[C])E=g[C];else{if(Bt(c)==="array")for(let $=0;$<s.length;$++){const P=s[$];if(I<=P){E=c[$];break}if(I>=P&&$===s.length-1){E=c[$];break}if(I>P&&I<s[$+1]){I=(I-P)/(s[$+1]-P),E=ot.interpolate(c[$],c[$+1],I,e);break}}else Bt(c)==="function"&&(E=c(I));v&&(g[C]=E)}return E};var N=()=>g={};b(t);const B=function(k){const L=ot(S(k));return u&&L[u]?L[u]():L};return B.classes=function(k){if(k!=null){if(Bt(k)==="array")l=k,r=[k[0],k[k.length-1]];else{const L=ot.analyze(r);k===0?l=[L.min,L.max]:l=ot.limits(L,"e",k)}return B}return l},B.domain=function(k){if(!arguments.length)return i;i=k.slice(0),d=k[0],f=k[k.length-1],s=[];const L=c.length;if(k.length===L&&d!==f)for(let E of Array.from(k))s.push((E-d)/(f-d));else{for(let E=0;E<L;E++)s.push(E/(L-1));if(k.length>2){const E=k.map((C,$)=>$/(k.length-1)),I=k.map(C=>(C-d)/(f-d));I.every((C,$)=>E[$]===C)||(_=C=>{if(C<=0||C>=1)return C;let $=0;for(;C>=I[$+1];)$++;const P=(C-I[$])/(I[$+1]-I[$]);return E[$]+P*(E[$+1]-E[$])})}}return r=[d,f],B},B.mode=function(k){return arguments.length?(e=k,N(),B):e},B.range=function(k,L){return b(k),B},B.out=function(k){return u=k,B},B.spread=function(k){return arguments.length?(o=k,B):o},B.correctLightness=function(k){return k==null&&(k=!0),h=k,N(),h?x=function(L){const E=S(0,!0).lab()[0],I=S(1,!0).lab()[0],C=E>I;let $=S(L,!0).lab()[0];const P=E+(I-E)*L;let M=$-P,F=0,V=1,G=20;for(;Math.abs(M)>.01&&G-- >0;)(function(){return C&&(M*=-1),M<0?(F=L,L+=(V-L)*.5):(V=L,L+=(F-L)*.5),$=S(L,!0).lab()[0],M=$-P})();return L}:x=L=>L,B},B.padding=function(k){return k!=null?(Bt(k)==="number"&&(k=[k,k]),a=k,B):a},B.colors=function(k,L){arguments.length<2&&(L="hex");let E=[];if(arguments.length===0)E=c.slice(0);else if(k===1)E=[B(.5)];else if(k>1){const I=r[0],C=r[1]-I;E=$ee(0,k).map($=>B(I+$/(k-1)*C))}else{t=[];let I=[];if(l&&l.length>2)for(let C=1,$=l.length,P=1<=$;P?C<$:C>$;P?C++:C--)I.push((l[C-1]+l[C])*.5);else I=r;E=I.map(C=>B(C))}return ot[L]&&(E=E.map(I=>I[L]())),E},B.cache=function(k){return k!=null?(v=k,B):v},B.gamma=function(k){return k!=null?(m=k,B):m},B.nodata=function(k){return k!=null?(n=ot(k),B):n},B}function $ee(t,e,n){let o=[],r=t<e,i=e;for(let s=t;r?s<i:s>i;r?s++:s--)o.push(s);return o}const Tee=function(t){let e=[1,1];for(let n=1;n<t;n++){let o=[1];for(let r=1;r<=e.length;r++)o[r]=(e[r]||0)+e[r-1];e=o}return e},Mee=function(t){let e,n,o,r;if(t=t.map(i=>new Ve(i)),t.length===2)[n,o]=t.map(i=>i.lab()),e=function(i){const s=[0,1,2].map(a=>n[a]+i*(o[a]-n[a]));return new Ve(s,"lab")};else if(t.length===3)[n,o,r]=t.map(i=>i.lab()),e=function(i){const s=[0,1,2].map(a=>(1-i)*(1-i)*n[a]+2*(1-i)*i*o[a]+i*i*r[a]);return new Ve(s,"lab")};else if(t.length===4){let i;[n,o,r,i]=t.map(s=>s.lab()),e=function(s){const a=[0,1,2].map(l=>(1-s)*(1-s)*(1-s)*n[l]+3*(1-s)*(1-s)*s*o[l]+3*(1-s)*s*s*r[l]+s*s*s*i[l]);return new Ve(a,"lab")}}else if(t.length>=5){let i,s,a;i=t.map(l=>l.lab()),a=t.length-1,s=Tee(a),e=function(l){const c=1-l,u=[0,1,2].map(d=>i.reduce((f,h,g)=>f+s[g]*c**(a-g)*l**g*h[d],0));return new Ve(u,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},Oee=t=>{const e=Mee(t);return e.scale=()=>c0(e),e},{round:H5}=Math;Ve.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(H5)};Ve.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:H5(e):e)};const Bee=(...t)=>new Ve(...t,"rgb");Object.assign(ot,{rgb:Bee});_t.format.rgb=(...t)=>{const e=Ct(t,"rgba");return e[3]===void 0&&(e[3]=1),e};_t.autodetect.push({p:3,test:(...t)=>{if(t=Ct(t,"rgba"),Bt(t)==="array"&&(t.length===3||t.length===4&&Bt(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const Bi=(t,e,n)=>{if(!Bi[n])throw new Error("unknown blend mode "+n);return Bi[n](t,e)},Ja=t=>(e,n)=>{const o=ot(n).rgb(),r=ot(e).rgb();return ot.rgb(t(o,r))},el=t=>(e,n)=>{const o=[];return o[0]=t(e[0],n[0]),o[1]=t(e[1],n[1]),o[2]=t(e[2],n[2]),o},Lee=t=>t,Pee=(t,e)=>t*e/255,Dee=(t,e)=>t>e?e:t,Eee=(t,e)=>t>e?t:e,Nee=(t,e)=>255*(1-(1-t/255)*(1-e/255)),Iee=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),Ree=(t,e)=>255*(1-(1-e/255)/(t/255)),Fee=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);Bi.normal=Ja(el(Lee));Bi.multiply=Ja(el(Pee));Bi.screen=Ja(el(Nee));Bi.overlay=Ja(el(Iee));Bi.darken=Ja(el(Dee));Bi.lighten=Ja(el(Eee));Bi.dodge=Ja(el(Fee));Bi.burn=Ja(el(Ree));const{pow:Vee,sin:zee,cos:Hee}=Math;function Wee(t=300,e=-1.5,n=1,o=1,r=[0,1]){let i=0,s;Bt(r)==="array"?s=r[1]-r[0]:(s=0,r=[r,r]);const a=function(l){const c=Os*((t+120)/360+e*l),u=Vee(r[0]+s*l,o),f=(i!==0?n[0]+l*i:n)*u*(1-u)/2,h=Hee(c),g=zee(c),v=u+f*(-.14861*h+1.78277*g),m=u+f*(-.29227*h-.90649*g),b=u+f*(1.97294*h);return ot(m2([v*255,m*255,b*255,1]))};return a.start=function(l){return l==null?t:(t=l,a)},a.rotations=function(l){return l==null?e:(e=l,a)},a.gamma=function(l){return l==null?o:(o=l,a)},a.hue=function(l){return l==null?n:(n=l,Bt(n)==="array"?(i=n[1]-n[0],i===0&&(n=n[1])):i=0,a)},a.lightness=function(l){return l==null?r:(Bt(l)==="array"?(r=l,s=l[1]-l[0]):(r=[l,l],s=0),a)},a.scale=()=>ot.scale(a),a.hue(n),a}const Uee="0123456789abcdef",{floor:Gee,random:qee}=Math,Yee=(t=qee)=>{let e="#";for(let n=0;n<6;n++)e+=Uee.charAt(Gee(t()*16));return new Ve(e,"hex")},{log:i6,pow:jee,floor:Xee,abs:Kee}=Math;function W5(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Bt(t)==="object"&&(t=Object.values(t)),t.forEach(o=>{e&&Bt(o)==="object"&&(o=o[e]),o!=null&&!isNaN(o)&&(n.values.push(o),n.sum+=o,o<n.min&&(n.min=o),o>n.max&&(n.max=o),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(o,r)=>U5(n,o,r),n}function U5(t,e="equal",n=7){Bt(t)=="array"&&(t=W5(t));const{min:o,max:r}=t,i=t.values.sort((a,l)=>a-l);if(n===1)return[o,r];const s=[];if(e.substr(0,1)==="c"&&(s.push(o),s.push(r)),e.substr(0,1)==="e"){s.push(o);for(let a=1;a<n;a++)s.push(o+a/n*(r-o));s.push(r)}else if(e.substr(0,1)==="l"){if(o<=0)throw new Error("Logarithmic scales are only possible for values > 0");const a=Math.LOG10E*i6(o),l=Math.LOG10E*i6(r);s.push(o);for(let c=1;c<n;c++)s.push(jee(10,a+c/n*(l-a)));s.push(r)}else if(e.substr(0,1)==="q"){s.push(o);for(let a=1;a<n;a++){const l=(i.length-1)*a/n,c=Xee(l);if(c===l)s.push(i[c]);else{const u=l-c;s.push(i[c]*(1-u)+i[c+1]*u)}}s.push(r)}else if(e.substr(0,1)==="k"){let a;const l=i.length,c=new Array(l),u=new Array(n);let d=!0,f=0,h=null;h=[],h.push(o);for(let m=1;m<n;m++)h.push(o+m/n*(r-o));for(h.push(r);d;){for(let b=0;b<n;b++)u[b]=0;for(let b=0;b<l;b++){const y=i[b];let x=Number.MAX_VALUE,_;for(let S=0;S<n;S++){const N=Kee(h[S]-y);N<x&&(x=N,_=S),u[_]++,c[b]=_}}const m=new Array(n);for(let b=0;b<n;b++)m[b]=null;for(let b=0;b<l;b++)a=c[b],m[a]===null?m[a]=i[b]:m[a]+=i[b];for(let b=0;b<n;b++)m[b]*=1/u[b];d=!1;for(let b=0;b<n;b++)if(m[b]!==h[b]){d=!0;break}h=m,f++,f>200&&(d=!1)}const g={};for(let m=0;m<n;m++)g[m]=[];for(let m=0;m<l;m++)a=c[m],g[a].push(i[m]);let v=[];for(let m=0;m<n;m++)v.push(g[m][0]),v.push(g[m][g[m].length-1]);v=v.sort((m,b)=>m-b),s.push(v[0]);for(let m=1;m<v.length;m+=2){const b=v[m];!isNaN(b)&&s.indexOf(b)===-1&&s.push(b)}}return s}const Zee=(t,e)=>{t=new Ve(t),e=new Ve(e);const n=t.luminance(),o=e.luminance();return n>o?(n+.05)/(o+.05):(o+.05)/(n+.05)};/**
|
|
54
|
-
* @license
|
|
55
|
-
*
|
|
56
|
-
* The APCA contrast prediction algorithm is based of the formulas published
|
|
57
|
-
* in the APCA-1.0.98G specification by Myndex. The specification is available at:
|
|
58
|
-
* https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
|
|
59
|
-
*
|
|
60
|
-
* Note that the APCA implementation is still beta, so please update to
|
|
61
|
-
* future versions of chroma.js when they become available.
|
|
62
|
-
*
|
|
63
|
-
* You can read more about the APCA Readability Criterion at
|
|
64
|
-
* https://readtech.org/ARC/
|
|
65
|
-
*/const s6=.027,Qee=5e-4,Jee=.1,a6=1.14,bh=.022,l6=1.414,ete=(t,e)=>{t=new Ve(t),e=new Ve(e),t.alpha()<1&&(t=uu(e,t,t.alpha(),"rgb"));const n=c6(...t.rgb()),o=c6(...e.rgb()),r=n>=bh?n:n+Math.pow(bh-n,l6),i=o>=bh?o:o+Math.pow(bh-o,l6),s=Math.pow(i,.56)-Math.pow(r,.57),a=Math.pow(i,.65)-Math.pow(r,.62),l=Math.abs(i-r)<Qee?0:r<i?s*a6:a*a6;return(Math.abs(l)<Jee?0:l>0?l-s6:l+s6)*100};function c6(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ks,pow:Bn,min:tte,max:nte,atan2:u6,abs:d6,cos:yh,sin:f6,exp:ote,PI:h6}=Math;function rte(t,e,n=1,o=1,r=1){var i=function(ge){return 360*ge/(2*h6)},s=function(ge){return 2*h6*ge/360};t=new Ve(t),e=new Ve(e);const[a,l,c]=Array.from(t.lab()),[u,d,f]=Array.from(e.lab()),h=(a+u)/2,g=ks(Bn(l,2)+Bn(c,2)),v=ks(Bn(d,2)+Bn(f,2)),m=(g+v)/2,b=.5*(1-ks(Bn(m,7)/(Bn(m,7)+Bn(25,7)))),y=l*(1+b),x=d*(1+b),_=ks(Bn(y,2)+Bn(c,2)),S=ks(Bn(x,2)+Bn(f,2)),N=(_+S)/2,B=i(u6(c,y)),k=i(u6(f,x)),L=B>=0?B:B+360,E=k>=0?k:k+360,I=d6(L-E)>180?(L+E+360)/2:(L+E)/2,C=1-.17*yh(s(I-30))+.24*yh(s(2*I))+.32*yh(s(3*I+6))-.2*yh(s(4*I-63));let $=E-L;$=d6($)<=180?$:E<=L?$+360:$-360,$=2*ks(_*S)*f6(s($)/2);const P=u-a,M=S-_,F=1+.015*Bn(h-50,2)/ks(20+Bn(h-50,2)),V=1+.045*N,G=1+.015*N*C,K=30*ote(-Bn((I-275)/25,2)),de=-(2*ks(Bn(N,7)/(Bn(N,7)+Bn(25,7))))*f6(2*s(K)),he=ks(Bn(P/(n*F),2)+Bn(M/(o*V),2)+Bn($/(r*G),2)+de*(M/(o*V))*($/(r*G)));return nte(0,tte(100,he))}function ite(t,e,n="lab"){t=new Ve(t),e=new Ve(e);const o=t.get(n),r=e.get(n);let i=0;for(let s in o){const a=(o[s]||0)-(r[s]||0);i+=a*a}return Math.sqrt(i)}const ste=(...t)=>{try{return new Ve(...t),!0}catch{return!1}},ate={cool(){return c0([ot.hsl(180,1,.9),ot.hsl(250,.7,.4)])},hot(){return c0(["#000","#f00","#ff0","#fff"]).mode("rgb")}},J1={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},G5=Object.keys(J1),p6=new Map(G5.map(t=>[t.toLowerCase(),t])),lte=typeof Proxy=="function"?new Proxy(J1,{get(t,e){const n=e.toLowerCase();if(p6.has(n))return t[p6.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(G5)}}):J1,cte=(...t)=>{t=Ct(t,"cmyk");const[e,n,o,r]=t,i=t.length>4?t[4]:1;return r===1?[0,0,0,i]:[e>=1?0:255*(1-e)*(1-r),n>=1?0:255*(1-n)*(1-r),o>=1?0:255*(1-o)*(1-r),i]},{max:m6}=Math,ute=(...t)=>{let[e,n,o]=Ct(t,"rgb");e=e/255,n=n/255,o=o/255;const r=1-m6(e,m6(n,o)),i=r<1?1/(1-r):0,s=(1-e-r)*i,a=(1-n-r)*i,l=(1-o-r)*i;return[s,a,l,r]};Ve.prototype.cmyk=function(){return ute(this._rgb)};const dte=(...t)=>new Ve(...t,"cmyk");Object.assign(ot,{cmyk:dte});_t.format.cmyk=cte;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"cmyk"),Bt(t)==="array"&&t.length===4)return"cmyk"}});const fte=(...t)=>{const e=Ct(t,"hsla");let n=Tu(t)||"lsa";return e[0]=Hr(e[0]||0)+"deg",e[1]=Hr(e[1]*100)+"%",e[2]=Hr(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},hte=(...t)=>{const e=Ct(t,"lab");let n=Tu(t)||"lab";return e[0]=Hr(e[0])+"%",e[1]=Hr(e[1]),e[2]=Hr(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},pte=(...t)=>{const e=Ct(t,"lch");let n=Tu(t)||"lab";return e[0]=Hr(e[0])+"%",e[1]=Hr(e[1]),e[2]=isNaN(e[2])?"none":Hr(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},mte=(...t)=>{const e=Ct(t,"lab");return e[0]=Hr(e[0]*100)+"%",e[1]=Z1(e[1]),e[2]=Z1(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},q5=(...t)=>{const[e,n,o,...r]=Ct(t,"rgb"),[i,s,a]=w2(e,n,o),[l,c,u]=F5(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},gte=(...t)=>{const e=Ct(t,"lch");return e[0]=Hr(e[0]*100)+"%",e[1]=Z1(e[1]),e[2]=isNaN(e[2])?"none":Hr(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:kv}=Math,vte=(...t)=>{const e=Ct(t,"rgba");let n=Tu(t)||"rgb";if(n.substr(0,3)==="hsl")return fte(z5(e),n);if(n.substr(0,3)==="lab"){const o=sf();Rs("d50");const r=hte(v2(e),n);return Rs(o),r}if(n.substr(0,3)==="lch"){const o=sf();Rs("d50");const r=pte(y2(e),n);return Rs(o),r}return n.substr(0,5)==="oklab"?mte(w2(e)):n.substr(0,5)==="oklch"?gte(q5(e)):(e[0]=kv(e[0]),e[1]=kv(e[1]),e[2]=kv(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},Y5=(...t)=>{t=Ct(t,"lch");const[e,n,o,...r]=t,[i,s,a]=R5(e,n,o),[l,c,u]=x2(i,s,a);return[l,c,u,...r.length>0&&r[0]<1?[r[0]]:[]]},Us=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,yi=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,u0=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Yr=/\s*/.source,Ou=/\s+/.source,_2=/\s*,\s*/.source,qm=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Bu=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,j5=new RegExp("^rgba?\\("+Yr+[Us,Us,Us].join(Ou)+Bu+"\\)$"),X5=new RegExp("^rgb\\("+Yr+[Us,Us,Us].join(_2)+Yr+"\\)$"),K5=new RegExp("^rgba\\("+Yr+[Us,Us,Us,yi].join(_2)+Yr+"\\)$"),Z5=new RegExp("^hsla?\\("+Yr+[qm,u0,u0].join(Ou)+Bu+"\\)$"),Q5=new RegExp("^hsl?\\("+Yr+[qm,u0,u0].join(_2)+Yr+"\\)$"),J5=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,e$=new RegExp("^lab\\("+Yr+[yi,yi,yi].join(Ou)+Bu+"\\)$"),t$=new RegExp("^lch\\("+Yr+[yi,yi,qm].join(Ou)+Bu+"\\)$"),n$=new RegExp("^oklab\\("+Yr+[yi,yi,yi].join(Ou)+Bu+"\\)$"),o$=new RegExp("^oklch\\("+Yr+[yi,yi,qm].join(Ou)+Bu+"\\)$"),{round:r$}=Math,bc=t=>t.map((e,n)=>n<=2?Ol(r$(e),0,255):e),Ln=(t,e=0,n=100,o=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,o?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),Do=(t,e)=>t==="none"?e:t,k2=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(_t.format.named)try{return _t.format.named(t)}catch{}if((e=t.match(j5))||(e=t.match(X5))){let n=e.slice(1,4);for(let r=0;r<3;r++)n[r]=+Ln(Do(n[r],0),0,255);n=bc(n);const o=e[4]!==void 0?+Ln(e[4],0,1):1;return n[3]=o,n}if(e=t.match(K5)){const n=e.slice(1,5);for(let o=0;o<4;o++)n[o]=+Ln(n[o],0,255);return n}if((e=t.match(Z5))||(e=t.match(Q5))){const n=e.slice(1,4);n[0]=+Do(n[0].replace("deg",""),0),n[1]=+Ln(Do(n[1],0),0,100)*.01,n[2]=+Ln(Do(n[2],0),0,100)*.01;const o=bc(Q1(n)),r=e[4]!==void 0?+Ln(e[4],0,1):1;return o[3]=r,o}if(e=t.match(J5)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const o=Q1(n);for(let r=0;r<3;r++)o[r]=r$(o[r]);return o[3]=+e[4],o}if(e=t.match(e$)){const n=e.slice(1,4);n[0]=Ln(Do(n[0],0),0,100),n[1]=Ln(Do(n[1],0),-125,125,!0),n[2]=Ln(Do(n[2],0),-125,125,!0);const o=sf();Rs("d50");const r=bc(g2(n));Rs(o);const i=e[4]!==void 0?+Ln(e[4],0,1):1;return r[3]=i,r}if(e=t.match(t$)){const n=e.slice(1,4);n[0]=Ln(n[0],0,100),n[1]=Ln(Do(n[1],0),0,150,!1),n[2]=+Do(n[2].replace("deg",""),0);const o=sf();Rs("d50");const r=bc(b2(n));Rs(o);const i=e[4]!==void 0?+Ln(e[4],0,1):1;return r[3]=i,r}if(e=t.match(n$)){const n=e.slice(1,4);n[0]=Ln(Do(n[0],0),0,1),n[1]=Ln(Do(n[1],0),-.4,.4,!0),n[2]=Ln(Do(n[2],0),-.4,.4,!0);const o=bc(x2(n)),r=e[4]!==void 0?+Ln(e[4],0,1):1;return o[3]=r,o}if(e=t.match(o$)){const n=e.slice(1,4);n[0]=Ln(Do(n[0],0),0,1),n[1]=Ln(Do(n[1],0),0,.4,!1),n[2]=+Do(n[2].replace("deg",""),0);const o=bc(Y5(n)),r=e[4]!==void 0?+Ln(e[4],0,1):1;return o[3]=r,o}};k2.test=t=>j5.test(t)||Z5.test(t)||e$.test(t)||t$.test(t)||n$.test(t)||o$.test(t)||X5.test(t)||K5.test(t)||Q5.test(t)||J5.test(t)||t==="transparent";Ve.prototype.css=function(t){return vte(this._rgb,t)};const bte=(...t)=>new Ve(...t,"css");ot.css=bte;_t.format.css=k2;_t.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&k2.test(t))return"css"}});_t.format.gl=(...t)=>{const e=Ct(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const yte=(...t)=>new Ve(...t,"gl");ot.gl=yte;Ve.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};Ve.prototype.hex=function(t){return E5(this._rgb,t)};const xte=(...t)=>new Ve(...t,"hex");ot.hex=xte;_t.format.hex=D5;_t.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Bt(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:xh}=Math,i$=t=>{const e=t/100;let n,o,r;return e<66?(n=255,o=e<6?0:-155.25485562709179-.44596950469579133*(o=e-2)+104.49216199393888*xh(o),r=e<20?0:-254.76935184120902+.8274096064007395*(r=e-10)+115.67994401066147*xh(r)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*xh(n),o=325.4494125711974+.07943456536662342*(o=e-50)-28.0852963507957*xh(o),r=255),[n,o,r,1]},{round:wte}=Math,_te=(...t)=>{const e=Ct(t,"rgb"),n=e[0],o=e[2];let r=1e3,i=4e4;const s=.4;let a;for(;i-r>s;){a=(i+r)*.5;const l=i$(a);l[2]/l[0]>=o/n?i=a:r=a}return wte(a)};Ve.prototype.temp=Ve.prototype.kelvin=Ve.prototype.temperature=function(){return _te(this._rgb)};const Sv=(...t)=>new Ve(...t,"temp");Object.assign(ot,{temp:Sv,kelvin:Sv,temperature:Sv});_t.format.temp=_t.format.kelvin=_t.format.temperature=i$;Ve.prototype.oklch=function(){return q5(this._rgb)};const kte=(...t)=>new Ve(...t,"oklch");Object.assign(ot,{oklch:kte});_t.format.oklch=Y5;_t.autodetect.push({p:2,test:(...t)=>{if(t=Ct(t,"oklch"),Bt(t)==="array"&&t.length===3)return"oklch"}});Object.assign(ot,{analyze:W5,average:See,bezier:Oee,blend:Bi,brewer:lte,Color:Ve,colors:cu,contrast:Zee,contrastAPCA:ete,cubehelix:Wee,deltaE:rte,distance:ite,input:_t,interpolate:uu,limits:U5,mix:uu,random:Yee,scale:c0,scales:ate,valid:ste});function s$(t,e){if(!ot.valid(t))return e;try{return ot(t)}catch{return e}}function Tr(t){return ot.valid(t)&&ot.contrast(t,"#fff")>=ot.contrast(t,"#333")?"#fff":"#333"}function Ste(t,e){return!ot.valid(t)||!ot.valid(e)?1:ot.contrast(t,e)}function Ate(t){return t>=7?"AAA":t>=4.5?"AA":"Fail"}const af=4.5;function Mr(t){let e=t;for(;e&&e instanceof Element;){const n=getComputedStyle(e).backgroundColor;if(n&&n!=="rgba(0, 0, 0, 0)"&&n!=="transparent")return n;e=e.parentElement}return"#fff"}function a$(t,e="#fff"){if(!ot.valid(t))return ot.valid(e)?Tr(e):"#333";let n=ot(t);const o=s$(e,ot("#fff"));if(ot.contrast(n,o)>=af)return n.hex();const r=o.luminance()>.5;for(let i=0;i<20&&(n=r?n.darken(.3):n.brighten(.3),!(ot.contrast(n,o)>=af));i++);return n.hex()}const S2=12,d0=.25,l$=20;function c$(t,e){if(t.length===0)return[];const n=s$(e,ot("#fff")),o=ot.valid(e)?e:"#fff",r=n.luminance()>.5,i=t.map(s=>ot.valid(s)?Cte(ot(s),o,r):ot("#000"));for(let s=1;s<i.length;s++)ot.deltaE(i[s],i[s-1])>=S2||(i[s]=$te(i[s],i[s-1],o,r));return i.map(s=>s.hex())}function Cte(t,e,n){for(let o=0;o<l$;o++){if(ot.contrast(t,e)>=af)return t;t=n?t.darken(d0):t.brighten(d0)}return t}function $te(t,e,n,o){const r=g6(t,e,n,o);if(ot.deltaE(r,e)>=S2)return r;const i=g6(t,e,n,!o);return ot.deltaE(i,e)>ot.deltaE(r,e)&&ot.contrast(i,n)>=af?i:r}function g6(t,e,n,o){let r=t,i=ot.deltaE(t,e),s=t;for(let a=0;a<l$;a++){s=o?s.darken(d0):s.brighten(d0);const l=ot.deltaE(s,e);if(l>i&&ot.contrast(s,n)>=af&&(r=s,i=l),i>=S2)break}return r}function ms(t){return new Map((t??[]).map(e=>[e.target,e.color]))}const u$=new WeakMap;function Qr(t){return u$.get(t)}function Jr(t,e){u$.set(t,e)}let Tte=0;const v6=new WeakMap;function Ni(t,e,n,o){let r=v6.get(e);r||(r=new Map,v6.set(e,r));let i=r.get(n);i||(i=`bc-clip-${++Tte}`,r.set(n,i));const s=Se(t).select("defs").empty()?Se(t).append("defs"):Se(t).select("defs"),a=s.select(`#${i}`);return a.empty()?s.append("clipPath").attr("id",i).append("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height):a.select("rect").attr("x",o.x).attr("y",o.y).attr("width",o.width).attr("height",o.height),i}const ip="bc-scene",Mte=500,b6=new Set,eb=new WeakMap;function sc(t){let e=eb.get(t);return e||(e=new Bte(t),eb.set(t,e)),e}function Ote(t){eb.delete(t)}class Bte{constructor(e){bn(this,"container");bn(this,"_state","idle");bn(this,"_transition",null);bn(this,"_buffer",[]);this.container=e}register(e){this._buffer.push(e)}get state(){return this._state}get activeTransition(){return this._transition}beginCommit(){(this._state==="committing"||this._state==="animating")&&this.interrupt(),this._state="committing"}commit(e={}){if(this._state!=="committing"){console.warn(`[blueprint-chart] commit() called from state '${this._state}' — call beginCommit() first; ignored.`);return}const n=e.mode??"transform";if(n!=="transform"){b6.has(n)||(b6.add(n),console.warn(`[blueprint-chart] transition mode '${n}' is not yet implemented; falling back to snap.`));const a=this._buffer;this._buffer=[],this._state="animating";for(const l of a)try{l()}catch(c){console.warn("[blueprint-chart] feature flush failed:",c)}this._state="idle";return}const o=e.duration??Mte,r=this.effectiveDuration(o),i=this._buffer;if(this._buffer=[],r<=0){this._state="animating";for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}this._state="idle";return}this._state="animating";const s=LC(ip).duration(r).ease(Zp);this._transition=s;for(const a of i)try{a()}catch(l){console.warn("[blueprint-chart] feature flush failed:",l)}s.on("end",()=>{this._transition===s&&(this._transition=null,this._state="idle")}),s.on("interrupt",()=>{this._transition===s&&(this._transition=null,this._state="idle")})}effectiveDuration(e){return e<=0?0:typeof window>"u"||typeof window.matchMedia!="function"?e:window.matchMedia("(prefers-reduced-motion: reduce)").matches?0:e}interrupt(){this._buffer=[],this._transition=null,Se(this.container).interrupt(ip),Se(this.container).selectAll("*").interrupt(ip),this._state="idle"}run(e,n={}){this.beginCommit();try{e()}catch(o){console.warn("[blueprint-chart] scene-transition commit failed:",o),this._state="idle";return}this.commit(n)}destroy(){this.interrupt(),Ote(this.container)}}function Lte(t,e){const n=new Map;return t.querySelectorAll(`[data-bc-role="${e}"]`).forEach(r=>{const i=r.getAttribute("data-bc-key");i!=null&&n.set(i,r)}),n}function Pte(t,e){return t.tagName===e.tagName}function y6(t,e){Se(t).interrupt(ip);const n={};for(const o of e){const r=t.getAttribute(o);r!==null&&(n[o]=r)}return n}const Dte={opacity:0};function Lu(t,e){if(t.state==="idle"||t.state==="animating"){Ete(e);return}t.register(()=>Nte(t,e))}function Ete(t){const n=Se(t.parent).selectAll(t.selector).data(t.data,i=>t.key(i));n.exit().remove();const o=t.insert(n.enter());d$(o,t),o.merge(n).each(function(i){hd(this,t.attrs(i))})}function Nte(t,e){const n=t.activeTransition,r=Se(e.parent).selectAll(e.selector).data(e.data,c=>e.key(c)),i=Ite(e),s=r.exit();n?s.each(function(){const c=this,u=Se(c).datum(),d=e.exitTo?e.exitTo(u):Dte;wh(c,d,n).on("end.featureJoin-exit",()=>{var f;return(f=c.parentNode)==null?void 0:f.removeChild(c)})}):s.remove();const a=Lte(t.container,e.role),l=e.insert(r.enter());d$(l,e),l.each(function(c){const u=this,d=e.attrs(c);if(n){const f=e.key(c),h=a.get(f);if(h&&Pte(h,u)){const v=y6(h,i);hd(u,v),wh(u,d,n);return}const g=e.enterFrom?e.enterFrom(c):d;hd(u,g),wh(u,d,n)}else hd(u,d)}),r.each(function(c){const u=this,d=e.attrs(c);n?(y6(u,i),wh(u,d,n)):hd(u,d)})}function d$(t,e){t.attr("data-bc-role",e.role),t.attr("data-bc-key",n=>e.key(n))}function Ite(t){return t.data.length===0?[]:Object.keys(t.attrs(t.data[0]))}function hd(t,e){for(const[n,o]of Object.entries(e))t.setAttribute(n,String(o))}function wh(t,e,n){const o=Se(t).transition(n);for(const[r,i]of Object.entries(e))o.attr(r,String(i));return o}const Rte=.35;function Pu(t){return new Set((t??[]).map(e=>e.target))}function Dn(t,e,n=1){return t.size===0||t.has(e)?n:Rte}const yc=["#4e79a7"],x6=13;class Fte extends co{initialize(){}}function f$(t,e,n={},o=!1){var pe,oe,ve,ce,D,W,j,ne,ie,ae,te,Y,X,q;Zr(o);let r=null,i,s;const a=Pr.for(t);if(o){const re=Qr(t);s=re==null?void 0:re.margin,a.detach(),re&&re.chartType!=="bar-vertical"&&(r=Br(t)),i=new Map;for(const me of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[we,ke]of cr(me))i.set(we,ke);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=lr(l).width,u=n.categoryLabelLine===!0,d=nc(e.values,(pe=n.verticalAxis)==null?void 0:pe.range,(oe=n.verticalAxis)==null?void 0:oe.numberFormat,(ve=n.verticalAxis)==null?void 0:ve.scaleType),f=u?rn.Off:(ce=n.horizontalAxis)==null?void 0:ce.labelPosition,h=Ei(c,(D=n.verticalAxis)==null?void 0:D.labelPosition,f,(W=n.verticalAxis)==null?void 0:W.direction,d);if(!u){const re=Math.max(0,c-(h.left??50)-(h.right??20)),me=a2(e.labels,re,n.horizontalAxis);me!==void 0&&(h.bottom=me)}const{chartArea:g,width:v,height:m,margin:b}=Kr(l,h),x=m-(u?x6:0),_=Di(s,b),S=Hte(e,n),N=S.map(re=>({label:re,value:e.values[e.labels.indexOf(re)]})),B=n.swapLabelValue===!0,k=n.waterfall===!0,L=[];if(k){let re=0;for(const me of N){const we=re;re+=me.value,L.push({label:me.label,value:me.value,y0:we,y1:re,isTotal:!1})}n.waterfallTotal&&L.push({label:"Total",value:re,y0:0,y1:re,isTotal:!0})}const E=k?L.map(re=>re.label):S,I=Jn().domain(E).range([0,v]).padding(rc(n.barGap)),C=((j=n.verticalAxis)==null?void 0:j.scaleType)==="log",$=k?L.flatMap(re=>[re.y0,re.y1]):N.map(re=>re.value);let[P,M]=Au($,(ne=n.verticalAxis)==null?void 0:ne.range,(ie=n.verticalAxis)==null?void 0:ie.scaleType);if(n.valueLabels&&P<0&&((te=(ae=n.verticalAxis)==null?void 0:ae.range)==null?void 0:te.min)==null){const re=M-P;P-=re*.1}const F=C?Ka().domain([P,M]).nice().range([x,0]):On().domain([P,M]).nice().range([x,0]);a.attach(g,_);const V=B&&n.valueLabels&&!k?(()=>{const re=new Map(N.map(me=>[me.label,me.value]));return{...n.horizontalAxis,width:v,tickFormat:me=>String(re.get(me)??me)}})():{...n.horizontalAxis,width:v},G=u?{...V,labelPosition:rn.Off}:V;a.update({vertical:{scale:F,height:m,options:{...n.verticalAxis,gridWidth:v,topPadding:b.top}},horizontal:{scale:I,height:m,options:G}}),!C&&P<0&&M>0&&Se(g).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",v).attr("y1",F(0)).attr("y2",F(0)).attr("stroke","#666").attr("stroke-width",1);const K=ms(n.colorizes),ue=new Set((n.highlights??[]).map(re=>re.target)),de=g.ownerSVGElement,he=Ni(de,t,"bars",{x:0,y:0,width:v,height:x}),ge=Se(de).select("defs"),ee=he.replace(/^bc-clip-/,""),fe=Se(g).append("g").attr("clip-path",`url(#${he})`);if(n.barBackground){const re=(n.colors??yc)[0],me=k?E:N.map(we=>we.label);fe.selectAll(".bc-bar-bg").data(me,we=>we).enter().append("rect").attr("class","bc-bar-bg").attr("x",we=>I(we)??0).attr("y",0).attr("width",I.bandwidth()).attr("height",x).attr("fill",re).attr("opacity",.18)}const xe=k?E:N.map(re=>re.label);if(n.barSeparators&&xe.length>1){const re=I.step();for(let me=1;me<xe.length;me++){const we=(I(xe[me-1])??0)+I.bandwidth()+(re-I.bandwidth())/2;fe.append("line").attr("class","bc-bar-separator").attr("x1",we).attr("x2",we).attr("y1",0).attr("y2",x).attr("stroke","currentColor").attr("opacity",.15)}}if(!k&&n.connectedColumns&&N.length>1){const re=n.colors??yc,me=n.connectionsOpacity??.15;for(let we=0;we<N.length-1;we++){const ke=N[we],$e=N[we+1];if(ke.value==null||$e.value==null||Number.isNaN(ke.value)||Number.isNaN($e.value)||ke.value===0||$e.value===0)continue;const De=(I(ke.label)??0)+I.bandwidth(),He=I($e.label)??0,Oe=Math.min(F(0),F(ke.value)),We=Math.min(F(0),F($e.value)),st=F(0),lt=K.get(ke.label)??re[0],At=K.get($e.label)??re[0];let on;if(lt===At)on=lt;else{const Nt=`bc-conn-grad-${ee}-${we}`,Yt=ge.append("linearGradient").attr("id",Nt).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");Yt.append("stop").attr("offset","0%").attr("stop-color",lt),Yt.append("stop").attr("offset","100%").attr("stop-color",At),on=`url(#${Nt})`}fe.append("polygon").attr("class","bc-bar-connection").attr("points",`${De},${Oe} ${He},${We} ${He},${st} ${De},${st}`).attr("fill",on).attr("opacity",me).attr("pointer-events","none")}}const Z=Se(g).append("g");if(k){const re=n.colors??yc,me="#333";if(n.connectedColumns&&L.length>1){const we=n.colors??yc,ke=n.connectionsOpacity??.15;for(let $e=0;$e<L.length-1;$e++){const De=L[$e],He=L[$e+1];if(He.isTotal||De.value==null||He.value==null||Number.isNaN(De.value)||Number.isNaN(He.value)||De.value===0||He.value===0)continue;const Oe=(I(De.label)??0)+I.bandwidth(),We=I(He.label)??0,st=F(De.y1),lt=F(He.y1),At=F(De.y0),on=F(He.y0),Nt=K.get(De.label)??we[0],Yt=K.get(He.label)??we[0];let Fn;if(Nt===Yt)Fn=Nt;else{const Vn=`bc-conn-grad-${ee}-${$e}`,fn=ge.append("linearGradient").attr("id",Vn).attr("x1","0%").attr("x2","100%").attr("y1","0%").attr("y2","0%");fn.append("stop").attr("offset","0%").attr("stop-color",Nt),fn.append("stop").attr("offset","100%").attr("stop-color",Yt),Fn=`url(#${Vn})`}fe.append("polygon").attr("class","bc-bar-connection").attr("points",`${Oe},${st} ${We},${lt} ${We},${on} ${Oe},${At}`).attr("fill",Fn).attr("opacity",ke).attr("pointer-events","none")}}for(let we=0;we<L.length-1;we++){const ke=L[we],$e=L[we+1];if($e.isTotal)break;fe.append("line").attr("class","bc-waterfall-connector").attr("x1",(I(ke.label)??0)+I.bandwidth()).attr("x2",I($e.label)??0).attr("y1",F(ke.y1)).attr("y2",F(ke.y1)).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(fe.selectAll(".bc-bar").data(L,we=>we.label).enter().append("rect").attr("class","bc-bar").attr("x",we=>I(we.label)??0).attr("y",we=>Math.min(F(we.y0),F(we.y1))).attr("width",I.bandwidth()).attr("height",we=>Math.abs(F(we.y0)-F(we.y1))).attr("fill",we=>we.isTotal?me:K.get(we.label)??re[0]).attr("opacity",we=>ue.size>0?Dn(ue,we.label):null),n.valueLabels){const we=n.valueLabelPosition??xt.Auto,ke=Ra(((Y=n.verticalAxis)==null?void 0:Y.numberFormat)??""),$e=De=>ke?ke(De):String(De);Z.selectAll(".bc-value-label").data(L,De=>De.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("x",De=>(I(De.label)??0)+I.bandwidth()/2).attr("y",De=>{const He=Math.min(F(De.y0),F(De.y1)),Oe=Math.abs(F(De.y0)-F(De.y1));return we===xt.Inside?He+Oe/2:He-4}).attr("text-anchor","middle").attr("dominant-baseline",we===xt.Inside?"central":"auto").attr("fill",De=>we===xt.Inside?Tr(De.isTotal?me:K.get(De.label)??re[0]):"currentColor").text(De=>B?De.label:$e(De.isTotal?De.y1:De.value))}}else{const re=sc(t),me=fe.append("g").node();Lu(re,{role:"mark-per-category",parent:me,selector:".bc-bar",data:N,key:ke=>ke.label,insert:ke=>ke.append("rect").attr("class","bc-bar"),attrs:ke=>({x:I(ke.label)??0,y:Math.min(F(0),F(ke.value)),width:I.bandwidth(),height:Math.abs(F(ke.value)-F(0)),fill:K.get(ke.label)??(n.colors??yc)[0],opacity:Dn(ue,ke.label)})});const we=new Fte(fe);n.tooltips&&we.use(Qa({numberFormat:(X=n.verticalAxis)==null?void 0:X.numberFormat})),n.crosshair&&we.use(ic({width:v,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(q=n.annotations)!=null&&q.length&&we.use($u(n.annotations,{scaleX:I,scaleY:F,data:N,width:v,height:x,backgroundColor:Mr(t),transition:o,priorAnnotations:i})),we.draw(N),n.valueLabels&&zte(Z,N,I,F,{position:n.valueLabelPosition,colorOverrides:K,colors:n.colors??yc,swapLabelValue:B,percent:n.valueLabels==="percent",total:EA(N,ke=>ke.value)})}if(u){const re=Se(g).append("g").attr("class","bc-category-labels");for(const me of E)re.append("text").attr("class","bc-category-label").attr("x",(I(me)??0)+I.bandwidth()/2).attr("y",x+x6/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(me)}Jr(t,{chartType:"bar-vertical",margin:b}),r&&(Or(fe.node()),Lr(t,r))}function Vte(t,e,n,o){const r=Math.abs(n(t.value)-n(0)),i=o===xt.Inside,s=(e(t.label)??0)+e.bandwidth()/2,a="middle";let l,c;return t.value<0?i?(l=n(t.value)-r/2,c="central"):(l=n(t.value)+4,c="hanging"):i?(l=n(t.value)+r/2,c="central"):(l=n(t.value)-4,c="auto"),{tx:s,ty:l,anchor:a,baseline:c,isInside:i}}function zte(t,e,n,o,r){const i=r.position??xt.Auto,s=d=>r.swapLabelValue?d.label:r.percent&&r.total!==void 0?Dm(d.value,r.total):String(d.value);let a=t.select(".bc-value-label-group");a.empty()&&(a=t.append("g").attr("class","bc-value-label-group"));const l=t.node().ownerSVGElement,c=l==null?void 0:l.parentElement,u=sc(c);Lu(u,{role:"value-label",parent:a.node(),selector:".bc-value-label",data:e,key:d=>d.label,insert:d=>d.append("text").attr("class","bc-value-label").attr("font-size","11px"),attrs:d=>{const f=Vte(d,n,o,i);return{x:f.tx,y:f.ty,"text-anchor":f.anchor,"dominant-baseline":f.baseline,fill:f.isInside?Tr(r.colorOverrides.get(d.label)??r.colors[0]):"currentColor"}}}),a.selectAll(".bc-value-label").data(e,d=>d.label).text(s)}function Hte(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===Jt.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===Jt.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}const xc=["#4e79a7"],w6=13,Wte="11px sans-serif",Av=4;class Ute extends co{initialize(){}}function Cv(t){try{const n=document.createElement("canvas").getContext("2d");if(n)return n.font=Wte,Math.ceil(n.measureText(t).width)}catch{}return t.length*6.5}function h$(t,e,n={},o=!1){var pe,oe,ve,ce,D,W,j,ne,ie,ae,te;Zr(o);let r=null,i,s;const a=Pr.for(t);if(o){const Y=Qr(t);s=Y==null?void 0:Y.margin,a.detach(),Y&&Y.chartType!=="bar-horizontal"&&(r=Br(t)),i=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[q,re]of cr(X))i.set(q,re);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=lr(l).width,u=c>0&&c<400&&((pe=n.verticalAxis)==null?void 0:pe.labelPosition)!=="outside",d=n.categoryLabelLine===!0||u,f=Em(e.labels),h=d?rn.Off:(oe=n.verticalAxis)==null?void 0:oe.labelPosition,g=Ei(c,h,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,f,(D=n.horizontalAxis)==null?void 0:D.showAxis),v=n.valueLabelPosition??xt.Auto,m=n.swapLabelValue===!0;if(n.valueLabels&&v!==xt.Inside)if(m){const Y=e.labels.reduce((q,re)=>q.length>re.length?q:re,""),X=Cv(Y)+Av;g.right=Math.max(g.right??15,X)}else{const Y=Math.max(...e.values),X=Math.min(...e.values),q=Y>0?Cv(String(Y))+Av:0,re=X<0?Cv(String(X))+Av:0;g.right=Math.max(g.right??15,q),re>0&&(g.left=(g.left??50)+re)}const{chartArea:b,width:y,height:x,margin:_}=Kr(l,g),S=d?w6:0,N=Di(s,_),B=Yte(e,n),k=B.map(Y=>({label:Y,value:e.values[e.labels.indexOf(Y)]})),L=n.waterfall===!0,E=[];if(L){let Y=0;for(const X of k){const q=Y;Y+=X.value,E.push({label:X.label,value:X.value,x0:q,x1:Y,isTotal:!1})}n.waterfallTotal&&E.push({label:"Total",value:Y,x0:0,x1:Y,isTotal:!0})}const I=((W=n.horizontalAxis)==null?void 0:W.scaleType)==="log",C=L?E.flatMap(Y=>[Y.x0,Y.x1]):k.map(Y=>Y.value),[$,P]=Au(C,(j=n.horizontalAxis)==null?void 0:j.range,(ne=n.horizontalAxis)==null?void 0:ne.scaleType),M=I?Ka().domain([$,P]).nice().range([0,y]):On().domain([$,P]).nice().range([0,y]),F=L?E.map(Y=>Y.label):B,V=Jn().domain(F).range([0,x]).padding(rc(n.barGap)),G=m&&n.valueLabels&&!L?(()=>{const Y=new Map(k.map(X=>[X.label,X.value]));return{...n.verticalAxis,topPadding:_.top,tickFormat:X=>String(Y.get(X)??X)}})():{...n.verticalAxis,topPadding:_.top},K=d?{...G,labelPosition:rn.Off,...u?{showAxis:!1}:{}}:G;a.attach(b,N),a.update({horizontal:{scale:M,height:x,options:{...n.horizontalAxis,width:y}},vertical:{scale:V,height:x,options:K},order:"horizontal-first"}),!I&&$<0&&P>0&&Se(b).append("line").attr("class","bc-zero-baseline").attr("x1",M(0)).attr("x2",M(0)).attr("y1",0).attr("y2",x).attr("stroke","#666").attr("stroke-width",1);const ue=ms(n.colorizes),de=new Set((n.highlights??[]).map(Y=>Y.target)),he=b.ownerSVGElement,ge=Ni(he,t,"bars",{x:0,y:0,width:y,height:x}),ee=Se(he).select("defs"),fe=ge.replace(/^bc-clip-/,""),xe=Se(b).append("g").attr("clip-path",`url(#${ge})`);if(n.barBackground){const Y=(n.colors??xc)[0],X=L?F:k.map(q=>q.label);xe.selectAll(".bc-bar-bg").data(X,q=>q).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",q=>(V(q)??0)+S).attr("width",y).attr("height",V.bandwidth()-S).attr("fill",Y).attr("opacity",.18)}const Z=L?F:k.map(Y=>Y.label);if(n.barSeparators&&Z.length>1){const Y=V.step();for(let X=1;X<Z.length;X++){const q=(V(Z[X-1])??0)+V.bandwidth()+(Y-V.bandwidth())/2;xe.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",y).attr("y1",q).attr("y2",q).attr("stroke","currentColor").attr("opacity",.15)}}if(!L&&n.connectedColumns&&k.length>1){const Y=n.colors??xc,X=n.connectionsOpacity??.15;for(let q=0;q<k.length-1;q++){const re=k[q],me=k[q+1];if(re.value==null||me.value==null||Number.isNaN(re.value)||Number.isNaN(me.value)||re.value===0||me.value===0)continue;const we=(V(re.label)??0)+V.bandwidth(),ke=(V(me.label)??0)+S,$e=Math.max(M(0),M(re.value)),De=Math.max(M(0),M(me.value)),He=M(0),Oe=ue.get(re.label)??Y[0],We=ue.get(me.label)??Y[0];let st;if(Oe===We)st=Oe;else{const lt=`bc-conn-grad-${fe}-${q}`,At=ee.append("linearGradient").attr("id",lt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");At.append("stop").attr("offset","0%").attr("stop-color",Oe),At.append("stop").attr("offset","100%").attr("stop-color",We),st=`url(#${lt})`}xe.append("polygon").attr("class","bc-bar-connection").attr("points",`${$e},${we} ${De},${ke} ${He},${ke} ${He},${we}`).attr("fill",st).attr("opacity",X).attr("pointer-events","none")}}if(L){const Y=n.colors??xc,X="#333";if(n.connectedColumns&&E.length>1){const q=n.colors??xc,re=n.connectionsOpacity??.15;for(let me=0;me<E.length-1;me++){const we=E[me],ke=E[me+1];if(ke.isTotal||we.value==null||ke.value==null||Number.isNaN(we.value)||Number.isNaN(ke.value)||we.value===0||ke.value===0)continue;const $e=(V(we.label)??0)+V.bandwidth(),De=(V(ke.label)??0)+S,He=M(we.x1),Oe=M(ke.x1),We=M(we.x0),st=M(ke.x0),lt=ue.get(we.label)??q[0],At=ue.get(ke.label)??q[0];let on;if(lt===At)on=lt;else{const Nt=`bc-conn-grad-${fe}-${me}`,Yt=ee.append("linearGradient").attr("id",Nt).attr("x1","0%").attr("x2","0%").attr("y1","0%").attr("y2","100%");Yt.append("stop").attr("offset","0%").attr("stop-color",lt),Yt.append("stop").attr("offset","100%").attr("stop-color",At),on=`url(#${Nt})`}xe.append("polygon").attr("class","bc-bar-connection").attr("points",`${He},${$e} ${Oe},${De} ${st},${De} ${We},${$e}`).attr("fill",on).attr("opacity",re).attr("pointer-events","none")}}for(let q=0;q<E.length-1;q++){const re=E[q],me=E[q+1];if(me.isTotal)break;xe.append("line").attr("class","bc-waterfall-connector").attr("x1",M(re.x1)).attr("x2",M(re.x1)).attr("y1",(V(re.label)??0)+V.bandwidth()).attr("y2",(V(me.label)??0)+S).attr("stroke","currentColor").attr("stroke-dasharray","2,2").attr("opacity",.3)}if(xe.selectAll(".bc-bar").data(E,q=>q.label).enter().append("rect").attr("class","bc-bar").attr("x",q=>Math.min(M(q.x0),M(q.x1))).attr("y",q=>(V(q.label)??0)+S).attr("width",q=>Math.abs(M(q.x1)-M(q.x0))).attr("height",V.bandwidth()-S).attr("fill",q=>q.isTotal?X:ue.get(q.label)??Y[0]).attr("opacity",q=>de.size>0?Dn(de,q.label):null),n.valueLabels){const q=v,re=Ra(((ie=n.horizontalAxis)==null?void 0:ie.numberFormat)??""),me=ke=>re?re(ke):String(ke);Se(b).append("g").selectAll(".bc-value-label").data(E,ke=>ke.label).enter().append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central").attr("y",ke=>(V(ke.label)??0)+S+(V.bandwidth()-S)/2).attr("x",ke=>{const $e=Math.max(M(ke.x0),M(ke.x1));return q===xt.Inside?$e-4:$e+4}).attr("text-anchor",q===xt.Inside?"end":"start").attr("fill",ke=>q===xt.Inside?Tr(ke.isTotal?X:ue.get(ke.label)??Y[0]):"currentColor").text(ke=>m?ke.label:me(ke.isTotal?ke.x1:ke.value))}}else{const Y=sc(t),X=xe.append("g").node();Lu(Y,{role:"mark-per-category",parent:X,selector:".bc-bar",data:k,key:re=>re.label,insert:re=>re.append("rect").attr("class","bc-bar"),attrs:re=>({x:Math.min(M(0),M(re.value)),y:(V(re.label)??0)+S,width:Math.abs(M(re.value)-M(0)),height:V.bandwidth()-S,fill:ue.get(re.label)??(n.colors??xc)[0],opacity:Dn(de,re.label)})});const q=new Ute(xe);if(n.tooltips&&q.use(Qa({numberFormat:(ae=n.horizontalAxis)==null?void 0:ae.numberFormat})),n.crosshair&&q.use(ic({width:y,height:x,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Kn.Horizontal})),(te=n.annotations)!=null&&te.length&&q.use($u(n.annotations,{scaleX:V,scaleY:M,data:k,width:y,height:x,backgroundColor:Mr(t),orientation:Kn.Horizontal,transition:o,priorAnnotations:i})),q.draw(k),n.valueLabels){const re=Se(b).append("g");qte(re,k,M,V,{position:v,colorOverrides:ue,colors:n.colors??xc,swapLabelValue:m,categoryLabelOffset:S,percent:n.valueLabels==="percent",total:EA(k,me=>me.value)})}}if(d){const Y=Se(b).append("g").attr("class","bc-category-labels");for(const X of F){const q=V(X)??0;Y.append("text").attr("class","bc-category-label").attr("x",2).attr("y",q+w6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(X)}}Jr(t,{chartType:"bar-horizontal",margin:_}),r&&(Or(xe.node()),Lr(t,r))}function Gte(t,e,n,o,r=0){const i=o===xt.Inside,s=(n(t.label)??0)+r+(n.bandwidth()-r)/2;let a,l;if(t.value<0){const c=Math.min(e(0),e(t.value));i?(a=c+4,l="start"):(a=c-4,l="end")}else{const c=e(t.value);i?(a=c-4,l="end"):(a=c+4,l="start")}return{tx:a,ty:s,anchor:l,isInside:i}}function qte(t,e,n,o,r){const i=r.position??xt.Auto,s=r.categoryLabelOffset??0,a=f=>r.swapLabelValue?f.label:r.percent&&r.total!==void 0?Dm(f.value,r.total):String(f.value);let l=t.select(".bc-value-label-group");l.empty()&&(l=t.append("g").attr("class","bc-value-label-group"));const c=t.node().ownerSVGElement,u=c==null?void 0:c.parentElement,d=sc(u);Lu(d,{role:"value-label",parent:l.node(),selector:".bc-value-label",data:e,key:f=>f.label,insert:f=>f.append("text").attr("class","bc-value-label").attr("font-size","11px").attr("dominant-baseline","central"),attrs:f=>{const h=Gte(f,n,o,i,s);return{x:h.tx,y:h.ty,"text-anchor":h.anchor,fill:h.isInside?Tr(r.colorOverrides.get(f.label)??r.colors[0]):"currentColor"}}}),l.selectAll(".bc-value-label").data(e,f=>f.label).text(a)}function Yte(t,e){const n=t.labels.map((o,r)=>({label:o,value:t.values[r]}));return e.sort===Jt.Ascending?n.sort((o,r)=>o.value-r.value):e.sort===Jt.Descending&&n.sort((o,r)=>r.value-o.value),n.map(o=>o.label)}function tl(t,e,n){if(t.length===0)return{width:0,height:0};if(e==="left"||e==="right"){const u=Math.max(...t.map(f=>f.length))*7+16+8,d=t.length*20;return{width:u,height:d}}const r=20,i=t.map(c=>16+c.length*7+12);if(!n||n<=0)return{width:i.reduce((u,d)=>u+d,0),height:r};let s=1,a=0,l=0;for(const c of i)a>0&&a+c>n?(l=Math.max(l,a),s++,a=c):a+=c;return l=Math.max(l,a),{width:l,height:s*r}}function p$(t){return t.length===0?0:Math.max(...t.map(n=>n.length))*7+10}function sa(t,e){return e==null?void 0:e.find(n=>n.name===t)}function ln(t,e,n,o){const r=sa(t,o);return(r==null?void 0:r.color)??n[e%n.length]}function jte(t,e){const n=sa(t,e);return(n==null?void 0:n.dash)??"solid"}function Xte(t,e){const n=sa(t,e);return(n==null?void 0:n.lineWidth)??2}function A2(t,e,n){const o=sa(t,n);return!(o!=null&&o.interpolation)||o.interpolation==="global"?e:o.interpolation}function nl(t,e){const n=sa(t,e);return(n==null?void 0:n.hidden)??!1}function Ma(t,e,n){const o=sa(t,n);return!(o!=null&&o.labelMode)||o.labelMode==="global"?e:o.labelMode}function Du(t,e,n){const o=sa(t,n);return(o==null?void 0:o.valueLabels)!==void 0?o.valueLabels:e}function Pf(t,e){const n=sa(t,e);return(n==null?void 0:n.opacity)??1}function Kte(t,e,n){const o=sa(t,n);if((o==null?void 0:o.lineSymbols)!==!1&&((o==null?void 0:o.lineSymbols)===!0||e))return{name:t,symbolShape:(o==null?void 0:o.symbolShape)??(e==null?void 0:e.symbolShape),symbolShowOn:(o==null?void 0:o.symbolShowOn)??(e==null?void 0:e.symbolShowOn),symbolStyle:(o==null?void 0:o.symbolStyle)??(e==null?void 0:e.symbolStyle),symbolSize:(o==null?void 0:o.symbolSize)??(e==null?void 0:e.symbolSize),symbolOpacity:(o==null?void 0:o.symbolOpacity)??(e==null?void 0:e.symbolOpacity),lineSymbols:!0}}const Zte=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class Qte extends co{initialize(){}}function Jte(t,e,n={},o=!1){var We,st,lt,At,on,Nt,Yt,Fn,Vn,fn,fr,hr,tt;Zr(o);let r=null,i,s;const a=Pr.for(t);if(o){const Ce=Qr(t);s=Ce==null?void 0:Ce.margin,a.detach(),Ce&&Ce.chartType!=="bar-multi"&&(r=Br(t)),i=new Map;for(const Je of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ie,ft]of cr(Je))i.set(Ie,ft);t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter(Ce=>!nl(Ce.name,n.seriesOverrides)),d=u.map(Ce=>Ce.name),f=n.colors??Zte,h=n.seriesOverrides,g=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",v=g?"direct":n.legend!==!1?"legend":"none",m=n.legend!==!1&&!g,b=lr(l).width,y=350,x=n.legendPosition??"top",_=b>0&&b<y&&(x==="left"||x==="right")?"top":x,S=n.legendAnchor??"start",N=u.flatMap(Ce=>Ce.values),B=nc(N,(We=n.verticalAxis)==null?void 0:We.range,(st=n.verticalAxis)==null?void 0:st.numberFormat,(lt=n.verticalAxis)==null?void 0:lt.scaleType),k=Ei(b,(At=n.verticalAxis)==null?void 0:At.labelPosition,(on=n.horizontalAxis)==null?void 0:on.labelPosition,(Nt=n.verticalAxis)==null?void 0:Nt.direction,B),L=Math.max(0,b-(k.left??50)-(k.right??20)),E=a2(e.labels,L,n.horizontalAxis);E!==void 0&&(k.bottom=E);const I=k.top!=null,C=Math.max(0,b-(k.left??50)-(k.right??20)),$=m?tl(d,_,C):{width:0,height:0},P=m?$.height+15:0,M={...k};if(m&&_==="top"){const Ce=I?15:0;M.top=P+Ce}m&&_==="bottom"&&(M.bottom=(M.bottom??24)+P),m&&_==="left"&&(M.left=(M.left??50)+$.width+10),m&&_==="right"&&(M.right=(M.right??20)+$.width+10);const{chartArea:F,width:V,height:G,margin:K}=Kr(l,M),ue=Di(s,K);let[de,he]=Au(N,(Yt=n.verticalAxis)==null?void 0:Yt.range,(Fn=n.verticalAxis)==null?void 0:Fn.scaleType);if(n.valueLabels&&de<0&&((fn=(Vn=n.verticalAxis)==null?void 0:Vn.range)==null?void 0:fn.min)==null){const Ce=he-de;de-=Ce*.1}let ge=e.labels;if(n.sortMode==="total"){const Ce=e.labels.map((Je,Ie)=>({label:Je,index:Ie,total:u.reduce((ft,cn)=>ft+(cn.values[Ie]??0),0)}));Ce.sort((Je,Ie)=>Ie.total-Je.total),ge=Ce.map(Je=>Je.label)}const ee=Jn().domain(ge).range([0,V]).padding(rc(n.barGap)),fe=Jn().domain(d).range([0,ee.bandwidth()]).padding(.05),xe=((fr=n.verticalAxis)==null?void 0:fr.scaleType)==="log",Z=xe?Ka().domain([de,he]).nice().range([G,0]):On().domain([de,he]).nice().range([G,0]);a.attach(F,ue),a.update({vertical:{scale:Z,height:G,options:{...n.verticalAxis,gridWidth:V,topPadding:K.top}},horizontal:{scale:ee,height:G,options:{...n.horizontalAxis,width:V}}}),!xe&&de<0&&he>0&&Se(F).append("line").attr("class","bc-zero-baseline").attr("x1",0).attr("x2",V).attr("y1",Z(0)).attr("y2",Z(0)).attr("stroke","#666").attr("stroke-width",1);const pe=new Map;n.sortMode==="within-groups"&&e.labels.forEach((Ce,Je)=>{const Ie=u.map(ft=>({name:ft.name,value:ft.values[Je]}));Ie.sort((ft,cn)=>cn.value-ft.value),Ie.forEach((ft,cn)=>{pe.set(`${Ce}\0${ft.name}`,d[cn])})});const oe=[];e.labels.forEach((Ce,Je)=>{u.forEach(Ie=>{const ft=c.findIndex(qn=>qn.name===Ie.name),cn=n.sortMode==="within-groups"?pe.get(`${Ce}\0${Ie.name}`)??Ie.name:Ie.name;oe.push({label:Ce,series:cn,seriesName:Ie.name,value:Ie.values[Je],seriesIndex:ft})})});const ve=n.valueLabels??!1,ce=F.ownerSVGElement,D=Ni(ce,t,"bars",{x:0,y:0,width:V,height:G}),W=Se(F).append("g").attr("clip-path",`url(#${D})`),j=sc(t),ne=Pu(n.highlights),ie=ms(n.colorizes),ae=W.append("g").node();Lu(j,{role:"mark-per-cell",parent:ae,selector:".bc-bar-multi",data:oe,key:Ce=>`${Ce.label}\0${Ce.seriesName}`,insert:Ce=>Ce.append("rect").attr("class","bc-bar bc-bar-multi"),attrs:Ce=>{const Je=ln(Ce.seriesName,Ce.seriesIndex,f,h),Ie=Pf(Ce.seriesName,h),ft={"data-series":Ce.seriesName,x:(ee(Ce.label)??0)+(fe(Ce.series)??0),y:Math.min(Z(0),Z(Ce.value)),width:fe.bandwidth(),height:Math.abs(Z(Ce.value)-Z(0)),fill:ie.get(Ce.seriesName)??Je};return Ie<1&&(ft["fill-opacity"]=Ie),ne.size>0?{...ft,opacity:Dn(ne,Ce.seriesName)}:ft}});const te=new Qte(W);if(n.tooltips&&te.use(Qa({numberFormat:(hr=n.verticalAxis)==null?void 0:hr.numberFormat})),n.crosshair&&te.use(ic({width:V,height:G,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(tt=n.annotations)!=null&&tt.length){const Ce=e.labels.map((Je,Ie)=>({label:Je,value:Math.max(...u.map(ft=>ft.values[Ie]??0))}));te.use($u(n.annotations,{scaleX:ee,scaleY:Z,data:Ce,width:V,height:G,backgroundColor:Mr(t),transition:o,priorAnnotations:i}))}te.draw(oe),Jr(t,{chartType:"bar-multi",margin:K}),r&&(Or(W.node()),Lr(t,r));const Y=new Set;u.forEach(Ce=>{Ma(Ce.name,v,h)==="direct"&&Y.add(Ce.name)});const X=Y.size>0,q=Mr(t),re=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?$o.Auto:$o.Off,me=n.directLabelAnchor??"middle",we=n.valueLabelPosition??xt.Auto;function ke(){return we===xt.Inside?xt.Inside:(we===xt.Outside,xt.Outside)}function $e(Ce){return re===$o.Inside?xt.Inside:re===$o.Outside?xt.Outside:ve?ke():xt.Outside}function De(Ce,Je,Ie){return Ie==="start"?Ce+12:Ie==="end"?Ce+Je-4:Ce+Je/2}const He=Se(F).append("g").attr("class","bc-value-labels");oe.forEach(Ce=>{if(!Du(Ce.seriesName,ve,h))return;const Je=(ee(Ce.label)??0)+(fe(Ce.series)??0)+fe.bandwidth()/2,Ie=Math.min(Z(0),Z(Ce.value)),ft=Math.abs(Z(Ce.value)-Z(0)),cn=ke(),qn=X&&Y.has(Ce.seriesName),to=Ce.value<0,Yn=Ie+ft;let pr,Er,vs;if(cn===xt.Inside){const Ye=ln(Ce.seriesName,Ce.seriesIndex,f,h);Er=Tr(Ye),vs="central",qn&&$e()===xt.Inside?pr=De(Ie,ft,me)+14:pr=Ie+ft/2}else Er="currentColor",to?(pr=qn&&$e()===xt.Outside?Yn+16:Yn+4,vs="hanging"):(pr=qn&&$e()===xt.Outside?Ie-16:Ie-4,vs="auto");He.append("text").attr("class","bc-value-label").attr("data-series",Ce.seriesName).attr("x",Je).attr("y",pr).attr("text-anchor","middle").attr("dominant-baseline",vs).attr("font-size","11px").attr("fill",Er).text(String(Ce.value))}),oe.forEach(Ce=>{var pr;if(!Y.has(Ce.seriesName))return;const Je=(ee(Ce.label)??0)+(fe(Ce.series)??0)+fe.bandwidth()/2,Ie=Math.min(Z(0),Z(Ce.value)),ft=Math.abs(Z(Ce.value)-Z(0)),cn=((pr=h==null?void 0:h.find(Er=>Er.name===Ce.seriesName))==null?void 0:pr.labelText)||Ce.seriesName,qn=$e(),to=ln(Ce.seriesName,Ce.seriesIndex,f,h),Yn=Se(F).append("text").attr("class","bc-direct-label").attr("data-series",Ce.seriesName).attr("x",Je).attr("text-anchor","middle").attr("font-size","10px").text(cn);if(qn===xt.Inside){const Er=De(Ie,ft,me);Yn.attr("y",Er).attr("fill",Tr(to)),me==="middle"&&Yn.attr("dominant-baseline","central")}else Yn.attr("y",Ie-4).attr("fill",a$(to,q))});const Oe=d.filter(Ce=>Ma(Ce,v,h)==="legend");if(m&&Oe.length>0){const Ce=Oe.map(ft=>{const cn=c.findIndex(qn=>qn.name===ft);return ln(ft,cn,f,h)});let Je=0,Ie=0;if(_==="top"){const ft=I?15:0;Ie=-($.height+10+ft)}else _==="bottom"?Ie=G+25:_==="left"?Je=-($.width+10):_==="right"&&(Je=V+10);Za(F,Oe,Ce,Ie,_,S,V,G,Je,[],{left:K.left,right:K.right})}}const ene={linear:ku,monotoneX:i2,step:fZ,stepBefore:hZ,stepAfter:pZ,basis:lZ,cardinal:cZ,catmullRom:dZ};function Wl(t){return t&&ene[t]||ku}function m$(t){const e=(t==null?void 0:t.position)??xt.Auto,n=(t==null?void 0:t.orientation)??Kn.Vertical,o=t!=null&&t.format?wu(t.format):r=>String(r);return{name:"value-labels",install(){},postDraw(r){const i=r.base;i.selectAll(".bc-bar").each(function(s){const a=Se(this),l=parseFloat(a.attr("x")),c=parseFloat(a.attr("y")),u=parseFloat(a.attr("width")),d=parseFloat(a.attr("height")),f=s.value<0;let h,g,v,m,b;if(n===Kn.Horizontal)if(b=e===xt.Inside,g=c+d/2,m="central",f)b?(h=l+4,v="start"):(h=l-4,v="end");else{const S=l+u;b?(h=S-4,v="end"):(h=S+4,v="start")}else b=e===xt.Inside,h=l+u/2,v="middle",f?b?(g=c+d/2,m="central"):(g=c+d+4,m="hanging"):b?(g=c+d/2,m="central"):(g=c-4,m="auto");const y=a.attr("fill")||"#ccc",x=b?Tr(y):"currentColor";Se(this.parentNode).append("text").attr("class","bc-value-label").attr("x",h).attr("y",g).attr("text-anchor",v).attr("dominant-baseline",m).attr("font-size","11px").attr("fill",x).text(o(s.value))}),i.selectAll(".bc-dot").each(function(s){const a=Se(this),l=parseFloat(a.attr("cx")),c=parseFloat(a.attr("cy"));Se(this.parentNode).append("text").attr("class","bc-value-label").attr("x",l).attr("y",c-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(o(s.value))})}}}const g$="bc-tooltip",$c=new WeakMap;function Ym(t){const e=$c.get(t);e&&($c.delete(t),e())}function tne(){if(document.getElementById("bc-tooltip-styles"))return;const t=document.createElement("style");t.id="bc-tooltip-styles",t.textContent=`
|
|
66
|
-
.${g$} {
|
|
67
|
-
position: absolute;
|
|
68
|
-
pointer-events: none;
|
|
69
|
-
background: var(--bs-body-bg, #fff);
|
|
70
|
-
color: var(--bs-body-color, #212529);
|
|
71
|
-
border: 1px solid var(--bs-border-color, #dee2e6);
|
|
72
|
-
border-radius: 4px;
|
|
73
|
-
padding: 6px 10px;
|
|
74
|
-
font-size: 13px;
|
|
75
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.12);
|
|
76
|
-
z-index: 9999;
|
|
77
|
-
display: none;
|
|
78
|
-
}
|
|
79
|
-
`,document.head.appendChild(t)}function nne(t){const e=t?Ra(t):null,n=o=>e?e(o):String(o);return o=>o.series?`${o.series} – ${o.label}: ${n(o.value)}`:`${o.label}: ${n(o.value)}`}function jm(t,e){const{width:n,height:o,points:r,tooltip:i=!0,crosshair:s=!1,crosshairDirection:a=Co.Both,crosshairStyle:l=di.Dashed,crosshairColor:c="#999",format:u=nne(e.numberFormat),container:d}=e;if(r.length===0){const P=()=>{};return d&&$c.set(d,P),P}const f=l===di.Solid?"none":l===di.Dotted?"2,2":"4,3",h=[...new Set(r.map(P=>P.cx))].sort((P,M)=>P-M),g=Se(t);let v=null;i&&(tne(),v=document.createElement("div"),v.className=g$,document.body.appendChild(v));const m=".bc-annotations",b=!g.select(m).empty(),y=P=>b?g.insert(P,m):g.append(P),x=s&&(a===Co.Both||a===Co.Vertical),_=s&&(a===Co.Both||a===Co.Horizontal);let S=null,N=null;x&&(S=y("line").attr("class","bc-crosshair bc-crosshair-v").attr("y1",0).attr("y2",o).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none")),_&&(N=y("line").attr("class","bc-crosshair bc-crosshair-h").attr("x1",0).attr("x2",n).attr("stroke",c).attr("stroke-width",1).style("stroke-dasharray",f).attr("pointer-events","none").style("display","none"));const B=y("circle").attr("class","bc-proximity-dot").attr("r",6).attr("fill","none").attr("stroke","#333").attr("stroke-width",1).attr("opacity",.45).attr("pointer-events","none").style("display","none"),k=y("rect").attr("class","bc-proximity-overlay").attr("width",n).attr("height",o).attr("fill","none").attr("pointer-events","all");function L(P,M){if(h.length===0)return null;const F=uz(h,P),V=h[F],G=r.filter(de=>de.cx===V);if(G.length===0)return null;let K=G[0],ue=Math.abs(G[0].cy-M);for(let de=1;de<G.length;de++){const he=Math.abs(G[de].cy-M);he<ue&&(K=G[de],ue=he)}return K}const E=P=>{const[M,F]=Uj(P,t),V=L(M,F);V&&(B.attr("cx",V.cx).attr("cy",V.cy).attr("stroke",V.color).style("display",null),v&&(v.textContent=u(V),v.style.display="block",w5(B.node(),v,{placement:"top",middleware:[b5(8),x5(),y5()]}).then(({x:G,y:K})=>{v&&(v.style.left=`${G}px`,v.style.top=`${K}px`)})),S&&S.attr("x1",V.cx).attr("x2",V.cx).style("display",null),N&&N.attr("y1",V.cy).attr("y2",V.cy).style("display",null))},I=()=>{B.style("display","none"),v&&(v.style.display="none"),S&&S.style("display","none"),N&&N.style("display","none")},C=k.node();C.addEventListener("mousemove",E),C.addEventListener("mouseleave",I);const $=()=>{C.removeEventListener("mousemove",E),C.removeEventListener("mouseleave",I),k.remove(),B.remove(),v&&(v.remove(),v=null),S&&S.remove(),N&&N.remove(),d&&$c.get(d)===$&&$c.delete(d)};return d&&$c.set(d,$),$}const one=sZ??UC,rne={circle:o2,square:eZ,diamond:JK,triangle:UC,triangleDown:one,cross:ZK,star:rZ};function ine(t,e,n){switch(n){case yr.First:return t===0;case yr.Last:return t===e-1;case yr.FirstLast:return t===0||t===e-1;case yr.All:default:return!0}}function C2(t,e,n,o,r=!1){const i=o.symbol??vr.Circle,s=o.showOn??yr.FirstLast,a=o.style??Ro.Filled,l=o.size??3.5,c=o.opacity??1,u="var(--bs-body-bg, #fff)",d=e.filter(h=>ine(h.index,n,s)),f=r?kt():0;if(i===vr.Circle){t.selectAll("path.bc-symbol").remove();const h=t.selectAll("circle.bc-symbol").data(d).join(v=>v.append("circle").attr("class","bc-symbol").attr("cx",m=>m.cx).attr("cy",m=>m.cy).attr("r",l).attr("fill",m=>a===Ro.Filled?m.color:u).attr("stroke",m=>m.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c),v=>v,v=>v.remove());(r?h.transition().duration(f):h).attr("cx",v=>v.cx).attr("cy",v=>v.cy).attr("r",l).attr("fill",v=>a===Ro.Filled?v.color:u).attr("stroke",v=>v.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c)}else{const h=rne[i]??o2,g=Math.PI*l*l,v=aZ().type(h).size(g);t.selectAll("circle.bc-symbol").remove();const m=t.selectAll("path.bc-symbol").data(d).join(y=>y.append("path").attr("class","bc-symbol").attr("transform",x=>`translate(${x.cx},${x.cy})`).attr("d",v).attr("fill",x=>a===Ro.Filled?x.color:u).attr("stroke",x=>x.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c),y=>y,y=>y.remove());(r?m.transition().duration(f):m).attr("transform",y=>`translate(${y.cx},${y.cy})`).attr("d",v).attr("fill",y=>a===Ro.Filled?y.color:u).attr("stroke",y=>y.color).attr("stroke-width",a===Ro.Hollow?1.5:0).attr("opacity",c)}}const v$="#4e79a7";class sne extends co{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:On()}),this.configDefine("color",{defaultValue:v$}),this.configDefine("curve",{defaultValue:ku}),this.configDefine("areaFill",{defaultValue:!1}),this.configDefine("areaFillOpacity",{defaultValue:.2}),this.configDefine("height",{defaultValue:0});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("area",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data(this.config("areaFill")?[i]:[]),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=Zs().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.attr("fill",a).attr("opacity",u).attr("d",d)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=Zs().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(kt()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("line",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data([i]),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ti().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.attr("fill","none").attr("stroke",a).attr("d",c)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ti().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(kt()).attr("fill","none").attr("stroke",a).attr("d",c)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:(r,i)=>r.selectAll(".bc-dot").data(i,s=>s.label),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.duration(kt()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}})}}function ane(t,e,n={},o=!1){var xe,Z,pe,oe,ve,ce,D,W,j,ne,ie,ae,te;Zr(o),Ym(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Pr.for(t);if(o){const Y=Qr(t);u=Y==null?void 0:Y.margin,d.detach(),(Y==null?void 0:Y.chartType)==="line"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),s=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),a=t.querySelector(".bc-frame .bc-symbols")):Y&&(l=Br(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[q,re]of cr(X))c.set(q,re);t.replaceChildren()}const{body:f}=Xr(t,n.frame),h=lr(f).width,g=nc(e.values,(xe=n.verticalAxis)==null?void 0:xe.range,(Z=n.verticalAxis)==null?void 0:Z.numberFormat,(pe=n.verticalAxis)==null?void 0:pe.scaleType),v=Ei(h,(oe=n.verticalAxis)==null?void 0:oe.labelPosition,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,g),{chartArea:m,width:b,height:y,margin:x}=Kr(f,v),_=Di(u,x),S=Im(e.labels,(D=n.horizontalAxis)==null?void 0:D.range),N=S.map(Y=>e.labels[Y]),B=S.map(Y=>e.values[Y]),k=N.map((Y,X)=>({label:Y,value:B[X]})),L=Om().domain(N).range([0,b]).padding(n.edgePadding?.6:0),E=L,I=Y=>L(Y.label)??0,C=((W=n.verticalAxis)==null?void 0:W.scaleType)==="log",[$,P]=Au(B,(j=n.verticalAxis)==null?void 0:j.range,(ne=n.verticalAxis)==null?void 0:ne.scaleType),M=C?Ka().domain([$,P]).nice().range([y,0]):On().domain([$,P]).nice().range([y,0]),F=M.domain(),V=F[0]<0&&F[1]>0?M(0):void 0;d.attach(m,_),d.update({vertical:{scale:M,height:y,options:{...n.verticalAxis,gridWidth:b,topPadding:x.top}},horizontal:{scale:E,height:y,options:{...n.horizontalAxis,width:b,zeroY:V}}});const G=m.ownerSVGElement,K=Ni(G,t,"plot",{x:-1,y:-1,width:b+2,height:y+2}),ue=Se(m).append("g").attr("clip-path",`url(#${K})`),de=ue.node(),he=((ie=n.colors)==null?void 0:ie[0])??v$,ge=Wl(n.interpolation),ee=n.lineSymbols,fe=new sne(Se(de));if(fe.config({xPos:I,y:M,color:he,curve:ge,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:y}),i.length>0||r.length>0||s.length>0){const Y=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,q=de.querySelectorAll(":scope > g");q[0]&&Wo(q[0],r,Y,X),q[1]&&Wo(q[1],i,Y,X),q[2]&&Wo(q[2],s,Y,X)}if(n.valueLabels&&fe.use(m$({position:n.valueLabelPosition,orientation:Kn.Vertical})),fe.draw(k),(ae=n.annotations)!=null&&ae.length&&Um(m,n.annotations,{scaleX:E,scaleY:M,data:k,width:b,height:y,backgroundColor:Mr(t),transition:o,priorAnnotations:c}),Se(de).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const Y=k.map(X=>({cx:I(X),cy:M(X.value),label:X.label,value:X.value,color:he}));jm(m,{width:b,height:y,points:Y,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(te=n.verticalAxis)==null?void 0:te.numberFormat,container:t})}if(ee){const Y=k.map((q,re)=>({cx:I(q),cy:M(q.value),color:he,index:re}));let X;a?(m.appendChild(a),X=Se(a)):X=Se(m).append("g").attr("class","bc-symbols"),C2(X,Y,k.length,ee,o)}Jr(t,{chartType:"line",margin:x}),l&&(Or(ue.node()),Lr(t,l))}const $2=28,b$=18,y$=20;function T2(t,e,n,o=$2){if(t.length===0)return[];if(t.length===1)return[Math.max(e,Math.min(n,t[0]))];const r=t.length,i=n-e,a=(r-1)*o>i?Math.max(0,i/(r-1)):o,l=[...t];for(let c=0;c<10;c++){for(let u=1;u<l.length;u++)l[u]-l[u-1]<a&&(l[u]=l[u-1]+a);l[l.length-1]>n&&(l[l.length-1]=n);for(let u=l.length-2;u>=0;u--)l[u+1]-l[u]<a&&(l[u]=l[u+1]-a);l[0]<e&&(l[0]=e)}return l}function x$(t,e,n){const{outerRadius:o,fontSize:r=12,bgColor:i="#fff"}=n,s=o+2,a=s+b$,l=$2/a,c=[],u=[];for(const f of e){const h=(f.startAngle+f.endAngle)/2;h<Math.PI?u.push({...f,midAngle:h}):c.push({...f,midAngle:h})}function d(f,h){if(f.length===0)return;f.sort((_,S)=>_.midAngle-S.midAngle);const g=h?.05:Math.PI+.05,v=h?Math.PI-.05:2*Math.PI-.05,m=f.map(_=>_.midAngle),b=T2(m,g,v,l),y=h?1:-1,x=t.append("g").attr("class","bc-arc-labels");f.forEach((_,S)=>{const N=_.showLabel!==!1,B=_.showValue!==!1;if(!N&&!B)return;const L=b[S]-Math.PI/2,E=Math.cos(L)*s,I=Math.sin(L)*s,C=Math.cos(L)*a,$=Math.sin(L)*a,P=C+y*y$;x.append("polyline").attr("class","bc-arc-label-line").attr("points",`${E},${I} ${C},${$} ${P},${$}`).attr("fill","none").attr("stroke","var(--bc-text-color, #999)").attr("stroke-width",1).attr("opacity",.5);const M=P+y*4,F=x.append("text").attr("class","bc-arc-direct-label").attr("x",M).attr("y",$).attr("text-anchor",h?"start":"end").attr("font-size",`${r}px`);if(N&&F.append("tspan").attr("x",M).attr("dy",B?"-0.1em":"0.35em").attr("font-weight","bold").attr("fill",a$(_.color,i)).text(_.label),B){const V=_.displayAsPercentage&&_.percentage!=null?`${Math.round(_.percentage)}%`:String(_.value);F.append("tspan").attr("x",M).attr("dy",N?"1.2em":"0.35em").attr("fill","var(--bc-text-color, #666)").text(V)}})}d(u,!0),d(c,!1)}const w$=.3;function _$(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12}=n,s=(r+o)/2,a=t.append("g").attr("class","bc-arc-labels-inside");for(const l of e){if(l.endAngle-l.startAngle<w$)continue;const u=l.showLabel!==!1,d=l.showValue!==!1;if(!u&&!d)continue;const f=(l.startAngle+l.endAngle)/2-Math.PI/2,h=Math.cos(f)*s,g=Math.sin(f)*s,v=a.append("text").attr("class","bc-arc-inside-label").attr("x",h).attr("y",g).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",`${i}px`),m=Tr(l.color);if(u&&v.append("tspan").attr("x",h).attr("dy",d?"-0.5em":"0em").attr("font-weight","bold").attr("fill",m).text(l.label),d){const b=l.displayAsPercentage&&l.percentage!=null?`${Math.round(l.percentage)}%`:String(l.value);v.append("tspan").attr("x",h).attr("dy",u?"1.2em":"0em").attr("fill",m).attr("opacity",.85).text(b)}}}function lne(t,e,n){const{outerRadius:o,innerRadius:r=0,fontSize:i=12,bgColor:s}=n,a=(r+o)/2,l=[],c=[];for(const u of e){const d=u.endAngle-u.startAngle,f=d*a,h=u.label.length*7;f>h*1.2&&d>=w$?l.push(u):c.push(u)}l.length>0&&_$(t,l,{outerRadius:o,innerRadius:r,fontSize:i}),c.length>0&&x$(t,c,{outerRadius:o,fontSize:i,bgColor:s})}function cne(t,e){if(t.length===0)return{left:0,right:0,top:0,bottom:0};const n=Math.max(...t.map(a=>a.length)),o=b$+y$+6+4+n*7+6,i=t.length*$2/2,s=Math.max(10,i-e+20);return{left:o,right:o,top:s,bottom:s}}const k$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class une extends co{initialize(){this.configDefine("xPos",{defaultValue:r=>0}),this.configDefine("y",{defaultValue:On()}),this.configDefine("colors",{defaultValue:k$}),this.configDefine("labels",{defaultValue:[]}),this.configDefine("curve",{defaultValue:ku}),this.configDefine("areaFill",{defaultValue:!1}),this.configDefine("areaFillOpacity",{defaultValue:.2}),this.configDefine("height",{defaultValue:0}),this.configDefine("dots",{defaultValue:[]}),this.configDefine("highlightTargets",{defaultValue:new Set});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("areas",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data(this.config("areaFill")?i:[],s=>s.name),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity");r.attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>Zs().curve(l).x((h,g)=>i(g)).y0(c).y1(h=>s(h))(d.values))},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity");r.duration(kt()).attr("data-series",d=>d.colorIndex).attr("fill",d=>a[d.colorIndex%a.length]).attr("opacity",u).attr("d",d=>Zs().curve(l).x((h,g)=>i(g)).y0(c).y1(h=>s(h))(d.values))},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("lines",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data(i,s=>s.name),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("highlightTargets"),c=l.size>0;r.attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?Dn(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Ti().curve(d).x((h,g)=>i(g)).y(h=>s(h))(u.values)})},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("highlightTargets"),c=l.size>0;r.duration(kt()).attr("data-series",u=>u.colorIndex).attr("fill","none").attr("stroke",u=>a[u.colorIndex%a.length]).attr("stroke-width",2).attr("opacity",u=>c?Dn(l,u.name,1):null).attr("d",u=>{const d=this.config("curve");return Ti().curve(d).x((h,g)=>i(g)).y(h=>s(h))(u.values)})},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:r=>r.selectAll(".bc-dot").data(this.config("dots"),i=>i.label+"\0"+i.series),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("labels");r.attr("data-series",c=>c.colorIndex).attr("cx",c=>i(l.indexOf(c.label))).attr("cy",c=>s(c.value)).attr("r",3).attr("fill",c=>a[c.colorIndex%a.length])},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("colors"),l=this.config("labels");r.duration(kt()).attr("data-series",c=>c.colorIndex).attr("cx",c=>i(l.indexOf(c.label))).attr("cy",c=>s(c.value)).attr("r",3).attr("fill",c=>a[c.colorIndex%a.length])},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}})}}function dne(t,e,n={},o=!1){var hr,tt,Ce,Je,Ie,ft,cn,qn,to,Yn,pr,Er,vs;Zr(o),Ym(t);let r=e,i=[],s=[],a=[],l=[],c=null,u,d;const f=Pr.for(t);if(o){const Ye=Qr(t);d=Ye==null?void 0:Ye.margin,f.detach(),(Ye==null?void 0:Ye.chartType)==="line-multi"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line")),a=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),l=Array.from(t.querySelectorAll(".bc-frame .bc-symbols"))):Ye&&(c=Br(t)),u=new Map;for(const ct of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Ot,Ft]of cr(ct))u.set(Ot,Ft);t.replaceChildren()}const{body:h}=Xr(t,n.frame),g=r.series??[];let v=g.filter(Ye=>!nl(Ye.name,n.seriesOverrides));(n.sortMode==="total"||n.sortMode==="within-groups")&&(v=[...v].sort((Ye,ct)=>{const Ot=Ye.values.reduce((jn,Xn)=>jn+Xn,0);return ct.values.reduce((jn,Xn)=>jn+Xn,0)-Ot}));const m=n.colors??k$,b=v.map(Ye=>Ye.name),y=ms(n.colorizes),x=n.seriesOverrides,_=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",S=_?"direct":n.legend!==!1?"legend":"none",N=b.filter(Ye=>Ma(Ye,S,x)==="direct"),B=n.legend!==!1&&!_,k=lr(h).width,L=350,E=n.legendPosition??"top",I=k>0&&k<L&&(E==="left"||E==="right")?"top":E,C=n.legendAnchor??"start",$=Im(r.labels,(hr=n.horizontalAxis)==null?void 0:hr.range),P=$.map(Ye=>r.labels[Ye]);v=v.map(Ye=>({...Ye,values:$.map(ct=>Ye.values[ct])})),r={...r,labels:P,series:v};const M=v.flatMap(Ye=>Ye.values),F=nc(M,(tt=n.verticalAxis)==null?void 0:tt.range,(Ce=n.verticalAxis)==null?void 0:Ce.numberFormat,(Je=n.verticalAxis)==null?void 0:Je.scaleType),V=Ei(k,(Ie=n.verticalAxis)==null?void 0:Ie.labelPosition,(ft=n.horizontalAxis)==null?void 0:ft.labelPosition,(cn=n.verticalAxis)==null?void 0:cn.direction,F),G=N.length>0?p$(N):0,K=V.top!=null,ue=Math.max(0,k-(V.left??50)-(V.right??20)-G),de=B?tl(b,I,ue):{width:0,height:0},he=B?de.height+15:0,ge={...V};if(B&&I==="top"){const Ye=K?15:0;ge.top=he+Ye}B&&I==="bottom"&&(ge.bottom=(ge.bottom??24)+he),B&&I==="left"&&(ge.left=(ge.left??50)+de.width+10),B&&I==="right"&&(ge.right=(ge.right??20)+de.width+10),G>0&&(ge.right=(ge.right??20)+G);const{chartArea:ee,width:fe,height:xe,margin:Z}=Kr(h,ge),pe=Di(d,Z),[oe,ve]=Au(M,(qn=n.verticalAxis)==null?void 0:qn.range,(to=n.verticalAxis)==null?void 0:to.scaleType),ce=Om().domain(r.labels).range([0,fe]).padding(n.edgePadding?.6:0),D=ce,W=Ye=>ce(r.labels[Ye])??0,ne=((Yn=n.verticalAxis)==null?void 0:Yn.scaleType)==="log"?Ka().domain([oe,ve]).nice().range([xe,0]):On().domain([oe,ve]).nice().range([xe,0]),ie=ne.domain(),ae=ie[0]<0&&ie[1]>0?ne(0):void 0;f.attach(ee,pe),f.update({vertical:{scale:ne,height:xe,options:{...n.verticalAxis,gridWidth:fe,topPadding:Z.top}},horizontal:{scale:D,height:xe,options:{...n.horizontalAxis,width:fe,zeroY:ae}}});const te=ee.ownerSVGElement,Y=Ni(te,t,"plot",{x:0,y:0,width:fe,height:xe}),X=Se(ee).append("g").attr("clip-path",`url(#${Y})`),q=X.node(),re=v.map(Ye=>({name:Ye.name,values:Ye.values,colorIndex:g.findIndex(ct=>ct.name===Ye.name)})),me=Wl(n.interpolation);(pr=n.areaFills)!=null&&pr.length&&fne(q,n.areaFills,v,W,r.labels.length,ne,me);const we=[];v.forEach((Ye,ct)=>{r.labels.forEach((Ot,Ft)=>{we.push({label:Ot,value:Ye.values[Ft],series:Ye.name,colorIndex:ct})})});const ke=n.lineSymbols,$e={solid:"",dotted:"2,4",dashed:"8,4","dash-dot":"8,4,2,4"},De=n.valueLabels??!1,He=new Set((n.highlights??[]).map(Ye=>Ye.target)),Oe=new une(Se(q));Oe.config({xPos:W,y:ne,colors:m,labels:r.labels,curve:me,areaFill:n.areaFill??!1,areaFillOpacity:n.areaFillOpacity??.2,height:xe,dots:we,highlightTargets:He});const We=new Set(re.map(Ye=>Ye.name)),st=i.filter(Ye=>{var ct;return We.has(((ct=Ye.__data__)==null?void 0:ct.name)??"")}),lt=s.filter(Ye=>{var ct;return We.has(((ct=Ye.__data__)==null?void 0:ct.name)??"")}),At=a.filter(Ye=>{var ct;return We.has(((ct=Ye.__data__)==null?void 0:ct.series)??"")});if(lt.length>0||st.length>0||At.length>0){const Ye=(pe==null?void 0:pe.dx)??0,ct=(pe==null?void 0:pe.dy)??0,Ot=q.querySelectorAll(":scope > g");Ot[0]&&Wo(Ot[0],st,Ye,ct),Ot[1]&&Wo(Ot[1],lt,Ye,ct),Ot[2]&&Wo(Ot[2],At,Ye,ct)}if(Oe.draw(re),(Er=n.annotations)!=null&&Er.length){const Ye=r.labels.map((ct,Ot)=>{var Ft;return{label:ct,value:((Ft=v[0])==null?void 0:Ft.values[Ot])??0}});Um(ee,n.annotations,{scaleX:D,scaleY:ne,data:Ye,width:fe,height:xe,backgroundColor:Mr(t),transition:o,priorAnnotations:u})}const on=Se(q).append("g").attr("class","bc-value-labels");if(we.forEach(Ye=>{if(!Du(Ye.series,De,x))return;const ct=W(r.labels.indexOf(Ye.label)),Ot=ne(Ye.value);on.append("text").attr("class","bc-value-label").attr("data-series",Ye.colorIndex).attr("x",ct).attr("y",Ot-8).attr("text-anchor","middle").attr("font-size","11px").attr("fill","currentColor").text(String(Ye.value))}),Se(q).selectAll(".bc-line").each(function(Ye){const ct=Ye,Ot=ln(ct.name,ct.colorIndex,m,x),Ft=Xte(ct.name,x),jn=jte(ct.name,x),Xn=A2(ct.name,n.interpolation??"linear",x),ti=o?Se(this).transition().duration(kt()):Se(this);if(ti.attr("stroke",y.get(ct.name)??Ot).attr("stroke-width",Ft),ti.attr("opacity",Dn(He,ct.name,1)),jn!=="solid"&&Se(this).attr("stroke-dasharray",$e[jn]??""),Xn!==(n.interpolation??"linear")){const ua=Wl(Xn),cc=Ti().curve(ua).x((ni,Mg)=>W(Mg)).y(ni=>ne(ni));ti.attr("d",cc(ct.values))}}),Se(q).selectAll(".bc-area").each(function(Ye){const ct=Ye,Ot=ln(ct.name,ct.colorIndex,m,x),Ft=o?Se(this).transition().duration(kt()):Se(this);Ft.attr("fill",y.get(ct.name)??Ot),Ft.attr("opacity",Dn(He,ct.name,n.areaFillOpacity??.2))}),Se(q).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const Ye=we.map(ct=>({cx:W(r.labels.indexOf(ct.label)),cy:ne(ct.value),label:ct.label,value:ct.value,series:ct.series,color:ln(ct.series,ct.colorIndex,m,x)}));jm(ee,{width:fe,height:xe,points:Ye,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(vs=n.verticalAxis)==null?void 0:vs.numberFormat,container:t})}const Nt=ke?{symbolShape:ke.symbol,symbolShowOn:ke.showOn,symbolStyle:ke.style,symbolSize:ke.size,symbolOpacity:ke.opacity}:void 0,Yt=r.labels.length;v.forEach((Ye,ct)=>{const Ot=Kte(Ye.name,Nt,x);if(!Ot)return;const Ft={symbol:Ot.symbolShape??(ke==null?void 0:ke.symbol)??vr.Circle,showOn:Ot.symbolShowOn??(ke==null?void 0:ke.showOn)??yr.FirstLast,style:Ot.symbolStyle??(ke==null?void 0:ke.style)??Ro.Filled,size:Ot.symbolSize??(ke==null?void 0:ke.size)??3.5,opacity:Ot.symbolOpacity??(ke==null?void 0:ke.opacity)??1},jn=r.labels.map((cc,ni)=>({cx:W(ni),cy:ne(Ye.values[ni]),color:ln(Ye.name,ct,m,x),index:ni})),Xn=l.find(cc=>cc.getAttribute("data-series-name")===Ye.name);let ti,ua=!1;Xn?(ee.appendChild(Xn),ti=Se(Xn),ua=!0):ti=Se(ee).append("g").attr("class","bc-symbols").attr("data-series",ct).attr("data-series-name",Ye.name),C2(ti,jn,Yt,Ft,o&&ua)});const Fn=r.labels.length-1,Vn=W(Fn)+6,fn=[];if(v.forEach((Ye,ct)=>{var Xn;if(Ma(Ye.name,S,x)!=="direct")return;const Ft=Ye.values[Fn],jn=((Xn=x==null?void 0:x.find(ti=>ti.name===Ye.name))==null?void 0:Xn.labelText)||Ye.name;fn.push({name:Ye.name,index:ct,naturalY:ne(Ft),text:jn})}),fn.length>0){fn.sort((Ft,jn)=>Ft.naturalY-jn.naturalY);const Ye=fn.map(Ft=>Ft.naturalY),Ot=T2(Ye,0,xe,14);fn.forEach((Ft,jn)=>{Se(ee).append("text").attr("class","bc-direct-label").attr("data-series",Ft.index).attr("x",Vn).attr("y",Ot[jn]).attr("dy","0.35em").attr("font-size","11px").attr("fill",ln(Ft.name,Ft.index,m,x)).text(Ft.text)})}const fr=b.filter(Ye=>Ma(Ye,S,x)==="legend");if(B&&fr.length>0){const Ye=fr.map(Ft=>{const jn=g.findIndex(Xn=>Xn.name===Ft);return ln(Ft,jn,m,x)});let ct=0,Ot=0;if(I==="top"){const Ft=K?15:0;Ot=-(de.height+10+Ft)}else I==="bottom"?Ot=xe+25:I==="left"?ct=-(de.width+10):I==="right"&&(ct=fe+10);Za(ee,fr,Ye,Ot,I,C,fe,xe,ct,[],{left:Z.left,right:Z.right})}Jr(t,{chartType:"line-multi",margin:Z}),c&&(Or(X.node()),Lr(t,c))}function fne(t,e,n,o,r,i,s){const a=Se(t).append("g").attr("class","bc-area-fills");for(const l of e){const c=n.find(v=>v.name===l.from),u=n.find(v=>v.name===l.to);if(!c||!u)continue;const d=l.interpolation?Wl(l.interpolation):s,f=(l.opacity??30)/100,h=l.color??"#ccc",g=l.negativeColor;if(g)pne(a,c.values,u.values,o,i,d,h,g,f);else{const v=Zs().curve(d).x((m,b)=>o(b)).y0((m,b)=>i(u.values[b])).y1(m=>i(m));a.append("path").attr("class","bc-area-fill").attr("d",v(c.values)??"").attr("fill",h).attr("opacity",f)}}}function hne(t,e,n,o){const r=t-n,i=e-o;if(r===0&&i===0||r>0&&i>0||r<0&&i<0)return null;const s=i-r;if(s===0)return null;const a=-r/s;return a<0||a>1?null:a}function pne(t,e,n,o,r,i,s,a,l){const c=e.length;if(c===0)return;const u=[];for(let g=0;g<c;g++){const v=o(g),m=r(e[g]),b=r(n[g]);if(u.push({x:v,fromY:m,toY:b}),g<c-1){const y=r(e[g+1]),x=r(n[g+1]),_=hne(m,y,b,x);if(_!==null&&_>0&&_<1){const S=v+_*(o(g+1)-v),N=m+_*(y-m),B=b+_*(x-b);u.push({x:S,fromY:N,toY:B})}}}const d=[];let f=[],h=null;for(const g of u){const v=g.fromY-g.toY,m=v<0;h===null?(h=v===0?null:m,f.push(g)):v===0?(f.push(g),f.length>=2&&d.push({points:f,positive:h}),f=[g],h=null):h===m?f.push(g):(f.push(g),f.length>=2&&d.push({points:f,positive:h}),f=[g],h=m)}f.length>=2&&h!==null&&d.push({points:f,positive:h});for(const g of d){const v=g.points;let m=`M${v[0].x},${v[0].fromY}`;for(let b=1;b<v.length;b++)m+=`L${v[b].x},${v[b].fromY}`;for(let b=v.length-1;b>=0;b--)m+=`L${v[b].x},${v[b].toY}`;m+="Z",t.append("path").attr("class",`bc-area-fill ${g.positive?"bc-area-fill-pos":"bc-area-fill-neg"}`).attr("d",m).attr("fill",g.positive?s:a).attr("opacity",l)}}const mne=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class gne extends co{initialize(){}}function vne(t,e,n={},o=!1){S$(t,e,n,.6,o)}function S$(t,e,n,o,r=!1){var ve;Zr(r);let i=null,s;if(r){const ce=Qr(t),D=o>0?"donut":"pie";ce&&ce.chartType!==D&&(i=Br(t)),s=new Map;for(const W of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[j,ne]of cr(W))s.set(j,ne);t.replaceChildren()}const{body:a}=Xr(t,n.frame);let l=[...e.labels],c=[...e.values];if(n.sort===Jt.Ascending||n.sort===Jt.Descending){const ce=l.map((D,W)=>({label:D,value:c[W]}));ce.sort((D,W)=>n.sort===Jt.Ascending?D.value-W.value:W.value-D.value),l=ce.map(D=>D.label),c=ce.map(D=>D.value)}if(n.sliceMax&&n.sliceMax>0&&l.length>n.sliceMax){const ce=n.sliceMax-1,D=l.slice(0,ce),W=c.slice(0,ce),j=c.slice(ce).reduce((ne,ie)=>ne+ie,0);D.push(n.sliceGroupLabel??"Others"),W.push(j),l=D,c=W}const u=c.reduce((ce,D)=>ce+D,0),d=c.map(ce=>u>0?ce/u*100:0),f=n.colors??mne,h=f.length<l.length&&f.length>=2?ot.scale(f).mode("lch").colors(l.length):f,g=typeof n.directLabelling=="string"?n.directLabelling:n.directLabelling?$o.Auto:$o.Off,v=!!g&&!(g===$o.Auto&&n.legend===!0),b=(n.showValues??!0)&&!v?c.map((ce,D)=>`(${n.displayAsPercentage?`${Math.round(d[D])}%`:String(ce)})`):[],y=n.legend!==!1&&!v,x=lr(a).width,_=350,S=n.legendPosition??"top",N=x>0&&x<_&&(S==="left"||S==="right")?"top":S,B=n.legendAnchor??"start",k=b.length>0?l.map((ce,D)=>`${ce} ${b[D]}`):l,L=Math.max(0,x-50-20),E=y?tl(k,N,L):{width:0,height:0},I=y?E.height+15:0,C={};if(y&&N==="top"&&(C.top=I),y&&N==="bottom"&&(C.bottom=24+I),y&&N==="left"&&(C.left=50+E.width+10),y&&N==="right"&&(C.right=20+E.width+10),v){const ce=lr(a),D=20,W=ce.width-2*D,j=(ce.height>0?ce.height:400)-2*D,ne=Math.min(W,j)/2,ie=cne(l,ne);C.left=(C.left??D)+ie.left,C.right=(C.right??D)+ie.right,C.top=(C.top??D)+ie.top,C.bottom=(C.bottom??D)+ie.bottom}const{chartArea:$,width:P,height:M,margin:F}=Kr(a,C),V=Math.min(P,M)/2,G=V*o,K=n2().domain(l).range(h),ue=KK().sort(null),de=YK().innerRadius(G).outerRadius(V),he=Se($).append("g").attr("transform",`translate(${P/2},${M/2})`),ge=ms(n.colorizes),ee=ue(c),fe=ee.map((ce,D)=>({label:l[D],arc:ce,color:ge.get(l[D])??K(l[D])})),xe=sc(t),Z=Pu(n.highlights),pe=he.append("g").node();Lu(xe,{role:"mark-per-category",parent:pe,selector:".bc-arc",data:fe,key:ce=>ce.label,insert:ce=>ce.append("path").attr("class","bc-arc"),attrs:ce=>{const D={d:de(ce.arc)??"",fill:ce.color};return Z.size>0?{...D,opacity:Dn(Z,ce.label)}:D}});const oe=new gne(he);if(n.tooltips&&oe.use(Qa()),oe.draw(fe),(ve=n.annotations)!=null&&ve.length){const ce=n.annotations.filter(D=>D.kind==="free");ce.length&&$u(ce,{scaleX:Jn().domain([]).range([0,P]),scaleY:On().domain([0,1]).range([M,0]),data:[],width:P,height:M,backgroundColor:Mr(t),transition:r,priorAnnotations:s}).postDraw({base:Se($)},void 0)}if(v){const ce=ee.map((ne,ie)=>({label:l[ie],value:ne.data,startAngle:ne.startAngle,endAngle:ne.endAngle,color:K(l[ie]),percentage:d[ie],displayAsPercentage:n.displayAsPercentage,showLabel:n.showLabels??!0,showValue:n.showValues??!0})),D=he,W=Mr(t),j={outerRadius:V,innerRadius:G,bgColor:W};g===$o.Inside?_$(D,ce,j):g===$o.Auto?lne(D,ce,j):x$(D,ce,j)}if(n.showTotal&&o>0&&!n.displayAsPercentage){const ce=String(u);he.append("text").attr("class","bc-arc-total-label").attr("text-anchor","middle").attr("dy","-0.3em").attr("font-size","11px").attr("fill","var(--bc-text-color, #555)").attr("opacity",.7).text("Total"),he.append("text").attr("class","bc-arc-total-value").attr("text-anchor","middle").attr("dy","1em").attr("font-size","18px").attr("font-weight","bold").attr("fill","var(--bc-text-color, #555)").text(ce)}if(y){let ce=0,D=0;N==="top"?D=-(E.height+10):N==="bottom"?D=M+25:N==="left"?ce=-(E.width+10):N==="right"&&(ce=P+10),Za($,l,h,D,N,B,P,M,ce,b,{left:F.left,right:F.right})}Jr(t,{chartType:o>0?"donut":"pie"}),i&&(Or(he.node()),Lr(t,i))}function bne(t,e,n={},o=!1){S$(t,e,n,0,o)}const A$="#4e79a7";class yne extends co{initialize(){this.configDefine("xPos",{defaultValue:(r,i)=>0}),this.configDefine("y",{defaultValue:On()}),this.configDefine("color",{defaultValue:A$}),this.configDefine("curve",{defaultValue:i2}),this.configDefine("areaFillOpacity",{defaultValue:.25}),this.configDefine("height",{defaultValue:0});const e=this.base.append("g"),n=this.base.append("g"),o=this.base.append("g");this.layer("area",e,{dataBind:(r,i)=>r.selectAll(".bc-area").data([i]),insert:r=>r.append("path").attr("class","bc-area"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=Zs().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.attr("fill",a).attr("opacity",u).attr("d",d)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=this.config("height"),u=this.config("areaFillOpacity"),d=Zs().curve(l).x((f,h)=>i(f,h)).y0(c).y1(f=>s(f.value));r.duration(kt()).attr("fill",a).attr("opacity",u).attr("d",d)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("line",n,{dataBind:(r,i)=>r.selectAll(".bc-line").data([i]),insert:r=>r.append("path").attr("class","bc-line"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ti().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color"),l=this.config("curve"),c=Ti().curve(l).x((u,d)=>i(u,d)).y(u=>s(u.value));r.duration(kt()).attr("fill","none").attr("stroke",a).attr("stroke-width",2).attr("d",c)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}}),this.layer("dots",o,{dataBind:(r,i)=>r.selectAll(".bc-dot").data(i,s=>s.label),insert:r=>r.append("circle").attr("class","bc-dot"),events:{enter:r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"merge:transition":r=>{const i=this.config("xPos"),s=this.config("y"),a=this.config("color");r.duration(kt()).attr("cx",(l,c)=>i(l,c)).attr("cy",l=>s(l.value)).attr("r",3).attr("fill",a)},"exit:transition":r=>{r.duration(kt()).attr("opacity",0).remove()}}})}}function xne(t,e,n={},o=!1){var xe,Z,pe,oe,ve,ce,D,W,j,ne,ie,ae,te;Zr(o),Ym(t);let r=[],i=[],s=[],a=null,l=null,c,u;const d=Pr.for(t);if(o){const Y=Qr(t);u=Y==null?void 0:Y.margin,d.detach(),(Y==null?void 0:Y.chartType)==="area"?(r=Array.from(t.querySelectorAll(".bc-frame .bc-area")),i=Array.from(t.querySelectorAll(".bc-frame .bc-line")),s=Array.from(t.querySelectorAll(".bc-frame .bc-dot")),a=t.querySelector(".bc-frame .bc-symbols")):Y&&(l=Br(t)),c=new Map;for(const X of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[q,re]of cr(X))c.set(q,re);t.replaceChildren()}const{body:f}=Xr(t,n.frame),h=lr(f).width,g=nc(e.values,(xe=n.verticalAxis)==null?void 0:xe.range,(Z=n.verticalAxis)==null?void 0:Z.numberFormat,(pe=n.verticalAxis)==null?void 0:pe.scaleType),v=Ei(h,(oe=n.verticalAxis)==null?void 0:oe.labelPosition,(ve=n.horizontalAxis)==null?void 0:ve.labelPosition,(ce=n.verticalAxis)==null?void 0:ce.direction,g),{chartArea:m,width:b,height:y,margin:x}=Kr(f,v),_=Di(u,x),S=Im(e.labels,(D=n.horizontalAxis)==null?void 0:D.range),N=S.map(Y=>e.labels[Y]),B=S.map(Y=>e.values[Y]),k=N.map((Y,X)=>({label:Y,value:B[X]})),L=Om().domain(N).range([0,b]).padding(n.edgePadding?.6:0),E=L,I=Y=>L(Y.label)??0,C=((W=n.verticalAxis)==null?void 0:W.scaleType)==="log",[$,P]=Au(B,(j=n.verticalAxis)==null?void 0:j.range,(ne=n.verticalAxis)==null?void 0:ne.scaleType),M=C?Ka().domain([$,P]).nice().range([y,0]):On().domain([$,P]).nice().range([y,0]),F=M.domain(),V=F[0]<0&&F[1]>0?M(0):void 0;d.attach(m,_),d.update({vertical:{scale:M,height:y,options:{...n.verticalAxis,gridWidth:b,topPadding:x.top}},horizontal:{scale:E,height:y,options:{...n.horizontalAxis,width:b,zeroY:V}}});const G=m.ownerSVGElement,K=Ni(G,t,"plot",{x:0,y:0,width:b,height:y}),ue=Se(m).append("g").attr("clip-path",`url(#${K})`),de=ue.node(),he=((ie=n.colors)==null?void 0:ie[0])??A$,ge=Wl(n.interpolation??"monotoneX"),ee=n.lineSymbols,fe=new yne(Se(de));if(fe.config({xPos:I,y:M,color:he,curve:ge,areaFillOpacity:n.areaFillOpacity??.25,height:y}),i.length>0||r.length>0||s.length>0){const Y=(_==null?void 0:_.dx)??0,X=(_==null?void 0:_.dy)??0,q=de.querySelectorAll(":scope > g");q[0]&&Wo(q[0],r,Y,X),q[1]&&Wo(q[1],i,Y,X),q[2]&&Wo(q[2],s,Y,X)}if(n.valueLabels&&fe.use(m$({position:n.valueLabelPosition,orientation:Kn.Vertical})),fe.draw(k),(ae=n.annotations)!=null&&ae.length&&Um(m,n.annotations,{scaleX:E,scaleY:M,data:k,width:b,height:y,backgroundColor:Mr(t),transition:o,priorAnnotations:c}),Se(de).selectAll(".bc-dot").attr("fill-opacity",0).attr("stroke-opacity",0).attr("pointer-events","none"),n.tooltips||n.crosshair){const Y=k.map(X=>({cx:I(X),cy:M(X.value),label:X.label,value:X.value,color:he}));jm(m,{width:b,height:y,points:Y,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(te=n.verticalAxis)==null?void 0:te.numberFormat,container:t})}if(ee){const Y=k.map((q,re)=>({cx:I(q),cy:M(q.value),color:he,index:re}));let X;a?(m.appendChild(a),X=Se(a)):X=Se(m).append("g").attr("class","bc-symbols"),C2(X,Y,k.length,ee,o)}Jr(t,{chartType:"area",margin:x}),l&&(Or(ue.node()),Lr(t,l))}function M2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name);let o=!1;const r=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{const u=c.values[a]??0;u<0&&(o=!0),l[c.name]=u}),l});return YC().keys(n).order(t0).offset(o?bZ:e0)(r)}function O2(t){const e=t.series??[];if(e.length===0)return[];const n=e.map(s=>s.name),o=t.labels.map((s,a)=>{const l={_index:a};return e.forEach(c=>{l[c.name]=c.values[a]??0}),l}),i=YC().keys(n).order(t0).offset(vZ)(o);for(const s of i)for(const a of s)a[0]*=100,a[1]*=100;return i}const C$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class wne extends co{initialize(){this.configDefine("xPos",{defaultValue:o=>0}),this.configDefine("colors",{defaultValue:C$}),this.configDefine("curve",{defaultValue:i2}),this.configDefine("areaFillOpacity",{defaultValue:.85}),this.configDefine("highlightTargets",{defaultValue:new Set});const e=this.base.append("g"),n=this.base.append("g");this.layer("stacked-areas",e,{dataBind:(o,r)=>o.selectAll(".bc-area").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-area"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("areaFillOpacity"),l=this.config("highlightTargets"),c=l.size>0;o.attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?Dn(l,u.name,a):a).attr("d",u=>Zs().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"merge:transition":o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("areaFillOpacity"),l=this.config("highlightTargets"),c=l.size>0;o.duration(kt()).attr("data-series",u=>u.colorIndex).attr("fill",u=>i[u.colorIndex%i.length]).attr("opacity",u=>c?Dn(l,u.name,a):a).attr("d",u=>Zs().curve(s).x((f,h)=>r(h)).y0(f=>f[0]).y1(f=>f[1])(u.points))},"exit:transition":o=>{o.duration(kt()).attr("opacity",0).remove()}}}),this.layer("line-edges",n,{dataBind:(o,r)=>o.selectAll(".bc-line").data(r,i=>i.name),insert:o=>o.append("path").attr("class","bc-line"),events:{enter:o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("highlightTargets"),l=a.size>0;o.attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?Dn(a,c.name,1):null).attr("d",c=>Ti().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"merge:transition":o=>{const r=this.config("xPos"),i=this.config("colors"),s=this.config("curve"),a=this.config("highlightTargets"),l=a.size>0;o.duration(kt()).attr("data-series",c=>c.colorIndex).attr("fill","none").attr("stroke",c=>i[c.colorIndex%i.length]).attr("stroke-width",1).attr("opacity",c=>l?Dn(a,c.name,1):null).attr("d",c=>Ti().curve(s).x((d,f)=>r(f)).y(d=>d[1])(c.points))},"exit:transition":o=>{o.duration(kt()).attr("opacity",0).remove()}}})}}function _ne(t,e,n={},o=!1){var At,on,Nt,Yt,Fn,Vn,fn,fr,hr;Zr(o),Ym(t);let r=e,i=[],s=[],a=null,l,c;const u=Pr.for(t);if(o){const tt=Qr(t);c=tt==null?void 0:tt.margin,u.detach(),(tt==null?void 0:tt.chartType)==="area-stacked"?(i=Array.from(t.querySelectorAll(".bc-frame .bc-area")),s=Array.from(t.querySelectorAll(".bc-frame .bc-line"))):tt&&(a=Br(t)),l=new Map;for(const Ce of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[Je,Ie]of cr(Ce))l.set(Je,Ie);t.replaceChildren()}const{body:d}=Xr(t,n.frame),f=Im(r.labels,(At=n.horizontalAxis)==null?void 0:At.range);if(f.length<r.labels.length){const tt=f.map(Je=>r.labels[Je]),Ce=(r.series??[]).map(Je=>({...Je,values:f.map(Ie=>Je.values[Ie])}));r={labels:tt,values:f.map(Je=>r.values[Je]),series:Ce}}const h=r.series??[],g=h.filter(tt=>!nl(tt.name,n.seriesOverrides)),v=n.colors??C$,m=g.map(tt=>tt.name),b=n.seriesOverrides,y=ms(n.colorizes),x=n.directLabelling===!0||n.directLabelling==="auto"&&n.legend!==!0||!!n.directLabelling&&n.directLabelling!=="auto",_=x?"direct":n.legend!==!1?"legend":"none",S=m.filter(tt=>Ma(tt,_,b)==="direct"),N=n.legend!==!1&&!x,B=lr(d).width,k=350,L=n.legendPosition??"top",E=B>0&&B<k&&(L==="left"||L==="right")?"top":L,I=n.legendAnchor??"start",C=n.stacked!==!1,$=n.stackPercent===!0||n.stackMode===Tl.Percent,P=n.areaSortMode??Jt.None,M=n.areaLines!==!1,F=[...g];if(P!==Jt.None){const tt=new Map(F.map(Ce=>[Ce.name,Ce.values.reduce((Je,Ie)=>Je+Ie,0)]));F.sort((Ce,Je)=>{const Ie=(tt.get(Ce.name)??0)-(tt.get(Je.name)??0);return P===Jt.Ascending?Ie:-Ie})}const V={labels:r.labels,values:r.values,series:F},G=$?O2(V):M2(V);let K=0;if(C)for(const tt of G)for(const Ce of tt)Ce[1]>K&&(K=Ce[1]);else for(const tt of F)for(const Ce of tt.values)Ce>K&&(K=Ce);$&&(K=100);const ue=[0,K],de=((on=n.verticalAxis)==null?void 0:on.numberFormat)??($?"|d|%":void 0),he=nc(ue,(Nt=n.verticalAxis)==null?void 0:Nt.range,de,(Yt=n.verticalAxis)==null?void 0:Yt.scaleType),ge=Ei(B,(Fn=n.verticalAxis)==null?void 0:Fn.labelPosition,(Vn=n.horizontalAxis)==null?void 0:Vn.labelPosition,(fn=n.verticalAxis)==null?void 0:fn.direction,he),ee=S.length>0?p$(S):0,fe=ge.top!=null,xe=Math.max(0,B-(ge.left??50)-(ge.right??20)-ee),Z=N?tl(m,E,xe):{width:0,height:0},pe=N?Z.height+15:0,oe={...ge};if(N&&E==="top"){const tt=fe?15:0;oe.top=pe+tt}N&&E==="bottom"&&(oe.bottom=(oe.bottom??24)+pe),N&&E==="left"&&(oe.left=(oe.left??50)+Z.width+10),N&&E==="right"&&(oe.right=(oe.right??20)+Z.width+10),ee>0&&(oe.right=(oe.right??20)+ee);const{chartArea:ve,width:ce,height:D,margin:W}=Kr(d,oe),j=Di(c,W),ne=Om().domain(r.labels).range([0,ce]).padding(n.edgePadding?.6:0),ie=ne,ae=tt=>ne(r.labels[tt])??0,te=On().domain([0,K]).nice().range([D,0]);u.attach(ve,j),u.update({vertical:{scale:te,height:D,options:{...n.verticalAxis,numberFormat:de,gridWidth:ce,topPadding:W.top}},horizontal:{scale:ie,height:D,options:{...n.horizontalAxis,width:ce}}});const Y=ve.ownerSVGElement,X=Ni(Y,t,"plot",{x:0,y:0,width:ce,height:D}),q=Se(ve).append("g").attr("clip-path",`url(#${X})`),re=q.node(),me=Wl(n.interpolation??"monotoneX"),we=G.map(tt=>{const Ce=h.findIndex(Ie=>Ie.name===tt.key);let Je;if(C)Je=Array.from(tt).map(Ie=>[te(Ie[0]),te(Ie[1])]);else{const Ie=F.find(ft=>ft.name===tt.key);Je=((Ie==null?void 0:Ie.values)??[]).map(ft=>[te(0),te(ft)])}return{name:tt.key,points:Je,colorIndex:Ce>=0?Ce:0}}),ke=new Set((n.highlights??[]).map(tt=>tt.target)),$e=ke.size>0,De=n.areaFillOpacity!=null?n.areaFillOpacity:.85,He=new wne(Se(re));if(He.config({xPos:ae,colors:v,curve:me,areaFillOpacity:De,highlightTargets:ke}),i.length>0||s.length>0){const tt=(j==null?void 0:j.dx)??0,Ce=(j==null?void 0:j.dy)??0,Je=re.querySelectorAll(":scope > g");Je[0]&&Wo(Je[0],i,tt,Ce),Je[1]&&Wo(Je[1],s,tt,Ce)}if(He.draw(we),Se(re).selectAll(".bc-area").each(function(tt){const Ce=tt,Je=y.get(Ce.name)??ln(Ce.name,Ce.colorIndex,v,b),Ie=o?Se(this).transition().duration(kt()):Se(this);Ie.attr("fill",Je),$e&&Ie.attr("opacity",Dn(ke,Ce.name,De))}),M||Se(re).selectAll(".bc-line").attr("display","none"),Se(re).selectAll(".bc-line").each(function(tt){const Ce=tt,Je=y.get(Ce.name)??ln(Ce.name,Ce.colorIndex,v,b),Ie=A2(Ce.name,n.interpolation??"monotoneX",b),ft=o?Se(this).transition().duration(kt()):Se(this);if(ft.attr("stroke",Je),$e&&ft.attr("opacity",Dn(ke,Ce.name,1)),Ie!==(n.interpolation??"monotoneX")){const cn=Wl(Ie),qn=Ti().curve(cn).x((to,Yn)=>ae(Yn)).y(to=>to[1]);ft.attr("d",qn(Ce.points))}}),(fr=n.annotations)!=null&&fr.length){const tt=r.labels.map((Ce,Je)=>{var Ie;return{label:Ce,value:((Ie=g[0])==null?void 0:Ie.values[Je])??0}});Um(ve,n.annotations,{scaleX:ie,scaleY:te,data:tt,width:ce,height:D,backgroundColor:Mr(t),transition:o,priorAnnotations:l})}if(n.tooltips||n.crosshair){const tt=[];G.forEach(Ce=>{const Je=h.findIndex(Ie=>Ie.name===Ce.key);Array.from(Ce).forEach((Ie,ft)=>{const cn=Ie[1]-Ie[0];tt.push({cx:ae(ft),cy:te(Ie[1]),label:r.labels[ft],value:Math.round(cn*100)/100,series:Ce.key,color:ln(Ce.key,Je,v,b)})})}),jm(ve,{width:ce,height:D,points:tt,tooltip:n.tooltips,crosshair:n.crosshair,crosshairDirection:n.crosshairDirection,crosshairStyle:n.crosshairStyle,crosshairColor:n.crosshairColor,numberFormat:(hr=n.verticalAxis)==null?void 0:hr.numberFormat,container:t})}const Oe=r.labels.length-1,We=ae(Oe)+6,st=[];if(g.forEach((tt,Ce)=>{var to;if(Ma(tt.name,_,b)!=="direct")return;const Ie=G.find(Yn=>Yn.key===tt.name);if(!Ie)return;const ft=Ie[Oe],cn=te((ft[0]+ft[1])/2),qn=((to=b==null?void 0:b.find(Yn=>Yn.name===tt.name))==null?void 0:to.labelText)||tt.name;st.push({name:tt.name,index:Ce,naturalY:cn,text:qn})}),st.length>0){st.sort((Ie,ft)=>Ie.naturalY-ft.naturalY);const tt=st.map(Ie=>Ie.naturalY),Je=T2(tt,0,D,14);st.forEach((Ie,ft)=>{Se(ve).append("text").attr("class","bc-direct-label").attr("data-series",Ie.index).attr("x",We).attr("y",Je[ft]).attr("dy","0.35em").attr("font-size","11px").attr("fill",ln(Ie.name,Ie.index,v,b)).text(Ie.text)})}const lt=m.filter(tt=>Ma(tt,_,b)==="legend");if(N&<.length>0){const tt=lt.map(Ie=>{const ft=h.findIndex(cn=>cn.name===Ie);return ln(Ie,ft,v,b)});let Ce=0,Je=0;if(E==="top"){const Ie=fe?15:0;Je=-(Z.height+10+Ie)}else E==="bottom"?Je=D+25:E==="left"?Ce=-(Z.width+10):E==="right"&&(Ce=ce+10);Za(ve,lt,tt,Je,E,I,ce,D,Ce,[],{left:W.left,right:W.right})}Jr(t,{chartType:"area-stacked",margin:W}),a&&(Or(q.node()),Lr(t,a))}const $$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"];class kne extends co{initialize(){this.configDefine("x",{defaultValue:Jn()}),this.configDefine("y",{defaultValue:On()}),this.configDefine("colors",{defaultValue:$$});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors");n.duration(kt()).attr("data-series",s=>s.seriesName).attr("x",s=>o(s.label)??0).attr("y",s=>r(s.y1)).attr("width",o.bandwidth()).attr("height",s=>r(s.y0)-r(s.y1)).attr("fill",s=>i[s.seriesIndex%i.length])},"exit:transition":n=>{n.duration(kt()).attr("opacity",0).remove()}}})}}function Sne(t,e,n){const o=[];for(const r of t){const i=r.key,s=n.findIndex(a=>a.name===i);for(let a=0;a<r.length;a++){const l=r[a];o.push({label:e[a],seriesName:i,seriesIndex:s,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return o}function Ane(t,e,n={},o=!1){var te,Y,X,q,re,me,we,ke;Zr(o);let r=[],i=null,s,a;const l=Pr.for(t);if(o){const $e=Qr(t);a=$e==null?void 0:$e.margin,l.detach(),($e==null?void 0:$e.chartType)==="column-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):$e&&(i=Br(t)),s=new Map;for(const De of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[He,Oe]of cr(De))s.set(He,Oe);t.replaceChildren()}const{body:c}=Xr(t,n.frame),u=e.series??[],d=u.filter($e=>!nl($e.name,n.seriesOverrides)),f=d.map($e=>$e.name),h=n.colors??$$,g=n.seriesOverrides,v=n.legend!==!1,m=lr(c).width,b=350,y=n.legendPosition??"top",x=m>0&&m<b&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",S={labels:e.labels,values:e.values,series:d},N=n.stackMode===Tl.Percent,B=N?O2(S):M2(S),k=Sne(B,e.labels,u),L=N?100:Fl(k,$e=>$e.y1)??0,I=nc([0,L],(te=n.verticalAxis)==null?void 0:te.range,(Y=n.verticalAxis)==null?void 0:Y.numberFormat,(X=n.verticalAxis)==null?void 0:X.scaleType),C=Ei(m,(q=n.verticalAxis)==null?void 0:q.labelPosition,(re=n.horizontalAxis)==null?void 0:re.labelPosition,(me=n.verticalAxis)==null?void 0:me.direction,I),$=Math.max(0,m-(C.left??50)-(C.right??20)),P=a2(e.labels,$,n.horizontalAxis);P!==void 0&&(C.bottom=P);const M=C.top!=null,F=Math.max(0,m-(C.left??50)-(C.right??20)),V=v?tl(f,x,F):{width:0,height:0},G=v?V.height+15:0,K={...C};if(v&&x==="top"){const $e=M?15:0;K.top=G+$e}v&&x==="bottom"&&(K.bottom=(K.bottom??24)+G),v&&x==="left"&&(K.left=(K.left??50)+V.width+10),v&&x==="right"&&(K.right=(K.right??20)+V.width+10);const{chartArea:ue,width:de,height:he,margin:ge}=Kr(c,K),ee=Di(a,ge);let fe=e.labels;if(n.sortMode==="total"){const $e=e.labels.map((De,He)=>({label:De,index:He,total:d.reduce((Oe,We)=>Oe+(We.values[He]??0),0)}));$e.sort((De,He)=>He.total-De.total),fe=$e.map(De=>De.label)}const xe=Jn().domain(fe).range([0,de]).padding(rc(n.barGap)),Z=On().domain([0,L]).nice().range([he,0]);l.attach(ue,ee),l.update({vertical:{scale:Z,height:he,options:{...n.verticalAxis,gridWidth:de,topPadding:ge.top}},horizontal:{scale:xe,height:he,options:{...n.horizontalAxis,width:de}}});const pe=ue.ownerSVGElement,oe=Ni(pe,t,"bars",{x:0,y:0,width:de,height:he}),ve=Se(ue).append("g").attr("clip-path",`url(#${oe})`),ce=fe===e.labels?k:fe.flatMap($e=>k.filter(De=>De.label===$e)),D=new kne(ve);if(D.config({x:xe,y:Z,colors:h}),r.length>0){const $e=ve.node().querySelector("g");Wo($e,r,(ee==null?void 0:ee.dx)??0,(ee==null?void 0:ee.dy)??0)}if(n.tooltips&&D.use(Qa({numberFormat:(we=n.verticalAxis)==null?void 0:we.numberFormat})),n.crosshair&&D.use(ic({width:de,height:he,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor})),(ke=n.annotations)!=null&&ke.length){const $e=e.labels.map((De,He)=>({label:De,value:d.reduce((Oe,We)=>Oe+(We.values[He]??0),0)}));D.use($u(n.annotations,{scaleX:xe,scaleY:Z,data:$e,width:de,height:he,backgroundColor:Mr(t),transition:o,priorAnnotations:s}))}D.draw(ce),Jr(t,{chartType:"column-stacked",margin:ge}),i&&(Or(ve.node()),Lr(t,i));const W=ms(n.colorizes),j=Pu(n.highlights);Se(ue).selectAll(".bc-bar-stacked").each(function($e){const De=$e,He=W.get(De.seriesName)??ln(De.seriesName,De.seriesIndex,h,g),Oe=Pf(De.seriesName,g),We=o?Se(this).transition().duration(kt()):Se(this);We.attr("fill",He),Oe<1&&We.attr("fill-opacity",Oe),j.size>0&&We.attr("opacity",Dn(j,De.seriesName))});const ne=n.valueLabels??!1,ie=DA(ce,$e=>Fl($e,De=>De.y1)??0,$e=>$e.label),ae=Se(ue).append("g").attr("class","bc-value-labels");if(ce.forEach($e=>{if(!Du($e.seriesName,ne,g))return;const De=(xe($e.label)??0)+xe.bandwidth()/2,He=Z($e.y0)-(Z($e.y0)-Z($e.y1))/2;ae.append("text").attr("class","bc-value-label").attr("data-series",$e.seriesName).attr("x",De).attr("y",He).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(N?`${Math.round($e.value)}%`:n.valueLabels==="percent"?Dm($e.value,ie.get($e.label)??0):String(Math.round($e.value*100)/100))}),v&&f.length>0){const $e=f.map(Oe=>{const We=u.findIndex(st=>st.name===Oe);return ln(Oe,We,h,g)});let De=0,He=0;if(x==="top"){const Oe=M?15:0;He=-(V.height+10+Oe)}else x==="bottom"?He=he+25:x==="left"?De=-(V.width+10):x==="right"&&(De=de+10);Za(ue,f,$e,He,x,_,de,he,De,[],{left:ge.left,right:ge.right})}}const T$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],_6=13;class Cne extends co{initialize(){this.configDefine("x",{defaultValue:On()}),this.configDefine("y",{defaultValue:Jn()}),this.configDefine("colors",{defaultValue:T$}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-stacked").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-stacked"),events:{enter:n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y"),i=this.config("colors"),s=this.config("categoryLabelOffset");n.duration(kt()).attr("data-series",a=>a.seriesName).attr("x",a=>o(a.y0)).attr("y",a=>(r(a.label)??0)+s).attr("width",a=>o(a.y1)-o(a.y0)).attr("height",Math.max(0,r.bandwidth()-s)).attr("fill",a=>i[a.seriesIndex%i.length])},"exit:transition":n=>{n.duration(kt()).attr("opacity",0).remove()}}})}}function $ne(t,e,n){const o=[];for(const r of t){const i=r.key,s=n.findIndex(a=>a.name===i);for(let a=0;a<r.length;a++){const l=r[a];o.push({label:e[a],seriesName:i,seriesIndex:s,y0:l[0],y1:l[1],value:l[1]-l[0]})}}return o}function Tne(t,e,n={},o=!1){var re,me,we,ke,$e,De,He;Zr(o);let r=[],i=null,s,a;const l=Pr.for(t);if(o){const Oe=Qr(t);a=Oe==null?void 0:Oe.margin,l.detach(),(Oe==null?void 0:Oe.chartType)==="bar-stacked"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-stacked")):Oe&&(i=Br(t)),s=new Map;for(const We of t.querySelectorAll(".bc-frame .bc-annotations, .bc-frame .bc-annotations-range"))for(const[st,lt]of cr(We))s.set(st,lt);t.replaceChildren()}const{body:c}=Xr(t,n.frame),u=e.series??[],d=u.filter(Oe=>!nl(Oe.name,n.seriesOverrides)),f=d.map(Oe=>Oe.name),h=n.colors??T$,g=n.seriesOverrides,v=n.legend!==!1,m=lr(c).width,b=350,y=n.legendPosition??"top",x=m>0&&m<b&&(y==="left"||y==="right")?"top":y,_=n.legendAnchor??"start",S={labels:e.labels,values:e.values,series:d},N=n.stackMode===Tl.Percent,B=N?O2(S):M2(S),k=$ne(B,e.labels,u),L=N?100:Fl(k,Oe=>Oe.y1)??0,E=n.categoryLabelLine===!0,I=Em(e.labels),C=E?rn.Off:(re=n.verticalAxis)==null?void 0:re.labelPosition,$=Ei(m,C,(me=n.horizontalAxis)==null?void 0:me.labelPosition,(we=n.verticalAxis)==null?void 0:we.direction,I,(ke=n.horizontalAxis)==null?void 0:ke.showAxis),P=$.top!=null,M=Math.max(0,m-($.left??50)-($.right??20)),F=v?tl(f,x,M):{width:0,height:0},V=v?F.height+15:0,G={...$};if(v&&x==="top"){const Oe=P?15:0;G.top=V+Oe}v&&x==="bottom"&&(G.bottom=(G.bottom??24)+V),v&&x==="left"&&(G.left=(G.left??50)+F.width+10),v&&x==="right"&&(G.right=(G.right??20)+F.width+10);const{chartArea:K,width:ue,height:de,margin:he}=Kr(c,G),ge=Di(a,he);let ee=e.labels;if(n.sortMode==="total"){const Oe=e.labels.map((We,st)=>({label:We,index:st,total:d.reduce((lt,At)=>lt+(At.values[st]??0),0)}));Oe.sort((We,st)=>st.total-We.total),ee=Oe.map(We=>We.label)}const fe=On().domain([0,L]).nice().range([0,ue]),xe=Jn().domain(ee).range([0,de]).padding(rc(n.barGap));l.attach(K,ge),l.update({horizontal:{scale:fe,height:de,options:{...n.horizontalAxis,width:ue}},vertical:{scale:xe,height:de,options:{...n.verticalAxis,labelPosition:E?rn.Off:($e=n.verticalAxis)==null?void 0:$e.labelPosition,topPadding:he.top}},order:"horizontal-first"});const Z=K.ownerSVGElement,pe=Ni(Z,t,"bars",{x:0,y:0,width:ue,height:de}),oe=Se(K).append("g").attr("clip-path",`url(#${pe})`),ve=ee===e.labels?k:ee.flatMap(Oe=>k.filter(We=>We.label===Oe)),ce=E?_6:0,D=new Cne(oe);if(D.config({x:fe,y:xe,colors:h,categoryLabelOffset:ce}),r.length>0){const Oe=oe.node().querySelector("g");Wo(Oe,r,(ge==null?void 0:ge.dx)??0,(ge==null?void 0:ge.dy)??0)}if(n.tooltips&&D.use(Qa({numberFormat:(De=n.verticalAxis)==null?void 0:De.numberFormat})),n.crosshair&&D.use(ic({width:ue,height:de,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Kn.Horizontal})),(He=n.annotations)!=null&&He.length){const Oe=e.labels.map((We,st)=>({label:We,value:d.reduce((lt,At)=>lt+(At.values[st]??0),0)}));D.use($u(n.annotations,{scaleX:xe,scaleY:fe,data:Oe,width:ue,height:de,backgroundColor:Mr(t),orientation:Kn.Horizontal,transition:o,priorAnnotations:s}))}D.draw(ve),Jr(t,{chartType:"bar-stacked",margin:he}),i&&(Or(oe.node()),Lr(t,i));const W=ms(n.colorizes),j=Pu(n.highlights);if(Se(K).selectAll(".bc-bar-stacked").each(function(Oe){const We=Oe,st=W.get(We.seriesName)??ln(We.seriesName,We.seriesIndex,h,g),lt=Pf(We.seriesName,g),At=o?Se(this).transition().duration(kt()):Se(this);At.attr("fill",st),lt<1&&At.attr("fill-opacity",lt),j.size>0&&At.attr("opacity",Dn(j,We.seriesName))}),E){const Oe=Se(K).append("g").attr("class","bc-category-labels");for(const We of ee){const st=xe(We)??0;Oe.append("text").attr("class","bc-category-label").attr("x",2).attr("y",st+_6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(We)}}const ne=n.valueLabels??!1,ie=n.valueLabelPosition??xt.Auto,ae=new Set,te=new Map;for(const Oe of ee){const We=ve.filter(st=>st.label===Oe).sort((st,lt)=>st.y1-lt.y1);if(We.length>0){const st=We[We.length-1];ae.add(st.label+"\0"+st.seriesName);for(let lt=0;lt<We.length-1;lt++){const At=We[lt].label+"\0"+We[lt].seriesName;te.set(At,fe(We[lt+1].y1)-fe(We[lt].y1))}}}const Y=new Map,X=DA(ve,Oe=>Fl(Oe,We=>We.y1)??0,Oe=>Oe.label),q=Se(K).append("g").attr("class","bc-value-labels");if(ve.forEach(Oe=>{if(!Du(Oe.seriesName,ne,g))return;const We=N?`${Math.round(Oe.value)}%`:n.valueLabels==="percent"?Dm(Oe.value,X.get(Oe.label)??0):String(Math.round(Oe.value*100)/100),st=fe(Oe.y1)-fe(Oe.y0),lt=We.length*6.5+8,At=st>=lt,on=(xe(Oe.label)??0)+ce+(xe.bandwidth()-ce)/2,Nt=ln(Oe.seriesName,Oe.seriesIndex,h,g),Yt=ae.has(Oe.label+"\0"+Oe.seriesName),Fn=ie===xt.Outside||ie===xt.Auto&&!At&&Yt,Vn=()=>{const fn=fe(Oe.y0)+st/2;q.append("text").attr("class","bc-value-label").attr("data-series",Oe.seriesName).attr("opacity",0).attr("x",fn).attr("y",on).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Tr(Nt)).text(We)};if(Fn)if(ie===xt.Inside)Vn();else{const fn=fe(Oe.y1)+4,fr=Y.get(Oe.label)??0,hr=te.get(Oe.label+"\0"+Oe.seriesName),tt=fn<fr,Ce=hr!==void 0&<+4>hr,Je=ue+he.right-2,Ie=fn+lt>Je;tt||Ce||Ie?Vn():(Y.set(Oe.label,fn+lt),q.append("text").attr("class","bc-value-label").attr("data-series",Oe.seriesName).attr("x",fn).attr("y",on).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","11px").attr("fill","currentColor").text(We))}else if(!At)Vn();else{const fn=fe(Oe.y0)+st/2;q.append("text").attr("class","bc-value-label").attr("data-series",Oe.seriesName).attr("x",fn).attr("y",on).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("fill",Tr(Nt)).text(We)}}),v&&f.length>0){const Oe=f.map(lt=>{const At=u.findIndex(on=>on.name===lt);return ln(lt,At,h,g)});let We=0,st=0;if(x==="top"){const lt=P?15:0;st=-(F.height+10+lt)}else x==="bottom"?st=de+25:x==="left"?We=-(F.width+10):x==="right"&&(We=ue+10);Za(K,f,Oe,st,x,_,ue,de,We,[],{left:he.left,right:he.right})}}const M$=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],k6=16,_h=20,S6=13;class Mne extends co{initialize(){this.configDefine("y",{defaultValue:Jn()}),this.configDefine("colors",{defaultValue:M$}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-split").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-split"),events:{enter:n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"merge:transition":n=>{const o=this.config("y"),r=this.config("colors"),i=this.config("categoryLabelOffset");n.duration(kt()).attr("data-series",s=>s.seriesName).attr("x",s=>s.xPos).attr("y",s=>(o(s.label)??0)+i).attr("width",s=>s.barWidth).attr("height",Math.max(0,o.bandwidth()-i)).attr("fill",s=>r[s.seriesIndex%r.length])},"exit:transition":n=>{n.duration(kt()).attr("opacity",0).remove()}}})}}function One(t,e,n,o){const r=t.length;if(r===0)return[];const i=Math.max(0,(n-(r-1)*k6)/r),s=o?Fl(t.flatMap(a=>a.values))??0:0;return t.map((a,l)=>{const c=o?s:Fl(a.values)??0,u=On().domain([0,c]).nice().range([0,i]);return{seriesName:a.name,seriesIndex:e.findIndex(d=>d.name===a.name),xOffset:l*(i+k6),panelWidth:i,xScale:u}})}function Bne(t,e,n,o){const r=[];for(const i of t){const s=o.find(a=>a.name===i.seriesName);if(s)for(const a of e){const l=n.indexOf(a),c=l>=0?s.values[l]??0:0,u=Math.max(0,i.xScale(c)-i.xScale(0));r.push({label:a,seriesName:i.seriesName,seriesIndex:i.seriesIndex,value:c,xPos:i.xOffset,barWidth:u})}}return r}function Lne(t,e,n={},o=!1){var W,j,ne,ie,ae,te;Zr(o);let r=[],i=null,s;const a=Pr.for(t);if(o){const Y=Qr(t);s=Y==null?void 0:Y.margin,a.detach(),(Y==null?void 0:Y.chartType)==="bar-split"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-split")):Y&&(i=Br(t)),t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter(Y=>!nl(Y.name,n.seriesOverrides)),d=u.map(Y=>Y.name),f=n.colors??M$,h=n.seriesOverrides,g=n.legend!==!1,v=lr(l).width,m=350,b=n.legendPosition??"top",y=v>0&&v<m&&(b==="left"||b==="right")?"top":b,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,S=Em(e.labels),N=_?rn.Off:(W=n.verticalAxis)==null?void 0:W.labelPosition,B=Ei(v,N,(j=n.horizontalAxis)==null?void 0:j.labelPosition,(ne=n.verticalAxis)==null?void 0:ne.direction,S,(ie=n.horizontalAxis)==null?void 0:ie.showAxis);B.top=(B.top??12)+_h;const k=Math.max(0,v-(B.left??50)-(B.right??20)),L=g?tl(d,y,k):{width:0,height:0},E=g?L.height+15:0,I={...B};g&&y==="top"&&(I.top=E+_h),g&&y==="bottom"&&(I.bottom=(I.bottom??24)+E),g&&y==="left"&&(I.left=(I.left??50)+L.width+10),g&&y==="right"&&(I.right=(I.right??20)+L.width+10);const{chartArea:C,width:$,height:P,margin:M}=Kr(l,I),F=Di(s,M);let V=e.labels;if(n.sortMode==="total"){const Y=e.labels.map((X,q)=>({label:X,total:u.reduce((re,me)=>re+(me.values[q]??0),0)}));Y.sort((X,q)=>q.total-X.total),V=Y.map(X=>X.label)}const G=Jn().domain(V).range([0,P]).padding(rc(n.barGap)),K=_?S6:0;a.attach(C,F),a.update({vertical:{scale:G,height:P,options:{...n.verticalAxis,labelPosition:_?rn.Off:(ae=n.verticalAxis)==null?void 0:ae.labelPosition,topPadding:M.top}},order:"horizontal-first"});const ue=n.sharedScale===!0,de=One(u,c,$,ue),he=C.ownerSVGElement,ge=Ni(he,t,"bars",{x:0,y:0,width:$,height:P}),ee=Se(C).append("g").attr("clip-path",`url(#${ge})`),fe=Se(C).append("g").attr("class","bc-split-headers");for(const Y of de)fe.append("text").attr("class","bc-split-header").attr("x",Y.xOffset+Y.panelWidth/2).attr("y",-_h/2).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size","11px").attr("font-weight","600").attr("fill","currentColor").text(Y.seriesName);const xe=Bne(de,V,e.labels,c),Z=new Mne(ee);if(Z.config({y:G,colors:f,categoryLabelOffset:K}),r.length>0){const Y=ee.node().querySelector("g");Wo(Y,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}n.tooltips&&Z.use(Qa({numberFormat:(te=n.verticalAxis)==null?void 0:te.numberFormat})),n.crosshair&&Z.use(ic({width:$,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Kn.Horizontal})),Z.draw(xe);const pe=Pu(n.highlights);Jr(t,{chartType:"bar-split",margin:M}),i&&(Or(ee.node()),Lr(t,i));const oe=ms(n.colorizes);if(Se(C).selectAll(".bc-bar-split").each(function(Y){const X=Y,q=oe.get(X.seriesName)??ln(X.seriesName,X.seriesIndex,f,h),re=Pf(X.seriesName,h),me=o?Se(this).transition().duration(kt()):Se(this);me.attr("fill",q),re<1&&me.attr("fill-opacity",re),pe.size>0&&me.attr("opacity",Dn(pe,X.seriesName))}),_){const Y=Se(C).append("g").attr("class","bc-category-labels");for(const X of V){const q=G(X)??0;Y.append("text").attr("class","bc-category-label").attr("x",2).attr("y",q+S6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(X)}}const ve=n.valueLabels??!0,ce=n.valueLabelPosition??xt.Auto,D=Se(C).append("g").attr("class","bc-value-labels");if(xe.forEach(Y=>{if(!Du(Y.seriesName,ve,h))return;const X=de.find(Oe=>Oe.seriesName===Y.seriesName);if(!X)return;const q=ln(Y.seriesName,Y.seriesIndex,f,h),re=Y.xPos+Y.barWidth,me=Math.max(0,G.bandwidth()-K),we=(G(Y.label)??0)+K+me/2,ke=ce===xt.Inside||ce===xt.Auto&&Y.barWidth>30;let $e,De,He;if(ke)$e=re-4,De="end",He=Tr(q);else{const Oe=re+4,We=X.xOffset+X.panelWidth;Oe+20>We?($e=Y.xPos-4,De="end"):($e=Oe,De="start"),He="currentColor"}D.append("text").attr("class","bc-value-label").attr("data-series",Y.seriesName).attr("x",$e).attr("y",we).attr("text-anchor",De).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",He).text(String(Y.value))}),g&&d.length>0){const Y=d.map(re=>{const me=c.findIndex(we=>we.name===re);return ln(re,me,f,h)});let X=0,q=0;y==="top"?q=-(L.height+10+_h):y==="bottom"?q=P+25:y==="left"?X=-(L.width+10):y==="right"&&(X=$+10),Za(C,d,Y,q,y,x,$,P,X,[],{left:M.left,right:M.right})}}const tb=["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"],A6=13;class Pne extends co{initialize(){this.configDefine("x",{defaultValue:On()}),this.configDefine("y0",{defaultValue:Jn()}),this.configDefine("y1",{defaultValue:Jn()}),this.configDefine("colors",{defaultValue:tb}),this.configDefine("categoryLabelOffset",{defaultValue:0});const e=this.base.append("g");this.layer("bars",e,{dataBind:(n,o)=>n.selectAll(".bc-bar-grouped").data(o,r=>r.label+"\0"+r.seriesName),insert:n=>n.append("rect").attr("class","bc-bar bc-bar-grouped"),events:{enter:n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"merge:transition":n=>{const o=this.config("x"),r=this.config("y0"),i=this.config("y1"),s=this.config("colors"),a=this.config("categoryLabelOffset");n.duration(kt()).attr("data-series",l=>l.seriesName).attr("x",o(0)).attr("y",l=>(r(l.label)??0)+a+(i(l.seriesName)??0)).attr("width",l=>Math.max(0,o(l.value)-o(0))).attr("height",i.bandwidth()).attr("fill",l=>s[l.seriesIndex%s.length])},"exit:transition":n=>{n.duration(kt()).attr("opacity",0).remove()}}})}}function Dne(t,e,n={},o=!1){var j,ne,ie,ae,te,Y;Zr(o);let r=[],i=null,s;const a=Pr.for(t);if(o){const X=Qr(t);s=X==null?void 0:X.margin,a.detach(),(X==null?void 0:X.chartType)==="bar-grouped"?r=Array.from(t.querySelectorAll(".bc-frame .bc-bar-grouped")):X&&(i=Br(t)),t.replaceChildren()}const{body:l}=Xr(t,n.frame),c=e.series??[],u=c.filter(X=>!nl(X.name,n.seriesOverrides)),d=u.map(X=>X.name),f=n.colors??tb,h=n.seriesOverrides,g=n.legend!==!1,v=lr(l).width,m=350,b=n.legendPosition??"top",y=v>0&&v<m&&(b==="left"||b==="right")?"top":b,x=n.legendAnchor??"start",_=n.categoryLabelLine===!0,S=Em(e.labels),N=_?rn.Off:(j=n.verticalAxis)==null?void 0:j.labelPosition,B=Ei(v,N,(ne=n.horizontalAxis)==null?void 0:ne.labelPosition,(ie=n.verticalAxis)==null?void 0:ie.direction,S,(ae=n.horizontalAxis)==null?void 0:ae.showAxis),k=Math.max(0,v-(B.left??50)-(B.right??20)),L=g?tl(d,y,k):{width:0,height:0},E=g?L.height+15:0,I={...B};g&&y==="top"&&(I.top=E),g&&y==="bottom"&&(I.bottom=(I.bottom??24)+E),g&&y==="left"&&(I.left=(I.left??50)+L.width+10),g&&y==="right"&&(I.right=(I.right??20)+L.width+10);const{chartArea:C,width:$,height:P,margin:M}=Kr(l,I),F=Di(s,M);let V=e.labels;if(n.sortMode==="total"){const X=e.labels.map((q,re)=>({label:q,total:u.reduce((me,we)=>me+(we.values[re]??0),0)}));X.sort((q,re)=>re.total-q.total),V=X.map(q=>q.label)}const G=Jn().domain(V).range([0,P]).paddingInner(rc(n.barGap)).paddingOuter(.05),K=_?A6:0,ue=Math.max(0,G.bandwidth()-K),de=Jn().domain(d).range([0,ue]).padding(.05),he=Fl(u.flatMap(X=>X.values))??0,ge=On().domain([0,he]).nice().range([0,$]);a.attach(C,F),a.update({vertical:{scale:G,height:P,options:{...n.verticalAxis,labelPosition:_?rn.Off:(te=n.verticalAxis)==null?void 0:te.labelPosition,topPadding:M.top}},horizontal:{scale:ge,height:P,options:{...n.horizontalAxis,width:$}},order:"horizontal-first"});const ee=C.ownerSVGElement,fe=Ni(ee,t,"bars",{x:0,y:0,width:$,height:P}),xe=Se(C).append("g").attr("clip-path",`url(#${fe})`);if(n.barBackground){const X=(n.colors??tb)[0];xe.selectAll(".bc-bar-bg").data(V,q=>q).enter().append("rect").attr("class","bc-bar-bg").attr("x",0).attr("y",q=>(G(q)??0)+K).attr("width",$).attr("height",G.bandwidth()-K).attr("fill",X).attr("opacity",.18)}if(n.barSeparators&&V.length>1){const X=G.step();for(let q=1;q<V.length;q++){const re=(G(V[q-1])??0)+G.bandwidth()+(X-G.bandwidth())/2;xe.append("line").attr("class","bc-bar-separator").attr("x1",0).attr("x2",$).attr("y1",re).attr("y2",re).attr("stroke","currentColor").attr("opacity",.15)}}const Z=[];for(const X of V){const q=e.labels.indexOf(X);for(const re of u){const me=c.findIndex(we=>we.name===re.name);Z.push({label:X,seriesName:re.name,seriesIndex:me,value:q>=0?re.values[q]??0:0})}}const pe=new Pne(xe);pe.config({x:ge,y0:G,y1:de,colors:f,categoryLabelOffset:K});const oe=Pu(n.highlights);if(r.length>0){const X=xe.node().querySelector("g");Wo(X,r,(F==null?void 0:F.dx)??0,(F==null?void 0:F.dy)??0)}n.tooltips&&pe.use(Qa({numberFormat:(Y=n.verticalAxis)==null?void 0:Y.numberFormat})),n.crosshair&&pe.use(ic({width:$,height:P,direction:n.crosshairDirection,style:n.crosshairStyle,color:n.crosshairColor,orientation:Kn.Horizontal})),pe.draw(Z),Jr(t,{chartType:"bar-grouped",margin:M}),i&&(Or(xe.node()),Lr(t,i));const ve=ms(n.colorizes);if(Se(C).selectAll(".bc-bar-grouped").each(function(X){const q=X,re=ve.get(q.seriesName)??ln(q.seriesName,q.seriesIndex,f,h),me=Pf(q.seriesName,h),we=o?Se(this).transition().duration(kt()):Se(this);we.attr("fill",re),me<1&&we.attr("fill-opacity",me),oe.size>0&&we.attr("opacity",Dn(oe,q.seriesName))}),_){const X=Se(C).append("g").attr("class","bc-category-labels");for(const q of V){const re=G(q)??0;X.append("text").attr("class","bc-category-label").attr("x",2).attr("y",re+A6/2).attr("text-anchor","start").attr("dominant-baseline","central").attr("font-size","10px").attr("font-weight","600").attr("fill","currentColor").text(q)}}const ce=n.valueLabels??!0,D=n.valueLabelPosition??xt.Auto,W=Se(C).append("g").attr("class","bc-value-labels");if(Z.forEach(X=>{if(!Du(X.seriesName,ce,h))return;const q=ln(X.seriesName,X.seriesIndex,f,h),re=Math.max(0,ge(X.value)-ge(0)),me=ge(0)+re,we=(G(X.label)??0)+K+(de(X.seriesName)??0)+de.bandwidth()/2,ke=D===xt.Inside||D===xt.Auto&&re>30;let $e,De,He;ke?($e=me-4,De="end",He=Tr(q)):($e=me+4,De="start",He="currentColor"),W.append("text").attr("class","bc-value-label").attr("data-series",X.seriesName).attr("x",$e).attr("y",we).attr("text-anchor",De).attr("dominant-baseline","central").attr("font-size","11px").attr("fill",He).text(String(X.value))}),g&&d.length>0){const X=d.map(me=>{const we=c.findIndex(ke=>ke.name===me);return ln(me,we,f,h)});let q=0,re=0;y==="top"?re=-(L.height+10):y==="bottom"?re=P+25:y==="left"?q=-(L.width+10):y==="right"&&(q=$+10),Za(C,d,X,re,y,x,$,P,q,[],{left:M.left,right:M.right})}}const B2=new Map;function Go(t,e,n){B2.set(t,{renderer:e,options:n})}function Ene(t){var e;return(e=B2.get(t))==null?void 0:e.renderer}function du(t){var e;return((e=B2.get(t))==null?void 0:e.options)??[]}const C6=[{value:Un.Solid,text:"Solid"},{value:Un.Dashed,text:"Dashed"},{value:Un.Dotted,text:"Dotted"},{value:Un.None,text:"None"}],qo={key:"colors",type:Qe.Colors,label:"Colors"},Yo={key:"colorPalette",type:Qe.Select,label:"Color palette",default:"Blueprint",choices:[{value:"",text:"Custom"},...i5().map(t=>({value:t.name,text:t.label}))]},jo={key:"autoContrast",type:Qe.Boolean,label:"Auto-adjust contrast",default:!1},Xo={key:"allowDarkMode",type:Qe.Boolean,label:"Allow dark mode",default:!0},Eu={key:"legend",type:Qe.Boolean,label:"Show legend",default:!0},aa={key:"legendPosition",type:Qe.Select,label:"Legend position",default:Ac.Top,choices:[{value:Ac.Top,text:"Top"},{value:Ac.Bottom,text:"Bottom"},{value:Ac.Left,text:"Left"},{value:Ac.Right,text:"Right"}]},la={key:"legendAnchor",type:Qe.Select,label:"Legend anchor",default:Is.Start,choices:[{value:Is.Start,text:"Start"},{value:Is.Middle,text:"Middle"},{value:Is.End,text:"End"}]},Xm={key:"directLabelling",type:Qe.Select,label:"Direct labelling",default:$o.Off,choices:[{value:$o.Off,text:"Off"},{value:$o.Auto,text:"Auto"},{value:$o.Outside,text:"Outside"},{value:$o.Inside,text:"Inside"}]},L2={key:"directLabelAnchor",type:Qe.Select,label:"Label anchor",default:Is.Middle,choices:[{value:Is.Start,text:"Start"},{value:Is.Middle,text:"Middle"},{value:Is.End,text:"End"}]},Km={key:"valueLabels",type:Qe.Boolean,label:"Value labels",default:!1},Zm={key:"valueLabelPosition",type:Qe.Select,label:"Label position",default:xt.Auto,choices:[{value:xt.Auto,text:"Auto"},{value:xt.Outside,text:"Outside"},{value:xt.Inside,text:"Inside"}]},ca={key:"tooltips",type:Qe.Boolean,label:"Tooltips",default:!1},O$={key:"crosshair",type:Qe.Boolean,label:"Crosshair",default:!1},B$={key:"crosshairDirection",type:Qe.Select,label:"Crosshair direction",default:Co.Both,choices:[{value:Co.Both,text:"Both"},{value:Co.Vertical,text:"Vertical"},{value:Co.Horizontal,text:"Horizontal"}]},L$={key:"crosshairStyle",type:Qe.Select,label:"Crosshair style",default:di.Dashed,choices:[{value:di.Solid,text:"Solid"},{value:di.Dashed,text:"Dashed"},{value:di.Dotted,text:"Dotted"}]},P$={key:"crosshairColor",type:Qe.Text,label:"Crosshair color",default:"#999",placeholder:"#999"},D$={key:"lineSymbols",type:Qe.Boolean,label:"Show line symbols",default:!1},E$={key:"lineSymbolShape",type:Qe.Select,label:"Symbol",default:vr.Circle,choices:[{value:vr.Circle,text:"Circle"},{value:vr.Square,text:"Square"},{value:vr.Diamond,text:"Diamond"},{value:vr.Triangle,text:"Triangle Up"},{value:vr.TriangleDown,text:"Triangle Down"},{value:vr.Cross,text:"Cross"},{value:vr.Star,text:"Star"}]},N$={key:"lineSymbolShowOn",type:Qe.Select,label:"Show on",default:yr.FirstLast,choices:[{value:yr.FirstLast,text:"First & Last"},{value:yr.First,text:"First"},{value:yr.Last,text:"Last"},{value:yr.All,text:"All"}]},I$={key:"lineSymbolStyle",type:Qe.Select,label:"Style",default:Ro.Filled,choices:[{value:Ro.Filled,text:"Filled"},{value:Ro.Hollow,text:"Hollow"}]},R$={key:"lineSymbolSize",type:Qe.Text,label:"Size",default:"3.5",placeholder:"3.5"},F$={key:"lineSymbolOpacity",type:Qe.Text,label:"Opacity",default:"1",placeholder:"1"},Df={key:"sortMode",type:Qe.Select,label:"Sort mode",default:ui.None,choices:[{value:ui.None,text:"None"},{value:ui.Total,text:"By total"},{value:ui.WithinGroups,text:"Within groups"}]},Qm={key:"edgePadding",type:Qe.Boolean,label:"Edge padding",default:!1},Jm={key:"waterfall",type:Qe.Boolean,label:"Waterfall",default:!1},eg={key:"waterfallTotal",type:Qe.Boolean,label:"Waterfall total",default:!1},Ef={key:"barBackground",type:Qe.Boolean,label:"Bar background",default:!1},tg={key:"barGap",type:Qe.Text,label:"Bar gap",default:String(of),placeholder:String(of)},Nf={key:"barSeparators",type:Qe.Boolean,label:"Bar separators",default:!1},ng={key:"connectedColumns",type:Qe.Boolean,label:"Connected columns",default:!1},og={key:"connectionsOpacity",type:Qe.Text,label:"Opacity",default:"0.15",placeholder:"0.15"},rg={key:"swapLabelValue",type:Qe.Boolean,label:"Swap labels and values",default:!1},V$={key:"stackMode",type:Qe.Select,label:"Stack mode",default:Tl.Normal,choices:[{value:Tl.Normal,text:"Normal"},{value:Tl.Percent,text:"Percentage (100%)"}]},Nne={key:"sharedScale",type:Qe.Boolean,label:"Shared scale",default:!1},ac={key:"categoryLabelLine",type:Qe.Boolean,label:"Labels on separate line",default:!1},z$={key:"displayAsPercentage",type:Qe.Boolean,label:"Display as percentage",default:!1},H$={key:"showTotal",type:Qe.Boolean,label:"Show total",default:!1},W$={key:"showLabels",type:Qe.Boolean,label:"Show labels",default:!0},U$={key:"showValues",type:Qe.Boolean,label:"Show values",default:!0},G$={key:"sliceMax",type:Qe.Text,label:"Max slices",default:"6"},q$={key:"sliceGroupLabel",type:Qe.Text,label:"Group label",default:"Others",placeholder:"Others"},Ine={key:"areaFillOpacity",type:Qe.Text,label:"Opacity",default:"0.85",placeholder:"0.85"},Rne={key:"stacked",type:Qe.Boolean,label:"Stack areas",default:!0},Fne={key:"stackPercent",type:Qe.Boolean,label:"Stack to 100%",default:!1},Vne={key:"areaLines",type:Qe.Boolean,label:"Separate areas with lines",default:!0},zne={key:"areaSortMode",type:Qe.Select,label:"Sort areas",default:Jt.None,choices:[{value:Jt.None,text:"Keep order"},{value:Jt.Ascending,text:"Smallest first"},{value:Jt.Descending,text:"Largest first"}]},Hne={key:"interpolation",type:Qe.Select,label:"Line interpolation",default:ii.Linear,choices:[{value:ii.Linear,text:"Linear"},{value:ii.MonotoneX,text:"Monotone"},{value:ii.Step,text:"Step"},{value:ii.StepBefore,text:"Step (before)"},{value:ii.StepAfter,text:"Step (after)"},{value:ii.Basis,text:"Basis"},{value:ii.Cardinal,text:"Cardinal"},{value:ii.CatmullRom,text:"Catmull-Rom"}]},$6=[{value:iu.Linear,text:"Linear"},{value:iu.Log,text:"Logarithmic"}],T6=[{value:rn.Auto,text:"Auto"},{value:rn.Inside,text:"Inside"},{value:rn.Outside,text:"Outside"},{value:rn.Off,text:"Off"}],Wne=[{value:Od.Auto,text:"Auto"},{value:Od.Horizontal,text:"Horizontal"},{value:Od.Vertical,text:"Vertical"}];function If(t){return[{key:"showVerticalAxis",type:Qe.Boolean,label:"Show vertical axis",default:t.showVerticalAxis??!0},{key:"verticalAxisDirection",type:Qe.Select,label:"Vertical axis side",default:si.Left,choices:[{value:si.Left,text:"Left"},{value:si.Right,text:"Right"}]},{key:"showVerticalTicks",type:Qe.Boolean,label:"Show vertical ticks",default:t.showVerticalTicks},{key:"verticalLabelPosition",type:Qe.Select,label:"Vertical labels",default:rn.Auto,choices:T6},{key:"verticalGridStyle",type:Qe.Select,label:"Vertical grid style",default:t.verticalGrid,choices:C6},{key:"verticalNumberFormat",type:Qe.NumberFormat,label:"Vertical number format"},...t.valueAxis==="vertical"?[{key:"verticalScaleType",type:Qe.Select,label:"Vertical scale",default:iu.Linear,choices:$6},t.valueAxisZeroBaseline?{key:"verticalRangeMin",type:Qe.Text,label:"Vertical min",default:"0",placeholder:"auto"}:{key:"verticalRangeMin",type:Qe.Text,label:"Vertical min",placeholder:"auto"},{key:"verticalRangeMax",type:Qe.Text,label:"Vertical max",placeholder:"auto"}]:[],{key:"showHorizontalAxis",type:Qe.Boolean,label:"Show horizontal axis",default:!0},{key:"showHorizontalTicks",type:Qe.Boolean,label:"Show horizontal ticks",default:t.showHorizontalTicks},{key:"horizontalLabelPosition",type:Qe.Select,label:"Horizontal labels",default:rn.Auto,choices:T6},{key:"horizontalLabelRotation",type:Qe.Select,label:"Horizontal label rotation",default:Od.Horizontal,choices:Wne},{key:"horizontalGridStyle",type:Qe.Select,label:"Horizontal grid style",default:t.horizontalGrid,choices:C6},{key:"horizontalNumberFormat",type:Qe.NumberFormat,label:"Horizontal number format"},...t.valueAxis==="horizontal"?[{key:"horizontalScaleType",type:Qe.Select,label:"Horizontal scale",default:iu.Linear,choices:$6},t.valueAxisZeroBaseline?{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",default:"0",placeholder:"auto"}:{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Qe.Text,label:"Horizontal max",placeholder:"auto"}]:[],...t.horizontalRange?[{key:"horizontalRangeMin",type:Qe.Text,label:"Horizontal min",placeholder:"auto"},{key:"horizontalRangeMax",type:Qe.Text,label:"Horizontal max",placeholder:"auto"}]:[]]}const ig=If({verticalGrid:Un.Dashed,horizontalGrid:Un.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",valueAxisZeroBaseline:!0}),Rf=If({verticalGrid:Un.None,horizontalGrid:Un.Dashed,showVerticalTicks:!1,showHorizontalTicks:!1,valueAxis:"horizontal",valueAxisZeroBaseline:!0}),Y$=If({verticalGrid:Un.Dashed,horizontalGrid:Un.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0}),Une=If({verticalGrid:Un.Dashed,horizontalGrid:Un.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0}),sg={...Hne,default:ii.MonotoneX},Gne={...B$,default:Co.Vertical},qne={...O$,default:!0},Yne={...D$,default:!0},j$={...Df,default:ui.Total},P2={...Km,default:!0},jne={...z$,default:!0},Xne={...G$,default:"5"},Kne={...H$,default:!0},ag={...Xm,default:$o.Auto},lg={...Eu,default:!1},cg=[O$,B$,L$,P$],D2=[qne,Gne,L$,P$],ug=[Km,Zm,ca,...cg],E2=[P2,Zm,ca,...cg],Zne=[D$,E$,N$,I$,R$,F$],Qne=[Yne,E$,N$,I$,R$,F$],X$=[Km,ca,...D2,...Zne],Jne=[Km,ca,...D2,...Qne],eoe=[jne,H$,W$,U$,Xne,q$],toe=[z$,Kne,W$,U$,G$,q$];Go(Le.BarVertical,f$,[qo,Yo,jo,Xo,rg,Ef,Nf,tg,ng,og,Jm,eg,ac,...ig,...ug]);Go(Le.BarHorizontal,h$,[qo,Yo,jo,Xo,rg,Ef,Nf,tg,ng,og,Jm,eg,ac,...Rf,...E2]);Go(Le.BarMulti,Jte,[qo,Yo,jo,Xo,j$,lg,la,aa,ag,L2,...ig,...ug]);Go(Le.Line,ane,[qo,Yo,jo,Xo,sg,Qm,...Y$,...X$]);Go(Le.LineMulti,dne,[qo,Yo,jo,Xo,sg,Qm,Df,lg,la,aa,ag,...Y$,...Jne]);Go(Le.Donut,vne,[qo,Yo,jo,Xo,lg,la,aa,ag,ca,...toe]);Go(Le.Pie,bne,[qo,Yo,jo,Xo,lg,la,aa,ag,ca,...eoe]);Go(Le.Area,xne,[qo,Yo,jo,Xo,sg,Qm,...Une,...X$]);const noe=If({verticalGrid:Un.Dashed,horizontalGrid:Un.None,showVerticalTicks:!1,showHorizontalTicks:!1,showVerticalAxis:!1,valueAxis:"vertical",horizontalRange:!0,valueAxisZeroBaseline:!0});Go(Le.AreaStacked,_ne,[qo,Yo,jo,Xo,Ine,sg,Qm,zne,Rne,Fne,Vne,Eu,la,aa,Xm,...noe,ca,...D2]);Go(Le.ColumnStacked,Ane,[qo,Yo,jo,Xo,V$,Df,Eu,la,aa,Xm,L2,...ig,...ug]);Go(Le.BarStacked,Tne,[qo,Yo,jo,Xo,V$,Df,Eu,la,aa,Xm,L2,ac,...Rf,...E2]);Go(Le.BarSplit,Lne,[qo,Yo,jo,Xo,Nne,Df,Eu,la,aa,ac,...Rf,P2,Zm,ca,...cg]);Go(Le.BarGrouped,Dne,[qo,Yo,jo,Xo,j$,Eu,la,aa,Ef,Nf,ac,...Rf,P2,Zm,ca,...cg]);Go(Le.VerticalBar,f$,[qo,Yo,jo,Xo,rg,Ef,Nf,tg,ng,og,Jm,eg,ac,...ig,...ug]);Go(Le.HorizontalBar,h$,[qo,Yo,jo,Xo,rg,Ef,Nf,tg,ng,og,Jm,eg,ac,...Rf,...E2]);function M6(t){const e=t==null?void 0:t.trim();if(!e)return;const n=Number.parseFloat(e);return Number.isFinite(n)?n:void 0}function gs(t){var i;const e=t.split(`
|
|
80
|
-
`).map(s=>s.trim()).filter(Boolean),n=[],o=[],r=(i=e[0])==null?void 0:i.match(/^_series\s*=\s*(.+)$/);if(r){const s=r[1].trim(),a=s.includes('","')?s.split(",").map(u=>u.trim().replace(/^"|"$/g,"")):s.replace(/^"|"$/g,"").split(",").map(u=>u.trim()),l=a.map(()=>[]);for(let u=1;u<e.length;u++){const d=e[u].match(/^"([^"]+)"\s*=\s*([^"]+)$/),h=e[u].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??d;if(h){n.push(h[1]);const g=h[2].split(",");for(let v=0;v<a.length;v++)l[v].push(M6(g[v]))}}const c=a.map((u,d)=>({name:u,values:l[d]}));return{labels:n,values:l[0]??[],series:c}}for(const s of e){const a=s.match(/^"([^"]+)"\s*=\s*(.+)$/);a&&(n.push(a[1]),o.push(M6(a[2])))}return{labels:n,values:o}}function ooe(t,e){const n={},o=r5(t.colorPalette);return o?n.colors=o:t.colors&&t.colors.length>0&&(n.colors=t.colors),t.autoContrast&&e&&n.colors&&(n.colors=c$(n.colors,e)),t.allowDarkMode!==void 0&&(n.allowDarkMode=t.allowDarkMode),n}function roe(t){const e={};return t.legend!==void 0&&(e.legend=t.legend),t.legendPosition!==void 0&&(e.legendPosition=t.legendPosition),t.legendAnchor!==void 0&&(e.legendAnchor=t.legendAnchor),t.directLabelling!==void 0&&(e.directLabelling=t.directLabelling),t.directLabelAnchor!==void 0&&(e.directLabelAnchor=t.directLabelAnchor),e}function ioe(t){if(!(t.showVerticalTicks!==void 0||t.verticalGridStyle!==void 0||t.verticalNumberFormat!==void 0||t.showVerticalAxis!==void 0||t.verticalAxisDirection!==void 0||t.verticalScaleType!==void 0||t.verticalLabelPosition!==void 0||t.verticalRangeMin||t.verticalRangeMax))return{};const n={};t.showVerticalTicks!==void 0&&(n.showTicks=t.showVerticalTicks),t.verticalAxisDirection!==void 0&&(n.direction=t.verticalAxisDirection),t.verticalGridStyle!==void 0&&(n.gridStyle=t.verticalGridStyle),t.verticalNumberFormat!==void 0&&(n.numberFormat=t.verticalNumberFormat),t.showVerticalAxis!==void 0&&(n.showAxis=t.showVerticalAxis),t.verticalScaleType!==void 0&&(n.scaleType=t.verticalScaleType),t.verticalLabelPosition!==void 0&&(n.labelPosition=t.verticalLabelPosition);const o=nf(t.verticalRangeMin??""),r=nf(t.verticalRangeMax??"");return(o!==void 0||r!==void 0)&&(n.range={},o!==void 0&&(n.range.min=o),r!==void 0&&(n.range.max=r)),{verticalAxis:n}}function soe(t){if(!(t.showHorizontalTicks!==void 0||t.horizontalGridStyle!==void 0||t.horizontalNumberFormat!==void 0||t.showHorizontalAxis!==void 0||t.horizontalScaleType!==void 0||t.horizontalLabelPosition!==void 0||t.horizontalLabelRotation!==void 0||t.horizontalRangeMin||t.horizontalRangeMax))return{};const n={};t.showHorizontalTicks!==void 0&&(n.showTicks=t.showHorizontalTicks),t.horizontalGridStyle!==void 0&&(n.gridStyle=t.horizontalGridStyle),t.horizontalNumberFormat!==void 0&&(n.numberFormat=t.horizontalNumberFormat),t.showHorizontalAxis!==void 0&&(n.showAxis=t.showHorizontalAxis),t.horizontalScaleType!==void 0&&(n.scaleType=t.horizontalScaleType),t.horizontalLabelPosition!==void 0&&(n.labelPosition=t.horizontalLabelPosition),t.horizontalLabelRotation!==void 0&&(n.labelRotation=t.horizontalLabelRotation);const o=nf(t.horizontalRangeMin??""),r=nf(t.horizontalRangeMax??"");return(o!==void 0||r!==void 0)&&(n.range={},o!==void 0&&(n.range.min=o),r!==void 0&&(n.range.max=r)),{horizontalAxis:n}}function aoe(t){return t.lineSymbols?{lineSymbols:{symbol:t.lineSymbolShape??vr.Circle,showOn:t.lineSymbolShowOn??yr.FirstLast,style:t.lineSymbolStyle??Ro.Filled,size:parseFloat(t.lineSymbolSize??"3.5")||3.5,opacity:parseFloat(t.lineSymbolOpacity??"1")||1}}:{}}function K$(t,e){const n={...ooe(t,e),...roe(t),...ioe(t),...soe(t),...aoe(t)};t.interpolation!==void 0&&(n.interpolation=t.interpolation),t.valueLabels!==void 0&&(n.valueLabels=t.valueLabels),t.valueLabelPosition!==void 0&&(n.valueLabelPosition=t.valueLabelPosition),t.tooltips!==void 0&&(n.tooltips=t.tooltips),t.crosshair!==void 0&&(n.crosshair=t.crosshair),t.crosshairDirection&&(n.crosshairDirection=t.crosshairDirection),t.crosshairStyle&&(n.crosshairStyle=t.crosshairStyle),t.crosshairColor&&(n.crosshairColor=t.crosshairColor),t.displayAsPercentage!==void 0&&(n.displayAsPercentage=t.displayAsPercentage),t.showTotal!==void 0&&(n.showTotal=t.showTotal),t.showLabels!==void 0&&(n.showLabels=t.showLabels),t.showValues!==void 0&&(n.showValues=t.showValues),t.swapLabelValue!==void 0&&(n.swapLabelValue=t.swapLabelValue);const o=parseInt(t.sliceMax??"",10);!isNaN(o)&&o>0&&(n.sliceMax=o),t.sliceGroupLabel!==void 0&&(n.sliceGroupLabel=t.sliceGroupLabel),t.barBackground!==void 0&&(n.barBackground=t.barBackground),t.barSeparators!==void 0&&(n.barSeparators=t.barSeparators);const r=parseFloat(t.barGap??"");isNaN(r)||(n.barGap=Math.max(0,Math.min(100,r))),t.connectedColumns!==void 0&&(n.connectedColumns=t.connectedColumns);const i=parseFloat(t.connectionsOpacity??"");isNaN(i)||(n.connectionsOpacity=Math.max(0,Math.min(1,i))),t.stackMode!==void 0&&(n.stackMode=t.stackMode),t.stacked!==void 0&&(n.stacked=t.stacked),t.stackPercent!==void 0&&(n.stackPercent=t.stackPercent),t.areaSortMode!==void 0&&(n.areaSortMode=t.areaSortMode),t.areaLines!==void 0&&(n.areaLines=t.areaLines);const s=parseFloat(t.areaFillOpacity??"");return isNaN(s)||(n.areaFillOpacity=s),t.edgePadding!==void 0&&(n.edgePadding=t.edgePadding),t.waterfall!==void 0&&(n.waterfall=t.waterfall),t.waterfallTotal!==void 0&&(n.waterfallTotal=t.waterfallTotal),t.categoryLabelLine!==void 0&&(n.categoryLabelLine=t.categoryLabelLine),n}const loe={[Le.BarVertical]:"Vertical Bar Chart",[Le.BarHorizontal]:"Horizontal Bar Chart",[Le.BarMulti]:"Grouped Bar Chart",[Le.Line]:"Line Chart",[Le.LineMulti]:"Multi-Line Chart",[Le.Pie]:"Pie Chart",[Le.Donut]:"Donut Chart"};function coe(t,e){if(t.length===0)return[];const n=t.filter(a=>a==="string").length,o=t.filter(a=>a==="number").length,r=t.filter(a=>a==="date").length,i=[],s=(a,l,c)=>i.push({chartType:a,label:loe[a]??a,fitness:l,reason:c});return r===1&&o>=1?o===1?(s(Le.Line,"best","1 date + 1 numeric column — ideal for trend"),s(Le.BarVertical,"alternative","Can also show as bars")):(s(Le.LineMulti,"best",`1 date + ${o} numeric columns — compare trends`),s(Le.BarMulti,"alternative","Can also show as grouped bars")):n===1&&o===1?(s(Le.BarVertical,"best","1 categorical + 1 numeric — classic bar chart"),s(Le.BarHorizontal,"good","Horizontal bars work well for long labels"),e<=8&&(s(Le.Donut,"good",`${e} items — suitable for part-of-whole`),s(Le.Pie,"alternative","Pie chart for part-of-whole"))):n===1&&o>1?(s(Le.BarMulti,"best",`1 categorical + ${o} numeric columns — compare groups`),s(Le.LineMulti,"good","Can also show as multi-line chart")):o>=1&&(n>=1||r>=1)&&s(Le.BarVertical,"good","Default bar chart recommendation"),i}const $v=Object.create(null);function Z$(t){if(!$v[t]){const e={};for(const n of du(t))n.default!==void 0&&(e[n.key]=n.default);$v[t]=e}return $v[t]}function f0(t,e){var r;const n=Z$(t);return((r=e.colors)==null?void 0:r.length)?{...n,colorPalette:void 0,...e}:{...n,...e}}const uoe={protanopia:"Protanopia (no red)",deuteranopia:"Deuteranopia (no green)",tritanopia:"Tritanopia (no blue)"},Q$={protanopia:[.152286,1.052583,-.204868,0,0,.114503,.786281,.099216,0,0,-.003882,-.048116,1.051998,0,0,0,0,0,1,0],deuteranopia:[.367322,.860646,-.227968,0,0,.280085,.672501,.047413,0,0,-.01182,.04294,.968881,0,0,0,0,0,1,0],tritanopia:[1.255528,-.076749,-.178779,0,0,-.078411,.930809,.147602,0,0,.004733,.691367,.3039,0,0,0,0,0,1,0]};function J$(t){return`bc-cvd-${t}`}function doe(t){const e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"filter");n.setAttribute("id",J$(t)),n.setAttribute("color-interpolation-filters","linearRGB");const o=document.createElementNS(e,"feColorMatrix");return o.setAttribute("type","matrix"),o.setAttribute("values",Q$[t].join(" ")),n.appendChild(o),n}function foe(t){return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function Tv(t){return t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055}function hoe(t,e){const[n,o,r]=ot(t).rgb().map(u=>foe(u/255)),i=Q$[e],s=Tv(i[0]*n+i[1]*o+i[2]*r),a=Tv(i[5]*n+i[6]*o+i[7]*r),l=Tv(i[10]*n+i[11]*o+i[12]*r),c=u=>Math.min(255,Math.max(0,Math.round(u*255)));return ot(c(s),c(a),c(l)).hex()}const poe=10;function moe(t){if(t.length<2)return[];const e=["protanopia","deuteranopia","tritanopia"],n=[];for(const o of e){const r=t.map(s=>hoe(s,o)),i=[];for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++){const l=ot.deltaE(r[s],r[a]);l<poe&&i.push({a:t[s],b:t[a],deltaE:l})}i.length>0&&n.push({type:o,label:uoe[o],pairs:i})}return n}function goe(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],annotationVisibility:[],series:[],scenes:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":if(e.data!==null)throw new SyntaxError("duplicate data block");e.data=n;break;case"colorize":e.colorizes.push(n);break;case"highlight":e.highlights.push(n);break;case"areafill":e.areaFills.push(n);break;case"annotation":e.annotations.push(n);break;case"annotation-visibility":e.annotationVisibility.push(n);break;case"series":e.series.push(n);break;case"scene":e.scenes.push(n);break;case"transform":e.transforms.push(n);break}return e}function voe(t){const e={properties:[],data:null,colorizes:[],highlights:[],areaFills:[],annotations:[],annotationVisibility:[],series:[],transforms:[]};for(const n of t)switch(n.type){case"property":e.properties.push(n);break;case"data":if(e.data!==null)throw new SyntaxError("duplicate data block");e.data=n;break;case"colorize":e.colorizes.push(n);break;case"highlight":e.highlights.push(n);break;case"areafill":e.areaFills.push(n);break;case"annotation":e.annotations.push(n);break;case"annotation-visibility":e.annotationVisibility.push(n);break;case"series":e.series.push(n);break;case"transform":e.transforms.push(n);break}return e}function boe(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}function Bl(t,e,n,o){var r=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(r,Bl.prototype),r.expected=e,r.found=n,r.location=o,r.name="SyntaxError",r}boe(Bl,Error);function Mv(t,e,n){return n=n||" ",t.length>e?t:(e-=t.length,n+=n.repeat(e),t+n.slice(0,e))}Bl.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var n=null,o;for(o=0;o<t.length;o++)if(t[o].source===this.location.source){n=t[o].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,i=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,s=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,l=Mv("",i.line.toString().length," "),c=n[r.line-1],u=r.line===a.line?a.column:c.length+1,d=u-r.column||1;e+=`
|
|
81
|
-
--> `+s+`
|
|
82
|
-
`+l+` |
|
|
83
|
-
`+i.line+" | "+c+`
|
|
84
|
-
`+l+" | "+Mv("",r.column-1," ")+Mv("",d,"^")}else e+=`
|
|
85
|
-
at `+s}return e};Bl.buildMessage=function(t,e){var n={literal:function(c){return'"'+r(c.text)+'"'},class:function(c){var u=c.parts.map(function(d){return Array.isArray(d)?i(d[0])+"-"+i(d[1]):i(d)});return"["+(c.inverted?"^":"")+u.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function o(c){return c.charCodeAt(0).toString(16).toUpperCase()}function r(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+o(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+o(u)})}function i(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+o(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+o(u)})}function s(c){return n[c.type](c)}function a(c){var u=c.map(s),d,f;if(u.sort(),u.length>0){for(d=1,f=1;d<u.length;d++)u[d-1]!==u[d]&&(u[f]=u[d],f++);u.length=f}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+r(c)+'"':"end of input"}return"Expected "+a(t)+" but "+l(e)+" found."};function yoe(t,e){e=e!==void 0?e:{};var n={},o=e.grammarSource,r={Chart:Ax},i=Ax,s="chart",a="{",l="}",c="data",u="=",d=",",f=" ",h="colorize",g="highlight",v="areafill",m="annotation",b="range",y="note",x="series",_="scene",S="step",N="transform",B="hide_annotation",k="hide_range",L="hide_note",E="show_annotation",I="show_range",C="show_note",$="%",P="-",M=".",F='"',V="\\",G="n",K="r",ue="t",de="u",he="//",ge="/*",ee="*/",fe=/^[^\t\n\r{}=]/,xe=/^[a-zA-Z_#]/,Z=/^[a-zA-Z0-9_#\-]/,pe=/^[0-9]/,oe=/^[eE]/,ve=/^[+\-]/,ce=/^[^"\\]/,D=/^[0-9a-fA-F]/,W=/^[^\n]/,j=/^[ \t\n\r]/,ne=It("chart",!1),ie=It("{",!1),ae=It("}",!1),te=It("data",!1),Y=It("=",!1),X=It(",",!1),q=It(" ",!1),re=Fi([" ",`
|
|
86
|
-
`,"\r","{","}","="],!0,!1),me=It("colorize",!1),we=It("highlight",!1),ke=It("areafill",!1),$e=It("annotation",!1),De=It("range",!1),He=It("note",!1),Oe=It("series",!1),We=It("scene",!1),st=It("step",!1),lt=It("transform",!1),At=It("hide_annotation",!1),on=It("hide_range",!1),Nt=It("hide_note",!1),Yt=It("show_annotation",!1),Fn=It("show_range",!1),Vn=It("show_note",!1),fn=It("%",!1),fr=qf("identifier"),hr=Fi([["a","z"],["A","Z"],"_","#"],!1,!1),tt=Fi([["a","z"],["A","Z"],["0","9"],"_","#","-"],!1,!1),Ce=It("-",!1),Je=It(".",!1),Ie=Fi([["0","9"]],!1,!1),ft=Fi(["e","E"],!1,!1),cn=Fi(["+","-"],!1,!1),qn=qf("string"),to=It('"',!1),Yn=It("\\",!1),pr=Fi(['"',"\\"],!0,!1),Er=It("n",!1),vs=It("r",!1),Ye=It("t",!1),ct=It("u",!1),Ot=Fi([["0","9"],["a","f"],["A","F"]],!1,!1),Ft=t9(),jn=It("//",!1),Xn=Fi([`
|
|
87
|
-
`],!0,!1),ti=It("/*",!1),ua=It("*/",!1),cc=qf("whitespace"),ni=Fi([" "," ",`
|
|
88
|
-
`,"\r"],!1,!1),Mg=qf("optional whitespace"),pB=function(O,U){const _e=goe(U);return{type:"chart",chartType:O,properties:_e.properties,data:_e.data,colorizes:_e.colorizes,highlights:_e.highlights,areaFills:_e.areaFills,annotations:_e.annotations,annotationVisibility:_e.annotationVisibility,series:_e.series,scenes:_e.scenes,transforms:_e.transforms}},mB=function(O){return O},gB=function(O){return{type:"data",entries:O}},kx=function(O,U,_e){return _e},vB=function(O,U,_e){const ye=[U,..._e];return{type:"property",key:O,value:ye[0].value,isPercentage:!1,values:ye.map(Pe=>Pe.value)}},bB=function(O){return O},yB=function(O,U){return{type:"property",key:O,value:U.value,isPercentage:U.isPercentage}},xB=function(O){return O.trim()},wB=function(O,U){return{type:"colorize",target:O,properties:U}},_B=function(O,U){return{type:"colorize",target:O,properties:U,fromHighlight:!0}},kB=function(O){return{type:"highlight",target:O,properties:[]}},SB=function(O,U,_e){return{type:"areafill",from:O,to:U,properties:_e}},AB=function(O,U){return{type:"annotation",kind:"point",target:O,properties:U}},CB=function(O){return{type:"annotation",kind:"range",properties:O}},$B=function(O){return{type:"annotation",kind:"free",properties:O}},TB=function(O,U){return{type:"series",name:O,properties:U}},MB=function(O,U){const _e=voe(U);return{type:"scene",name:O??null,properties:_e.properties,data:_e.data,colorizes:_e.colorizes,highlights:_e.highlights,areaFills:_e.areaFills,annotations:_e.annotations,annotationVisibility:_e.annotationVisibility,series:_e.series,transforms:_e.transforms}},OB=function(O,U){return{type:"transform",transformType:O,properties:U}},BB=function(O){return{type:"annotation-visibility",action:"hide",kind:"point",id:O}},LB=function(O){return{type:"annotation-visibility",action:"hide",kind:"range",id:O}},PB=function(O){return{type:"annotation-visibility",action:"hide",kind:"free",id:O}},DB=function(O){return{type:"annotation-visibility",action:"show",kind:"point",id:O}},EB=function(O){return{type:"annotation-visibility",action:"show",kind:"range",id:O}},NB=function(O){return{type:"annotation-visibility",action:"show",kind:"free",id:O}},IB=function(O){return O},RB=function(O){return O},FB=function(O,U){return{type:"property",key:O,value:U.value,isPercentage:U.isPercentage}},VB=function(O){return{value:O,isPercentage:!0}},zB=function(O){return{value:O,isPercentage:!1}},HB=function(O){return{value:O,isPercentage:!1}},WB=function(O){return{value:O,isPercentage:!1}},UB=function(O){return parseFloat(O)},GB=function(O){return O.join("")},qB=function(O){return O},YB=function(){return'"'},jB=function(){return"\\"},XB=function(){return`
|
|
89
|
-
`},KB=function(){return"\r"},ZB=function(){return" "},QB=function(O){return String.fromCharCode(parseInt(O,16))},JB=function(O){e9("Unknown escape sequence \\"+O)},z=e.peg$currPos|0,wt=z,uc=[{line:1,column:1}],oi=z,Gf=e.peg$maxFailExpected||[],Ee=e.peg$silentFails|0,Ru;if(e.startRule){if(!(e.startRule in r))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');i=r[e.startRule]}function e9(O,U){throw U=U!==void 0?U:Og(wt,z),o9(O,U)}function It(O,U){return{type:"literal",text:O,ignoreCase:U}}function Fi(O,U,_e){return{type:"class",parts:O,inverted:U,ignoreCase:_e}}function t9(){return{type:"any"}}function n9(){return{type:"end"}}function qf(O){return{type:"other",description:O}}function Sx(O){var U=uc[O],_e;if(U)return U;if(O>=uc.length)_e=uc.length-1;else for(_e=O;!uc[--_e];);for(U=uc[_e],U={line:U.line,column:U.column};_e<O;)t.charCodeAt(_e)===10?(U.line++,U.column=1):U.column++,_e++;return uc[O]=U,U}function Og(O,U,_e){var ye=Sx(O),Pe=Sx(U),Ne={source:o,start:{offset:O,line:ye.line,column:ye.column},end:{offset:U,line:Pe.line,column:Pe.column}};return Ne}function Re(O){z<oi||(z>oi&&(oi=z,Gf=[]),Gf.push(O))}function o9(O,U){return new Bl(O,null,null,U)}function r9(O,U,_e){return new Bl(Bl.buildMessage(O,U),O,U,_e)}function Ax(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,ht(),t.substr(z,5)===s?(U=s,z+=5):(U=n,Ee===0&&Re(ne)),U!==n)if(_e=ho(),_e!==n)if(ye=jf(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=Cx();qe!==n;)Ne.push(qe),qe=Cx();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(ht(),wt=O,O=pB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Cx(){var O,U;return O=z,ht(),U=$x(),U===n&&(U=Ox(),U===n&&(U=Bx(),U===n&&(U=Lx(),U===n&&(U=Dx(),U===n&&(U=Ex(),U===n&&(U=Px(),U===n&&(U=Rx(),U===n&&(U=Fx(),U===n&&(U=Vx(),U===n&&(U=zx(),U===n&&(U=Hx(),U===n&&(U=Wx(),U===n&&(U=Nx(),U===n&&(U=s9(),U===n&&(U=Ix(),U===n&&(U=Yf())))))))))))))))),U!==n?(ht(),wt=O,O=mB(U)):(z=O,O=n),O}function $x(){var O,U,_e,ye,Pe,Ne;if(O=z,t.substr(z,4)===c?(U=c,z+=4):(U=n,Ee===0&&Re(te)),U!==n)if(ht(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,Ee===0&&Re(ie)),_e!==n){for(ht(),ye=[],Pe=Mx(),Pe===n&&(Pe=Tx());Pe!==n;)ye.push(Pe),Pe=Mx(),Pe===n&&(Pe=Tx());Pe=ht(),t.charCodeAt(z)===125?(Ne=l,z++):(Ne=n,Ee===0&&Re(ae)),Ne!==n?(wt=O,O=gB(ye)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Tx(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,ht(),U=Gx(),U!==n)if(ht(),t.charCodeAt(z)===61?(_e=u,z++):(_e=n,Ee===0&&Re(Y)),_e!==n)if(ht(),ye=Fu(),ye!==n){if(Pe=[],Ne=z,t.charCodeAt(z)===44?(qe=d,z++):(qe=n,Ee===0&&Re(X)),qe!==n?(ht(),rt=Fu(),rt!==n?(wt=Ne,Ne=kx(U,ye,rt)):(z=Ne,Ne=n)):(z=Ne,Ne=n),Ne!==n)for(;Ne!==n;)Pe.push(Ne),Ne=z,t.charCodeAt(z)===44?(qe=d,z++):(qe=n,Ee===0&&Re(X)),qe!==n?(ht(),rt=Fu(),rt!==n?(wt=Ne,Ne=kx(U,ye,rt)):(z=Ne,Ne=n)):(z=Ne,Ne=n);else Pe=n;Pe!==n?(Ne=ht(),wt=O,O=vB(U,ye,Pe)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;return O===n&&(O=z,ht(),U=Yf(),U!==n?(ht(),wt=O,O=bB(U)):(z=O,O=n)),O}function Mx(){var O,U,_e,ye;return O=z,ht(),U=i9(),U!==n?(t.charCodeAt(z)===9?(_e=f,z++):(_e=n,Ee===0&&Re(q)),_e!==n?(ht(),ye=Fu(),ye!==n?(ht(),wt=O,O=yB(U,ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function i9(){var O,U,_e,ye;if(O=z,U=z,_e=[],ye=t.charAt(z),fe.test(ye)?z++:(ye=n,Ee===0&&Re(re)),ye!==n)for(;ye!==n;)_e.push(ye),ye=t.charAt(z),fe.test(ye)?z++:(ye=n,Ee===0&&Re(re));else _e=n;return _e!==n?U=t.substring(U,z):U=_e,U!==n&&(wt=O,U=xB(U)),O=U,O}function Ox(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,8)===h?(U=h,z+=8):(U=n,Ee===0&&Re(me)),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=uo();qe!==n;)Ne.push(qe),qe=uo();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=wB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Bx(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,9)===g?(U=g,z+=9):(U=n,Ee===0&&Re(we)),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=uo();qe!==n;)Ne.push(qe),qe=uo();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=_B(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O===n&&(O=z,t.substr(z,9)===g?(U=g,z+=9):(U=n,Ee===0&&Re(we)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=kB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n)),O}function Lx(){var O,U,_e,ye,Pe,Ne,qe,rt,Zo,Sn;if(O=z,t.substr(z,8)===v?(U=v,z+=8):(U=n,Ee===0&&Re(ke)),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye!==n)if(Pe=ho(),Pe!==n)if(Ne=fo(),Ne!==n)if(ht(),t.charCodeAt(z)===123?(qe=a,z++):(qe=n,Ee===0&&Re(ie)),qe!==n){for(ht(),rt=[],Zo=uo();Zo!==n;)rt.push(Zo),Zo=uo();Zo=ht(),t.charCodeAt(z)===125?(Sn=l,z++):(Sn=n,Ee===0&&Re(ae)),Sn!==n?(wt=O,O=SB(ye,Ne,rt)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Px(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,10)===m?(U=m,z+=10):(U=n,Ee===0&&Re($e)),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=uo();qe!==n;)Ne.push(qe),qe=uo();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=AB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Dx(){var O,U,_e,ye,Pe,Ne;if(O=z,t.substr(z,5)===b?(U=b,z+=5):(U=n,Ee===0&&Re(De)),U!==n)if(ht(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,Ee===0&&Re(ie)),_e!==n){for(ht(),ye=[],Pe=uo();Pe!==n;)ye.push(Pe),Pe=uo();Pe=ht(),t.charCodeAt(z)===125?(Ne=l,z++):(Ne=n,Ee===0&&Re(ae)),Ne!==n?(wt=O,O=CB(ye)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Ex(){var O,U,_e,ye,Pe,Ne;if(O=z,t.substr(z,4)===y?(U=y,z+=4):(U=n,Ee===0&&Re(He)),U!==n)if(ht(),t.charCodeAt(z)===123?(_e=a,z++):(_e=n,Ee===0&&Re(ie)),_e!==n){for(ht(),ye=[],Pe=uo();Pe!==n;)ye.push(Pe),Pe=uo();Pe=ht(),t.charCodeAt(z)===125?(Ne=l,z++):(Ne=n,Ee===0&&Re(ae)),Ne!==n?(wt=O,O=$B(ye)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;return O}function Nx(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,6)===x?(U=x,z+=6):(U=n,Ee===0&&Re(Oe)),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=uo();qe!==n;)Ne.push(qe),qe=uo();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=TB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function s9(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,5)===_?(U=_,z+=5):(U=n,Ee===0&&Re(We)),U===n&&(t.substr(z,4)===S?(U=S,z+=4):(U=n,Ee===0&&Re(st))),U!==n)if(_e=ho(),_e!==n)if(ye=fo(),ye===n&&(ye=null),ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=Ux();qe!==n;)Ne.push(qe),qe=Ux();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=MB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Ix(){var O,U,_e,ye,Pe,Ne,qe,rt;if(O=z,t.substr(z,9)===N?(U=N,z+=9):(U=n,Ee===0&&Re(lt)),U!==n)if(_e=ho(),_e!==n)if(ye=jf(),ye!==n)if(ht(),t.charCodeAt(z)===123?(Pe=a,z++):(Pe=n,Ee===0&&Re(ie)),Pe!==n){for(ht(),Ne=[],qe=uo();qe!==n;)Ne.push(qe),qe=uo();qe=ht(),t.charCodeAt(z)===125?(rt=l,z++):(rt=n,Ee===0&&Re(ae)),rt!==n?(wt=O,O=OB(ye,Ne)):(z=O,O=n)}else z=O,O=n;else z=O,O=n;else z=O,O=n;else z=O,O=n;return O}function Rx(){var O,U,_e,ye;return O=z,t.substr(z,15)===B?(U=B,z+=15):(U=n,Ee===0&&Re(At)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=BB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Fx(){var O,U,_e,ye;return O=z,t.substr(z,10)===k?(U=k,z+=10):(U=n,Ee===0&&Re(on)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=LB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Vx(){var O,U,_e,ye;return O=z,t.substr(z,9)===L?(U=L,z+=9):(U=n,Ee===0&&Re(Nt)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=PB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function zx(){var O,U,_e,ye;return O=z,t.substr(z,15)===E?(U=E,z+=15):(U=n,Ee===0&&Re(Yt)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=DB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Hx(){var O,U,_e,ye;return O=z,t.substr(z,10)===I?(U=I,z+=10):(U=n,Ee===0&&Re(Fn)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=EB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Wx(){var O,U,_e,ye;return O=z,t.substr(z,9)===C?(U=C,z+=9):(U=n,Ee===0&&Re(Vn)),U!==n?(_e=ho(),_e!==n?(ye=fo(),ye!==n?(wt=O,O=NB(ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Ux(){var O,U;return O=z,ht(),U=$x(),U===n&&(U=Ox(),U===n&&(U=Bx(),U===n&&(U=Lx(),U===n&&(U=Dx(),U===n&&(U=Ex(),U===n&&(U=Px(),U===n&&(U=Rx(),U===n&&(U=Fx(),U===n&&(U=Vx(),U===n&&(U=zx(),U===n&&(U=Hx(),U===n&&(U=Wx(),U===n&&(U=Nx(),U===n&&(U=Ix(),U===n&&(U=Yf()))))))))))))))),U!==n?(ht(),wt=O,O=IB(U)):(z=O,O=n),O}function uo(){var O,U;return O=z,ht(),U=Yf(),U!==n?(ht(),wt=O,O=RB(U)):(z=O,O=n),O}function Yf(){var O,U,_e,ye;return O=z,U=Gx(),U!==n?(ht(),t.charCodeAt(z)===61?(_e=u,z++):(_e=n,Ee===0&&Re(Y)),_e!==n?(ht(),ye=Fu(),ye!==n?(wt=O,O=FB(U,ye)):(z=O,O=n)):(z=O,O=n)):(z=O,O=n),O}function Gx(){var O;return O=fo(),O===n&&(O=jf()),O}function Fu(){var O,U,_e;return O=z,U=qx(),U!==n?(t.charCodeAt(z)===37?(_e=$,z++):(_e=n,Ee===0&&Re(fn)),_e!==n?(wt=O,O=VB(U)):(z=O,O=n)):(z=O,O=n),O===n&&(O=z,U=qx(),U!==n&&(wt=O,U=zB(U)),O=U,O===n&&(O=z,U=fo(),U!==n&&(wt=O,U=HB(U)),O=U,O===n&&(O=z,U=jf(),U!==n&&(wt=O,U=WB(U)),O=U))),O}function jf(){var O,U,_e,ye,Pe;if(Ee++,O=z,U=z,_e=t.charAt(z),xe.test(_e)?z++:(_e=n,Ee===0&&Re(hr)),_e!==n){for(ye=[],Pe=t.charAt(z),Z.test(Pe)?z++:(Pe=n,Ee===0&&Re(tt));Pe!==n;)ye.push(Pe),Pe=t.charAt(z),Z.test(Pe)?z++:(Pe=n,Ee===0&&Re(tt));_e=[_e,ye],U=_e}else z=U,U=n;return U!==n?O=t.substring(O,z):O=U,Ee--,O===n&&(U=n,Ee===0&&Re(fr)),O}function qx(){var O,U,_e,ye,Pe,Ne,qe,rt,Zo,Sn;if(O=z,U=z,_e=z,t.charCodeAt(z)===45?(ye=P,z++):(ye=n,Ee===0&&Re(Ce)),ye===n&&(ye=null),Pe=z,t.charCodeAt(z)===46?(Ne=M,z++):(Ne=n,Ee===0&&Re(Je)),Ne!==n){if(qe=[],rt=t.charAt(z),pe.test(rt)?z++:(rt=n,Ee===0&&Re(Ie)),rt!==n)for(;rt!==n;)qe.push(rt),rt=t.charAt(z),pe.test(rt)?z++:(rt=n,Ee===0&&Re(Ie));else qe=n;qe!==n?(Ne=[Ne,qe],Pe=Ne):(z=Pe,Pe=n)}else z=Pe,Pe=n;if(Pe===n){if(Pe=z,Ne=[],qe=t.charAt(z),pe.test(qe)?z++:(qe=n,Ee===0&&Re(Ie)),qe!==n)for(;qe!==n;)Ne.push(qe),qe=t.charAt(z),pe.test(qe)?z++:(qe=n,Ee===0&&Re(Ie));else Ne=n;if(Ne!==n){if(qe=z,t.charCodeAt(z)===46?(rt=M,z++):(rt=n,Ee===0&&Re(Je)),rt!==n){for(Zo=[],Sn=t.charAt(z),pe.test(Sn)?z++:(Sn=n,Ee===0&&Re(Ie));Sn!==n;)Zo.push(Sn),Sn=t.charAt(z),pe.test(Sn)?z++:(Sn=n,Ee===0&&Re(Ie));rt=[rt,Zo],qe=rt}else z=qe,qe=n;qe===n&&(qe=null),Ne=[Ne,qe],Pe=Ne}else z=Pe,Pe=n}if(Pe!==n){if(Ne=z,qe=t.charAt(z),oe.test(qe)?z++:(qe=n,Ee===0&&Re(ft)),qe!==n){if(rt=t.charAt(z),ve.test(rt)?z++:(rt=n,Ee===0&&Re(cn)),rt===n&&(rt=null),Zo=[],Sn=t.charAt(z),pe.test(Sn)?z++:(Sn=n,Ee===0&&Re(Ie)),Sn!==n)for(;Sn!==n;)Zo.push(Sn),Sn=t.charAt(z),pe.test(Sn)?z++:(Sn=n,Ee===0&&Re(Ie));else Zo=n;Zo!==n?(qe=[qe,rt,Zo],Ne=qe):(z=Ne,Ne=n)}else z=Ne,Ne=n;Ne===n&&(Ne=null),ye=[ye,Pe,Ne],_e=ye}else z=_e,_e=n;return _e!==n?U=t.substring(U,z):U=_e,U!==n&&(wt=O,U=UB(U)),O=U,O}function fo(){var O,U,_e,ye;if(Ee++,O=z,t.charCodeAt(z)===34?(U=F,z++):(U=n,Ee===0&&Re(to)),U!==n){for(_e=[],ye=Yx();ye!==n;)_e.push(ye),ye=Yx();t.charCodeAt(z)===34?(ye=F,z++):(ye=n,Ee===0&&Re(to)),ye!==n?(wt=O,O=GB(_e)):(z=O,O=n)}else z=O,O=n;return Ee--,O===n&&(U=n,Ee===0&&Re(qn)),O}function Yx(){var O,U,_e;return O=z,t.charCodeAt(z)===92?(U=V,z++):(U=n,Ee===0&&Re(Yn)),U!==n?(_e=a9(),_e!==n?(wt=O,O=qB(_e)):(z=O,O=n)):(z=O,O=n),O===n&&(O=t.charAt(z),ce.test(O)?z++:(O=n,Ee===0&&Re(pr))),O}function a9(){var O,U,_e,ye,Pe,Ne,qe,rt;return O=z,t.charCodeAt(z)===34?(U=F,z++):(U=n,Ee===0&&Re(to)),U!==n&&(wt=O,U=YB()),O=U,O===n&&(O=z,t.charCodeAt(z)===92?(U=V,z++):(U=n,Ee===0&&Re(Yn)),U!==n&&(wt=O,U=jB()),O=U,O===n&&(O=z,t.charCodeAt(z)===110?(U=G,z++):(U=n,Ee===0&&Re(Er)),U!==n&&(wt=O,U=XB()),O=U,O===n&&(O=z,t.charCodeAt(z)===114?(U=K,z++):(U=n,Ee===0&&Re(vs)),U!==n&&(wt=O,U=KB()),O=U,O===n&&(O=z,t.charCodeAt(z)===116?(U=ue,z++):(U=n,Ee===0&&Re(Ye)),U!==n&&(wt=O,U=ZB()),O=U,O===n&&(O=z,t.charCodeAt(z)===117?(U=de,z++):(U=n,Ee===0&&Re(ct)),U!==n?(_e=z,ye=z,Pe=t.charAt(z),D.test(Pe)?z++:(Pe=n,Ee===0&&Re(Ot)),Pe!==n?(Ne=t.charAt(z),D.test(Ne)?z++:(Ne=n,Ee===0&&Re(Ot)),Ne!==n?(qe=t.charAt(z),D.test(qe)?z++:(qe=n,Ee===0&&Re(Ot)),qe!==n?(rt=t.charAt(z),D.test(rt)?z++:(rt=n,Ee===0&&Re(Ot)),rt!==n?(Pe=[Pe,Ne,qe,rt],ye=Pe):(z=ye,ye=n)):(z=ye,ye=n)):(z=ye,ye=n)):(z=ye,ye=n),ye!==n?_e=t.substring(_e,z):_e=ye,_e!==n?(wt=O,O=QB(_e)):(z=O,O=n)):(z=O,O=n),O===n&&(O=z,t.length>z?(U=t.charAt(z),z++):(U=n,Ee===0&&Re(Ft)),U!==n&&(wt=O,U=JB(U)),O=U)))))),O}function Xf(){var O;return O=l9(),O===n&&(O=c9()),O}function l9(){var O,U,_e,ye;if(O=z,t.substr(z,2)===he?(U=he,z+=2):(U=n,Ee===0&&Re(jn)),U!==n){for(_e=[],ye=t.charAt(z),W.test(ye)?z++:(ye=n,Ee===0&&Re(Xn));ye!==n;)_e.push(ye),ye=t.charAt(z),W.test(ye)?z++:(ye=n,Ee===0&&Re(Xn));U=[U,_e],O=U}else z=O,O=n;return O}function c9(){var O,U,_e,ye,Pe,Ne;if(O=z,t.substr(z,2)===ge?(U=ge,z+=2):(U=n,Ee===0&&Re(ti)),U!==n){for(_e=[],ye=z,Pe=z,Ee++,t.substr(z,2)===ee?(Ne=ee,z+=2):(Ne=n,Ee===0&&Re(ua)),Ee--,Ne===n?Pe=void 0:(z=Pe,Pe=n),Pe!==n?(t.length>z?(Ne=t.charAt(z),z++):(Ne=n,Ee===0&&Re(Ft)),Ne!==n?(Pe=[Pe,Ne],ye=Pe):(z=ye,ye=n)):(z=ye,ye=n);ye!==n;)_e.push(ye),ye=z,Pe=z,Ee++,t.substr(z,2)===ee?(Ne=ee,z+=2):(Ne=n,Ee===0&&Re(ua)),Ee--,Ne===n?Pe=void 0:(z=Pe,Pe=n),Pe!==n?(t.length>z?(Ne=t.charAt(z),z++):(Ne=n,Ee===0&&Re(Ft)),Ne!==n?(Pe=[Pe,Ne],ye=Pe):(z=ye,ye=n)):(z=ye,ye=n);t.substr(z,2)===ee?(ye=ee,z+=2):(ye=n,Ee===0&&Re(ua)),ye!==n?(U=[U,_e,ye],O=U):(z=O,O=n)}else z=O,O=n;return O}function ho(){var O,U;if(Ee++,O=[],U=t.charAt(z),j.test(U)?z++:(U=n,Ee===0&&Re(ni)),U===n&&(U=Xf()),U!==n)for(;U!==n;)O.push(U),U=t.charAt(z),j.test(U)?z++:(U=n,Ee===0&&Re(ni)),U===n&&(U=Xf());else O=n;return Ee--,O===n&&(U=n,Ee===0&&Re(cc)),O}function ht(){var O,U;for(Ee++,O=[],U=t.charAt(z),j.test(U)?z++:(U=n,Ee===0&&Re(ni)),U===n&&(U=Xf());U!==n;)O.push(U),U=t.charAt(z),j.test(U)?z++:(U=n,Ee===0&&Re(ni)),U===n&&(U=Xf());return Ee--,U=n,Ee===0&&Re(Mg),O}if(Ru=i(),e.peg$library)return{peg$result:Ru,peg$currPos:z,peg$FAILED:n,peg$maxFailExpected:Gf,peg$maxFailPos:oi};if(Ru!==n&&z===t.length)return Ru;throw Ru!==n&&z<t.length&&Re(n9()),r9(Gf,oi<t.length?t.charAt(oi):null,oi<t.length?Og(oi,oi+1):Og(oi,oi))}function dg(t){try{return yoe(t)}catch(e){if(e instanceof Error&&"location"in e){const n=e.location;throw new SyntaxError(`${e.message} at ${n.start.line}:${n.start.column}`)}throw e}}function Wr(t){return new Map(t.map(e=>[e.key,e.value]))}function fg(t,e){const n=Wr(e),o=du(t),r=new Set(o.map(s=>s.key)),i={};for(const s of o){const a=n.get(s.key);a!==void 0&&r.has(s.key)&&(s.type===Qe.Colors?i[s.key]=String(a).split(",").map(l=>l.trim()).filter(Boolean):s.type===Qe.Boolean?s.key==="valueLabels"&&String(a).toLowerCase()==="percent"?i[s.key]="percent":i[s.key]=a==="true"||a===!0:i[s.key]=String(a))}return i}function xoe(t){return!(/^-?\d+(\.\d+)?$/.test(t)||/^-?\d+(\.\d+)?%$/.test(t)||/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(t))}function h0(t){return t.entries.map(e=>{if(e.values&&e.values.length>1){if(e.key==="_series")return`_series = ${e.values.map(r=>`"${r}"`).join(",")}`;const o=e.values.join(",");return`"${e.key}" = ${o}`}const n=e.isPercentage?`${e.value}%`:String(e.value);return e.key==="_series"?`_series = "${n}"`:typeof e.value=="string"&&xoe(n)?`"${e.key}" = "${n}"`:`"${e.key}" = ${n}`}).join(`
|
|
90
|
-
`)}function woe(t,e){const n=Wr(t.properties),o=n.get("type"),r=o??e;return{name:t.name,chartType:o,properties:n,data:t.data,chartTypeOptions:fg(r,t.properties),colorizes:t.colorizes,highlights:t.highlights,areaFills:t.areaFills,annotations:t.annotations,annotationVisibility:t.annotationVisibility??[],series:t.series,transforms:t.transforms}}function O6(t,e){const n=t.find(o=>o.key===e);return n?String(n.value):void 0}function B6(t,e){const n=t.find(o=>o.key===e);if(n)return n.isPercentage,n.value}function L6(t){const e=t.find(n=>n.key==="maxWidth");if(e)return e.isPercentage?`${e.value}%`:e.value}const wa=t=>t==="true"||t===!0;function p0(t){return t.map(e=>({target:e.target,color:O6(e.properties,"color")??"#e15759",label:O6(e.properties,"label")}))}function m0(t){return t.map(e=>({target:e.target}))}function g0(t){return t.map(e=>{const n=Wr(e.properties);return{from:e.from,to:e.to,color:n.has("color")?String(n.get("color")):void 0,negativeColor:n.has("negativeColor")?String(n.get("negativeColor")):void 0,opacity:n.has("opacity")?Number(n.get("opacity")):void 0,interpolation:n.has("interpolation")?String(n.get("interpolation")):void 0}})}function v0(t){return t.map(e=>{const n=Wr(e.properties),o=e.kind??Pt.Point;if(o===Pt.Range){const a={kind:Pt.Range,start:n.has("start")?isNaN(Number(n.get("start")))?String(n.get("start")):Number(n.get("start")):0,end:n.has("end")?isNaN(Number(n.get("end")))?String(n.get("end")):Number(n.get("end")):0};return n.has("id")&&(a.id=String(n.get("id"))),n.has("orientation")&&(a.orientation=String(n.get("orientation"))),n.has("startAnchor")&&(a.startAnchor=String(n.get("startAnchor"))),n.has("endAnchor")&&(a.endAnchor=String(n.get("endAnchor"))),n.has("bgColor")&&(a.bgColor=String(n.get("bgColor"))),n.has("bgOpacity")&&(a.bgOpacity=Number(n.get("bgOpacity"))),n.has("direction")&&(a.direction=String(n.get("direction"))),n.has("text")&&(a.text=String(n.get("text"))),n.has("textColor")&&(a.textColor=String(n.get("textColor"))),a}if(o===Pt.Free){const a={kind:Pt.Free,text:String(n.get("text")??""),x:B6(e.properties,"x")??0,y:B6(e.properties,"y")??0};n.has("id")&&(a.id=String(n.get("id"))),n.has("textColor")&&(a.textColor=String(n.get("textColor")));const l=L6(e.properties);return l!==void 0&&(a.maxWidth=l),n.has("textOutline")&&(a.textOutline=wa(n.get("textOutline"))),a}const r="target"in e?e.target:"",i={kind:Pt.Point,target:r,text:String(n.get("text")??"")};n.has("id")&&(i.id=String(n.get("id"))),n.has("textColor")&&(i.textColor=String(n.get("textColor")));const s=L6(e.properties);return s!==void 0&&(i.maxWidth=s),n.has("textOutline")&&(i.textOutline=wa(n.get("textOutline"))),n.has("showLine")&&(i.showLine=wa(n.get("showLine"))),n.has("anchorDirection")&&(i.anchorDirection=String(n.get("anchorDirection"))),n.has("textOffsetX")&&(i.textOffsetX=Number(n.get("textOffsetX"))),n.has("textOffsetY")&&(i.textOffsetY=Number(n.get("textOffsetY"))),n.has("lineStyle")&&(i.lineStyle=String(n.get("lineStyle"))),n.has("lineWeight")&&(i.lineWeight=Number(n.get("lineWeight"))),n.has("showArrow")&&(i.showArrow=wa(n.get("showArrow"))),n.has("lineTargetDistance")&&(i.lineTargetDistance=Number(n.get("lineTargetDistance"))),n.has("showCircle")&&(i.showCircle=wa(n.get("showCircle"))),n.has("circleSize")&&(i.circleSize=Number(n.get("circleSize"))),n.has("circleStyle")&&(i.circleStyle=String(n.get("circleStyle"))),n.has("circleColor")&&(i.circleColor=String(n.get("circleColor"))),i})}function b0(t){return t.map(e=>{const n=Wr(e.properties),o={name:e.name};if(n.has("color")&&(o.color=String(n.get("color"))),n.has("lineWidth")&&(o.lineWidth=Number(n.get("lineWidth"))),n.has("dash")&&(o.dash=String(n.get("dash"))),n.has("interpolation")&&(o.interpolation=String(n.get("interpolation"))),n.has("labelMode")&&(o.labelMode=String(n.get("labelMode"))),n.has("labelText")&&(o.labelText=String(n.get("labelText"))),n.has("valueLabels")){const r=n.get("valueLabels");o.valueLabels=String(r).toLowerCase()==="percent"?"percent":wa(r)}return n.has("lineSymbols")&&(o.lineSymbols=wa(n.get("lineSymbols"))),n.has("hidden")&&(o.hidden=wa(n.get("hidden"))),n.has("symbolShape")&&(o.symbolShape=String(n.get("symbolShape"))),n.has("symbolShowOn")&&(o.symbolShowOn=String(n.get("symbolShowOn"))),n.has("symbolStyle")&&(o.symbolStyle=String(n.get("symbolStyle"))),n.has("symbolSize")&&(o.symbolSize=Number(n.get("symbolSize"))),n.has("symbolOpacity")&&(o.symbolOpacity=Number(n.get("symbolOpacity"))),o})}const _oe=`chart bar-vertical {
|
|
91
|
-
title = "E is the most frequent letter in English"
|
|
92
|
-
description = "How often each letter appears in typical English text"
|
|
93
|
-
byline = "Pierre Romera"
|
|
94
|
-
source = "Lewand, Cryptological Mathematics"
|
|
95
|
-
sourceUrl = "https://en.wikipedia.org/wiki/Letter_frequency"
|
|
96
|
-
note = "Based on analysis of 40,000 words from English prose"
|
|
97
|
-
colorPalette = "London"
|
|
98
|
-
sort = descending
|
|
99
|
-
valueLabels = true
|
|
100
|
-
verticalLabelPosition = off
|
|
101
|
-
verticalGridStyle = none
|
|
102
|
-
|
|
103
|
-
highlight "E"
|
|
104
|
-
|
|
105
|
-
data {
|
|
106
|
-
"E" = 12.70
|
|
107
|
-
"T" = 9.06
|
|
108
|
-
"A" = 8.17
|
|
109
|
-
"O" = 7.51
|
|
110
|
-
"I" = 6.97
|
|
111
|
-
"N" = 6.75
|
|
112
|
-
"S" = 6.33
|
|
113
|
-
"H" = 6.09
|
|
114
|
-
"R" = 5.99
|
|
115
|
-
"D" = 4.25
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
`,koe=`chart bar-vertical {
|
|
119
|
-
title = "China emits more CO₂ than the US and India combined"
|
|
120
|
-
description = "Annual emissions in billion tonnes, 2023"
|
|
121
|
-
source = "Global Carbon Project"
|
|
122
|
-
sourceUrl = "https://globalcarbonproject.org"
|
|
123
|
-
verticalLabelPosition = "off"
|
|
124
|
-
verticalGridStyle = "none"
|
|
125
|
-
valueLabels = true
|
|
126
|
-
|
|
127
|
-
data {
|
|
128
|
-
"China" = 11.9
|
|
129
|
-
"United States" = 4.78
|
|
130
|
-
"India" = 2.88
|
|
131
|
-
"Russia" = 1.78
|
|
132
|
-
"Japan" = 1.02
|
|
133
|
-
"Germany" = 0.64
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
highlight "China"
|
|
137
|
-
|
|
138
|
-
annotation "India" {
|
|
139
|
-
text = "Surpassed EU in 2023"
|
|
140
|
-
showLine = true
|
|
141
|
-
anchorDirection = N
|
|
142
|
-
textOffsetX = 66
|
|
143
|
-
textOffsetY = -41
|
|
144
|
-
lineStyle = curve-left
|
|
145
|
-
showArrow = true
|
|
146
|
-
lineTargetDistance = 26
|
|
147
|
-
showCircle = false
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
`,Soe=`chart bar-horizontal {
|
|
151
|
-
title = "Mandarin has nearly twice as many native speakers as Spanish"
|
|
152
|
-
description = "Number of native speakers worldwide, in millions"
|
|
153
|
-
source = "Ethnologue"
|
|
154
|
-
sourceUrl = "https://ethnologue.com"
|
|
155
|
-
byline = "Pierre Romera"
|
|
156
|
-
sort = descending
|
|
157
|
-
horizontalLabelPosition = off
|
|
158
|
-
horizontalGridStyle = none
|
|
159
|
-
|
|
160
|
-
highlight "Mandarin"
|
|
161
|
-
|
|
162
|
-
data {
|
|
163
|
-
"Mandarin" = 920
|
|
164
|
-
"Spanish" = 475
|
|
165
|
-
"English" = 373
|
|
166
|
-
"Hindi" = 344
|
|
167
|
-
"Bengali" = 234
|
|
168
|
-
"Portuguese" = 232
|
|
169
|
-
"Russian" = 154
|
|
170
|
-
"Japanese" = 125
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
`,Aoe=`chart bar-multi {
|
|
174
|
-
title = "Software overtakes hardware as the top revenue driver"
|
|
175
|
-
description = "USD billions"
|
|
176
|
-
byline = "Pierre Romera"
|
|
177
|
-
source = "Company filings"
|
|
178
|
-
note = "Figures are illustrative and do not represent actual company data"
|
|
179
|
-
tooltips = true
|
|
180
|
-
colorPalette = "Egypt"
|
|
181
|
-
|
|
182
|
-
data {
|
|
183
|
-
_series = "Hardware","Software","Services"
|
|
184
|
-
"Q1 2024" = 14.2,9.8,7.4
|
|
185
|
-
"Q2 2024" = 13.8,11.0,8.1
|
|
186
|
-
"Q3 2024" = 15.5,12.1,8.9
|
|
187
|
-
"Q4 2024" = 18.9,13.4,10.2
|
|
188
|
-
"Q1 2025" = 14.8,14.0,9.5
|
|
189
|
-
"Q2 2025" = 16.2,15.5,10.8
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
`,Coe=`chart bar-multi {
|
|
193
|
-
title = "USA tops Paris 2024 with 126 medals across all categories"
|
|
194
|
-
description = "2024 Paris Summer Games — top six nations"
|
|
195
|
-
source = "Olympics.com"
|
|
196
|
-
sourceUrl = "https://olympics.com"
|
|
197
|
-
colors = "#eeca3b, #c0c0c0, #cd7f32"
|
|
198
|
-
valueLabels = true
|
|
199
|
-
verticalGridStyle = none
|
|
200
|
-
verticalLabelPosition = off
|
|
201
|
-
sort = descending
|
|
202
|
-
|
|
203
|
-
data {
|
|
204
|
-
_series = "Gold","Silver","Bronze"
|
|
205
|
-
"USA" = 40,44,42
|
|
206
|
-
"China" = 38,32,18
|
|
207
|
-
"Japan" = 27,14,17
|
|
208
|
-
"Great Britain" = 22,21,22
|
|
209
|
-
"Australia" = 17,7,22
|
|
210
|
-
"France" = 16,20,23
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
`,$oe=`chart line {
|
|
214
|
-
title = "2024 was the hottest year on record"
|
|
215
|
-
description = "Deviation from the 1951–1980 average, in °C"
|
|
216
|
-
source = "NASA GISS"
|
|
217
|
-
sourceUrl = "https://data.giss.nasa.gov/gistemp/"
|
|
218
|
-
tooltips = true
|
|
219
|
-
crosshair = false
|
|
220
|
-
lineSymbols = true
|
|
221
|
-
|
|
222
|
-
data {
|
|
223
|
-
"1980" = 0.26
|
|
224
|
-
"1985" = 0.12
|
|
225
|
-
"1990" = 0.45
|
|
226
|
-
"1995" = 0.45
|
|
227
|
-
"2000" = 0.42
|
|
228
|
-
"2005" = 0.68
|
|
229
|
-
"2010" = 0.72
|
|
230
|
-
"2015" = 0.9
|
|
231
|
-
"2020" = 1.02
|
|
232
|
-
"2024" = 1.29
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
annotation "2015" {
|
|
236
|
-
id = "2o3cx"
|
|
237
|
-
text = "2015 Paris Agreement to limit global warming to 1.5°C "
|
|
238
|
-
maxWidth = 224
|
|
239
|
-
showLine = true
|
|
240
|
-
lineStyle = curve-right
|
|
241
|
-
showArrow = true
|
|
242
|
-
showCircle = true
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
`,Toe=`chart line-multi {
|
|
246
|
-
title = "Detroit's unemployment hit 16% during the Great Recession"
|
|
247
|
-
description = "Percent of labour force, 2000–2014"
|
|
248
|
-
source = "Bureau of Labor Statistics"
|
|
249
|
-
sourceUrl = "https://bls.gov"
|
|
250
|
-
note = "Not seasonally adjusted. Metro area definitions may vary across years."
|
|
251
|
-
colorPalette = "Maya"
|
|
252
|
-
tooltips = true
|
|
253
|
-
|
|
254
|
-
annotation "2009" {
|
|
255
|
-
text = "Great Recession peak"
|
|
256
|
-
dy = -10
|
|
257
|
-
showArrow = true
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
data {
|
|
261
|
-
_series = "New York","Los Angeles","Chicago","Detroit"
|
|
262
|
-
"2000" = 5.0,5.6,4.5,3.8
|
|
263
|
-
"2002" = 7.3,7.5,6.8,7.0
|
|
264
|
-
"2004" = 6.5,6.4,6.5,7.3
|
|
265
|
-
"2006" = 5.0,4.8,5.0,6.8
|
|
266
|
-
"2008" = 6.2,7.5,7.1,9.4
|
|
267
|
-
"2009" = 9.5,12.4,11.2,16.2
|
|
268
|
-
"2010" = 9.4,12.7,10.8,15.8
|
|
269
|
-
"2012" = 8.2,10.6,9.3,10.4
|
|
270
|
-
"2014" = 6.5,8.0,7.1,8.2
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
`,Moe=`chart pie {
|
|
274
|
-
title = "Asia is home to nearly 60% of the world's population"
|
|
275
|
-
description = "Estimated share, 2024"
|
|
276
|
-
source = "United Nations"
|
|
277
|
-
sourceUrl = "https://population.un.org"
|
|
278
|
-
colorPalette = "Klimt"
|
|
279
|
-
legendPosition = "right"
|
|
280
|
-
tooltips = true
|
|
281
|
-
|
|
282
|
-
data {
|
|
283
|
-
"Asia" = 59.4
|
|
284
|
-
"Africa" = 18.3
|
|
285
|
-
"Europe" = 9.3
|
|
286
|
-
"Latin America" = 8.2
|
|
287
|
-
"North America" = 4.8
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
`,Ooe=`chart bar-vertical {
|
|
291
|
-
title = "Brazil produces more coffee than the next three countries combined"
|
|
292
|
-
description = "Million 60-kg bags, 2023/24 crop year"
|
|
293
|
-
source = "International Coffee Organization"
|
|
294
|
-
sourceUrl = "https://ico.org"
|
|
295
|
-
colorPalette = "Harvey"
|
|
296
|
-
verticalLabelPosition = "off"
|
|
297
|
-
verticalGridStyle = "none"
|
|
298
|
-
valueLabels = true
|
|
299
|
-
|
|
300
|
-
data {
|
|
301
|
-
"Brazil" = 66.4
|
|
302
|
-
"Vietnam" = 29
|
|
303
|
-
"Colombia" = 11.4
|
|
304
|
-
"Indonesia" = 9.9
|
|
305
|
-
"Ethiopia" = 8.7
|
|
306
|
-
"Honduras" = 6.3
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
highlight "Brazil"
|
|
310
|
-
|
|
311
|
-
transform sort {
|
|
312
|
-
column = "value"
|
|
313
|
-
direction = descending
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
`,Boe=`chart donut {
|
|
317
|
-
title = "Chrome dominates with two-thirds of the desktop browser market"
|
|
318
|
-
description = "Worldwide, January 2025"
|
|
319
|
-
source = "StatCounter"
|
|
320
|
-
sourceUrl = "https://gs.statcounter.com"
|
|
321
|
-
colorPalette = "Heep"
|
|
322
|
-
legendPosition = "right"
|
|
323
|
-
tooltips = true
|
|
324
|
-
displayAsPercentage = true
|
|
325
|
-
|
|
326
|
-
data {
|
|
327
|
-
"Chrome" = 65.7
|
|
328
|
-
"Edge" = 13.1
|
|
329
|
-
"Safari" = 8.9
|
|
330
|
-
"Firefox" = 6.3
|
|
331
|
-
"Opera" = 3.1
|
|
332
|
-
"Others" = 2.9
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
`,Loe=`chart area {
|
|
336
|
-
title = "Apple stock climbed 36 % through 2024"
|
|
337
|
-
description = "Monthly closing price in USD"
|
|
338
|
-
source = "Yahoo Finance"
|
|
339
|
-
sourceUrl = "https://finance.yahoo.com"
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
data {
|
|
343
|
-
"Jan" = 183
|
|
344
|
-
"Feb" = 182
|
|
345
|
-
"Mar" = 171
|
|
346
|
-
"Apr" = 170
|
|
347
|
-
"May" = 192
|
|
348
|
-
"Jun" = 210
|
|
349
|
-
"Jul" = 222
|
|
350
|
-
"Aug" = 229
|
|
351
|
-
"Sep" = 233
|
|
352
|
-
"Oct" = 225
|
|
353
|
-
"Nov" = 237
|
|
354
|
-
"Dec" = 249
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
`,Poe=`chart area-stacked {
|
|
358
|
-
title = "Renewables rose from 18 % to 23 % of global energy since 2000"
|
|
359
|
-
description = "Share of primary energy by source, 2000–2023"
|
|
360
|
-
source = "Our World in Data"
|
|
361
|
-
sourceUrl = "https://ourworldindata.org/energy-mix"
|
|
362
|
-
stackPercent = true
|
|
363
|
-
areaSortMode = descending
|
|
364
|
-
|
|
365
|
-
data {
|
|
366
|
-
_series = "Coal","Oil","Gas","Renewables"
|
|
367
|
-
"2000" = 25,36,21,18
|
|
368
|
-
"2005" = 27,35,22,16
|
|
369
|
-
"2010" = 29,33,23,15
|
|
370
|
-
"2015" = 28,32,24,16
|
|
371
|
-
"2020" = 26,30,25,19
|
|
372
|
-
"2023" = 24,29,24,23
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
`,Doe=`chart column-stacked {
|
|
376
|
-
title = "Software revenue grew steadily while hardware spiked in Q4"
|
|
377
|
-
description = "Quarterly revenue in millions, 2024"
|
|
378
|
-
source = "Annual report"
|
|
379
|
-
|
|
380
|
-
data {
|
|
381
|
-
_series = "Hardware","Software","Services"
|
|
382
|
-
"Q1" = 120,85,45
|
|
383
|
-
"Q2" = 135,92,48
|
|
384
|
-
"Q3" = 128,98,52
|
|
385
|
-
"Q4" = 155,105,58
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
`,Eoe=`chart bar-stacked {
|
|
389
|
-
title = "India's working-age population now surpasses China's"
|
|
390
|
-
description = "Millions of people, 2023"
|
|
391
|
-
source = "UN Population Division"
|
|
392
|
-
sourceUrl = "https://population.un.org"
|
|
393
|
-
horizontalGridStyle = none
|
|
394
|
-
horizontalLabelPosition = off
|
|
395
|
-
|
|
396
|
-
data {
|
|
397
|
-
_series = "0-14","15-64","65+"
|
|
398
|
-
"China" = 249,987,191
|
|
399
|
-
"India" = 365,948,100
|
|
400
|
-
"USA" = 60,215,58
|
|
401
|
-
"Indonesia" = 66,191,18
|
|
402
|
-
"Brazil" = 42,150,22
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
`,Noe=`chart area-stacked {
|
|
406
|
-
title = "EU subsidies to new members surged after enlargement"
|
|
407
|
-
description = "Agricultural subsidies to post-socialist EU members, million euros"
|
|
408
|
-
source = "Eurostat"
|
|
409
|
-
sourceUrl = "https://ec.europa.eu/eurostat"
|
|
410
|
-
interpolation = "linear"
|
|
411
|
-
heightMode = "aspect-ratio"
|
|
412
|
-
aspectRatio = "1:1"
|
|
413
|
-
|
|
414
|
-
data {
|
|
415
|
-
_series = "Indirect subsidies","Direct subsidies"
|
|
416
|
-
"2000" = 370,800
|
|
417
|
-
"2001" = 445,896
|
|
418
|
-
"2002" = 567,816
|
|
419
|
-
"2003" = 641,950
|
|
420
|
-
"2004" = 1908,2434
|
|
421
|
-
"2005" = 2234,3509
|
|
422
|
-
"2006" = 2576,4356
|
|
423
|
-
"2007" = 2467,5429
|
|
424
|
-
"2008" = 2672,6655
|
|
425
|
-
"2009" = 2474,7195
|
|
426
|
-
"2010" = 2117,8207
|
|
427
|
-
"2011" = 1863,9230
|
|
428
|
-
"2012" = 1528,9191
|
|
429
|
-
"2013" = 1251,10252
|
|
430
|
-
"2014" = 1132,10987
|
|
431
|
-
"2015" = 1687,10145
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
scene "Indirect subsidies shrank" {
|
|
435
|
-
title = "Indirect subsidies were cut under WTO pressure"
|
|
436
|
-
description = "Subsidies tied to specific crops fell foul of World Trade Organization rules"
|
|
437
|
-
|
|
438
|
-
highlight "Indirect subsidies"
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
scene "Direct subsidies dominate" {
|
|
442
|
-
title = "Direct per-hectare payments now dominate"
|
|
443
|
-
description = "The larger the fields, the more money farmers receive"
|
|
444
|
-
|
|
445
|
-
highlight "Direct subsidies"
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
scene "Bulgaria: subsidies explode" {
|
|
449
|
-
title = "Subsidies to Bulgarian farmers, million euros"
|
|
450
|
-
description = "85% of Bulgarian subsidies are direct payments — the highest share among new members"
|
|
451
|
-
|
|
452
|
-
data {
|
|
453
|
-
_series = "Indirect subsidies","Direct subsidies"
|
|
454
|
-
"2000" = 0,5
|
|
455
|
-
"2001" = 0,33
|
|
456
|
-
"2002" = 0,48
|
|
457
|
-
"2003" = 0,69
|
|
458
|
-
"2004" = 0,67
|
|
459
|
-
"2005" = 0,87
|
|
460
|
-
"2006" = 0,57
|
|
461
|
-
"2007" = 59,250
|
|
462
|
-
"2008" = 75,484
|
|
463
|
-
"2009" = 97,415
|
|
464
|
-
"2010" = 79,466
|
|
465
|
-
"2011" = 94,458
|
|
466
|
-
"2012" = 120,617
|
|
467
|
-
"2013" = 132,852
|
|
468
|
-
"2014" = 143,821
|
|
469
|
-
"2015" = 213,677
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
highlight "Direct subsidies"
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
scene "Bulgarian farms grew" {
|
|
476
|
-
title = "Average farm size in Bulgaria quadrupled"
|
|
477
|
-
description = "Average farm size in hectares"
|
|
478
|
-
type = line
|
|
479
|
-
|
|
480
|
-
data {
|
|
481
|
-
"2005" = 5
|
|
482
|
-
"2007" = 6
|
|
483
|
-
"2010" = 12
|
|
484
|
-
"2013" = 18
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
scene "Production rose" {
|
|
489
|
-
title = "Bulgarian farm production rose from 3 to 4 billion euros"
|
|
490
|
-
description = "Total production of Bulgarian farms, million euros"
|
|
491
|
-
type = area
|
|
492
|
-
|
|
493
|
-
data {
|
|
494
|
-
"2000" = 2933
|
|
495
|
-
"2001" = 3240
|
|
496
|
-
"2002" = 3051
|
|
497
|
-
"2003" = 2816
|
|
498
|
-
"2004" = 3049
|
|
499
|
-
"2005" = 3011
|
|
500
|
-
"2006" = 3111
|
|
501
|
-
"2007" = 3038
|
|
502
|
-
"2008" = 4148
|
|
503
|
-
"2009" = 3437
|
|
504
|
-
"2010" = 3486
|
|
505
|
-
"2011" = 4038
|
|
506
|
-
"2012" = 4161
|
|
507
|
-
"2013" = 4115
|
|
508
|
-
"2014" = 4138
|
|
509
|
-
"2015" = 3915
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
scene "Cash crops replaced vegetables" {
|
|
514
|
-
title = "Cash crops replaced vegetables in Bulgaria"
|
|
515
|
-
description = "Production of Bulgarian farms, million euros"
|
|
516
|
-
type = area-stacked
|
|
517
|
-
|
|
518
|
-
data {
|
|
519
|
-
_series = "Vegetables","Cash crops","Other production"
|
|
520
|
-
"2000" = 464,615,1854
|
|
521
|
-
"2001" = 458,777,2005
|
|
522
|
-
"2002" = 577,850,1624
|
|
523
|
-
"2003" = 539,818,1459
|
|
524
|
-
"2004" = 483,1103,1463
|
|
525
|
-
"2005" = 492,994,1525
|
|
526
|
-
"2006" = 510,1083,1518
|
|
527
|
-
"2007" = 436,936,1666
|
|
528
|
-
"2008" = 541,2045,1563
|
|
529
|
-
"2009" = 243,1553,1641
|
|
530
|
-
"2010" = 184,2173,1128
|
|
531
|
-
"2011" = 120,2853,1065
|
|
532
|
-
"2012" = 117,2900,1144
|
|
533
|
-
"2013" = 139,2802,1174
|
|
534
|
-
"2014" = 143,3082,914
|
|
535
|
-
"2015" = 144,2986,785
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
highlight "Cash crops"
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
scene "Vegetables collapsed" {
|
|
542
|
-
title = "Vegetable production fell by a factor of four"
|
|
543
|
-
description = "A traditional Bulgarian cultivation shrank as subsidies favoured large fields"
|
|
544
|
-
|
|
545
|
-
highlight "Vegetables"
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
scene "Every vegetable declined" {
|
|
549
|
-
title = "Bulgarian vegetable production collapsed across the board"
|
|
550
|
-
description = "Production volume indexed to 2001 = 100"
|
|
551
|
-
type = line-multi
|
|
552
|
-
lineSymbols = false
|
|
553
|
-
|
|
554
|
-
data {
|
|
555
|
-
_series = "Cabbages","Tomatoes","Watermelons","Carrots","Onions","Garlic","Strawberries"
|
|
556
|
-
"2001" = 100,100,100,100,100,100,100
|
|
557
|
-
"2002" = 79,90,124,64,106,95,100
|
|
558
|
-
"2003" = 100,157,177,142,118,98,72
|
|
559
|
-
"2004" = 84,87,83,245,124,138,74
|
|
560
|
-
"2005" = 50,46,62,30,40,93,42
|
|
561
|
-
"2006" = 52,78,113,95,56,80,56
|
|
562
|
-
"2007" = 36,49,64,74,29,30,38
|
|
563
|
-
"2008" = 47,49,66,97,44,29,55
|
|
564
|
-
"2009" = 28,38,74,105,23,39,55
|
|
565
|
-
"2010" = 57,42,51,76,53,57,37
|
|
566
|
-
"2011" = 32,38,56,86,47,43,45
|
|
567
|
-
"2012" = 34,34,46,69,29,43,31
|
|
568
|
-
"2013" = 33,43,53,39,36,40,24
|
|
569
|
-
"2014" = 31,44,28,69,37,8,27
|
|
570
|
-
"2015" = 31,45,50,57,25,18,32
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
scene "Jobs disappeared" {
|
|
575
|
-
title = "Seasonal farm workers vanished while salaried jobs held steady"
|
|
576
|
-
description = "EU agricultural employment, thousands of full-time equivalents"
|
|
577
|
-
type = line-multi
|
|
578
|
-
lineSymbols = false
|
|
579
|
-
|
|
580
|
-
data {
|
|
581
|
-
_series = "Salaried workers","Non-salaried workers"
|
|
582
|
-
"2000" = 2678,12194
|
|
583
|
-
"2001" = 2598,11586
|
|
584
|
-
"2002" = 2658,10795
|
|
585
|
-
"2003" = 2563,10609
|
|
586
|
-
"2004" = 2560,9999
|
|
587
|
-
"2005" = 2501,10047
|
|
588
|
-
"2006" = 2499,9782
|
|
589
|
-
"2007" = 2437,9231
|
|
590
|
-
"2008" = 2416,8971
|
|
591
|
-
"2009" = 2348,8672
|
|
592
|
-
"2010" = 2335,7808
|
|
593
|
-
"2011" = 2322,7551
|
|
594
|
-
"2012" = 2325,7501
|
|
595
|
-
"2013" = 2297,7425
|
|
596
|
-
"2014" = 2366,7183
|
|
597
|
-
"2015" = 2413,6928
|
|
598
|
-
"2016" = 2457,6741
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
highlight "Non-salaried workers"
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
`,Ioe=`chart bar-split {
|
|
605
|
-
title = "CDU/CSU led German polls at 29 % ahead of the 2021 election"
|
|
606
|
-
description = "How Germany would vote in the September 2021 federal election, according to polling in the previous June"
|
|
607
|
-
source = "FG Wahlen"
|
|
608
|
-
sourceUrl = "https://www.forschungsgruppe.de"
|
|
609
|
-
note = "Margin of error at 10%: +/- 2 percentage points; at 40%: +/- 3 percentage points"
|
|
610
|
-
|
|
611
|
-
data {
|
|
612
|
-
_series = "Poll","High","Low"
|
|
613
|
-
"CDU/CSU" = 29,32,27
|
|
614
|
-
"Greens" = 22,25,20
|
|
615
|
-
"SPD" = 14,16,12
|
|
616
|
-
"AfD" = 10,12,8
|
|
617
|
-
"FDP" = 10,12,8
|
|
618
|
-
"Left" = 7,9,5
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
`,Roe=`chart bar-grouped {
|
|
622
|
-
title = "Asia Pacific holds more renewable capacity than all other regions combined"
|
|
623
|
-
description = "Installed capacity in gigawatts (GW)"
|
|
624
|
-
source = "IRENA"
|
|
625
|
-
sourceUrl = "https://www.irena.org"
|
|
626
|
-
|
|
627
|
-
data {
|
|
628
|
-
_series = "Solar","Wind","Hydro"
|
|
629
|
-
"Asia Pacific" = 680,540,840
|
|
630
|
-
"Europe" = 250,300,200
|
|
631
|
-
"North America" = 200,180,190
|
|
632
|
-
"Latin America" = 30,50,200
|
|
633
|
-
"Africa" = 15,10,40
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
`;function P6(t,e){const n=t.properties.find(o=>o.key===e);return n?String(n.value):""}function Foe(t){if(!t.data)return"";const e=t.data.entries,n=e.find(i=>i.key==="_series");if(n){const s=["category",...String(n.value).split(",")].join(" "),a=e.filter(l=>l.key!=="_series").map(l=>{const c=String(l.value).split(",");return[l.key,...c].join(" ")});return[s,...a].join(`
|
|
637
|
-
`)}const o=["label","value"].join(" "),r=e.map(i=>[i.key,String(i.value)].join(" "));return[o,...r].join(`
|
|
638
|
-
`)}function Voe(t){if(!t.data)return"";const e=t.data.entries,n=e.find(o=>o.key==="_series");if(n){const o=`_series = "${String(n.value)}"`,r=e.filter(i=>i.key!=="_series").map(i=>`"${i.key}" = "${String(i.value)}"`);return[o,...r].join(`
|
|
639
|
-
`)}return e.map(o=>`"${o.key}" = ${String(o.value)}`).join(`
|
|
640
|
-
`)}function no(t,e){const n=dg(e);return{id:t,title:P6(n,"title"),description:P6(n,"description"),chartType:n.chartType,tsvData:Foe(n),serializedData:Voe(n),dsl:e}}const D6=[no("letter-frequency",_oe),no("co2-emissions",koe),no("coffee-production",Ooe),no("spoken-languages",Soe),no("quarterly-revenue",Aoe),no("medal-count",Coe),no("temperature-anomaly",$oe),no("unemployment-rates",Toe),no("browser-market",Boe),no("world-population",Moe),no("stock-price-area",Loe),no("energy-mix-stacked-area",Poe),no("quarterly-stacked-columns",Doe),no("population-stacked-bar",Eoe),no("election-polls",Ioe),no("renewable-capacity",Roe),no("farm-compass",Noe)],E6=new Set;function zoe(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=ui.Total:E6.has(r.transformType)||(E6.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function Hoe(t){const e=i=>{const s=t.get(i);return s==null?void 0:String(s)||void 0},n=t.get("transparentBackground"),o={title:e("title"),description:e("description"),source:e("source"),sourceUrl:e("sourceUrl"),byline:e("byline"),note:e("note"),padding:e("padding"),transparentBackground:n===!0||n==="true"||void 0};return Object.values(o).some(i=>i!==void 0)?o:void 0}function Woe(t){const e=Wr(t.properties),n=t.data?h0(t.data):"",o=gs(n),r=e.get("sort"),i=r==null?void 0:String(r),s=i===Jt.Ascending||i===Jt.Descending?i:void 0,a=e.get("theme"),l=e.get("sortMode");let c;return(l===ui.Total||l===ui.WithinGroups||l===ui.None)&&(c=l),c=zoe(t.transforms,c,"chart"),{chartType:t.chartType,data:o,properties:t.properties,frame:Hoe(e),colorizes:p0(t.colorizes),highlights:m0(t.highlights),areaFills:g0(t.areaFills),annotations:v0(t.annotations),seriesOverrides:b0(t.series),scenes:t.scenes,sort:s,sortMode:c,theme:a==null?void 0:String(a)||void 0}}const N6=new Set;function Uoe(t,e,n){let o=e;for(const r of t)r.transformType==="sort"?o=ui.Total:N6.has(r.transformType)||(N6.add(r.transformType),console.warn(`[blueprint-chart] Unknown transform "${r.transformType}" in ${n}; ignored.`));return o}function Goe(){return{properties:new Map,chartTypeOptions:{},colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],hiddenAnnotationIds:new Set,transforms:[]}}function qoe(t,e,n){const o=Goe();for(let r=0;r<=e;r++){const i=t[r],s=Wr(i.properties),a=s.get("type");a&&(o.chartType=a);const l=o.chartType??n;i.data&&(o.data=i.data);const c=fg(l,i.properties);if(o.chartTypeOptions={...o.chartTypeOptions,...c},i.colorizes.length>0?o.colorizes=i.colorizes:i.data&&(o.colorizes=[]),r===e&&(o.highlights=i.highlights),i.areaFills.length>0&&(o.areaFills=i.areaFills),i.annotations.length>0){const u=[...o.annotations];for(const d of i.annotations){const f=Wr(d.properties).get("id");if(f!=null){const h=u.findIndex(g=>Wr(g.properties).get("id")===f);if(h>=0){u[h]=d;continue}}u.push(d)}o.annotations=u}for(const u of i.annotationVisibility)u.action===sC.Hide?o.hiddenAnnotationIds.add(u.id):o.hiddenAnnotationIds.delete(u.id);i.series.length>0&&(o.seriesOverrides=i.series),i.transforms.length>0&&(o.transforms=[...o.transforms,...i.transforms]);for(const[u,d]of s)o.properties.set(u,d)}return o}function Yoe(t,e){const n=t.options??(t.properties?f0(t.chartType,fg(t.chartType,t.properties)):{}),o={chartType:t.chartType,data:t.data,options:n,frame:t.frame,colorizes:t.colorizes??[],highlights:t.highlights??[],areaFills:t.areaFills??[],annotations:t.annotations??[],seriesOverrides:t.seriesOverrides??[],sort:t.sort,sortMode:t.sortMode,theme:t.theme};if(e==null||!t.scenes||e<0||e>=t.scenes.length)return o;const r=qoe(t.scenes,e,t.chartType),i=r.chartType??t.chartType,s=r.data?gs(h0(r.data)):o.data,a=Object.keys(r.chartTypeOptions).length>0?f0(i,{...n,...r.chartTypeOptions}):n,l=r.colorizes.length>0?p0(r.colorizes):r.data?[]:o.colorizes,c=e!=null?m0(r.highlights):o.highlights,u=r.areaFills.length>0?g0(r.areaFills):o.areaFills,d=r.annotations.length>0?v0(r.annotations):[],f=[...o.annotations,...d],h=r.hiddenAnnotationIds.size>0?f.filter(x=>!x.id||!r.hiddenAnnotationIds.has(x.id)):f,g=r.seriesOverrides.length>0?b0(r.seriesOverrides):o.seriesOverrides,v=Uoe(r.transforms,o.sortMode,`scene ${e}`),m=["title","description","source","sourceUrl","byline","note"],b={};for(const x of m){const _=r.properties.get(x);typeof _=="string"&&(b[x]=_)}const y=Object.keys(b).length>0?{...o.frame,...b}:o.frame;return{...o,chartType:i,data:s,options:a,frame:y,colorizes:l,highlights:c,areaFills:u,annotations:h,seriesOverrides:g,sortMode:v}}const nb=new WeakMap;function joe(t){const e=nb.get(t);if(!(!e||e.size===0)){for(const n of e)t.style[n]="";e.clear()}}function wc(t,e){let n=nb.get(t);n||(n=new Set,nb.set(t,n)),n.add(e)}function Xoe(t,e,n){if(joe(t),n.ignoreLayout||!e)return{constrained:!1};const o=Wr(e),r=o.get("heightMode"),i=o.get("aspectRatio"),s=o.get("fixedHeight");let a=!1;if(r==="aspect-ratio"&&i){const l=String(i).split(":").map(Number);l.length===2&&l[0]>0&&l[1]>0&&(t.style.aspectRatio=`${l[0]} / ${l[1]}`,t.style.height="auto",wc(t,"aspectRatio"),wc(t,"height"),a=!0)}else r==="fixed"&&s&&(t.style.height=`${s}px`,wc(t,"height"),a=!0);return a&&(t.style.display="flex",t.style.flexDirection="column",t.style.overflow="hidden",wc(t,"display"),wc(t,"flexDirection"),wc(t,"overflow")),{constrained:a}}const N2=new WeakMap;function eT(t){t.querySelectorAll("[data-bc-fade-overlay]").forEach(e=>{typeof e.getAnimations=="function"&&e.getAnimations().forEach(n=>n.cancel()),e.remove()})}function Koe(t,e,n){if(!n)return null;const o=N2.get(t);return!o||o===e?null:(eT(t),Br(t))}function Zoe(t,e,n){if(N2.set(t,e),n){const o=t.querySelector(".bc-frame .bc-frame-body");o&&Or(o),Lr(t,n)}}function I6(t){N2.delete(t),eT(t)}function Qoe(t,e,n){const o=t.querySelector(".bc-frame");if(!o)return;const r=[];o.classList.forEach(i=>{i.startsWith("bc-theme-")&&r.push(i)});for(const i of r)o.classList.remove(i);e.theme&&o.classList.add(`bc-theme-${e.theme}`),n.constrained&&o.classList.add("bc-frame--constrained")}function I2(t,e,n={}){var h;if(n.transition||(t.replaceChildren(),I6(t)),e.data.labels.length===0){n.transition&&(t.replaceChildren(),I6(t));return}let o=e;if(n.stripColors){const g={...e};if(e.properties&&(g.properties=e.properties.filter(v=>v.key!=="colors"&&v.key!=="colorPalette")),e.options){const{colors:v,colorPalette:m,...b}=e.options;g.options=b}o=g}const r=Xoe(t,o.properties,n),i=Yoe(o,n.sceneIndex),s=Ene(i.chartType);if(!s)return;const a=Koe(t,i.chartType,!!n.transition);a&&t.replaceChildren();const l=Mr(t),c=K$(i.options,l);let u;if(n.thumbnail)u=null;else{const g=((h=i.frame)==null?void 0:h.padding)??n.padding??"16px";u={...i.frame??{},padding:g}}const d=sc(t);n.transition&&d.beginCommit(),s(t,i.data,{frame:u,sort:i.sort,sortMode:i.sortMode,...c,colorizes:i.colorizes.length>0?i.colorizes:void 0,highlights:i.highlights.length>0?i.highlights:void 0,areaFills:i.areaFills.length>0?i.areaFills:void 0,annotations:i.annotations.length>0?i.annotations:void 0,seriesOverrides:i.seriesOverrides.length>0?i.seriesOverrides:void 0},!!n.transition),n.transition&&d.commit({mode:n.transitionMode});const f=n.theme??i.theme;Qoe(t,{theme:f},r),Zoe(t,i.chartType,a)}function tT(t,e,n){if(!e){n!=null&&n.transition||t.replaceChildren();return}const o=dg(e),r=Woe(o);I2(t,r,n)}const R6="abcdefghijklmnopqrstuvwxyz0123456789";function Joe(){let t="";for(let e=0;e<8;e++)t+=R6[Math.floor(Math.random()*R6.length)];return t}const ere=Lo("scenes",()=>{const t=ze([]),e=Fe(-1),n=Fe(!1);let o=null;const r=A(()=>e.value<0||e.value>=t.value.length?null:t.value[e.value]);function i(){const b=Joe();return t.value.push({id:b,name:null}),b}function s(b){b<0||b>=t.value.length||(t.value.splice(b,1),e.value>=t.value.length&&(e.value=t.value.length>0?t.value.length-1:-1),t.value.length===0&&(e.value=-1))}function a(b,y){b<0||b>=t.value.length||(t.value[b]={...t.value[b],...y})}function l(b){b!==e.value&&(b===-1||b>=0&&b<t.value.length)&&(e.value=b)}function c(){l(e.value+1)}function u(){l(e.value-1)}function d(b,y){if(b<0||b>=t.value.length||y<0||y>=t.value.length)return;const[x]=t.value.splice(b,1);t.value.splice(y,0,x),e.value===b?e.value=y:b<e.value&&y>=e.value?e.value--:b>e.value&&y<=e.value&&e.value++}function f(){n.value||(n.value=!0,t.value.length!==0&&(e.value=-1,o=setInterval(()=>{e.value<t.value.length-1?e.value++:h()},3e3)))}function h(){n.value=!1,o!==null&&(clearInterval(o),o=null)}function g(){h(),t.value=[],e.value=-1}function v(){return{scenes:t.value.map(b=>({...b})),activeIndex:e.value}}function m(b){h(),t.value=b.scenes.map(y=>({...y})),e.value=b.activeIndex}return{scenes:t,activeIndex:e,playing:n,activeScene:r,add:i,remove:s,update:a,setActive:l,nextScene:c,previousScene:u,reorder:d,startPlayback:f,stopPlayback:h,reset:g,snapshot:v,hydrate:m}});function _n(){const t=ere(),{scenes:e,activeIndex:n,playing:o,activeScene:r}=Mt(t);return{scenes:e,activeIndex:n,playing:o,activeScene:r,add:t.add,remove:t.remove,update:t.update,setActive:t.setActive,nextScene:t.nextScene,previousScene:t.previousScene,reorder:t.reorder,startPlayback:t.startPlayback,stopPlayback:t.stopPlayback,reset:t.reset,snapshot:t.snapshot,hydrate:t.hydrate}}function y0(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((n,o)=>y0(n,e[o]));if(typeof t=="object"&&typeof e=="object"){const n=Object.keys(t),o=Object.keys(e);return n.length!==o.length?!1:n.every(r=>y0(t[r],e[r]))}return!1}function nT(t){return!(t===void 0||Array.isArray(t)&&t.length===0)}function F6(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i&&e in i&&nT(i[e]))return i[e]}return t}function V6(t,e,n,o){for(let r=o-1;r>=0;r--){const i=n[r];if(i!=null&&i.properties&&e in i.properties)return String(i.properties[e])}return t}const lf={sizing:"max-width",fixedWidth:600,maxWidth:660,heightMode:"auto",fixedHeight:400,aspectRatio:"16:9",padding:16,transparentBackground:!1,playerType:"buttons",playerPosition:"left"},z6={chartType:Le.BarVertical,title:"",description:"",byline:"",source:"",sourceUrl:"",note:"",sort:Jt.None,sortMode:"none",data:"",selectedColumn:"",colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...lf}};function dl(t,e){return A({get(){const{activeScene:n,activeIndex:o,scenes:r}=_n(),i=n.value;return i&&e in i&&nT(i[e])?i[e]:o.value>=0?F6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=_n();if(o.value>=0&&r.value){const a=F6(t.value,e,s.value,o.value);if(y0(n,a)){const l={...r.value};delete l[e],s.value[o.value]=l}else i(o.value,{[e]:n});return}t.value=n}})}function ha(t,e){return A({get(){const{activeScene:n,activeIndex:o,scenes:r}=_n(),i=n.value;return i!=null&&i.properties&&e in i.properties?String(i.properties[e]):o.value>=0?V6(t.value,e,r.value,o.value):t.value},set(n){const{activeIndex:o,activeScene:r,update:i,scenes:s}=_n();if(o.value>=0&&r.value){const a=V6(t.value,e,s.value,o.value);if(n===a){const l={...r.value.properties};delete l[e];const c=Object.keys(l).length>0?l:void 0,u={...r.value,properties:c};c||delete u.properties,s.value[o.value]=u}else{const l=r.value.properties??{};i(o.value,{properties:{...l,[e]:n}})}return}t.value=n}})}const tre=Lo("chartConfig",()=>{const t=ar({...z6}),e=J0(t),n=dl(e.chartType,"chartType"),o=dl(e.data,"data"),r=dl(e.colorizes,"colorizes"),i=dl(e.highlights,"highlights"),s=dl(e.areaFills,"areaFills"),a=dl(e.annotations,"annotations"),l=dl(e.seriesOverrides,"seriesOverrides"),c=ha(e.title,"title"),u=ha(e.description,"description"),d=ha(e.byline,"byline"),f=ha(e.source,"source"),h=ha(e.sourceUrl,"sourceUrl"),g=ha(e.note,"note"),v=ha(e.sort,"sort"),m=ha(e.sortMode,"sortMode");function b(){Object.assign(t,{...z6,colorizes:[],highlights:[],areaFills:[],annotations:[],seriesOverrides:[],layout:{...lf}})}function y(x){Object.assign(t,{...x,layout:{...lf,...x.layout}})}return{chartType:n,data:o,colorizes:r,highlights:i,areaFills:s,annotations:a,seriesOverrides:l,title:c,description:u,byline:d,source:f,sourceUrl:h,note:g,sort:v,sortMode:m,layout:e.layout,selectedColumn:e.selectedColumn,_base:Me(e),reset:b,hydrate:y}});function pn(){const t=tre(),e=Mt(t);return{chartType:e.chartType,data:e.data,colorizes:e.colorizes,highlights:e.highlights,areaFills:e.areaFills,annotations:e.annotations,seriesOverrides:e.seriesOverrides,title:e.title,description:e.description,byline:e.byline,source:e.source,sourceUrl:e.sourceUrl,note:e.note,sort:e.sort,sortMode:e.sortMode,layout:e.layout,selectedColumn:e.selectedColumn,_base:t._base,reset:t.reset,hydrate:t.hydrate}}function nre(t){const e=t.split(`
|
|
641
|
-
`)[0]??"",n=(e.match(/\t/g)??[]).length,o=(e.match(/,/g)??[]).length;return n>=o?" ":","}function kh(t,e){if(e===" ")return t.split(" ").map(i=>i.trim());const n=[];let o="",r=!1;for(let i=0;i<t.length;i++){const s=t[i];s==='"'?r&&t[i+1]==='"'?(o+='"',i++):r=!r:s===e&&!r?(n.push(o.trim()),o=""):o+=s}return n.push(o.trim()),n}const ore=[/^\d{4}-\d{2}-\d{2}$/,/^\d{4}-\d{2}$/,/^\d{4}$/,/^\d{1,2}\/\d{1,2}\/\d{2,4}$/,/^\d{1,2}-\d{1,2}-\d{2,4}$/,/^(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{1,2},?\s+\d{4}$/i,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{4}\/\d{2}$/,/^Q[1-4]\s+\d{4}$/];function rre(t){if(!t)return!1;for(const e of ore)if(e.test(t))return/^\d{4}(-\d{2})?$/.test(t)||/^\d{4}\/\d{2}$/.test(t)||/^Q[1-4]\s+\d{4}$/.test(t)?!0:!Number.isNaN(Date.parse(t));return!1}function oT(t){const e=t.match(/^[<>≤≥~]\s*(.+)$/);if(e){const n=e[1].replace(/[,%$€£¥₹]/g,"").trim();if(n.length>0&&!Number.isNaN(Number(n)))return e[1].trim()}return t}function ire(t){if(!t)return!1;const e=oT(t).replace(/[,%$€£¥₹]/g,"").trim();return e.length>0&&!Number.isNaN(Number(e))}function ob(t,e){return t.map((n,o)=>{const r=e.map(i=>i[o]??"").filter(i=>i.length>0);return r.length===0?"string":r.every(rre)?"date":r.every(ire)?"number":"string"})}function rT(t){var s;const e=t.split(`
|
|
642
|
-
`).map(a=>a.trim()).filter(Boolean);if(e.length===0)return{columns:[],rows:[],columnTypes:[]};const n=(s=e[0])==null?void 0:s.match(/^_series\s*=\s*(.+)$/);if(n){const a=n[1].trim(),c=["label",...a.includes('","')?a.split(",").map(f=>f.trim().replace(/^"|"$/g,"")):a.replace(/^"|"$/g,"").split(",").map(f=>f.trim())],u=[];for(let f=1;f<e.length;f++){const h=e[f].match(/^"([^"]+)"\s*=\s*([^"]+)$/),v=e[f].match(/^"([^"]+)"\s*=\s*"([^"]*)"$/)??h;v&&u.push([v[1],...v[2].split(",").map(m=>m.trim())])}const d=ob(c,u);return{columns:c,rows:u,columnTypes:d}}const o=["label","value"],r=[];for(const a of e){const l=a.match(/^"([^"]+)"\s*=\s*(.+)$/);l&&r.push([l[1],l[2].replace(/%$/,"").trim()])}const i=ob(o,r);return{columns:o,rows:r,columnTypes:i}}function H6(t,e,n=" "){const o=s=>n===" "?s:s.includes(n)||s.includes('"')||s.includes(`
|
|
643
|
-
`)?`"${s.replace(/"/g,'""')}"`:s,r=t.map(o).join(n),i=e.map(s=>s.map(o).join(n));return[r,...i].join(`
|
|
644
|
-
`)}function rb(t,e){const n=e??{},o=n.trimWhitespace!==!1,r=t.split(`
|
|
645
|
-
`).filter(u=>u.trim().length>0);if(r.length===0)return{columns:[],rows:[],columnTypes:[]};const i=n.delimiter&&n.delimiter!=="auto"?n.delimiter:nre(t),s=n.firstRowIsHeader!==!1;let a,l;s?(a=kh(r[0],i),l=r.slice(1).map(u=>kh(u,i))):(a=kh(r[0],i).map((d,f)=>`Column ${f+1}`),l=r.map(d=>kh(d,i))),o&&(a=a.map(u=>u.trim()),l=l.map(u=>u.map(d=>d.trim()))),n.decimalSeparator===","&&(l=l.map(u=>u.map(d=>/^\d+,\d+$/.test(d)?d.replace(",","."):d))),l=l.map(u=>u.map(oT));const c=ob(a,l);return{columns:a,rows:l,columnTypes:c}}var et=(t=>(t.Sort="sort",t.Filter="filter",t.HideColumns="hide-columns",t.Transpose="transpose",t.Parse="parse",t.Rename="rename",t.GroupBy="group-by",t.Computed="computed",t))(et||{}),bo=(t=>(t.Equals="equals",t.NotEquals="not-equals",t.Contains="contains",t.GreaterThan="greater-than",t.LessThan="less-than",t))(bo||{}),Rt=(t=>(t.Type="type",t.String="string",t.Numeric="numeric",t.Date="date",t))(Rt||{});const Eo=["string","number","date"],sp=[{id:"to-number",label:"To Number",description:"Strip non-numeric characters and convert to number",category:Rt.Type,accepts:Eo,outputType:"number"},{id:"to-string",label:"To String",description:"Keep value as plain text",category:Rt.Type,accepts:Eo,outputType:"string"},{id:"to-date",label:"To Date",description:"Parse text into an ISO date",category:Rt.Type,accepts:Eo,outputType:"date"},{id:"to-boolean",label:"To Boolean",description:"Map yes/no, true/false, 1/0 to boolean",category:Rt.Type,accepts:Eo,outputType:"string"},{id:"parse-json",label:"Parse JSON",description:"Parse JSON string and optionally extract a key",category:Rt.Type,accepts:["string"],outputType:"string",params:["key"]},{id:"trim",label:"Trim",description:"Remove leading and trailing whitespace",category:Rt.String,accepts:Eo,outputType:"string"},{id:"lowercase",label:"Lowercase",description:"Convert all characters to lowercase",category:Rt.String,accepts:Eo,outputType:"string"},{id:"uppercase",label:"Uppercase",description:"Convert all characters to uppercase",category:Rt.String,accepts:Eo,outputType:"string"},{id:"title-case",label:"Title Case",description:"Capitalize the first letter of each word",category:Rt.String,accepts:Eo,outputType:"string"},{id:"slugify",label:"Slugify",description:"Lowercase and replace non-alphanumeric with hyphens",category:Rt.String,accepts:Eo,outputType:"string"},{id:"regex-replace",label:"Regex Replace",description:"Find and replace using a regular expression",category:Rt.String,accepts:Eo,outputType:"string",params:["pattern","replacement"]},{id:"extract",label:"Extract Substring",description:"Extract a portion of text by character position",category:Rt.String,accepts:Eo,outputType:"string",params:["start","end"]},{id:"pad-start",label:"Pad Start",description:"Pad the beginning to a fixed length",category:Rt.String,accepts:Eo,outputType:"string",params:["length","char"]},{id:"pad-end",label:"Pad End",description:"Pad the end to a fixed length",category:Rt.String,accepts:Eo,outputType:"string",params:["length","char"]},{id:"remove-diacritics",label:"Remove Diacritics",description:"Strip accents and diacritical marks",category:Rt.String,accepts:Eo,outputType:"string"},{id:"split",label:"Split into Columns",description:"Split values by a separator into new columns",category:Rt.String,accepts:Eo,outputType:"string",params:["separator","limit"]},{id:"round",label:"Round",description:"Round to a number of decimal places",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["decimals"]},{id:"floor",label:"Floor",description:"Round down to the nearest integer",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"ceil",label:"Ceiling",description:"Round up to the nearest integer",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"abs",label:"Absolute Value",description:"Remove the sign (make positive)",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"clamp",label:"Clamp",description:"Constrain values between a min and max",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["min","max"]},{id:"log",label:"Logarithm",description:"Natural log — compress wide-range values for charting",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"exp",label:"Exponential",description:"Raise e to the power of each value",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"normalize",label:"Normalize (0–1)",description:"Scale values to 0–1 range for cross-series comparison",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"standardize",label:"Standardize (z-score)",description:"Center around mean, scale by std deviation",category:Rt.Numeric,accepts:["number"],outputType:"number"},{id:"bin",label:"Bin/Bucket",description:"Group values into fixed-size buckets",category:Rt.Numeric,accepts:["number"],outputType:"number",params:["size"]},{id:"extract-year",label:"Extract Year",description:"Get the four-digit year as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-month",label:"Extract Month",description:"Get the month (1–12) as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-day",label:"Extract Day",description:"Get the day of the month as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"extract-weekday",label:"Extract Weekday",description:"Get the day name (Monday, Tuesday, …)",category:Rt.Date,accepts:["date"],outputType:"string"},{id:"extract-hour",label:"Extract Hour",description:"Get the hour (0–23) as a number",category:Rt.Date,accepts:["date"],outputType:"number"},{id:"shift-date",label:"Shift Date",description:"Add or subtract days, months, or years",category:Rt.Date,accepts:["date"],outputType:"date",params:["amount","unit"]},{id:"truncate-date",label:"Truncate to Period",description:"Round down to start of week, month, quarter, or year",category:Rt.Date,accepts:["date"],outputType:"date",params:["period"]},{id:"date-diff",label:"Duration Since",description:"Days between each date and a reference date",category:Rt.Date,accepts:["date"],outputType:"number",params:["reference"]}],R2=new Map(sp.map(t=>[t.id,t]));function iT(t,e){const n=R2.get(t);return n?n.accepts.includes(e):!1}function sre(t){var e;return((e=R2.get(t))==null?void 0:e.outputType)??"string"}function pa(t,e){const n=parseFloat(t);if(Number.isNaN(n))return t;const o=e(n);return Number.isNaN(o)?t:String(o)}function As(t,e){const n=new Date(t);return Number.isNaN(n.getTime())?t:e(n)}function are(t,e,n){switch(e){case"to-number":{const o=Number(t.replace(/[^0-9.\-+eE]/g,""));return Number.isNaN(o)?"":String(o)}case"to-string":return t;case"to-date":return As(t,o=>o.toISOString());case"to-boolean":{const o=t.toLowerCase().trim();return["true","1","yes","on","y"].includes(o)?"true":["false","0","no","off","n",""].includes(o)?"false":t}case"parse-json":try{const o=JSON.parse(t);return n.key?String(o[n.key]??""):JSON.stringify(o)}catch{return t}default:return t}}function lre(t,e,n){switch(e){case"trim":return t.trim();case"lowercase":return t.toLowerCase();case"uppercase":return t.toUpperCase();case"title-case":return t.replace(/\w\S*/g,o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase());case"slugify":return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");case"regex-replace":{if(!n.pattern)return t;try{return t.replace(new RegExp(n.pattern,"g"),n.replacement??"")}catch{return t}}case"extract":return t.slice(Number(n.start)||0,n.end?Number(n.end):void 0);case"pad-start":return t.padStart(Number(n.length)||0,n.char||" ");case"pad-end":return t.padEnd(Number(n.length)||0,n.char||" ");case"remove-diacritics":return t.normalize("NFD").replace(/[\u0300-\u036f]/g,"");default:return t}}function cre(t,e,n){switch(e){case"round":{const r=10**(Number(n.decimals)||0);return pa(t,i=>Math.round(i*r)/r)}case"floor":return pa(t,Math.floor);case"ceil":return pa(t,Math.ceil);case"abs":return pa(t,Math.abs);case"clamp":{const o=n.min?Number(n.min):-1/0,r=n.max?Number(n.max):1/0;return pa(t,i=>Math.min(Math.max(i,o),r))}case"log":return pa(t,o=>o>0?Math.log(o):NaN);case"exp":return pa(t,Math.exp);case"bin":{const o=Number(n.size)||1;return pa(t,r=>Math.floor(r/o)*o)}default:return t}}function ure(t,e,n){switch(e){case"extract-year":return As(t,o=>String(o.getFullYear()));case"extract-month":return As(t,o=>String(o.getMonth()+1));case"extract-day":return As(t,o=>String(o.getDate()));case"extract-weekday":return As(t,o=>o.toLocaleDateString("en",{weekday:"long"}));case"extract-hour":return As(t,o=>String(o.getHours()));case"shift-date":return As(t,o=>{const r=Number(n.amount)||0,i=n.unit||"days";return i==="years"?o.setFullYear(o.getFullYear()+r):i==="months"?o.setMonth(o.getMonth()+r):o.setDate(o.getDate()+r),o.toISOString()});case"truncate-date":return As(t,o=>{const r=n.period||"month";return r==="year"?new Date(o.getFullYear(),0,1).toISOString():r==="quarter"?new Date(o.getFullYear(),Math.floor(o.getMonth()/3)*3,1).toISOString():r==="month"?new Date(o.getFullYear(),o.getMonth(),1).toISOString():(r==="week"&&(o.setDate(o.getDate()-o.getDay()),o.setHours(0,0,0,0)),o.toISOString())});case"date-diff":{const o=new Date(n.reference||new Date().toISOString());return Number.isNaN(o.getTime())?t:As(t,r=>String(Math.round((r.getTime()-o.getTime())/(1e3*60*60*24))))}default:return t}}function dre(t,e,n){return e.startsWith("to-")||e==="parse-json"?are(t,e,n):new Set(["round","floor","ceil","abs","clamp","log","exp","bin"]).has(e)?cre(t,e,n):e.startsWith("extract-")||e.startsWith("shift-")||e.startsWith("truncate-")||e==="date-diff"?ure(t,e,n):lre(t,e,n)}const fre="";function hre(t,e){const n=t.rows.map(o=>{const r=[...o];return r[e]=fre,r});return{columns:[...t.columns],rows:n,columnTypes:[...t.columnTypes]}}function pre(t,e,n){const o=n.separator||",",r=n.limit?Number(n.limit):void 0;let i=0;const s=t.rows.map(d=>{const f=d[e].split(o),h=r?f.slice(0,r):f;return i=Math.max(i,h.length),h}),a=[...t.columns],l=[...t.columnTypes],c=[];for(let d=0;d<i;d++)c.push(`${n.column}_${d+1}`);a.splice(e,1,...c),l.splice(e,1,...Array(i).fill("string"));const u=t.rows.map((d,f)=>{const h=s[f],g=[...d],v=[...h,...Array(i-h.length).fill("")];return g.splice(e,1,...v),g});return{columns:a,rows:u,columnTypes:l}}function mre(t,e,n){const o=t.rows.map(s=>parseFloat(s[e])).filter(s=>!Number.isNaN(s));if(o.length===0)return t;const r=t.rows.map(s=>[...s]),i=[...t.columnTypes];if(i[e]="number",n==="normalize"){const s=Math.min(...o),l=Math.max(...o)-s;for(const c of r){const u=parseFloat(c[e]);c[e]=Number.isNaN(u)?c[e]:String(l===0?0:(u-s)/l)}}else{const s=o.reduce((c,u)=>c+u,0)/o.length,a=o.reduce((c,u)=>c+(u-s)**2,0)/o.length,l=Math.sqrt(a);for(const c of r){const u=parseFloat(c[e]);c[e]=Number.isNaN(u)?c[e]:String(l===0?0:(u-s)/l)}}return{columns:[...t.columns],rows:r,columnTypes:i}}function gre(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column||!e.operation)return t;const o=e.operation,r=t.columnTypes[n];if(!iT(o,r))return hre(t,n);if(o==="split")return pre(t,n,e);if(o==="normalize"||o==="standardize")return mre(t,n,o);const i=t.rows.map(a=>[...a]);for(const a of i)a[n]=dre(a[n],o,e);const s=[...t.columnTypes];return s[n]=sre(o),{columns:[...t.columns],rows:i,columnTypes:s}}function cf(t){return Number(t.replace(/[,%$€£¥₹]/g,"").trim())||0}function vre(t,e,n){if(n==="number")return cf(t)-cf(e);if(n==="date"){const o=Date.parse(t)||0,r=Date.parse(e)||0;return o-r}return t.localeCompare(e)}function F2(t){return t.columns?t.columns.split(",").map(e=>e.trim()).filter(Boolean):t.column?[t.column]:[]}function bre(t,e){const n=F2(e);if(n.length===0)return t;const o=n.map(a=>t.columns.indexOf(a)).filter(a=>a>=0);if(o.length===0)return t;const r=e.direction===Jt.Descending?-1:1,i=e.operation;if(i&&o.length>1){const a=[...t.rows].sort((l,c)=>{const u=o.map(g=>cf(l[g]??"")),d=o.map(g=>cf(c[g]??""));let f,h;return i==="avg"?(f=u.reduce((g,v)=>g+v,0)/u.length,h=d.reduce((g,v)=>g+v,0)/d.length):(f=u.reduce((g,v)=>g+v,0),h=d.reduce((g,v)=>g+v,0)),r*(f-h)});return{...t,rows:a}}const s=[...t.rows].sort((a,l)=>{for(const c of o){const u=t.columnTypes[c]??"string",d=vre(a[c]??"",l[c]??"",u);if(d!==0)return r*d}return 0});return{...t,rows:s}}function yre(t,e,n){if(!n&&e!==bo.Equals&&e!==bo.NotEquals)return!0;switch(e){case bo.Equals:return t===n;case bo.NotEquals:return t!==n;case bo.Contains:return t.toLowerCase().includes(n.toLowerCase());case bo.GreaterThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o>r}case bo.LessThan:{const o=Number(t.replace(/[,%$€£¥₹]/g,"").trim()),r=Number(n);return!Number.isNaN(o)&&!Number.isNaN(r)&&o<r}default:return!0}}function xre(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column)return t;const o=t.rows.filter(r=>yre(r[n]??"",e.condition??bo.Equals,e.value??""));return{...t,rows:o}}function wre(t,e){const n=F2(e);if(n.length===0)return t;const o=t.columns.map((r,i)=>n.includes(r)?-1:i).filter(r=>r>=0);return o.length===t.columns.length?t:{columns:o.map(r=>t.columns[r]),rows:t.rows.map(r=>o.map(i=>r[i])),columnTypes:o.map(r=>t.columnTypes[r])}}function _re(t){if(t.rows.length===0||t.columns.length===0)return t;const e=["Field",...t.rows.map(r=>r[0]??"")],n=[],o=["string"];for(let r=1;r<t.columns.length;r++){const i=[t.columns[r]];for(let s=0;s<t.rows.length;s++)i.push(t.rows[s][r]??"");n.push(i)}for(let r=0;r<t.rows.length;r++){const i=n.map(s=>s[r+1]??"").filter(s=>s.length>0);i.length>0&&i.every(s=>!Number.isNaN(Number(s.replace(/[,%$€£¥₹]/g,"").trim()))&&s.trim().length>0)?o.push("number"):o.push("string")}return{columns:e,rows:n,columnTypes:o}}function kre(t,e){const n=t.columns.indexOf(e.column);if(n<0||!e.column||!e.newName)return t;const o=[...t.columns];return o[n]=e.newName,{...t,columns:o}}const sT={sum:t=>t.reduce((e,n)=>e+n,0),avg:t=>t.reduce((e,n)=>e+n,0)/t.length,min:t=>Math.min(...t),max:t=>Math.max(...t)};function Sre(t,e){return t.split(",").map(n=>n.trim()).filter(Boolean).map(n=>{const o=n.lastIndexOf(":");if(o<0)return null;const r=n.slice(0,o),i=n.slice(o+1);if(i!=="count"&&!sT[i])return null;const s=i==="count"?-1:e.indexOf(r);return i!=="count"&&s<0?null:{col:r,fn:i,colIndex:s}}).filter(n=>n!==null)}function Are(t,e,n){if(t==="count")return String(e.length);const o=e.map(r=>cf(r[n]??""));return String(sT[t](o))}function Cre(t,e){const n=F2({columns:e.groupColumns}).map(i=>t.columns.indexOf(i)).filter(i=>i>=0);if(n.length===0||!e.aggregates)return t;const o=Sre(e.aggregates,t.columns);if(o.length===0)return t;const r=new Map;for(const i of t.rows){const s=n.map(c=>i[c]??""),a=s.join("\0"),l=r.get(a);l?l.rows.push(i):r.set(a,{key:s,rows:[i]})}return{columns:[...n.map(i=>t.columns[i]),...o.map(i=>`${i.col}_${i.fn}`)],columnTypes:[...n.map(i=>t.columnTypes[i]),...o.map(()=>"number")],rows:[...r.values()].map(({key:i,rows:s})=>[...i,...o.map(a=>Are(a.fn,s,a.colIndex))])}}const $re=Lo("dataTransforms",()=>{const t=ze([]);let e=1;function n(h,g={}){const v=String(e++);return t.value.push({id:v,type:h,config:g}),v}function o(h){const g=t.value.findIndex(v=>v.id===h);g>=0&&t.value.splice(g,1)}function r(h,g){const v=t.value.find(m=>m.id===h);v&&(v.config={...g})}function i(h,g){const v=t.value.findIndex(b=>b.id===h);if(v<0||g<0||g>=t.value.length)return;const[m]=t.value.splice(v,1);t.value.splice(g,0,m)}function s(h,g,v,m){let b={columns:[...g],rows:v.map(y=>[...y]),columnTypes:[...m]};for(const y of h)switch(y.type){case et.Sort:b=bre(b,y.config);break;case et.Filter:b=xre(b,y.config);break;case et.HideColumns:b=wre(b,y.config);break;case et.Transpose:b=_re(b);break;case et.Parse:b=gre(b,y.config);break;case et.Rename:b=kre(b,y.config);break;case et.GroupBy:b=Cre(b,y.config);break}return b}function a(h,g,v){return s(t.value,h,g,v)}function l(h,g,v,m){const b=t.value.slice(0,h);return s(b,g,v,m)}function c(h,g,v){const{config:m}=h;if(m.column&&!g.includes(m.column))return`Column "${m.column}" not found`;if(h.type===et.Parse&&m.column&&m.operation){const b=g.indexOf(m.column);if(b>=0&&!iT(m.operation,v[b])){const y=R2.get(m.operation);return`${(y==null?void 0:y.label)??m.operation} requires ${y==null?void 0:y.accepts.join(" or ")} column, got ${v[b]}`}}return h.type===et.Rename?m.column?m.newName?null:"New name is required":"No column selected":h.type===et.Filter&&!m.column||h.type===et.Sort&&!m.column&&!m.columns?"No column selected":h.type===et.GroupBy?m.groupColumns?m.aggregates?null:"No aggregates defined":"No group columns selected":null}function u(){t.value=[],e=1}function d(h){t.value=h.map(g=>({...g,config:{...g.config}})),e=h.reduce((g,v)=>Math.max(g,Number(v.id)||0),0)+1}function f(){return t.value.map(h=>({id:h.id,type:h.type,config:{...h.config}}))}return{steps:t,addStep:n,removeStep:o,updateStep:r,moveStep:i,applyStepList:s,applyTransforms:a,getColumnsAtStep:l,validateStep:c,reset:u,hydrate:d,snapshot:f}});function Dr(){const t=$re(),{steps:e}=Mt(t);return{steps:e,addStep:t.addStep,removeStep:t.removeStep,updateStep:t.updateStep,moveStep:t.moveStep,applyStepList:t.applyStepList,applyTransforms:t.applyTransforms,getColumnsAtStep:t.getColumnsAtStep,validateStep:t.validateStep,reset:t.reset,hydrate:t.hydrate,snapshot:t.snapshot}}function za(t,e){if(e<0||e>=t.length)return null;const n={id:t[e].id,name:t[e].name},o=new Set;for(let r=0;r<=e;r++){const i=t[r];if(i.chartType!==void 0&&(n.chartType=i.chartType),i.data!==void 0&&(n.data=i.data),i.chartTypeOptions!==void 0&&(n.chartTypeOptions=n.chartTypeOptions?{...n.chartTypeOptions,...i.chartTypeOptions}:{...i.chartTypeOptions}),i.colorizes!==void 0&&i.colorizes.length>0?n.colorizes=i.colorizes:i.data!==void 0&&(n.colorizes=[]),r===e&&(n.highlights=i.highlights),i.areaFills!==void 0&&i.areaFills.length>0&&(n.areaFills=i.areaFills),i.annotations!==void 0&&i.annotations.length>0&&(n.annotations=i.annotations),i.annotationVisibility)for(const s of i.annotationVisibility)s.action==="hide"?o.add(s.id):o.delete(s.id);i.seriesOverrides!==void 0&&i.seriesOverrides.length>0&&(n.seriesOverrides=i.seriesOverrides),i.transforms!==void 0&&(n.transforms=i.transforms),i.properties!==void 0&&(n.properties=n.properties?{...n.properties,...i.properties}:{...i.properties})}return o.size>0&&(n.hiddenAnnotationIds=o),n}function aT(t,e){var n;if(e<0||e>=t.length)return-1;for(let o=e;o>=0;o--)if(((n=t[o])==null?void 0:n.data)!==void 0)return o;return-1}function lT(t){var e,n;if((e=t==null?void 0:t.transforms)!=null&&e.length){for(let o=t.transforms.length-1;o>=0;o--)if(t.transforms[o].type===et.Sort)return((n=t.transforms[o].config)==null?void 0:n.direction)??Jt.Ascending}}function W6(t){return/^-?\d+(\.\d+)?%?$/.test(t)?t:`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function hg(t,e){if(t.length<=2)return e.map(i=>{const s=i[0]??"",a=i[1]??"";return`"${s}" = ${W6(a)}`}).join(`
|
|
646
|
-
`);const o=`_series = ${t.slice(1).map(i=>`"${i}"`).join(",")}`,r=e.map(i=>{const s=i[0]??"",a=i.slice(1).map(l=>W6(l??"")).join(",");return`"${s}" = ${a}`});return[o,...r].join(`
|
|
647
|
-
`)}const Tre=Lo("dataTable",()=>{const t=ar({columns:[],rows:[],rawInput:"",columnTypes:[]}),e=Fe("delimited"),n=Fe(""),o=Fe(null),{steps:r,applyTransforms:i,applyStepList:s}=Dr(),{activeIndex:a,scenes:l}=_n(),c=A(()=>{var S;if(a.value>=0){const N=za(l.value,a.value);if(N!=null&&N.data)return rT(N.data)}let _={columns:t.columns,rows:t.rows,columnTypes:t.columnTypes};if(r.value.length>0&&(_=i(t.columns,t.rows,t.columnTypes)),a.value>=0&&_.columns.length>0){const N=za(l.value,a.value);(S=N==null?void 0:N.transforms)!=null&&S.length&&(_=s(N.transforms,_.columns,_.rows,_.columnTypes))}return _}),u=A(()=>c.value.columns),d=A(()=>c.value.rows),f=A(()=>c.value.columnTypes),h=A(()=>r.value.length>0);function g(_,S){t.columns=[..._.columns],t.rows=_.rows.map(N=>[...N]),t.columnTypes=_.columnTypes?[..._.columnTypes]:_.columns.map(()=>"string"),o.value=Date.now(),S!=null&&S.label&&(n.value=S.label)}function v(_,S){_>=0&&_<t.columns.length&&(t.columns[_]=S)}function m(_,S){_>=0&&_<t.columnTypes.length&&(t.columnTypes[_]=S)}function b(){return hg(u.value,d.value)}function y(){t.columns=[],t.rows=[],t.rawInput="",t.columnTypes=[],n.value="",o.value=null}function x(_){t.columns=_.columns,t.rows=_.rows,t.rawInput=_.rawInput,t.columnTypes=_.columnTypes??_.columns.map(()=>"string")}return{...J0(t),sourceFormat:e,sourceLabel:n,loadedAt:o,displayColumns:u,displayRows:d,displayColumnTypes:f,hasTransforms:h,loadParsed:g,renameColumn:v,setColumnType:m,serialize:b,reset:y,hydrate:x}});function Ko(){const t=Tre(),{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d}=Mt(t);return{columns:e,rows:n,rawInput:o,columnTypes:r,sourceFormat:i,sourceLabel:s,loadedAt:a,displayColumns:l,displayRows:c,displayColumnTypes:u,hasTransforms:d,loadParsed:t.loadParsed,renameColumn:t.renameColumn,setColumnType:t.setColumnType,serialize:t.serialize,reset:t.reset,hydrate:t.hydrate}}const Mre=Lo("chartTypeOptions",()=>{const t=ar({});function e(d){Z$(d),t[d]||(t[d]={})}const{chartType:n,_base:o}=pn(),r=A(()=>{var m,b;const d=t[n.value]??{},f=f0(n.value,d),{activeScene:h,activeIndex:g,scenes:v}=_n();if(g.value>=0){let y={...f};for(let x=0;x<=g.value;x++){const _=(m=v.value[x])==null?void 0:m.chartTypeOptions;_&&(y={...y,..._})}return y}return(b=h.value)!=null&&b.chartTypeOptions?{...f,...h.value.chartTypeOptions}:f}),i=A(()=>{const d=t[o.chartType.value]??{};return f0(o.chartType.value,d)}),s=A(()=>du(n.value)),a=A(()=>s.value.map(d=>d.key));function l(d,f){var m;const{activeIndex:h,activeScene:g,scenes:v}=_n();if(h.value>=0&&g.value){let y=(t[n.value]??{})[d];for(let x=h.value-1;x>=0;x--){const _=(m=v.value[x])==null?void 0:m.chartTypeOptions;if(_&&d in _){y=_[d];break}}if(y0(f,y)){const x={...g.value.chartTypeOptions};delete x[d];const _=Object.keys(x).length>0?x:void 0,S={...g.value};_?S.chartTypeOptions=_:delete S.chartTypeOptions,v.value[h.value]=S}else{const x=g.value.chartTypeOptions??{};v.value[h.value]={...g.value,chartTypeOptions:{...x,[d]:f}}}return}t[n.value]||(t[n.value]={}),t[n.value][d]=f}je(n,(d,f)=>{var _;e(d);const{activeIndex:h,activeScene:g,scenes:v}=_n(),m=h.value>=0&&g.value!=null;let b;if(m){let S={...t[f]??{}};for(let N=0;N<=h.value;N++){const B=(_=v.value[N])==null?void 0:_.chartTypeOptions;B&&(S={...S,...B})}b=S}else b=t[f]??{};if(Object.keys(b).length===0)return;const y=du(d).map(S=>S.key);if(y.length===0)return;const x=t[d]??{};for(const S of y)if(S in b){if(m){const N=g.value.chartTypeOptions??{};if(!(S in N)&&!(S in x)){const B=b[S],k=Array.isArray(B)?[...B]:B;v.value[h.value]={...g.value,chartTypeOptions:{...N,[S]:k}}}}else if(!(S in x)){const N=b[S],B=t[d];Array.isArray(N)?B[S]=[...N]:B[S]=N}}},{flush:"sync"});function c(){for(const d of Object.keys(t))delete t[d]}function u(d){c();for(const[f,h]of Object.entries(d))t[f]=h}return{currentOptions:r,baseOptions:i,availableOptionKeys:a,optionDefs:s,setOption:l,ensureDefaults:e,reset:c,hydrate:u,store:t}});function kn(){const t=Mre(),{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r}=Mt(t);return{currentOptions:e,baseOptions:n,availableOptionKeys:o,optionDefs:r,setOption:t.setOption,ensureDefaults:t.ensureDefaults,reset:t.reset,hydrate:t.hydrate,store:t.store}}const cT=[{value:"blueprint",label:"Blueprint",description:"The default Blueprint Chart theme"},{value:"blueprint-framed",label:"Blueprint Framed",description:"Adds borders and a tinted footer"}],V2=Lo("chartTheme",()=>{const t=Fe("blueprint");function e(){t.value="blueprint"}return{chartTheme:t,chartThemeOptions:cT,reset:e}});function uT(){const t=V2(),{chartTheme:e}=Mt(t);return{chartTheme:e,availableThemes:cT,reset:t.reset}}const Ore=new Set([et.Sort,et.Filter,et.HideColumns,et.Transpose,et.Parse,et.GroupBy,et.Computed,"pivot"]);function zc(){const t=pn(),e=V2(),n=Mt(e).chartTheme,{store:o,ensureDefaults:r}=kn(),i=Dr(),s=_n();function a(l){var c,u;try{const d=dg(l);s.setActive(-1),t.chartType.value=d.chartType;const f=Wr(d.properties);t.title.value=String(f.get("title")??""),t.description.value=String(f.get("description")??""),t.byline.value=String(f.get("byline")??""),t.source.value=String(f.get("source")??""),t.sourceUrl.value=String(f.get("sourceUrl")??"");const h=f.get("theme");n.value=h?String(h):"blueprint";const g={},v=f.get("sizing");v&&["responsive","fixed","max-width"].includes(String(v))&&(g.sizing=String(v));const b=f.get("fixedWidth");b!==void 0&&(g.fixedWidth=Number(b));const y=f.get("maxWidth");y!==void 0&&(g.maxWidth=Number(y));const x=f.get("heightMode");x&&["auto","fixed","aspect-ratio"].includes(String(x))&&(g.heightMode=String(x));const S=f.get("fixedHeight");S!==void 0&&(g.fixedHeight=Number(S));const N=f.get("aspectRatio");N!==void 0&&(g.aspectRatio=String(N));const B=f.get("padding");B!==void 0&&(g.padding=Number(B));const k=f.get("transparentBackground");k!==void 0&&(g.transparentBackground=k===!0||k==="true");const L=f.get("player");L&&["buttons","progress-bar","dot-stepper","minimal-arrows","none"].includes(String(L))&&(g.playerType=String(L));const I=f.get("playerPosition");I&&["left","center","right"].includes(String(I))&&(g.playerPosition=String(I)),t.layout.value={...lf,...g};const $=f.get("sort");$===Jt.Ascending||$===Jt.Descending?t.sort.value=$:t.sort.value=Jt.None;const P=d.data?h0(d.data):"";if(t.data.value=P,P){const M=Ko(),F=rT(P);M.loadParsed(F),M.rawInput.value=P,M.sourceFormat.value="bpc"}if(o[d.chartType]=fg(d.chartType,d.properties),r(d.chartType),t.colorizes.value=d.colorizes?p0(d.colorizes):[],t.highlights.value=d.highlights?m0(d.highlights):[],t.areaFills.value=d.areaFills?g0(d.areaFills):[],t.annotations.value=d.annotations?v0(d.annotations):[],t.seriesOverrides.value=d.series?b0(d.series):[],(c=d.transforms)!=null&&c.length){i.reset();for(const M of d.transforms){if(!Ore.has(M.transformType))continue;const F=Wr(M.properties),V={};for(const[G,K]of F)V[G]=String(K);if(M.transformType===et.Sort&&F.has("direction")){const G=String(F.get("direction"));(G===Jt.Ascending||G===Jt.Descending)&&(t.sort.value=G)}i.addStep(M.transformType,V)}}else i.reset();if((u=d.scenes)!=null&&u.length){const M=d.scenes.map(F=>{const V=woe(F,d.chartType),G={id:Math.random().toString(36).slice(2,10),name:V.name};V.chartType&&(G.chartType=V.chartType),V.data&&(G.data=h0(V.data)),Object.keys(V.chartTypeOptions).length>0&&(G.chartTypeOptions=V.chartTypeOptions),V.colorizes.length>0&&(G.colorizes=p0(V.colorizes)),V.highlights.length>0&&(G.highlights=m0(V.highlights)),V.areaFills.length>0&&(G.areaFills=g0(V.areaFills)),V.annotations.length>0&&(G.annotations=v0(V.annotations)),V.series.length>0&&(G.seriesOverrides=b0(V.series)),V.annotationVisibility.length>0&&(G.annotationVisibility=V.annotationVisibility.map(ue=>({action:ue.action,kind:ue.kind,id:ue.id}))),V.transforms.length>0&&(G.transforms=V.transforms.map((ue,de)=>({id:String(de),type:ue.transformType,config:Object.fromEntries(ue.properties.map(he=>[he.key,String(he.value)]))})));const K=Object.fromEntries([...V.properties.entries()].filter(([ue])=>!["type"].includes(ue)));return Object.keys(K).length>0&&(G.properties=K),G});s.hydrate({scenes:M,activeIndex:-1})}else s.reset();return{success:!0}}catch(d){return{success:!1,error:d instanceof Error?d.message:String(d)}}}return{applyDsl:a}}function Sh(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?String(parseFloat(e)):`"${e}"`}function Ju(t){if(typeof t=="number")return String(t);const e=String(t);return e.endsWith("%")?`"${e}"`:String(parseFloat(e))}function Ff(){const e=pn()._base,n=Mt(V2()).chartTheme,{baseOptions:o}=kn(),{steps:r}=Dr(),{scenes:i}=_n(),s=Ko(),a=Fe(!1);function l(){let u=`chart ${e.chartType.value} {
|
|
648
|
-
`;e.title.value&&(u+=` title = "${e.title.value}"
|
|
649
|
-
`),e.description.value&&(u+=` description = "${e.description.value}"
|
|
650
|
-
`),e.byline.value&&(u+=` byline = "${e.byline.value}"
|
|
651
|
-
`),e.source.value&&(u+=` source = "${e.source.value}"
|
|
652
|
-
`),e.sourceUrl.value&&(u+=` sourceUrl = "${e.sourceUrl.value}"
|
|
653
|
-
`),n.value&&n.value!=="blueprint"&&(u+=` theme = "${n.value}"
|
|
654
|
-
`);const d=du(e.chartType.value),f=d.map(m=>m.key),h=new Map(d.filter(m=>m.default!==void 0).map(m=>[m.key,String(m.default)])),g=o.value;for(const m of f){const b=g[m];b!==void 0&&(a.value&&h.has(m)&&String(b)===h.get(m)||(m==="colors"&&Array.isArray(b)&&b.length>0?u+=` colors = "${b.join(", ")}"
|
|
655
|
-
`:typeof b=="boolean"?u+=` ${m} = ${b}
|
|
656
|
-
`:typeof b=="string"&&b!==""&&(u+=` ${m} = "${b}"
|
|
657
|
-
`)))}const v=Lt(e.layout.value);if(v.sizing!=="max-width"&&(u+=` sizing = "${v.sizing}"
|
|
658
|
-
`),v.sizing==="fixed"&&v.fixedWidth!==600&&(u+=` fixedWidth = ${v.fixedWidth}
|
|
659
|
-
`),v.sizing==="max-width"&&v.maxWidth!==660&&(u+=` maxWidth = ${Ju(v.maxWidth)}
|
|
660
|
-
`),v.heightMode!=="auto"&&(u+=` heightMode = "${v.heightMode}"
|
|
661
|
-
`),v.heightMode==="fixed"&&v.fixedHeight!==400&&(u+=` fixedHeight = ${v.fixedHeight}
|
|
662
|
-
`),v.heightMode==="aspect-ratio"&&v.aspectRatio!=="16:9"&&(u+=` aspectRatio = "${v.aspectRatio}"
|
|
663
|
-
`),v.padding!==16&&(u+=` padding = ${v.padding}
|
|
664
|
-
`),v.transparentBackground&&(u+=` transparentBackground = true
|
|
665
|
-
`),v.playerType&&v.playerType!=="buttons"&&(u+=` player = "${v.playerType}"
|
|
666
|
-
`),v.playerPosition!=="left"&&(u+=` playerPosition = "${v.playerPosition}"
|
|
667
|
-
`),e.data.value){u+=`
|
|
668
|
-
data {
|
|
669
|
-
`;const m=e.data.value.split(`
|
|
670
|
-
`).map(b=>b.trim()).filter(Boolean);u+=m.map(b=>` ${b}`).join(`
|
|
671
|
-
`),u+=`
|
|
672
|
-
}
|
|
673
|
-
`}for(const m of e.colorizes.value)m.target&&(u+=`
|
|
674
|
-
colorize "${m.target}" {
|
|
675
|
-
`,m.color&&(u+=` color = "${m.color}"
|
|
676
|
-
`),m.label&&(u+=` label = "${m.label}"
|
|
677
|
-
`),u+=` }
|
|
678
|
-
`);for(const m of e.highlights.value)m.target&&(u+=`
|
|
679
|
-
highlight "${m.target}"
|
|
680
|
-
`);for(const m of e.areaFills.value)!m.from||!m.to||(u+=`
|
|
681
|
-
areafill "${m.from}" "${m.to}" {
|
|
682
|
-
`,m.color&&(u+=` color = "${m.color}"
|
|
683
|
-
`),m.negativeColor&&(u+=` negativeColor = "${m.negativeColor}"
|
|
684
|
-
`),m.opacity!==void 0&&(u+=` opacity = ${m.opacity}
|
|
685
|
-
`),m.interpolation&&(u+=` interpolation = "${m.interpolation}"
|
|
686
|
-
`),u+=` }
|
|
687
|
-
`);for(const m of e.annotations.value){const b=m.kind??Pt.Point;if(b===Pt.Point){if(!("target"in m)||!m.target)continue;u+=`
|
|
688
|
-
annotation "${m.target}" {
|
|
689
|
-
`,m.id&&(u+=` id = "${m.id}"
|
|
690
|
-
`),m.text&&(u+=` text = "${m.text}"
|
|
691
|
-
`),m.textColor&&(u+=` textColor = "${m.textColor}"
|
|
692
|
-
`),m.maxWidth!==void 0&&(u+=` maxWidth = ${Ju(m.maxWidth)}
|
|
693
|
-
`),m.textOutline!==void 0&&(u+=` textOutline = ${m.textOutline}
|
|
694
|
-
`),m.showLine!==void 0&&(u+=` showLine = ${m.showLine}
|
|
695
|
-
`),m.anchorDirection&&(u+=` anchorDirection = ${m.anchorDirection}
|
|
696
|
-
`),m.textOffsetX!==void 0&&(u+=` textOffsetX = ${m.textOffsetX}
|
|
697
|
-
`),m.textOffsetY!==void 0&&(u+=` textOffsetY = ${m.textOffsetY}
|
|
698
|
-
`),m.lineStyle&&(u+=` lineStyle = ${m.lineStyle}
|
|
699
|
-
`),m.lineWeight!==void 0&&(u+=` lineWeight = ${m.lineWeight}
|
|
700
|
-
`),m.showArrow!==void 0&&(u+=` showArrow = ${m.showArrow}
|
|
701
|
-
`),m.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${m.lineTargetDistance}
|
|
702
|
-
`),m.showCircle!==void 0&&(u+=` showCircle = ${m.showCircle}
|
|
703
|
-
`),m.circleSize!==void 0&&(u+=` circleSize = ${m.circleSize}
|
|
704
|
-
`),m.circleStyle&&(u+=` circleStyle = ${m.circleStyle}
|
|
705
|
-
`),m.circleColor&&(u+=` circleColor = "${m.circleColor}"
|
|
706
|
-
`),u+=` }
|
|
707
|
-
`}else if(b===Pt.Range){const y=m;u+=`
|
|
708
|
-
range {
|
|
709
|
-
`,y.id&&(u+=` id = "${y.id}"
|
|
710
|
-
`),y.start!==void 0&&(u+=` start = ${typeof y.start=="string"?`"${y.start}"`:y.start}
|
|
711
|
-
`),y.end!==void 0&&(u+=` end = ${typeof y.end=="string"?`"${y.end}"`:y.end}
|
|
712
|
-
`),y.orientation&&(u+=` orientation = ${y.orientation}
|
|
713
|
-
`),y.startAnchor&&y.startAnchor!=="center"&&(u+=` startAnchor = ${y.startAnchor}
|
|
714
|
-
`),y.endAnchor&&y.endAnchor!=="center"&&(u+=` endAnchor = ${y.endAnchor}
|
|
715
|
-
`),y.bgColor&&(u+=` bgColor = "${y.bgColor}"
|
|
716
|
-
`),y.bgOpacity!==void 0&&(u+=` bgOpacity = ${y.bgOpacity}
|
|
717
|
-
`),y.direction&&(u+=` direction = ${y.direction}
|
|
718
|
-
`),y.text&&(u+=` text = "${y.text}"
|
|
719
|
-
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
720
|
-
`),u+=` }
|
|
721
|
-
`}else if(b===Pt.Free){const y=m;u+=`
|
|
722
|
-
note {
|
|
723
|
-
`,y.id&&(u+=` id = "${y.id}"
|
|
724
|
-
`),y.text&&(u+=` text = "${y.text}"
|
|
725
|
-
`),y.x!==void 0&&(u+=` x = ${Sh(y.x)}
|
|
726
|
-
`),y.y!==void 0&&(u+=` y = ${Sh(y.y)}
|
|
727
|
-
`),y.textColor&&(u+=` textColor = "${y.textColor}"
|
|
728
|
-
`),y.maxWidth!==void 0&&(u+=` maxWidth = ${Ju(y.maxWidth)}
|
|
729
|
-
`),y.textOutline!==void 0&&(u+=` textOutline = ${y.textOutline}
|
|
730
|
-
`),u+=` }
|
|
731
|
-
`}}for(const m of r.value){u+=`
|
|
732
|
-
transform ${m.type} {
|
|
733
|
-
`;for(const[b,y]of Object.entries(m.config))y!==void 0&&y!==""&&(u+=` ${b} = "${y}"
|
|
734
|
-
`);u+=` }
|
|
735
|
-
`}if(e.sort.value!==Jt.None){const m=s.displayColumns.value,b=m.length>2?m.slice(1):m.length>1?[m[1]]:[m[0]??""];u+=`
|
|
736
|
-
transform ${et.Sort} {
|
|
737
|
-
`,b.length>1?(u+=` columns = "${b.join(",")}"
|
|
738
|
-
`,u+=` operation = sum
|
|
739
|
-
`):u+=` column = "${b[0]}"
|
|
740
|
-
`,u+=` direction = ${e.sort.value}
|
|
741
|
-
`,u+=` }
|
|
742
|
-
`}for(const m of e.seriesOverrides.value)m.name&&(u+=`
|
|
743
|
-
series "${m.name}" {
|
|
744
|
-
`,m.color&&(u+=` color = "${m.color}"
|
|
745
|
-
`),m.lineWidth!==void 0&&(u+=` lineWidth = ${m.lineWidth}
|
|
746
|
-
`),m.dash&&(u+=` dash = "${m.dash}"
|
|
747
|
-
`),m.interpolation&&(u+=` interpolation = "${m.interpolation}"
|
|
748
|
-
`),m.labelMode&&(u+=` labelMode = "${m.labelMode}"
|
|
749
|
-
`),m.labelText&&(u+=` labelText = "${m.labelText}"
|
|
750
|
-
`),m.valueLabels!==void 0&&(u+=` valueLabels = ${m.valueLabels}
|
|
751
|
-
`),m.lineSymbols!==void 0&&(u+=` lineSymbols = ${m.lineSymbols}
|
|
752
|
-
`),m.hidden!==void 0&&(u+=` hidden = ${m.hidden}
|
|
753
|
-
`),m.symbolShape&&(u+=` symbolShape = "${m.symbolShape}"
|
|
754
|
-
`),m.symbolShowOn&&(u+=` symbolShowOn = "${m.symbolShowOn}"
|
|
755
|
-
`),m.symbolStyle&&(u+=` symbolStyle = "${m.symbolStyle}"
|
|
756
|
-
`),m.symbolSize!==void 0&&(u+=` symbolSize = ${m.symbolSize}
|
|
757
|
-
`),m.symbolOpacity!==void 0&&(u+=` symbolOpacity = ${m.symbolOpacity}
|
|
758
|
-
`),u+=` }
|
|
759
|
-
`);for(const m of Lt(i.value)){if(m.name!==null?u+=`
|
|
760
|
-
scene "${m.name}" {
|
|
761
|
-
`:u+=`
|
|
762
|
-
scene {
|
|
763
|
-
`,m.chartType&&(u+=` type = ${m.chartType}
|
|
764
|
-
`),m.properties)for(const[b,y]of Object.entries(m.properties))typeof y=="string"?u+=` ${b} = "${y}"
|
|
765
|
-
`:u+=` ${b} = ${y}
|
|
766
|
-
`;if(m.chartTypeOptions){const b=m.chartType||e.chartType.value,x=du(b).map(_=>_.key);for(const _ of x){const S=m.chartTypeOptions[_];S!==void 0&&(_==="colors"&&Array.isArray(S)&&S.length>0?u+=` colors = "${S.join(", ")}"
|
|
767
|
-
`:typeof S=="boolean"?u+=` ${_} = ${S}
|
|
768
|
-
`:typeof S=="string"&&S!==""&&(u+=` ${_} = "${S}"
|
|
769
|
-
`))}}if(m.data){u+=`
|
|
770
|
-
data {
|
|
771
|
-
`;const b=m.data.split(`
|
|
772
|
-
`).map(y=>y.trim()).filter(Boolean);u+=b.map(y=>` ${y}`).join(`
|
|
773
|
-
`),u+=`
|
|
774
|
-
}
|
|
775
|
-
`}if(m.colorizes)for(const b of m.colorizes)b.target&&(u+=`
|
|
776
|
-
colorize "${b.target}" {
|
|
777
|
-
`,b.color&&(u+=` color = "${b.color}"
|
|
778
|
-
`),b.label&&(u+=` label = "${b.label}"
|
|
779
|
-
`),u+=` }
|
|
780
|
-
`);if(m.highlights)for(const b of m.highlights)b.target&&(u+=`
|
|
781
|
-
highlight "${b.target}"
|
|
782
|
-
`);if(m.areaFills)for(const b of m.areaFills)!b.from||!b.to||(u+=`
|
|
783
|
-
areafill "${b.from}" "${b.to}" {
|
|
784
|
-
`,b.color&&(u+=` color = "${b.color}"
|
|
785
|
-
`),u+=` }
|
|
786
|
-
`);if(m.annotations)for(const b of m.annotations){const y=b.kind??Pt.Point;if(y===Pt.Point){if(!("target"in b)||!b.target)continue;u+=`
|
|
787
|
-
annotation "${b.target}" {
|
|
788
|
-
`,b.id&&(u+=` id = "${b.id}"
|
|
789
|
-
`),b.text&&(u+=` text = "${b.text}"
|
|
790
|
-
`),b.textColor&&(u+=` textColor = "${b.textColor}"
|
|
791
|
-
`),b.maxWidth!==void 0&&(u+=` maxWidth = ${Ju(b.maxWidth)}
|
|
792
|
-
`),b.textOutline!==void 0&&(u+=` textOutline = ${b.textOutline}
|
|
793
|
-
`),b.showLine!==void 0&&(u+=` showLine = ${b.showLine}
|
|
794
|
-
`),b.anchorDirection&&(u+=` anchorDirection = ${b.anchorDirection}
|
|
795
|
-
`),b.textOffsetX!==void 0&&(u+=` textOffsetX = ${b.textOffsetX}
|
|
796
|
-
`),b.textOffsetY!==void 0&&(u+=` textOffsetY = ${b.textOffsetY}
|
|
797
|
-
`),b.lineStyle&&(u+=` lineStyle = ${b.lineStyle}
|
|
798
|
-
`),b.lineWeight!==void 0&&(u+=` lineWeight = ${b.lineWeight}
|
|
799
|
-
`),b.showArrow!==void 0&&(u+=` showArrow = ${b.showArrow}
|
|
800
|
-
`),b.lineTargetDistance!==void 0&&(u+=` lineTargetDistance = ${b.lineTargetDistance}
|
|
801
|
-
`),b.showCircle!==void 0&&(u+=` showCircle = ${b.showCircle}
|
|
802
|
-
`),b.circleSize!==void 0&&(u+=` circleSize = ${b.circleSize}
|
|
803
|
-
`),b.circleStyle&&(u+=` circleStyle = ${b.circleStyle}
|
|
804
|
-
`),b.circleColor&&(u+=` circleColor = "${b.circleColor}"
|
|
805
|
-
`),u+=` }
|
|
806
|
-
`}else if(y===Pt.Range){const x=b;u+=`
|
|
807
|
-
range {
|
|
808
|
-
`,x.id&&(u+=` id = "${x.id}"
|
|
809
|
-
`),x.start!==void 0&&(u+=` start = ${typeof x.start=="string"?`"${x.start}"`:x.start}
|
|
810
|
-
`),x.end!==void 0&&(u+=` end = ${typeof x.end=="string"?`"${x.end}"`:x.end}
|
|
811
|
-
`),x.orientation&&(u+=` orientation = ${x.orientation}
|
|
812
|
-
`),x.startAnchor&&x.startAnchor!=="center"&&(u+=` startAnchor = ${x.startAnchor}
|
|
813
|
-
`),x.endAnchor&&x.endAnchor!=="center"&&(u+=` endAnchor = ${x.endAnchor}
|
|
814
|
-
`),x.bgColor&&(u+=` bgColor = "${x.bgColor}"
|
|
815
|
-
`),x.bgOpacity!==void 0&&(u+=` bgOpacity = ${x.bgOpacity}
|
|
816
|
-
`),x.direction&&(u+=` direction = ${x.direction}
|
|
817
|
-
`),x.text&&(u+=` text = "${x.text}"
|
|
818
|
-
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
819
|
-
`),u+=` }
|
|
820
|
-
`}else if(y===Pt.Free){const x=b;u+=`
|
|
821
|
-
note {
|
|
822
|
-
`,x.id&&(u+=` id = "${x.id}"
|
|
823
|
-
`),x.text&&(u+=` text = "${x.text}"
|
|
824
|
-
`),x.x!==void 0&&(u+=` x = ${Sh(x.x)}
|
|
825
|
-
`),x.y!==void 0&&(u+=` y = ${Sh(x.y)}
|
|
826
|
-
`),x.textColor&&(u+=` textColor = "${x.textColor}"
|
|
827
|
-
`),x.maxWidth!==void 0&&(u+=` maxWidth = ${Ju(x.maxWidth)}
|
|
828
|
-
`),x.textOutline!==void 0&&(u+=` textOutline = ${x.textOutline}
|
|
829
|
-
`),u+=` }
|
|
830
|
-
`}}if(m.annotationVisibility){const b={[Pt.Point]:"annotation",[Pt.Range]:"range",[Pt.Free]:"note"};for(const y of m.annotationVisibility)u+=` ${y.action}_${b[y.kind]} "${y.id}"
|
|
831
|
-
`}if(m.seriesOverrides)for(const b of m.seriesOverrides)b.name&&(u+=`
|
|
832
|
-
series "${b.name}" {
|
|
833
|
-
`,b.color&&(u+=` color = "${b.color}"
|
|
834
|
-
`),u+=` }
|
|
835
|
-
`);if(m.transforms)for(const b of m.transforms){u+=`
|
|
836
|
-
transform ${b.type} {
|
|
837
|
-
`;for(const[y,x]of Object.entries(b.config))x!==void 0&&x!==""&&(u+=` ${y} = "${x}"
|
|
838
|
-
`);u+=` }
|
|
839
|
-
`}u+=` }
|
|
840
|
-
`}return u+=`}
|
|
841
|
-
`,u}const c=Fe("");return tm(()=>{c.value=l()},{flush:"post"}),{dsl:c,compact:a,generateDsl:l}}function Tc(t){return`data:image/svg+xml;base64,${globalThis.btoa(unescape(encodeURIComponent(t)))}`}function dT(){return document.documentElement.getAttribute("data-bs-theme")??"light"}const fT=t=>`blueprint-chart:${t}:thumbnail:${dT()}`,hT=t=>`blueprint-chart:${t}:preview:${dT()}`;function pT(t){for(const e of t.querySelectorAll("*")){if(!(e instanceof SVGElement))continue;const n=globalThis.getComputedStyle(e),o=n.fill;if(o&&o!=="none"){const i=e.getAttribute("fill");(!i||i==="currentColor"||i.startsWith("var("))&&e.setAttribute("fill",o)}const r=n.stroke;if(r&&r!=="none"){const i=e.getAttribute("stroke");(!i||i==="currentColor"||i.startsWith("var("))&&e.setAttribute("stroke",r)}}}function mT(t){const e=t.querySelector("svg");if(!e)return null;const n=e.getAttribute("width"),o=e.getAttribute("height");return n&&o&&!e.getAttribute("viewBox")&&e.setAttribute("viewBox",`0 0 ${n} ${o}`),e.removeAttribute("width"),e.removeAttribute("height"),e.getAttribute("xmlns")||e.setAttribute("xmlns","http://www.w3.org/2000/svg"),pT(e),e.outerHTML}function Bre(t){const e=t.querySelector(".bc-frame");if(!e)return null;const n=e.querySelector("svg");if(!n)return null;const o=e.getBoundingClientRect(),r=globalThis.getComputedStyle(e).backgroundColor||"#ffffff",i=[],s=".bc-frame-title, .bc-frame-description, .bc-frame-byline, .bc-frame-source, .bc-frame-credit";for(const x of e.querySelectorAll(s)){const _=x.getBoundingClientRect();if(_.width===0)continue;const S=globalThis.getComputedStyle(x);i.push({text:x.textContent??"",x:_.left-o.left,y:_.top-o.top+parseFloat(S.fontSize),fontSize:parseFloat(S.fontSize),fontWeight:S.fontWeight,fontFamily:S.fontFamily,fill:S.color,fontStyle:S.fontStyle!=="normal"?S.fontStyle:void 0})}const a=n.getBoundingClientRect(),l=a.left-o.left,c=a.top-o.top,u=a.width,d=a.height;pT(n);const f=n.cloneNode(!0);f.removeAttribute("width"),f.removeAttribute("height");const g=new XMLSerializer().serializeToString(f),v=Math.ceil(o.width),m=Math.ceil(o.height),b=x=>x.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),y=i.map(x=>`<text x="${x.x}" y="${x.y}" font-size="${x.fontSize}px" font-weight="${x.fontWeight}" font-family="${b(x.fontFamily)}" fill="${x.fill}"${x.fontStyle?` font-style="${x.fontStyle}"`:""}>${b(x.text)}</text>`).join(`
|
|
842
|
-
`);return[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 ${v} ${m}">`,` <rect width="100%" height="100%" fill="${r}" />`,` ${y}`,` <g transform="translate(${l},${c})">`,` <svg width="${u}" height="${d}"${f.getAttribute("viewBox")?` viewBox="${f.getAttribute("viewBox")}"`:""}>`,g.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
843
|
-
`)}function z2(t,e,n,o,r,i){const s=document.createElement("div"),a=n?`height:${n}px;`:"";s.style.cssText=`position:fixed;left:-9999px;top:0;width:${e}px;${a}overflow:hidden;`,s.id=t,i!=null&&i.forceLightTheme&&s.setAttribute("data-bs-theme","light");const l=document.createElement("style");l.textContent=o,document.head.appendChild(l),document.body.appendChild(s);try{return r(s)}finally{document.body.removeChild(s),document.head.removeChild(l)}}function Lre(t){const e=t.match(/allowDarkMode\s*=\s*(true|false)/);return e?e[1]==="true":!0}const gT=600,H2=400,vT=[`#__bc_thumb .bc-frame { height:${H2}px; display:flex; flex-direction:column; }`,"#__bc_thumb .bc-frame-header, #__bc_thumb .bc-frame-footer { display:none; }","#__bc_thumb .bc-frame-body { flex:1; min-height:0; }"].join(`
|
|
844
|
-
`);function bT(t){return document.documentElement.getAttribute("data-bs-theme")==="dark"&&!Lre(t)}function yT(t){const e=bT(t);return z2("__bc_thumb",gT,H2,vT,n=>(tT(n,t,{thumbnail:!0}),mT(n)),{forceLightTheme:e})}function W2(t,e,n,o,r){return e.labels.length===0?null:z2("__bc_thumb",gT,H2,vT,i=>(I2(i,{chartType:t,data:e,options:n,sort:o,colorizes:r==null?void 0:r.colorizes,seriesOverrides:r==null?void 0:r.seriesOverrides},{thumbnail:!0}),mT(i)))}const Pre=600,Dre=500,Ere=["#__bc_preview .bc-frame { display:flex; flex-direction:column; }",`#__bc_preview .bc-frame-body { height:${Dre}px; min-height:0; }`].join(`
|
|
845
|
-
`);function xT(t){const e=bT(t);return z2("__bc_preview",Pre,null,Ere,n=>(tT(n,t,{padding:"12px"}),Bre(n)),{forceLightTheme:e})}function ib(t){return localStorage.getItem(fT(t))}function sb(t,e){localStorage.setItem(fT(t),e)}function wT(t){localStorage.removeItem(`blueprint-chart:${t}:thumbnail:light`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail:dark`),localStorage.removeItem(`blueprint-chart:${t}:thumbnail`)}function Nre(t){return localStorage.getItem(hT(t))}function _T(t,e){localStorage.setItem(hT(t),e)}function Ire(t){localStorage.removeItem(`blueprint-chart:${t}:preview:light`),localStorage.removeItem(`blueprint-chart:${t}:preview:dark`),localStorage.removeItem(`blueprint-chart:${t}:preview`)}function kT(t){return t.trimStart().startsWith("{")}function ST(t){if(!kT(t))return yT(t);const e=JSON.parse(t);if(!e.chartConfig)return null;const{chartConfig:n,chartTypeOptions:o}=e,r=gs(n.data),i=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(r.series&&r.series.length>0&&i.includes(n.chartType)){const a=r.series.find(l=>l.name===n.selectedColumn);a&&(r.values=a.values),delete r.series}const s=(o??{})[n.chartType]??{};return W2(n.chartType,r,s,n.sort)}function Rre(t){return kT(t)?ST(t):xT(t)}function Fre(){const t=pn(),{currentOptions:e}=kn(),{sessionId:n}=Qs();if(!n.value||!t.data.value)return;const o=gs(t.data.value),r=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(o.series&&o.series.length>0&&r.includes(t.chartType.value)){const l=o.series.find(c=>c.name===t.selectedColumn.value);l&&(o.values=l.values),delete o.series}const i=W2(t.chartType.value,o,e.value,t.sort.value,{colorizes:t.colorizes.value.length>0?t.colorizes.value:void 0,seriesOverrides:t.seriesOverrides.value.length>0?t.seriesOverrides.value:void 0});i&&sb(n.value,i);const{generateDsl:s}=Ff(),a=s();if(a){const l=xT(a);l&&_T(n.value,l)}}const U6="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function ap(){let t="";for(let e=0;e<11;e++)t+=U6[Math.floor(Math.random()*U6.length)];return t}function Ov(t){return`blueprint-chart:${t}`}function Ah(t){return`blueprint-chart:${t}:meta`}function G6(t){return t.trimStart().startsWith("{")}const Vre=Lo("chartSession",()=>{const t=Fe(""),e=Fe(null),n=ze(null),o=ze(""),r=pn(),i=Ko(),s=Dr(),a=kn(),l=_n();function c(){if(!t.value)return;const{generateDsl:B}=Ff();localStorage.setItem(Ov(t.value),B());const k=new Date().toISOString(),L={savedAt:k,sheetNumber:n.value,sheetId:o.value};i.sourceFormat.value==="delimited"&&i.rawInput.value&&(L.rawInput=i.rawInput.value,L.sourceLabel=i.sourceLabel.value,L.sourceFormat="delimited"),localStorage.setItem(Ah(t.value),JSON.stringify(L)),e.value=k}function u(B){const k=localStorage.getItem(Ov(B));if(!k)return!1;try{if(G6(k)){const $=JSON.parse(k);if($.chartConfig)return d(B,$)}const{applyDsl:L}=zc();if(!L(k).success)return!1;const I=localStorage.getItem(Ah(B));let C;return I&&(C=JSON.parse(I),C.sourceFormat==="delimited"&&C.rawInput&&(i.rawInput.value=C.rawInput,i.sourceFormat.value="delimited",C.sourceLabel&&(i.sourceLabel.value=C.sourceLabel))),t.value=B,e.value=(C==null?void 0:C.savedAt)??null,n.value=(C==null?void 0:C.sheetNumber)??null,o.value=(C==null?void 0:C.sheetId)??crypto.randomUUID(),!0}catch{return!1}}function d(B,k){try{return r.hydrate(k.chartConfig),k.dataTable&&i.hydrate(k.dataTable),t.value=B,n.value=null,o.value=crypto.randomUUID(),!0}catch{return!1}}function f(){r.reset(),i.reset(),s.reset(),a.reset(),l.reset(),t.value=""}function h(){f(),e.value=null,n.value=null,o.value=crypto.randomUUID()}function g(){if(n.value!==null)return;const B=Object.keys(localStorage).filter(L=>L.startsWith("blueprint-chart:")&&L.endsWith(":meta"));let k=0;for(const L of B)try{const E=JSON.parse(localStorage.getItem(L)||"{}");if(E.sheetNumber){const I=parseInt(E.sheetNumber,10);Number.isFinite(I)&&I>k&&(k=I)}}catch{}n.value=String(k+1).padStart(3,"0"),c()}function v(){return t.value=ap(),c(),_(),t.value}function m(){f(),t.value=ap(),n.value=null,o.value=crypto.randomUUID()}function b(B){i.rawInput.value=B.tsvData;const k=rb(B.tsvData);i.loadParsed(k),r.data.value=i.serialize();const{applyDsl:L}=zc();L(B.dsl)}function y(B){return u(B)}function x(B){if(!B)return null;try{dg(B)}catch{return null}f();const{applyDsl:k}=zc();return k(B).success?(t.value=ap(),n.value=null,o.value=crypto.randomUUID(),c(),_(),t.value):(f(),null)}function _(){je([r.chartType,r.title,r.description,r.byline,r.note,r.source,r.sourceUrl,r.sort,r.data,r.selectedColumn,r.colorizes,r.highlights,r.areaFills,r.annotations,r.seriesOverrides,r.layout,i.columns,i.rows,i.rawInput,i.columnTypes,s.steps,l.scenes,l.activeIndex,()=>a.store],c,{deep:!0,flush:"post"})}function S(){var L;const B=[],k="blueprint-chart:";for(let E=0;E<localStorage.length;E++){const I=localStorage.key(E);if(!I||!I.startsWith(k))continue;const C=I.slice(k.length);if(C.includes(":"))continue;const $=localStorage.getItem(I);if($)try{if(G6($)){const ee=JSON.parse($);if(ee.chartConfig){B.push({id:C,title:ee.chartConfig.title||"",description:ee.chartConfig.description||"",chartType:ee.chartConfig.chartType||"",savedAt:ee.savedAt??null,sceneCount:((L=ee.chartConfig.scenes)==null?void 0:L.length)??0,rowCount:ee.chartConfig.data?ee.chartConfig.data.split(`
|
|
846
|
-
`).filter(fe=>fe.trim()).length-1:0,allowDarkMode:ee.chartConfig.allowDarkMode??!0,sheetNumber:null,sheetId:""});continue}}const P=$.match(/title\s*=\s*"([^"]*)"/),M=$.match(/description\s*=\s*"([^"]*)"/),F=$.match(/^chart\s+(\S+)/),V=$.match(/\bscene\s+"/g),G=$.match(/data\s*\{([^}]*)\}/),K=G?G[1].split(`
|
|
847
|
-
`).filter(ee=>ee.trim()&&ee.includes("=")).length:0,ue=$.match(/allowDarkMode\s*=\s*(true|false)/),de=localStorage.getItem(Ah(C)),he=de?JSON.parse(de):null,ge=(he==null?void 0:he.savedAt)??null;B.push({id:C,title:(P==null?void 0:P[1])??"",description:(M==null?void 0:M[1])??"",chartType:(F==null?void 0:F[1])??"",savedAt:ge,sceneCount:(V==null?void 0:V.length)??0,rowCount:K,allowDarkMode:ue?ue[1]==="true":!0,sheetNumber:(he==null?void 0:he.sheetNumber)??null,sheetId:(he==null?void 0:he.sheetId)??""})}catch{}}return B.sort((E,I)=>!E.savedAt&&!I.savedAt?0:E.savedAt?I.savedAt?I.savedAt.localeCompare(E.savedAt):-1:1),B}function N(B){localStorage.removeItem(Ov(B)),localStorage.removeItem(Ah(B)),wT(B)}return{sessionId:t,lastSavedAt:e,sheetNumber:n,sheetId:o,save:c,load:u,prepareNew:h,assignSheetNumber:g,createSession:v,newChart:m,loadSample:b,loadChart:y,createFromDsl:x,startAutoSave:_,listSavedCharts:S,deleteChart:N}});function Qs(){const t=Vre(),{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r}=Mt(t);return{sessionId:e,lastSavedAt:n,sheetNumber:o,sheetId:r,save:t.save,load:t.load,prepareNew:t.prepareNew,assignSheetNumber:t.assignSheetNumber,createSession:t.createSession,newChart:t.newChart,loadSample:t.loadSample,loadChart:t.loadChart,createFromDsl:t.createFromDsl,startAutoSave:t.startAutoSave,listSavedCharts:t.listSavedCharts,deleteChart:t.deleteChart}}const ab=260,q6=660,AT=220,zre=ab+AT,lb=.22,Nu=Lo("panel",()=>{const t=Fe("docked"),e=Fe(lb),n=Fe("docked"),o=Fe(!1),r=Fe(!1);function i(){t.value="docked",o.value||(n.value="docked")}function s(){t.value="closed",o.value||(n.value="closed")}function a(){t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function l(){t.value!=="drawer"&&(n.value=t.value),t.value="drawer"}function c(){t.value=n.value}function u(){t.value==="docked"?s():t.value==="closed"&&(t.value="docked",o.value||(n.value="docked"))}function d(m){if(!Number.isFinite(m)||m<=0){e.value=lb;return}e.value=Math.min(1,m)}function f(m){o.value=m,m?t.value!=="drawer"&&(t.value="drawer"):t.value==="drawer"&&(t.value=n.value)}function h(m){o.value!==m&&(o.value=m,m?(t.value!=="drawer"&&(n.value=t.value),t.value="drawer"):t.value=n.value)}function g(m){r.value=m,m&&t.value!=="closed"&&t.value!=="drawer"&&(t.value="closed")}function v(m){r.value!==m&&(r.value=m,!o.value&&(m?(t.value!=="closed"&&t.value!=="drawer"&&(n.value=t.value),t.value="closed"):t.value==="closed"&&(t.value=n.value)))}return{mode:t,dockedWidth:e,lastDesktopMode:n,narrow:o,cramped:r,dock:i,close:s,open:a,openDrawer:l,closeDrawer:c,toggleMode:u,setDockedWidth:d,initBreakpoint:f,syncBreakpoint:h,initCramped:g,syncCramped:v}},{persist:{key:"blueprint-chart:panel:v3",pick:["mode","dockedWidth","lastDesktopMode"]}});function lc(){const t=Nu(),{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i}=Mt(t);return{mode:e,dockedWidth:n,lastDesktopMode:o,narrow:r,cramped:i,dock:t.dock,close:t.close,open:t.open,openDrawer:t.openDrawer,closeDrawer:t.closeDrawer,toggleMode:t.toggleMode,setDockedWidth:t.setDockedWidth,initBreakpoint:t.initBreakpoint,syncBreakpoint:t.syncBreakpoint,initCramped:t.initCramped,syncCramped:t.syncCramped}}const Hre=Lo("dashboardPanel",()=>{const t=Fe(null);function e(o){if(t.value===o){t.value=null;return}t.value=o;const r=Nu();r.mode==="closed"&&r.open()}function n(){t.value=null}return{selectedChartId:t,selectChart:e,reset:n}});function CT(){const t=Hre(),{selectedChartId:e}=Mt(t);return{selectedChartId:e,selectChart:t.selectChart,reset:t.reset}}function $T(){const{listSavedCharts:t,deleteChart:e}=Qs(),{selectedChartId:n}=CT(),{resolvedTheme:o}=Mf(),r=ze([]),i=ar({}),s=ar({}),a=Fe("date-desc"),l=A(()=>{const v=[...r.value];return a.value==="date-desc"?v.sort((m,b)=>(b.savedAt??"").localeCompare(m.savedAt??"")):a.value==="date-asc"?v.sort((m,b)=>(m.savedAt??"").localeCompare(b.savedAt??"")):a.value==="name-asc"&&v.sort((m,b)=>(m.title||"").localeCompare(b.title||"")),v}),c=A(()=>r.value.find(v=>v.id===n.value)??null);function u(){r.value=t(),d()}function d(){for(const v of r.value){const m=ib(v.id),b=Nre(v.id);if(m&&(i[v.id]=Tc(m)),b&&(s[v.id]=Tc(b)),m&&b)continue;const y=localStorage.getItem(`blueprint-chart:${v.id}`);if(y)try{if(!m){const x=ST(y);x&&(sb(v.id,x),i[v.id]=Tc(x))}if(!b){const x=Rre(y);x&&(_T(v.id,x),s[v.id]=Tc(x))}}catch{}}}function f(v){const m=localStorage.getItem(`blueprint-chart:${v}`);if(!m)return null;const b=ap();localStorage.setItem(`blueprint-chart:${b}`,m);const y=localStorage.getItem(`blueprint-chart:${v}:meta`);y&&localStorage.setItem(`blueprint-chart:${b}:meta`,y);const x=ib(v);return x&&sb(b,x),u(),b}function h(v){n.value=null,e(v),delete i[v],delete s[v],u()}function g(){for(const v of r.value)wT(v.id),Ire(v.id),delete i[v.id],delete s[v.id];d()}return je(o,()=>{g()}),{charts:r,sortedCharts:l,selectedChart:c,thumbnails:i,previews:s,sortValue:a,refresh:u,duplicateChart:f,removeChart:h}}const Wre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ure(t,e){return w(),R("svg",Wre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m219.31 108.68l-80-80a16 16 0 0 0-22.62 0l-80 80A15.87 15.87 0 0 0 32 120v96a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-56h32v56a8 8 0 0 0 8 8h64a8 8 0 0 0 8-8v-96a15.87 15.87 0 0 0-4.69-11.32M208 208h-48v-56a8 8 0 0 0-8-8h-48a8 8 0 0 0-8 8v56H48v-88l80-80l80 80Z"},null,-1)])])}const Gre=Me({name:"ph-house",render:Ure}),qre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yre(t,e){return w(),R("svg",qre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M104 40H56a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 64H56V56h48zm96-64h-48a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 64h-48V56h48zm-96 32H56a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16m0 64H56v-48h48zm96-64h-48a16 16 0 0 0-16 16v48a16 16 0 0 0 16 16h48a16 16 0 0 0 16-16v-48a16 16 0 0 0-16-16m0 64h-48v-48h48z"},null,-1)])])}const TT=Me({name:"ph-squares-four",render:Yre}),jre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Xre(t,e){return w(),R("svg",jre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208.31 75.68A59.78 59.78 0 0 0 202.93 28a8 8 0 0 0-6.93-4a59.75 59.75 0 0 0-48 24h-24a59.75 59.75 0 0 0-48-24a8 8 0 0 0-6.93 4a59.78 59.78 0 0 0-5.38 47.68A58.14 58.14 0 0 0 56 104v8a56.06 56.06 0 0 0 48.44 55.47A39.8 39.8 0 0 0 96 192v8H72a24 24 0 0 1-24-24a40 40 0 0 0-40-40a8 8 0 0 0 0 16a24 24 0 0 1 24 24a40 40 0 0 0 40 40h24v16a8 8 0 0 0 16 0v-40a24 24 0 0 1 48 0v40a8 8 0 0 0 16 0v-40a39.8 39.8 0 0 0-8.44-24.53A56.06 56.06 0 0 0 216 112v-8a58.14 58.14 0 0 0-7.69-28.32M200 112a40 40 0 0 1-40 40h-48a40 40 0 0 1-40-40v-8a41.74 41.74 0 0 1 6.9-22.48a8 8 0 0 0 1.1-7.69a43.8 43.8 0 0 1 .79-33.58a43.88 43.88 0 0 1 32.32 20.06a8 8 0 0 0 6.71 3.69h32.35a8 8 0 0 0 6.74-3.69a43.87 43.87 0 0 1 32.32-20.06a43.8 43.8 0 0 1 .77 33.58a8.09 8.09 0 0 0 1 7.65a41.7 41.7 0 0 1 7 22.52Z"},null,-1)])])}const Kre=Me({name:"ph-github-logo",render:Xre}),Zre={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Qre(t,e){return w(),R("svg",Zre,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 48h-72a40 40 0 0 0-32 16a40 40 0 0 0-32-16H24a8 8 0 0 0-8 8v144a8 8 0 0 0 8 8h72a24 24 0 0 1 24 24a8 8 0 0 0 16 0a24 24 0 0 1 24-24h72a8 8 0 0 0 8-8V56a8 8 0 0 0-8-8M96 192H32V64h64a24 24 0 0 1 24 24v112a39.8 39.8 0 0 0-24-8m128 0h-64a39.8 39.8 0 0 0-24 8V88a24 24 0 0 1 24-24h64Z"},null,-1)])])}const Jre=Me({name:"ph-book-open",render:Qre}),eie={class:"layout-sidebar__header"},tie=le({__name:"LayoutSidebar",setup(t){const e=Jl(),{sortedCharts:n}=$T(),{resolvedTheme:o}=Mf(),r=A(()=>n.value.slice(0,5)),i=A(()=>e.path==="/"),s=A(()=>e.path.startsWith("/charts")),a=A(()=>o.value==="dark"?iC:rC);return(l,c)=>(w(),Q(p(MU),{"aria-label":"Workspace navigation"},{header:J(()=>[T("div",eie,[H(p(jA),{name:"Blueprint Chart","logo-src":a.value,to:"/"},null,8,["logo-src"]),Ae(l.$slots,"trailing",{},void 0,!0)])]),default:J(()=>[H(p(lv),{eyebrow:"Workspace"},{default:J(()=>[H(p(Zu),{to:"/",label:"Home",active:i.value},{icon:J(()=>[H(p(Gre))]),_:1},8,["active"]),H(p(Zu),{to:"/charts",label:"My Charts",active:s.value,count:p(n).length||void 0},{icon:J(()=>[H(p(TT))]),_:1},8,["active","count"])]),_:1}),r.value.length?(w(),Q(p(lv),{key:0,eyebrow:"Recent"},{default:J(()=>[(w(!0),R(Ge,null,gt(r.value,u=>(w(),Q(p(Zu),{key:u.id,to:`/edit/${u.id}`,label:u.title||"Untitled"},null,8,["to","label"]))),128))]),_:1})):se("",!0),H(p(lv),{eyebrow:"Resources"},{default:J(()=>[H(p(Zu),{href:"https://docs.blueprintchart.com",label:"Documentation"},{icon:J(()=>[H(p(Jre))]),_:1}),H(p(Zu),{href:"https://github.com/blueprint-chart/blueprint-chart",label:"GitHub"},{icon:J(()=>[H(p(Kre))]),_:1})]),_:1})]),_:3}))}}),Y6=Be(tie,[["__scopeId","data-v-34084162"]]),nie={class:"command-palette-modal"},oie={class:"command-palette-modal__input-row"},rie={key:0,class:"command-palette-modal__results",role:"listbox","aria-label":"Chart results"},iie=["aria-selected","onClick","onMousemove"],sie=["src"],aie={class:"command-palette-modal__meta"},lie={class:"command-palette-modal__title"},cie={class:"command-palette-modal__desc"},uie={key:1,class:"command-palette-modal__empty"},die=le({__name:"CommandPaletteModal",props:{open:{type:Boolean,required:!0},openModifiers:{}},emits:["update:open"],setup(t){const e=pt(t,"open"),n=Oy(),o=Jl(),{listSavedCharts:r}=Qs(),i=ze(""),s=ze(0),a=mt("inputRef"),l=ze([]),c=A(()=>{const m=i.value.trim().toLowerCase();return m?l.value.filter(b=>{var y,x;return((y=b.title)==null?void 0:y.toLowerCase().includes(m))||((x=b.description)==null?void 0:x.toLowerCase().includes(m))}):l.value.slice(0,5)}),u=A(()=>{const m={};for(const b of l.value){const y=ib(b.id);y&&(m[b.id]=Tc(y))}return m});je(i,()=>{s.value=0}),je(()=>o.path,()=>{e.value&&(e.value=!1)}),je(e,m=>{m?l.value=r():(i.value="",s.value=0)},{immediate:!0});function d(){var m;(m=a.value)==null||m.focus()}function f(m){const b=c.value.length-1;if(b<0)return;let y=s.value+m;y<0&&(y=b),y>b&&(y=0),s.value=y}function h(){const m=c.value[s.value];m&&g(m.id)}function g(m){e.value=!1,n.push(`/edit/${m}`)}function v(m){return{"command-palette-modal__result":!0,"command-palette-modal__result--active":m===s.value}}return(m,b)=>(w(),Q(p(XE),{modelValue:e.value,"onUpdate:modelValue":b[4]||(b[4]=y=>e.value=y),size:"lg",centered:"","no-header":"","no-footer":"",autofocus:!1,"body-class":"command-palette-modal__body","no-close-on-esc":"",onShown:d},{default:J(()=>[T("div",nie,[T("div",oie,[H(p(Uy),{class:"command-palette-modal__icon"}),H(p(ra),{ref_key:"inputRef",ref:a,modelValue:p(i),"onUpdate:modelValue":b[0]||(b[0]=y=>Ze(i)?i.value=y:null),"aria-label":"Search charts",placeholder:"Search charts…",autofocus:"",onKeydown:[b[1]||(b[1]=nr(gn(y=>e.value=!1,["prevent"]),["escape"])),b[2]||(b[2]=nr(gn(y=>f(1),["prevent"]),["down"])),b[3]||(b[3]=nr(gn(y=>f(-1),["prevent"]),["up"])),nr(gn(h,["prevent"]),["enter"])]},null,8,["modelValue","onKeydown"])]),p(c).length>0?(w(),R("div",rie,[(w(!0),R(Ge,null,gt(p(c),(y,x)=>(w(),R("div",{key:y.id,class:Te(v(x)),role:"option",tabindex:"-1","aria-selected":x===p(s),onClick:_=>g(y.id),onMousemove:_=>s.value=x},[p(u)[y.id]?(w(),R("img",{key:0,src:p(u)[y.id],class:"command-palette-modal__thumb",alt:""},null,8,sie)):se("",!0),T("div",aie,[T("span",lie,be(y.title||"Untitled"),1),T("span",cie,be(y.description),1)])],42,iie))),128))])):p(i).trim()?(w(),R("div",uie,' No charts match "'+be(p(i))+'" ',1)):se("",!0)])]),_:1},8,["modelValue"]))}}),j6=Be(die,[["__scopeId","data-v-09e7b11e"]]);function fie(){const{isNarrow:t}=bi(),e=Nu();e.initBreakpoint(t.value),je(t,n=>{e.syncBreakpoint(n)})}const hie={key:0,class:"layout-shell layout-shell--landing"},pie={key:1,class:"layout-shell layout-shell--app"},mie={class:"layout-shell__sidebar"},gie={class:"layout-shell__topbar"},vie={class:"layout-shell__main"},bie=le({__name:"LayoutShell",setup(t){fie();const e=Jl(),n=A(()=>e.path==="/"),o=Fe(!1),r=nC("k"),{isNarrow:i}=bi("xl"),s=ze(!1);return je(()=>e.fullPath,()=>{s.value=!1}),je(i,a=>{a||(s.value=!1)}),Ws(document,"keydown",a=>{r.matches(a)&&(a.preventDefault(),o.value=!0)}),(a,l)=>{const c=JE;return n.value?(w(),R("div",hie,[Ae(a.$slots,"default",{},void 0,!0),H(j6,{open:o.value,"onUpdate:open":l[0]||(l[0]=u=>o.value=u)},null,8,["open"])])):(w(),R("div",pie,[T("aside",mie,[H(Y6)]),T("div",gie,[H(Jq,{"sidebar-open":s.value,onSearchClick:l[1]||(l[1]=u=>o.value=!0),onToggleSidebar:l[2]||(l[2]=u=>s.value=!s.value)},null,8,["sidebar-open"])]),T("main",vie,[Ae(a.$slots,"default",{},void 0,!0)]),p(i)?(w(),Q(c,{key:0,id:"layout-sidebar-offcanvas",modelValue:s.value,"onUpdate:modelValue":l[4]||(l[4]=u=>s.value=u),placement:"start","no-header":"","aria-label":"Workspace navigation",class:"layout-shell__sidebar-offcanvas"},{default:J(()=>[H(Y6,null,{trailing:J(()=>[H(p(GA),{onClick:l[3]||(l[3]=u=>s.value=!1)})]),_:1})]),_:1},8,["modelValue"])):se("",!0),H(j6,{open:o.value,"onUpdate:open":l[5]||(l[5]=u=>o.value=u)},null,8,["open"])]))}}}),yie=Be(bie,[["__scopeId","data-v-e550b95e"]]),xie=le({__name:"App",setup(t){const e=Jl();return(n,o)=>{const r=im("router-view"),i=yie;return p(e).meta.bare?(w(),Q(r,{key:0})):(w(),Q(i,{key:1},{default:J(()=>[H(r)]),_:1}))}}}),wie="modulepreload",_ie=function(t){return"/"+t},X6={},K6=function(e,n,o){let r=Promise.resolve();if(n&&n.length>0){let s=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=s(n.map(c=>{if(c=_ie(c),c in X6)return;X6[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":wie,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return r.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},kie=le({__name:"PanelDocked",props:at({collapsed:{type:Boolean},title:{},initialWidth:{default:lb},showClose:{type:Boolean,default:!0},canvasWidth:{default:void 0}},{modelValue:{},modelModifiers:{}}),emits:at(["close"],["update:modelValue"]),setup(t){const e=t,n=pt(t,"modelValue"),o=Fe(n.value??e.initialWidth);je(n,u=>{u!==void 0&&(o.value=u)});const r=Fe(!1),{width:i}=eR(),s=A(()=>({"panel-docked--collapsed":e.collapsed,"panel-docked--resizing":r.value})),a=A(()=>e.canvasWidth===void 0||e.canvasWidth<=0?q6:Math.min(q6,e.canvasWidth-AT)),l=A(()=>{const u=o.value*i.value;return Math.max(ab,Math.min(u,a.value))});function c(u){const d=u.clientX,f=o.value*i.value,h=u.currentTarget;h.setPointerCapture(u.pointerId),r.value=!0;function g(m){const b=d-m.clientX,y=f+b,x=Math.min(a.value,Math.max(ab,y)),_=i.value||window.innerWidth;o.value=_>0?x/_:o.value,n.value=o.value}function v(){r.value=!1,h.removeEventListener("pointermove",g),h.removeEventListener("pointerup",v)}h.addEventListener("pointermove",g),h.addEventListener("pointerup",v)}return(u,d)=>(w(),R("div",{class:Te(["panel-docked",p(s)]),style:Dt({width:t.collapsed?void 0:`${p(l)}px`})},[T("div",{class:"panel-docked__resize-handle",onPointerdown:c},null,32),H(p(eU),{title:t.title},ki({actions:J(()=>[t.showClose?(w(),Q(p(GA),{key:0,onClick:d[0]||(d[0]=f=>u.$emit("close"))})):se("",!0)]),default:J(()=>[Ae(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots.toolbar?{name:"toolbar",fn:J(()=>[Ae(u.$slots,"toolbar",{},void 0,!0)]),key:"0"}:void 0,u.$slots.footer?{name:"footer",fn:J(()=>[Ae(u.$slots,"footer",{},void 0,!0)]),key:"1"}:void 0]),1032,["title"])],6))}}),Sie=Be(kie,[["__scopeId","data-v-02f78f79"]]),Aie={class:"panel-drawer__body"},Cie=le({__name:"PanelDrawer",props:at({title:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue");return(n,o)=>(w(),Q(p(qA),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=r=>e.value=r),title:t.title},{default:J(()=>[Ae(n.$slots,"header",{},void 0,!0),T("div",Aie,[Ae(n.$slots,"default",{},void 0,!0)])]),_:3},8,["modelValue","title"]))}}),$ie=Be(Cie,[["__scopeId","data-v-46314d76"]]);function Tie(t){const{width:e}=GI(t),n=Nu(),o=A(()=>e.value>0&&e.value<zre);return n.initCramped(o.value),je(o,r=>{n.syncCramped(r)}),{canvasWidth:e}}const pg=le({__name:"PanelShell",props:at({title:{},containerRef:{default:null},showClose:{type:Boolean,default:!0}},{drawerOpen:{type:Boolean,default:!1},drawerOpenModifiers:{}}),emits:at(["close"],["update:drawerOpen"]),setup(t,{emit:e}){const n=t,o=e,r=pt(t,"drawerOpen"),i=Nu(),{mode:s,dockedWidth:a}=Mt(i),{close:l}=i,c=A(()=>{var f;return((f=n.containerRef)==null?void 0:f.parentElement)??null}),{canvasWidth:u}=Tie(c);function d(){l(),o("close")}return(f,h)=>{const g=$ie,v=Sie;return p(s)==="drawer"?(w(),Q(g,{key:0,modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=m=>r.value=m),title:t.title},ki({default:J(()=>[Ae(f.$slots,"default")]),_:2},[f.$slots.tabs||f.$slots.header?{name:"header",fn:J(()=>[Ae(f.$slots,"tabs"),Ae(f.$slots,"header")]),key:"0"}:void 0]),1032,["modelValue","title"])):p(s)==="docked"?(w(),Q(v,{key:1,modelValue:p(a),"onUpdate:modelValue":h[1]||(h[1]=m=>Ze(a)?a.value=m:null),collapsed:!1,title:t.title,"show-close":t.showClose,"canvas-width":p(u),onClose:d},ki({default:J(()=>[Ae(f.$slots,"default")]),_:2},[f.$slots.header?{name:"toolbar",fn:J(()=>[Ae(f.$slots,"header")]),key:"0"}:void 0,f.$slots.footer?{name:"footer",fn:J(()=>[Ae(f.$slots,"footer")]),key:"1"}:void 0]),1032,["modelValue","title","show-close","canvas-width"])):se("",!0)}}}),Mie={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Oie(t,e){return w(),R("svg",Mie,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M88 24v-8a8 8 0 0 1 16 0v8a8 8 0 0 1-16 0m-72 80h8a8 8 0 0 0 0-16h-8a8 8 0 0 0 0 16m108.42-64.84a8 8 0 0 0 10.74-3.58l8-16a8 8 0 0 0-14.31-7.16l-8 16a8 8 0 0 0 3.57 10.74m-96 81.69l-16 8a8 8 0 0 0 7.16 14.31l16-8a8 8 0 1 0-7.16-14.31M219.31 184a16 16 0 0 1 0 22.63l-12.68 12.68a16 16 0 0 1-22.63 0L132.7 168L115 214.09c0 .1-.08.21-.13.32a15.83 15.83 0 0 1-14.6 9.59h-.79a15.83 15.83 0 0 1-14.41-11L32.8 52.92A16 16 0 0 1 52.92 32.8L213 85.07a16 16 0 0 1 1.41 29.8l-.32.13L168 132.69ZM208 195.31L156.69 144a16 16 0 0 1 4.93-26l.32-.14l45.95-17.64L48 48l52.2 159.86l17.65-46c0-.11.08-.22.13-.33a16 16 0 0 1 11.69-9.34a16.7 16.7 0 0 1 3-.28a16 16 0 0 1 11.3 4.69l51.34 51.4Z"},null,-1)])])}const MT=Me({name:"ph-cursor-click",render:Oie}),Bie={class:"dashboard-empty-state"},Lie=le({__name:"DashboardEmptyState",setup(t){return(e,n)=>(w(),R("div",Bie,[H(p(MT),{class:"dashboard-empty-state__icon"}),n[0]||(n[0]=T("p",{class:"dashboard-empty-state__text"}," Select a chart to see its details ",-1))]))}}),Pie=Be(Lie,[["__scopeId","data-v-f6c24334"]]),Die={class:"dashboard-action-row__label"},Eie={key:0,class:"dashboard-action-row__description"},Nie=le({__name:"DashboardActionRow",props:{icon:{},label:{},description:{},danger:{type:Boolean}},emits:["click"],setup(t){const e=t,n=A(()=>({"dashboard-action-row--danger":e.danger}));return(o,r)=>(w(),R("button",{class:Te(["dashboard-action-row",p(n)]),onClick:r[0]||(r[0]=i=>o.$emit("click"))},[(w(),Q(Gt(t.icon),{class:"dashboard-action-row__icon"})),T("div",null,[T("div",Die,be(t.label),1),t.description?(w(),R("div",Eie,be(t.description),1)):se("",!0)])],2))}}),Iie=Be(Nie,[["__scopeId","data-v-0f47d7d3"]]),Rie={class:"dashboard-detail-actions"},Fie={class:"dashboard-detail-actions__list"},Vie=le({__name:"DashboardDetailActions",emits:["duplicate","delete"],setup(t){return(e,n)=>{const o=Iie;return w(),R("div",Rie,[n[2]||(n[2]=T("div",{class:"dashboard-detail-actions__title"}," Actions ",-1)),T("div",Fie,[H(o,{icon:p(bA),label:"Duplicate",description:"Create a copy to edit",onClick:n[0]||(n[0]=r=>e.$emit("duplicate"))},null,8,["icon"]),H(o,{icon:p(KA),label:"Delete chart",description:"This cannot be undone",danger:"",onClick:n[1]||(n[1]=r=>e.$emit("delete"))},null,8,["icon"])])])}}}),zie=Be(Vie,[["__scopeId","data-v-de396b53"]]),Hie={class:"dashboard-meta-chip"},Wie={class:"dashboard-meta-chip__label"},Uie={class:"dashboard-meta-chip__value"},Gie=le({__name:"DashboardMetaChip",props:{label:{},value:{}},setup(t){return(e,n)=>(w(),R("div",Hie,[T("div",Wie,be(t.label),1),T("div",Uie,be(t.value),1)]))}}),qie=Be(Gie,[["__scopeId","data-v-a1903aff"]]),Yie={class:"dashboard-detail-meta"},jie={class:"dashboard-detail-meta__grid"},Xie=le({__name:"DashboardDetailMeta",props:{chartType:{},savedAt:{},sceneCount:{},rowCount:{}},setup(t){const e=t,n=A(()=>HA(e.chartType)),o=A(()=>{if(!e.savedAt)return"—";const r=new Date(e.savedAt);return Number.isNaN(r.getTime())?e.savedAt:r.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})});return(r,i)=>{const s=qie;return w(),R("div",Yie,[i[0]||(i[0]=T("div",{class:"dashboard-detail-meta__title"}," Details ",-1)),T("div",jie,[H(s,{label:"Chart type",value:p(n)},null,8,["value"]),H(s,{label:"Last edited",value:p(o)},null,8,["value"]),H(s,{label:"Scenes",value:String(t.sceneCount)},null,8,["value"]),H(s,{label:"Data rows",value:String(t.rowCount)},null,8,["value"])])])}}}),Kie=Be(Xie,[["__scopeId","data-v-533a4b72"]]),Zie=["data-bs-theme"],Qie=["src"],Jie=le({__name:"DashboardDetailPreview",props:{src:{},forceLightTheme:{type:Boolean}},setup(t){return(e,n)=>t.src?(w(),R("div",{key:0,class:"dashboard-detail-preview","data-bs-theme":t.forceLightTheme?"light":void 0},[T("img",{src:t.src,alt:"",class:"dashboard-detail-preview__img"},null,8,Qie)],8,Zie)):se("",!0)}}),ese=Be(Jie,[["__scopeId","data-v-ddbd95be"]]),tse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nse(t,e){return w(),R("svg",tse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m227.31 73.37l-44.68-44.69a16 16 0 0 0-22.63 0L36.69 152A15.86 15.86 0 0 0 32 163.31V208a16 16 0 0 0 16 16h44.69a15.86 15.86 0 0 0 11.31-4.69L227.31 96a16 16 0 0 0 0-22.63M92.69 208H48v-44.69l88-88L180.69 120ZM192 108.68L147.31 64l24-24L216 84.68Z"},null,-1)])])}const U2=Me({name:"ph-pencil-simple",render:nse}),ose={class:"dashboard-detail-content"},rse={key:0,class:"dashboard-detail-content__subtitle"},ise=le({__name:"DashboardDetailContent",props:{title:{},subtitle:{},previewSrc:{},forceLightTheme:{type:Boolean},chartType:{},savedAt:{},sceneCount:{},rowCount:{}},emits:["edit","duplicate","delete"],setup(t){return(e,n)=>{const o=ese,r=Kie,i=zie;return w(),R("div",ose,[t.subtitle?(w(),R("div",rse,be(t.subtitle),1)):se("",!0),H(p(Qn),{"icon-left":p(U2),label:"Edit chart",variant:"primary",block:"",onClick:n[0]||(n[0]=s=>e.$emit("edit"))},null,8,["icon-left"]),H(o,{src:t.previewSrc,"force-light-theme":t.forceLightTheme},null,8,["src","force-light-theme"]),H(r,{"chart-type":t.chartType,"saved-at":t.savedAt,"scene-count":t.sceneCount,"row-count":t.rowCount},null,8,["chart-type","saved-at","scene-count","row-count"]),H(i,{onDuplicate:n[1]||(n[1]=s=>e.$emit("duplicate")),onDelete:n[2]||(n[2]=s=>e.$emit("delete"))})])}}}),sse=Be(ise,[["__scopeId","data-v-3d8b1e29"]]),ase=le({__name:"DashboardChartCard",props:{chart:{},thumbSrc:{},selected:{type:Boolean},layout:{}},emits:["select","edit"],setup(t){const{resolvedTheme:e}=Mf();return(n,o)=>(w(),Q(p(hG),{title:t.chart.title||"Untitled",subtitle:t.chart.description,"thumb-src":t.thumbSrc,selected:t.selected,layout:t.layout,"force-light-thumb":!t.chart.allowDarkMode,"serif-title":!0,onClick:o[1]||(o[1]=r=>n.$emit("select",t.chart.id))},{actions:J(()=>[H(p(Qn),{"icon-left":p(U2),label:"Edit","hide-label":"",square:"",variant:"primary",size:"sm",class:"dashboard-chart-card__edit-btn",onClick:o[0]||(o[0]=r=>n.$emit("edit",t.chart.id))},null,8,["icon-left"])]),footer:J(()=>[H(p(iW),{"chart-type":t.chart.chartType,theme:p(e)},null,8,["chart-type","theme"]),t.chart.savedAt?(w(),Q(p(zH),{key:0,value:t.chart.savedAt},null,8,["value"])):se("",!0)]),_:1},8,["title","subtitle","thumb-src","selected","layout","force-light-thumb"]))}}),lse=le({__name:"DashboardNewCard",props:{layout:{default:"grid"}},emits:["click"],setup(t){const e=t,n=A(()=>({"dashboard-new-card--row":e.layout==="row"}));return(o,r)=>(w(),R("div",{class:Te(["dashboard-new-card",p(n)]),role:"button",tabindex:"0",onClick:r[0]||(r[0]=i=>o.$emit("click")),onKeydown:[r[1]||(r[1]=nr(i=>o.$emit("click"),["enter"])),r[2]||(r[2]=nr(gn(i=>o.$emit("click"),["prevent"]),["space"]))]},[H(p(Ry),{class:"dashboard-new-card__icon"}),r[3]||(r[3]=T("span",{class:"dashboard-new-card__label"},"New Chart",-1))],34))}}),cse=Be(lse,[["__scopeId","data-v-ef746b42"]]),use=le({__name:"DashboardGallery",props:{charts:{},thumbnails:{},selectedId:{},layout:{}},emits:["select","edit","new"],setup(t){return(e,n)=>{const o=cse,r=ase;return w(),Q(p(mG),{layout:t.layout},{default:J(()=>[H(o,{layout:t.layout,onClick:n[0]||(n[0]=i=>e.$emit("new"))},null,8,["layout"]),(w(!0),R(Ge,null,gt(t.charts,i=>(w(),Q(r,{key:i.id,chart:i,"thumb-src":t.thumbnails[i.id],selected:t.selectedId===i.id,layout:t.layout,onSelect:n[1]||(n[1]=s=>e.$emit("select",s)),onEdit:n[2]||(n[2]=s=>e.$emit("edit",s))},null,8,["chart","thumb-src","selected","layout"]))),128)),t.charts.length===0?(w(),Q(p(VW),{key:0,message:"No saved charts yet. Create a new chart to get started."})):se("",!0)]),_:1},8,["layout"])}}}),dse={},fse={class:"layout-page-header"},hse={class:"layout-page-header__start"},pse={class:"layout-page-header__center"},mse={class:"layout-page-header__end"};function gse(t,e){return w(),R("div",fse,[T("div",hse,[Ae(t.$slots,"start",{},void 0,!0)]),T("div",pse,[Ae(t.$slots,"center",{},void 0,!0)]),T("div",mse,[Ae(t.$slots,"end",{},void 0,!0)])])}const OT=Be(dse,[["render",gse],["__scopeId","data-v-c99b9b81"]]),vse={key:0,class:"layout-breadcrumb","aria-label":"Breadcrumb"},bse=["aria-current"],yse={key:2,class:"layout-breadcrumb__crumb-sep","aria-hidden":"true"},xse=le({__name:"LayoutBreadcrumb",setup(t){const e=Jl(),n=pn(),o=A(()=>{const r=e.path;if(r.startsWith("/edit/")){const i=n._base.title.value||"Untitled";return[{label:"My Charts",to:"/charts"},{label:i}]}return r.startsWith("/charts")?[{label:"My Charts"}]:r==="/new"?[{label:"My Charts",to:"/charts"},{label:"New chart"}]:[]});return(r,i)=>{const s=im("router-link");return o.value.length?(w(),R("nav",vse,[(w(!0),R(Ge,null,gt(o.value,(a,l)=>(w(),R(Ge,{key:l},[a.to?(w(),Q(s,{key:0,to:a.to,class:"layout-breadcrumb__crumb"},{default:J(()=>[Xe(be(a.label),1)]),_:2},1032,["to"])):(w(),R("span",{key:1,class:"layout-breadcrumb__crumb layout-breadcrumb__crumb--active","aria-current":l===o.value.length-1?"page":void 0},be(a.label),9,bse)),l<o.value.length-1?(w(),R("span",yse,"/")):se("",!0)],64))),128))])):se("",!0)}}}),BT=Be(xse,[["__scopeId","data-v-73a5f2ae"]]),wse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _se(t,e){return w(),R("svg",wse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208 136H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16v-40a16 16 0 0 0-16-16m0 56H48v-40h160zm0-144H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16m0 56H48V64h160z"},null,-1)])])}const kse=Me({name:"ph-rows",render:_se}),Sse={class:"dashboard-toolbar__count"},Ase=le({__name:"DashboardToolbar",props:{chartCount:{},sortValue:{},layout:{}},emits:["update:sortValue","update:layout","new"],setup(t){const e=t,n=[{value:"date-desc",label:"Last edited"},{value:"date-asc",label:"Oldest first"},{value:"name-asc",label:"Name A–Z"}],o=A(()=>[{key:"grid",text:"Grid",icon:TT,active:e.layout==="grid"},{key:"row",text:"List",icon:kse,active:e.layout==="row"}]);return(r,i)=>(w(),Q(OT,{class:"dashboard-toolbar"},{start:J(()=>[H(BT),T("span",Sse,be(t.chartCount)+" "+be(t.chartCount===1?"chart":"charts"),1)]),end:J(()=>[H(p(YA),{items:p(o),"aria-label":"View layout",onSelect:i[0]||(i[0]=s=>r.$emit("update:layout",s))},null,8,["items"]),H(p(Nn),{"model-value":t.sortValue,options:n,"onUpdate:modelValue":i[1]||(i[1]=s=>r.$emit("update:sortValue",s))},null,8,["model-value"]),H(p(Qn),{"icon-left":p(Ry),label:"New chart",variant:"primary",onClick:i[2]||(i[2]=s=>r.$emit("new"))},null,8,["icon-left"])]),_:1}))}}),Cse=Be(Ase,[["__scopeId","data-v-de771377"]]),$se={class:"dashboard-page-wrapper d-flex flex-column flex-grow-1"},Tse=le({__name:"DashboardPage",setup(t){const e=Oy(),{isNarrow:n}=bi(),{selectedChartId:o,selectChart:r}=CT(),{mode:i}=Mt(Nu()),{sortedCharts:s,selectedChart:a,thumbnails:l,previews:c,sortValue:u,refresh:d,duplicateChart:f,removeChart:h}=$T(),g=mt("galleryRef"),v=Fe("grid"),m=A(()=>({"dashboard-page":!0,"dashboard-page--narrow":n.value})),b=A(()=>a.value?a.value.title||"Untitled":"Chart details");function y(){o.value=null}const x=A({get:()=>o.value!==null,set:k=>{k||(o.value=null)}});function _(){o.value&&e.push(`/edit/${o.value}`)}function S(){if(o.value){const k=f(o.value);k&&e.push(`/edit/${k}`)}}function N(){o.value&&h(o.value)}function B(k){k.key==="Escape"&&(o.value=null)}return hn(()=>{d(),document.addEventListener("keydown",B)}),na(()=>{document.removeEventListener("keydown",B)}),(k,L)=>{const E=Cse,I=use,C=sse,$=Pie,P=pg;return w(),R("div",$se,[H(E,{"chart-count":p(s).length,"sort-value":p(u),layout:p(v),"onUpdate:sortValue":L[0]||(L[0]=M=>u.value=M),"onUpdate:layout":L[1]||(L[1]=M=>v.value=M),onNew:L[2]||(L[2]=M=>p(e).push("/new"))},null,8,["chart-count","sort-value","layout"]),T("div",{class:Te(p(m))},[T("div",{ref_key:"galleryRef",ref:g,class:"dashboard-page__gallery"},[H(I,{charts:p(s),thumbnails:p(l),"selected-id":p(o),layout:p(v),onSelect:p(r),onEdit:L[3]||(L[3]=M=>p(e).push(`/edit/${M}`)),onNew:L[4]||(L[4]=M=>p(e).push("/new"))},null,8,["charts","thumbnails","selected-id","layout","onSelect"])],512),H(P,{"drawer-open":p(x),"onUpdate:drawerOpen":L[5]||(L[5]=M=>Ze(x)?x.value=M:null),title:p(b),"container-ref":p(g),"show-close":!1,onClose:y},{default:J(()=>[p(a)?(w(),Q(C,{key:0,title:p(a).title||"Untitled",subtitle:p(a).description,"preview-src":p(o)?p(c)[p(o)]:void 0,"force-light-theme":p(a)?!p(a).allowDarkMode:!1,"chart-type":p(a).chartType,"saved-at":p(a).savedAt??void 0,"scene-count":p(a).sceneCount,"row-count":p(a).rowCount,onEdit:_,onDuplicate:S,onDelete:N},null,8,["title","subtitle","preview-src","force-light-theme","chart-type","saved-at","scene-count","row-count"])):p(i)==="docked"?(w(),Q($,{key:1})):se("",!0)]),_:1},8,["drawer-open","title","container-ref"])],2)])}}}),Mse=Be(Tse,[["__scopeId","data-v-fe7a5a93"]]),Ose={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Bse(t,e){return w(),R("svg",Ose,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16M40 56h40v144H40Zm176 144H96V56h120z"},null,-1)])])}const LT=Me({name:"ph-sidebar-simple",render:Bse}),G2=le({__name:"PanelIconRail",props:{activeTab:{},items:{}},emits:["select","toggle-mode"],setup(t,{emit:e}){const n=e,{mode:o,open:r}=lc();function i(a){o.value==="closed"&&r(),n("select",a)}const s=A(()=>o.value==="closed"?"Open panel":"Close panel");return(a,l)=>(w(),Q(p(_U),{"model-value":t.activeTab,items:t.items,"onUpdate:modelValue":i},{footer:J(()=>[H(p(Qn),{"icon-left":p(LT),label:p(s),"hide-label":"",square:"",variant:"link",size:"sm",onClick:l[0]||(l[0]=c=>a.$emit("toggle-mode"))},null,8,["icon-left","label"])]),_:1},8,["model-value","items"]))}}),Lse=Lo("exportPanel",()=>{const t=Fe("embed"),e=Fe("png"),n=Fe(2),o=Fe(!1),r=Fe(!1),i=Fe(!0),s=Fe(!1),a=Fe("embed");function l(f){t.value=f}function c(f){e.value=f}function u(f){a.value=f}function d(){t.value="embed",e.value="png",n.value=2,o.value=!1,r.value=!1,i.value=!0,s.value=!1,a.value="embed"}return{exportTab:t,selectedFormat:e,pngScale:n,svgInlineFonts:o,svgMinify:r,bpcIncludeData:i,bpcCompact:s,lastNarrowExportTab:a,setExportTab:l,setSelectedFormat:c,setLastNarrowExportTab:u,reset:d}});function mg(){const t=Lse(),{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l}=Mt(t);return{exportTab:e,selectedFormat:n,pngScale:o,svgInlineFonts:r,svgMinify:i,bpcIncludeData:s,bpcCompact:a,lastNarrowExportTab:l,setExportTab:t.setExportTab,setSelectedFormat:t.setSelectedFormat,setLastNarrowExportTab:t.setLastNarrowExportTab,reset:t.reset}}const Pse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Dse(t,e){return w(),R("svg",Pse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M69.12 94.15L28.5 128l40.62 33.85a8 8 0 1 1-10.24 12.29l-48-40a8 8 0 0 1 0-12.29l48-40a8 8 0 0 1 10.24 12.3m176 27.7l-48-40a8 8 0 1 0-10.24 12.3L227.5 128l-40.62 33.85a8 8 0 1 0 10.24 12.29l48-40a8 8 0 0 0 0-12.29m-82.39-89.37a8 8 0 0 0-10.25 4.79l-64 176a8 8 0 0 0 4.79 10.26A8.1 8.1 0 0 0 96 224a8 8 0 0 0 7.52-5.27l64-176a8 8 0 0 0-4.79-10.25"},null,-1)])])}const Ese=Me({name:"ph-code",render:Dse}),Nse={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ise(t,e){return w(),R("svg",Nse,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 144v64a8 8 0 0 1-8 8H40a8 8 0 0 1-8-8v-64a8 8 0 0 1 16 0v56h160v-56a8 8 0 0 1 16 0m-101.66 5.66a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0-11.32-11.32L136 124.69V32a8 8 0 0 0-16 0v92.69L93.66 98.34a8 8 0 0 0-11.32 11.32Z"},null,-1)])])}const PT=Me({name:"ph-download-simple",render:Ise});function DT(){return{sections:[{key:"embed",label:"Embed",icon:Ese},{key:"download",label:"Download",icon:PT}]}}const Rse=le({__name:"ExportIconRail",setup(t){const{mode:e,toggleMode:n}=lc(),o=mg(),{exportTab:r}=Mt(o),{setExportTab:i}=o,{sections:s}=DT(),a=A(()=>s.map(c=>({value:c.key,icon:c.icon,tooltip:c.tooltip??c.label})));function l(c){i(c),e.value==="closed"&&n()}return(c,u)=>{const d=G2;return w(),Q(d,{"active-tab":p(r),items:p(a),onSelect:l,onToggleMode:p(n)},null,8,["active-tab","items","onToggleMode"])}}}),zi=[{label:"Data",key:"data"},{label:"Visualize",key:"edit"},{label:"Export",key:"export"}];function Fse(t){return t.endsWith("/export")?"export":t.endsWith("/visualize")?"edit":(t.endsWith("/data"),"data")}function Vse(t,e){return e==="edit"?`/edit/${t}/visualize`:`/edit/${t}/${e}`}const Bv=ze(null);function q2(){const t=Jl(),e=Oy(),n=A(()=>{const h=Fse((t==null?void 0:t.path)??"/new");return zi.find(g=>g.key===h)??zi[0]}),o=A({get:()=>zi.indexOf(n.value),set:h=>{u(h)}}),r=A(()=>o.value===0),i=A(()=>o.value===zi.length-1);function s(){var g;const h=(g=t==null?void 0:t.params)==null?void 0:g.id;return h||(Bv.value?Bv.value():null)}function a(h){const g=s();g&&e&&e.replace(Vse(g,h))}function l(){const h=o.value;h<zi.length-1&&a(zi[h+1].key)}function c(){const h=o.value;h>0&&a(zi[h-1].key)}function u(h){h>=0&&h<zi.length&&a(zi[h].key)}function d(){}function f(h){Bv.value=h}return{currentIndex:o,steps:zi,currentStep:n,isFirst:r,isLast:i,next:l,back:c,goTo:u,reset:d,registerCreateSession:f}}const zse={class:"panel-stepper-footer"},Hse=le({__name:"PanelStepperFooter",setup(t){const{steps:e,currentIndex:n,isFirst:o,isLast:r,next:i,back:s}=q2(),a=A(()=>{var c;return((c=e[n.value-1])==null?void 0:c.label)??"Previous"}),l=A(()=>{var c;return((c=e[n.value+1])==null?void 0:c.label)??"Next"});return(c,u)=>(w(),R("div",zse,[p(o)?se("",!0):(w(),Q(p(Qn),{key:0,"icon-left":p(ZA),"icon-left-size":"1em",label:p(a),variant:"outline-secondary",size:"sm",onClick:p(s)},null,8,["icon-left","label","onClick"])),p(r)?se("",!0):(w(),Q(p(Qn),{key:1,"icon-right":p(QA),"icon-right-size":"1em",label:p(l),variant:"primary",size:"sm",class:"ms-auto",onClick:p(i)},null,8,["icon-right","label","onClick"]))]))}}),Y2=Be(Hse,[["__scopeId","data-v-52b4dceb"]]),Wse={class:"format-card__header"},Use={class:"format-card__header__text"},Gse={class:"format-card__header__text__label"},qse={class:"format-card__header__text__desc"},Yse={key:0,class:"format-card__options"},jse=le({__name:"ExportDownloadFormatCard",props:{selected:{type:Boolean},icon:{},label:{},description:{},iconBg:{},iconColor:{}},emits:["select","download"],setup(t){return(e,n)=>(w(),R("div",{class:Te(["format-card",{"format-card--selected":t.selected}]),onClick:n[1]||(n[1]=o=>e.$emit("select"))},[T("div",Wse,[T("span",{class:"format-card__header__icon",style:Dt({background:t.iconBg,color:t.iconColor})},[(w(),Q(Gt(t.icon)))],4),T("div",Use,[T("div",Gse,be(t.label),1),T("div",qse,be(t.description),1)]),H(p(Qn),{"icon-left":p(PT),label:"Download","hide-label":"",variant:"primary",size:"sm",square:"",onClick:n[0]||(n[0]=gn(o=>e.$emit("download"),["stop"]))},null,8,["icon-left"])]),t.selected&&e.$slots.default?(w(),R("div",Yse,[Ae(e.$slots,"default",{},void 0,!0)])):se("",!0)],2))}}),Xse=Be(jse,[["__scopeId","data-v-f26129ef"]]);function Vf(t,e){const n=URL.createObjectURL(t),o=document.createElement("a");o.href=n,o.download=e,o.click(),URL.revokeObjectURL(n)}function Kse(t,e="chart.svg"){const o=new XMLSerializer().serializeToString(t),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"});Vf(r,e)}function Zse(t,e,n,o="chart.png"){const i=new XMLSerializer().serializeToString(t),s=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(s);return new Promise((l,c)=>{const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=e,d.height=n;const f=d.getContext("2d");if(!f){URL.revokeObjectURL(a),c(new Error("Could not get canvas context"));return}f.drawImage(u,0,0,e,n),d.toBlob(h=>{if(URL.revokeObjectURL(a),!h){c(new Error("Could not create PNG blob"));return}Vf(h,o),l()},"image/png")},u.onerror=()=>{URL.revokeObjectURL(a),c(new Error("Failed to load SVG image"))},u.src=a})}function ET(t,e){const n=globalThis.getComputedStyle(t),o=e;if(o.style)for(let s=0;s<n.length;s++){const a=n[s];o.style.setProperty(a,n.getPropertyValue(a))}const r=t.children,i=e.children;for(let s=0;s<r.length;s++)i[s]&&ET(r[s],i[s])}function Qse(t){const e=globalThis.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function Jse(t,e=2,n="chart.png",o,r){const{width:i,height:s}=t.getBoundingClientRect(),a=r??{top:0,right:0,bottom:0,left:0},l=i+a.left+a.right,c=s+a.top+a.bottom,u=Math.ceil(l*e),d=Math.ceil(c*e),f=t.cloneNode(!0);ET(t,f),f.querySelectorAll("[data-scene-player]").forEach(S=>S.remove()),f.style.setProperty("pointer-events","auto"),f.style.setProperty("transition","none"),f.style.setProperty("animation","none");const g=new XMLSerializer().serializeToString(f),v=a.left,m=a.top,b=o?`<rect width="${l}" height="${c}" fill="${o}" />`:"",y=[`<svg xmlns="http://www.w3.org/2000/svg" width="${u}" height="${d}">`,`<g transform="scale(${e})">`,b,`<foreignObject x="${v}" y="${m}" width="${i}" height="${s}">`,g,"</foreignObject>","</g>","</svg>"].join(""),x=new Blob([y],{type:"image/svg+xml;charset=utf-8"}),_=URL.createObjectURL(x);return new Promise((S,N)=>{const B=new Image;B.onload=()=>{const k=document.createElement("canvas");k.width=u,k.height=d;const L=k.getContext("2d");if(!L){URL.revokeObjectURL(_),N(new Error("Could not get canvas context"));return}L.drawImage(B,0,0,u,d),k.toBlob(E=>{if(URL.revokeObjectURL(_),!E){N(new Error("Could not create PNG blob"));return}Vf(E,n),S()},"image/png")},B.onerror=()=>{URL.revokeObjectURL(_),N(new Error("Failed to render frame as image"))},B.src=_})}function Lv(t){const e=globalThis.getComputedStyle(t);return{fontSize:parseFloat(e.fontSize),fontWeight:e.fontWeight,fontFamily:e.fontFamily,fill:e.color,fontStyle:e.fontStyle}}function NT(t){let e=t;for(;e;){const n=globalThis.getComputedStyle(e).backgroundColor;if(n&&n!=="transparent"&&n!=="rgba(0, 0, 0, 0)")return n;e=e.parentElement}return"#ffffff"}function eae(t,e="chart.svg"){const n=t.querySelector("svg");if(!n)return;const o=t.getBoundingClientRect(),r=NT(t),i=new XMLSerializer,s=[],a=t.querySelectorAll(".bc-frame-title, .bc-frame-description");for(const B of a){const k=B.getBoundingClientRect(),L=Lv(B);s.push({text:B.textContent??"",x:k.left-o.left,y:k.top-o.top+L.fontSize,...L})}const l=t.querySelector(".bc-frame-note");if(l&&l.textContent&&l.style.display!=="none"){const B=l.getBoundingClientRect(),k=Lv(l);s.push({text:l.textContent,x:B.left-o.left,y:B.top-o.top+k.fontSize,...k})}const c=t.querySelectorAll(".bc-frame-byline, .bc-frame-source, .bc-frame-credit");for(const B of c){const k=B.getBoundingClientRect();if(k.width===0)continue;const L=Lv(B);s.push({text:B.textContent??"",x:k.left-o.left,y:k.top-o.top+L.fontSize,...L})}const u=n.getBoundingClientRect(),d=u.left-o.left,f=u.top-o.top,h=u.width,g=u.height,v=n.cloneNode(!0);v.removeAttribute("width"),v.removeAttribute("height");const m=i.serializeToString(v),b=Math.ceil(o.width),y=Math.ceil(o.height),x=B=>B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),_=s.map(B=>`<text x="${B.x}" y="${B.y}" font-size="${B.fontSize}px" font-weight="${B.fontWeight}" font-family="${x(B.fontFamily)}" fill="${B.fill}"${B.fontStyle&&B.fontStyle!=="normal"?` font-style="${B.fontStyle}"`:""}>${x(B.text)}</text>`).join(`
|
|
848
|
-
`),S=[`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${b}" height="${y}" viewBox="0 0 ${b} ${y}">`,` <rect width="100%" height="100%" fill="${r}" />`,` ${_}`,` <g transform="translate(${d},${f})">`,` <svg width="${h}" height="${g}"${v.getAttribute("viewBox")?` viewBox="${v.getAttribute("viewBox")}"`:""}>`,m.replace(/^<svg[^>]*>/,"").replace(/<\/svg>$/,"")," </svg>"," </g>","</svg>"].join(`
|
|
849
|
-
`),N=new Blob([S],{type:"image/svg+xml;charset=utf-8"});Vf(N,e)}const tae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nae(t,e){return w(),R("svg",tae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 40H40a16 16 0 0 0-16 16v144a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a16 16 0 0 0-16-16m0 16v102.75l-26.07-26.06a16 16 0 0 0-22.63 0l-20 20l-44-44a16 16 0 0 0-22.62 0L40 149.37V56ZM40 172l52-52l80 80H40Zm176 28h-21.37l-36-36l20-20L216 181.38zm-72-100a12 12 0 1 1 12 12a12 12 0 0 1-12-12"},null,-1)])])}const oae=Me({name:"ph-image",render:nae}),rae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function iae(t,e){return w(),R("svg",rae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M181.66 146.34a8 8 0 0 1 0 11.32l-24 24a8 8 0 0 1-11.32-11.32L164.69 152l-18.35-18.34a8 8 0 0 1 11.32-11.32Zm-72-24a8 8 0 0 0-11.32 0l-24 24a8 8 0 0 0 0 11.32l24 24a8 8 0 0 0 11.32-11.32L91.31 152l18.35-18.34a8 8 0 0 0 0-11.32M216 88v128a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16V40a16 16 0 0 1 16-16h96a8 8 0 0 1 5.66 2.34l56 56A8 8 0 0 1 216 88m-56-8h28.69L160 51.31Zm40 136V96h-48a8 8 0 0 1-8-8V40H56v176z"},null,-1)])])}const sae=Me({name:"ph-file-code",render:iae}),aae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function lae(t,e){return w(),R("svg",aae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m213.66 82.34l-56-56A8 8 0 0 0 152 24H56a16 16 0 0 0-16 16v176a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16V88a8 8 0 0 0-2.34-5.66M160 51.31L188.69 80H160ZM200 216H56V40h88v48a8 8 0 0 0 8 8h48zm-32-80a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8m0 32a8 8 0 0 1-8 8H96a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8"},null,-1)])])}const IT=Me({name:"ph-file-text",render:lae}),cae={class:"export-download-panel"},uae=le({__name:"ExportDownloadPanel",emits:["download-png","download-svg"],setup(t,{emit:e}){const n=mg(),{selectedFormat:o,pngScale:r,svgInlineFonts:i,svgMinify:s,bpcCompact:a}=Mt(n),{setSelectedFormat:l}=n,{dsl:c}=Ff(),u=e;function d(){u("download-png",r.value)}function f(){u("download-svg")}function h(){Vf(new globalThis.Blob([c.value],{type:"text/plain"}),"chart.bpc")}return(g,v)=>{const m=Xse,b=Hs;return w(),R("div",cae,[H(m,{selected:p(o)==="png",icon:p(oae),label:"PNG",description:"Raster image, best for presentations","icon-bg":"var(--bs-info-bg-subtle)","icon-color":"var(--bs-info-text-emphasis)",onSelect:v[1]||(v[1]=y=>p(l)("png")),onDownload:d},{default:J(()=>[H(p(_r),{id:"png-scale","model-value":p(r),label:"Scale",min:1,max:4,step:1,"onUpdate:modelValue":v[0]||(v[0]=y=>r.value=y)},null,8,["model-value"])]),_:1},8,["selected","icon"]),H(m,{selected:p(o)==="svg",icon:p(sae),label:"SVG",description:"Vector image, best for print and web","icon-bg":"var(--bs-success-bg-subtle)","icon-color":"var(--bs-success-text-emphasis)",onSelect:v[4]||(v[4]=y=>p(l)("svg")),onDownload:f},{default:J(()=>[H(b,{modelValue:p(i),"onUpdate:modelValue":v[2]||(v[2]=y=>Ze(i)?i.value=y:null),switch:""},{default:J(()=>[...v[7]||(v[7]=[Xe(" Inline fonts ",-1)])]),_:1},8,["modelValue"]),H(b,{modelValue:p(s),"onUpdate:modelValue":v[3]||(v[3]=y=>Ze(s)?s.value=y:null),switch:""},{default:J(()=>[...v[8]||(v[8]=[Xe(" Minify ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"]),H(m,{selected:p(o)==="bpc",icon:p(IT),label:"BPC",description:"Blueprint Chart DSL file","icon-bg":"var(--bs-warning-bg-subtle)","icon-color":"var(--bs-warning-text-emphasis)",onSelect:v[6]||(v[6]=y=>p(l)("bpc")),onDownload:h},{default:J(()=>[H(b,{modelValue:p(a),"onUpdate:modelValue":v[5]||(v[5]=y=>Ze(a)?a.value=y:null),switch:""},{default:J(()=>[...v[9]||(v[9]=[Xe(" Compact ",-1)])]),_:1},8,["modelValue"])]),_:1},8,["selected","icon"])])}}}),dae=Be(uae,[["__scopeId","data-v-f6670dcb"]]),fae={class:"export-embed-panel"},hae={class:"export-embed-panel__code-block"},pae={class:"export-embed-panel__code-block__header"},mae={class:"export-embed-panel__code-block__pre"},gae=["href"],vae=le({__name:"ExportEmbedPanel",setup(t){const{dsl:e,generateDsl:n}=Ff(),{layout:o}=pn();function r(a){const l=new TextEncoder().encode(a);let c="";for(const u of l)c+=String.fromCharCode(u);return globalThis.btoa(c)}const i=A(()=>{const a=r(e.value||n());return`${window.location.origin}${window.location.pathname}#/render?bpc64=${encodeURIComponent(a)}`}),s=A(()=>{const a=Lt(o.value),l=a.heightMode==="fixed"?a.fixedHeight:400,c=[];return a.sizing==="responsive"?c.push(`width="100%" height="${l}"`):a.sizing==="max-width"?c.push(`style="width:100%;max-width:${a.maxWidth}px" height="${l}"`):c.push(`width="${a.fixedWidth}" height="${l}"`),`<iframe src="${i.value}" ${c.join(" ")} frameborder="0"></iframe>`});return(a,l)=>(w(),R("div",fae,[T("div",hae,[T("div",pae,[l[0]||(l[0]=T("span",{class:"export-embed-panel__code-block__label"},"Embed code",-1)),H(p(E_),{text:p(s),label:"Copy",variant:"outline-secondary",size:"sm"},null,8,["text"])]),T("pre",mae,[T("code",null,be(p(s)),1)])]),l[1]||(l[1]=T("div",{class:"export-embed-panel__info"}," Paste this iframe into your HTML page. The chart renders automatically. ",-1)),H(p(E_),{text:p(s),label:"Copy embed code",variant:"primary",size:"sm"},null,8,["text"]),T("a",{href:p(i),target:"_blank",rel:"noopener",class:"export-embed-panel__link"}," Preview in new tab ",8,gae)]))}}),bae=Be(vae,[["__scopeId","data-v-030ab97a"]]),yae=["onClick"],xae=le({__name:"PanelTabBar",props:at({tabs:{},sticky:{type:Boolean,default:!1}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=pt(t,"modelValue"),n=mt("tabsRef");let o=null;function r(){wn(()=>{o!=null&&o.scrollIntoView&&n.value&&o.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})})}return je(()=>o,r),(i,s)=>(w(),R("div",{ref_key:"tabsRef",ref:n,class:Te(["panel-tab-bar",{"panel-tab-bar--sticky":t.sticky}])},[(w(!0),R(Ge,null,gt(t.tabs,a=>(w(),R("button",{key:a.key,ref_for:!0,ref:l=>{a.key===e.value&&(Ze(o)?o.value=l:o=l)},class:Te(["panel-tab-bar__tab",{"panel-tab-bar__tab--active":e.value===a.key}]),onClick:l=>e.value=a.key},[a.icon?(w(),Q(Gt(a.icon),{key:0,class:"panel-tab-bar__tab__icon","aria-hidden":"true"})):se("",!0),Xe(" "+be(a.label),1)],10,yae))),128))],2))}}),j2=Be(xae,[["__scopeId","data-v-1a1009cc"]]),wae=le({__name:"CanvasModePickerOptionSwatch",props:{mode:{}},setup(t){return(e,n)=>(w(),R("span",{class:Te(["canvas-mode-swatch",`canvas-mode-swatch--${t.mode}`])},null,2))}}),RT=Be(wae,[["__scopeId","data-v-81dabc6c"]]),_ae=Lo("editorPanel",()=>{const t=Fe("type"),e=Fe("preview"),n=Fe("blueprint"),o=Fe(!0),r=Fe(null),i=Fe("upload"),s=Fe(""),a=Fe(!1),l=Fe(-1),c=Fe("type"),u=Fe("column");function d(k){t.value=k}function f(k){r.value=k,d("annotate")}function h(k){e.value=k}function g(k){n.value=k}function v(k){i.value=k,k==="structure"&&b("column")}function m(k){s.value=k}function b(k){s.value=k,a.value=!0}function y(){a.value=!1,s.value=""}function x(){a.value=!a.value}function _(k){if(l.value===k){l.value=-1;return}l.value=k,b("column")}function S(k){c.value=k}function N(k){u.value=k}function B(){t.value="type",e.value="preview",n.value="blueprint",o.value=!0,r.value=null,i.value="upload",s.value="",a.value=!1,l.value=-1,c.value="type",u.value="column"}return{activeTab:t,viewMode:e,canvasMode:n,showDimensions:o,pendingAnnotationIndex:r,dataView:i,dataPanelTab:s,dataPanelOpen:a,selectedColumnIndex:l,lastNarrowEditTab:c,lastNarrowDataTab:u,selectTab:d,selectAnnotation:f,setViewMode:h,setCanvasMode:g,setDataView:v,setDataPanelTab:m,openDataPanel:b,closeDataPanel:y,toggleDataPanel:x,selectColumn:_,setLastNarrowEditTab:S,setLastNarrowDataTab:N,reset:B}});function dr(){const t=_ae(),{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d}=Mt(t);return{activeTab:e,viewMode:n,canvasMode:o,showDimensions:r,pendingAnnotationIndex:i,dataView:s,dataPanelTab:a,dataPanelOpen:l,selectedColumnIndex:c,lastNarrowEditTab:u,lastNarrowDataTab:d,selectTab:t.selectTab,selectAnnotation:t.selectAnnotation,setViewMode:t.setViewMode,setCanvasMode:t.setCanvasMode,setDataView:t.setDataView,setDataPanelTab:t.setDataPanelTab,openDataPanel:t.openDataPanel,closeDataPanel:t.closeDataPanel,toggleDataPanel:t.toggleDataPanel,selectColumn:t.selectColumn,setLastNarrowEditTab:t.setLastNarrowEditTab,setLastNarrowDataTab:t.setLastNarrowDataTab,reset:t.reset}}const kae={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sae(t,e){return w(),R("svg",kae,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m235.32 73.37l-52.69-52.68a16 16 0 0 0-22.63 0L20.68 160a16 16 0 0 0 0 22.63l52.69 52.68a16 16 0 0 0 22.63 0L235.32 96a16 16 0 0 0 0-22.63M84.68 224L32 171.31l32-32l26.34 26.35a8 8 0 0 0 11.32-11.32L75.31 128L96 107.31l26.34 26.35a8 8 0 0 0 11.32-11.32L107.31 96L128 75.31l26.34 26.35a8 8 0 0 0 11.32-11.32L139.31 64l32-32L224 84.69Z"},null,-1)])])}const Aae=Me({name:"ph-ruler",render:Sae}),Cae=le({__name:"CanvasDimensionsToggle",setup(t){const{showDimensions:e}=Mt(dr());return(n,o)=>(w(),R("button",{class:Te(["canvas-dimensions-toggle",{"canvas-dimensions-toggle--active":p(e)}]),title:"Show dimensions",onClick:o[0]||(o[0]=r=>e.value=!p(e))},[H(p(Aae))],2))}}),$ae=Be(Cae,[["__scopeId","data-v-0920c699"]]),Tae=["title"],Mae={class:"canvas-mode-picker-option__label"},Oae=le({__name:"CanvasModePickerOption",props:{mode:{},label:{},active:{type:Boolean}},emits:["select"],setup(t){return(e,n)=>{const o=RT;return w(),R("button",{class:Te(["canvas-mode-picker-option",{"canvas-mode-picker-option--active":t.active}]),title:t.label,onClick:n[0]||(n[0]=r=>e.$emit("select"))},[H(o,{mode:t.mode},null,8,["mode"]),T("span",Mae,be(t.label),1)],10,Tae)}}}),Bae=Be(Oae,[["__scopeId","data-v-b7a042b3"]]),Lae={class:"canvas-mode-picker__extra"},Pae={key:1,class:"canvas-mode-picker__trigger",title:"Canvas mode"},Dae=le({__name:"CanvasModePicker",setup(t){const e=dr(),{canvasMode:n}=Mt(e),{setCanvasMode:o}=e,r=Fe(!1),i=[{value:"blueprint",label:"Blueprint"},{value:"auto",label:"Auto"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];function s(a){o(a),r.value=!1}return(a,l)=>{const c=Bae,u=$ae,d=RT;return w(),R("div",{class:"canvas-mode-picker",onMouseenter:l[0]||(l[0]=f=>r.value=!0),onMouseleave:l[1]||(l[1]=f=>r.value=!1)},[p(r)?(w(),R(Ge,{key:0},[(w(),R(Ge,null,gt(i,f=>H(c,{key:f.value,mode:f.value,label:f.label,active:p(n)===f.value,onSelect:h=>s(f.value)},null,8,["mode","label","active","onSelect"])),64)),l[3]||(l[3]=T("div",{class:"canvas-mode-picker__divider"},null,-1)),T("div",Lae,[H(u),l[2]||(l[2]=T("span",{class:"canvas-mode-picker__extra__label"},"Dims",-1))])],64)):(w(),R("button",Pae,[H(d,{mode:p(n)},null,8,["mode"])]))],32)}}}),FT=Be(Dae,[["__scopeId","data-v-f05ed5f9"]]),Eae={transform:"translate(0.5, 0.5)"},Nae={class:"canvas-dimensions__line"},Iae=["x1","y1","x2","y2"],Rae=["x1","y1","x2","y2"],Fae=["x1","y1","x2","y2"],Vae=["x","y"],zae={class:"canvas-dimensions__line"},Hae=["x1","y1","x2","y2"],Wae=["x1","y1","x2","y2"],Uae=["x1","y1","x2","y2"],Gae=["x","y"],qae={class:"canvas-dimensions__line canvas-dimensions__line--padding"},Yae=["x1","y1","x2","y2"],jae=["x1","y1","x2","y2"],Xae=["x1","y1","x2","y2"],Kae=["x","y"],Zae=["x1","y1","x2","y2"],Qae=["x1","y1","x2","y2"],Jae=["x1","y1","x2","y2"],ele=["x","y"],tle={class:"canvas-dimensions__line canvas-dimensions__line--padding"},nle=["x1","y1","x2","y2"],ole=["x1","y1","x2","y2"],rle=["x1","y1","x2","y2"],ile=["x","y"],sle=["x1","y1","x2","y2"],ale=["x1","y1","x2","y2"],lle=["x1","y1","x2","y2"],cle=["x","y"],Z6=20,en=3,Ch=4,Q6=20,ule=le({__name:"CanvasDimensions",props:{cardRef:{},canvasRef:{},layout:{}},setup(t){const e=t,n=ze(null);function o(){const b=e.cardRef;if(!b){n.value=null;return}n.value={left:b.offsetLeft,top:b.offsetTop,width:b.offsetWidth,height:b.offsetHeight}}ls(()=>e.canvasRef,o),ls(()=>e.cardRef,o);const r=A(()=>({position:"absolute",inset:"0",width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"})),i=A(()=>{const b=n.value;return{x1:b.left,x2:b.left+b.width,y:b.top+b.height+Z6}}),s=A(()=>{const b=n.value;return{x:b.left-Z6,y1:b.top,y2:b.top+b.height}}),a=A(()=>{const b=i.value,y=e.layout.padding;return y>0&&!c.value?{x1:b.x1+y+Ch,x2:b.x2-y-Ch}:{x1:b.x1,x2:b.x2}}),l=A(()=>{const b=s.value,y=e.layout.padding;return y>0&&!u.value?{y1:b.y1+y+Ch,y2:b.y2-y-Ch}:{y1:b.y1,y2:b.y2}}),c=A(()=>e.layout.sizing!=="responsive"),u=A(()=>e.layout.heightMode!=="auto"),d=A(()=>e.layout.padding>0),f=A(()=>`${e.layout.padding}px`),h=A(()=>i.value.y+Q6),g=A(()=>s.value.x-Q6),v=A(()=>{const b=e.layout;return b.sizing==="fixed"?`${b.fixedWidth}px`:b.sizing==="max-width"?`max ${b.maxWidth}px`:"auto"}),m=A(()=>{const b=e.layout;return b.heightMode==="fixed"?`${b.fixedHeight}px`:b.heightMode==="aspect-ratio"?b.aspectRatio:"auto"});return(b,y)=>p(n)?(w(),R("svg",{key:0,class:"canvas-dimensions",style:Dt(p(r))},[T("g",Eae,[T("g",Nae,[T("line",{x1:p(a).x1,y1:p(i).y,x2:p(a).x2,y2:p(i).y},null,8,Iae),T("line",{x1:p(a).x1,y1:p(i).y-en,x2:p(a).x1,y2:p(i).y+en},null,8,Rae),T("line",{x1:p(a).x2,y1:p(i).y-en,x2:p(a).x2,y2:p(i).y+en},null,8,Fae),T("text",{x:(p(i).x1+p(i).x2)/2,y:p(i).y+en+12,"text-anchor":"middle"},be(p(v)),9,Vae)]),T("g",zae,[T("line",{x1:p(s).x,y1:p(l).y1,x2:p(s).x,y2:p(l).y2},null,8,Hae),T("line",{x1:p(s).x-en,y1:p(l).y1,x2:p(s).x+en,y2:p(l).y1},null,8,Wae),T("line",{x1:p(s).x-en,y1:p(l).y2,x2:p(s).x+en,y2:p(l).y2},null,8,Uae),T("text",{x:p(s).x-5,y:(p(s).y1+p(s).y2)/2,"text-anchor":"end","dominant-baseline":"central"},be(p(m)),9,Gae)]),p(d)?(w(),R(Ge,{key:0},[T("g",qae,[T("line",{x1:p(i).x1,y1:p(c)?p(h):p(i).y,x2:p(i).x1+t.layout.padding,y2:p(c)?p(h):p(i).y},null,8,Yae),T("line",{x1:p(i).x1,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x1,y2:(p(c)?p(h):p(i).y)+en},null,8,jae),T("line",{x1:p(i).x1+t.layout.padding,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x1+t.layout.padding,y2:(p(c)?p(h):p(i).y)+en},null,8,Xae),T("text",{x:p(i).x1+t.layout.padding/2,y:(p(c)?p(h):p(i).y)+en+12,"text-anchor":"middle"},be(p(f)),9,Kae),T("line",{x1:p(i).x2-t.layout.padding,y1:p(c)?p(h):p(i).y,x2:p(i).x2,y2:p(c)?p(h):p(i).y},null,8,Zae),T("line",{x1:p(i).x2-t.layout.padding,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x2-t.layout.padding,y2:(p(c)?p(h):p(i).y)+en},null,8,Qae),T("line",{x1:p(i).x2,y1:(p(c)?p(h):p(i).y)-en,x2:p(i).x2,y2:(p(c)?p(h):p(i).y)+en},null,8,Jae),T("text",{x:p(i).x2-t.layout.padding/2,y:(p(c)?p(h):p(i).y)+en+12,"text-anchor":"middle"},be(p(f)),9,ele)]),T("g",tle,[T("line",{x1:p(u)?p(g):p(s).x,y1:p(s).y1,x2:p(u)?p(g):p(s).x,y2:p(s).y1+t.layout.padding},null,8,nle),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y1,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y1},null,8,ole),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y1+t.layout.padding,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y1+t.layout.padding},null,8,rle),T("text",{x:(p(u)?p(g):p(s).x)-en-4,y:p(s).y1+t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},be(p(f)),9,ile),T("line",{x1:p(u)?p(g):p(s).x,y1:p(s).y2-t.layout.padding,x2:p(u)?p(g):p(s).x,y2:p(s).y2},null,8,sle),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y2-t.layout.padding,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y2-t.layout.padding},null,8,ale),T("line",{x1:(p(u)?p(g):p(s).x)-en,y1:p(s).y2,x2:(p(u)?p(g):p(s).x)+en,y2:p(s).y2},null,8,lle),T("text",{x:(p(u)?p(g):p(s).x)-en-4,y:p(s).y2-t.layout.padding/2,"text-anchor":"end","dominant-baseline":"central"},be(p(f)),9,cle)])],64)):se("",!0)])],4)):se("",!0)}}),VT=Be(ule,[["__scopeId","data-v-394e6d5d"]]);function dle(t){const e=t.split(":");if(e.length!==2)return;const n=Number(e[0]),o=Number(e[1]);return n&&o?n/o:void 0}function X2(t,e){const n=A(()=>t.value.heightMode==="fixed"||t.value.heightMode==="aspect-ratio"),o=A(()=>({[`${e}--fixed`]:t.value.sizing==="fixed",[`${e}--max-width`]:t.value.sizing==="max-width",[`${e}--transparent`]:t.value.transparentBackground,[`${e}--constrained-height`]:n.value})),r=A(()=>{const i=t.value,s={};if(i.sizing==="fixed"?s.width=`${i.fixedWidth}px`:i.sizing==="max-width"&&(s.maxWidth=`${i.maxWidth}px`,s.width="100%"),i.heightMode==="fixed")s.height=`${i.fixedHeight}px`;else if(i.heightMode==="aspect-ratio"){const a=dle(i.aspectRatio);a&&(s.aspectRatio=String(a))}return s});return{cardClass:o,cardStyle:r,hasConstrainedHeight:n}}function fle(t,e){t.replaceChildren();const n=document.createElement("div");n.className="text-center text-muted p-5",n.textContent=e,t.appendChild(n)}const hle=150;function K2(t){const e=pn(),{currentOptions:n}=kn(),{scenes:o,activeIndex:r,activeScene:i}=_n(),{columns:s,rows:a,columnTypes:l}=Ko(),{applyStepList:c}=Dr(),{theme:u}=Mf(),{chartTheme:d}=uT(),f=Symbol("unset");let h=f,g=!1;function v(){if(!(!t.value||g)){g=!0;try{m()}finally{g=!1}}}function m(){var ee;if(!t.value)return;const _=i.value,S=za(o.value,r.value),N=(S==null?void 0:S.chartType)??e.chartType.value;let B;if((S==null?void 0:S.data)!==void 0)B=S.data;else if((ee=S==null?void 0:S.transforms)!=null&&ee.length&&s.value.length>0){const fe=c(S.transforms,s.value,a.value,l.value);B=hg(fe.columns,fe.rows)}else B=e.data.value;const k=gs(B),L=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];if(k.series&&k.series.length>0&&L.includes(N)){const fe=k.series.find(xe=>xe.name===e.selectedColumn.value);fe&&(k.values=fe.values),delete k.series}if(k.labels.length===0){fle(t.value,"No data to preview");return}const E=n.value.allowDarkMode??!0,I=t.value.parentElement;I&&(!E&&u.value!=="light"?I.setAttribute("data-bs-theme","light"):I.removeAttribute("data-bs-theme"));const C=h!==f&&_!==h,$=S!=null&&S.chartTypeOptions?{...n.value,...S.chartTypeOptions}:n.value,P=(S==null?void 0:S.colorizes)??e.colorizes.value,M=S?S.highlights??[]:e._base.highlights.value,F=(S==null?void 0:S.areaFills)??e.areaFills.value,V=e._base.annotations.value,G=(S==null?void 0:S.annotations)??[],K=[...V,...G],ue=S!=null&&S.hiddenAnnotationIds?K.filter(fe=>!fe.id||!S.hiddenAnnotationIds.has(fe.id)):K,de=(S==null?void 0:S.seriesOverrides)??e.seriesOverrides.value,he=S==null?void 0:S.properties,ge={title:(he==null?void 0:he.title)??(e.title.value||void 0),description:(he==null?void 0:he.description)??(e.description.value||void 0),byline:e.byline.value||void 0,note:e.note.value||void 0,source:(he==null?void 0:he.source)??(e.source.value||void 0),sourceUrl:(he==null?void 0:he.sourceUrl)??(e.sourceUrl.value||void 0),padding:`${e.layout.value.padding}px`,transparentBackground:e.layout.value.transparentBackground||void 0};I2(t.value,{chartType:N,data:k,options:$,frame:ge,colorizes:P,highlights:M,areaFills:F,annotations:ue,seriesOverrides:de,sort:lT(S)??e.sort.value,sortMode:e.sortMode.value!=="none"?e.sortMode.value:void 0,theme:d.value},{transition:C,ignoreLayout:!0}),h=_}ls(t,II(v,hle));const y=A(()=>JSON.stringify(e.layout.value)),x=A(()=>JSON.stringify(n.value));return je([t,e.chartType,e.title,e.data,e.sort,e.sortMode,e.description,e.byline,e.note,e.source,e.sourceUrl,e.selectedColumn,e.colorizes,e.highlights,e.areaFills,e.annotations,e.seriesOverrides,y,x,o,i,u,d],v,{immediate:!0,flush:"post"}),{config:e}}function ple(t,e){function n(){var s;return((s=t.value)==null?void 0:s.querySelector("svg"))??null}function o(){var s;return((s=t.value)==null?void 0:s.querySelector(".bc-frame"))??null}function r(){const s=(e==null?void 0:e.value)??o();if(s){eae(s);return}const a=n();a&&Kse(a)}async function i(s=2){const a=o();if(a){const d=e!=null&&e.value?NT(e.value):void 0,f=e!=null&&e.value?Qse(e.value):void 0;await Jse(a,s,"chart.png",d,f);return}const l=n();if(!l)return;const{width:c,height:u}=l.getBoundingClientRect();await Zse(l,c*s,u*s)}return{downloadSvg:r,downloadPng:i}}const mle=le({__name:"ExportPanel",setup(t){const e=dr(),{canvasMode:n,showDimensions:o}=Mt(e),{setViewMode:r}=e,{mode:i}=lc();r("preview");const s=mg(),{exportTab:a}=Mt(s),{setExportTab:l,setLastNarrowExportTab:c}=s,{isNarrow:u}=bi();je(i,M=>{M==="drawer"&&a.value&&(c(a.value),l(""))},{immediate:!0});const{layout:d}=pn(),{cardClass:f,cardStyle:h}=X2(d,"export-panel__canvas__card"),g=mt("canvasRef"),v=mt("cardRef"),m=mt("previewRef");K2(m);const{downloadSvg:b,downloadPng:y}=ple(m,v),x=Fe(0),_=Fe(0);let S=0;function N(){globalThis.cancelAnimationFrame(S),S=globalThis.requestAnimationFrame(()=>{const M=v.value;if(M){const F=M.offsetLeft,V=M.offsetTop;(F!==x.value||V!==_.value)&&(x.value=F,_.value=V)}})}ls(g,N),ls(v,N);const B=A(()=>({"--grid-offset-x":`${x.value}px`,"--grid-offset-y":`${_.value}px`})),{lastNarrowExportTab:k}=Mt(s),L=A({get:()=>!!a.value,set:M=>{l(M?k.value:"")}});function E(M){c(M),l(M)}const{sections:I}=DT(),C={embed:"Embed",download:"Download"},$=A(()=>C[a.value]??"Export"),P=A(()=>({[`export-panel__canvas--${n.value}`]:n.value!=="blueprint"}));return(M,F)=>{const V=VT,G=FT,K=j2,ue=bae,de=dae,he=Y2,ge=pg,ee=Rse;return w(),R("div",{class:Te(["export-panel",{"export-panel--narrow":p(u)}])},[T("div",{ref_key:"canvasRef",ref:g,class:Te(["export-panel__canvas",p(P)]),style:Dt(p(B))},[T("div",{ref_key:"cardRef",ref:v,class:Te(["export-panel__canvas__card",p(f)]),style:Dt(p(h))},[T("div",{ref_key:"previewRef",ref:m,class:"export-panel__canvas__preview w-100 h-100"},null,512)],6),p(o)?(w(),Q(V,{key:0,"card-ref":p(v),"canvas-ref":p(g),layout:p(d)},null,8,["card-ref","canvas-ref","layout"])):se("",!0),H(G)],6),H(ge,{"drawer-open":p(L),"onUpdate:drawerOpen":F[0]||(F[0]=fe=>Ze(L)?L.value=fe:null),title:p($),"container-ref":p(g)},ki({default:J(()=>[p(a)==="embed"?(w(),Q(ue,{key:0})):p(a)==="download"?(w(),Q(de,{key:1,onDownloadPng:p(y),onDownloadSvg:p(b)},null,8,["onDownloadPng","onDownloadSvg"])):se("",!0)]),_:2},[p(i)==="drawer"?{name:"tabs",fn:J(()=>[H(K,{tabs:p(I),"model-value":p(a),sticky:"","onUpdate:modelValue":E},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(i)!=="drawer"?{name:"footer",fn:J(()=>[H(he)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref"]),p(u)?se("",!0):(w(),Q(ee,{key:0}))],2)}}}),gle=Be(mle,[["__scopeId","data-v-6f293e9b"]]),vle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function ble(t,e){return w(),R("svg",vle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M87.24 52.59a8 8 0 0 0-14.48 0l-64 136a8 8 0 1 0 14.48 6.81L39.9 160h80.2l16.66 35.4a8 8 0 1 0 14.48-6.81ZM47.43 144L80 74.79L112.57 144ZM200 96c-12.76 0-22.73 3.47-29.63 10.32a8 8 0 0 0 11.26 11.36c3.8-3.77 10-5.68 18.37-5.68c13.23 0 24 9 24 20v3.22a42.76 42.76 0 0 0-24-7.22c-22.06 0-40 16.15-40 36s17.94 36 40 36a42.73 42.73 0 0 0 24-7.25a8 8 0 0 0 16-.75v-60c0-19.85-17.94-36-40-36m0 88c-13.23 0-24-9-24-20s10.77-20 24-20s24 9 24 20s-10.77 20-24 20"},null,-1)])])}const zT=Me({name:"ph-text-aa",render:ble}),yle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xle(t,e){return w(),R("svg",yle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M200.77 53.89A103.27 103.27 0 0 0 128 24h-1.07A104 104 0 0 0 24 128c0 43 26.58 79.06 69.36 94.17A32 32 0 0 0 136 192a16 16 0 0 1 16-16h46.21a31.81 31.81 0 0 0 31.2-24.88a104.4 104.4 0 0 0 2.59-24a103.28 103.28 0 0 0-31.23-73.23m13 93.71a15.89 15.89 0 0 1-15.56 12.4H152a32 32 0 0 0-32 32a16 16 0 0 1-21.31 15.07C62.49 194.3 40 164 40 128a88 88 0 0 1 87.09-88h.9a88.35 88.35 0 0 1 88 87.25a89 89 0 0 1-2.18 20.35ZM140 76a12 12 0 1 1-12-12a12 12 0 0 1 12 12m-44 24a12 12 0 1 1-12-12a12 12 0 0 1 12 12m0 56a12 12 0 1 1-12-12a12 12 0 0 1 12 12m88-56a12 12 0 1 1-12-12a12 12 0 0 1 12 12"},null,-1)])])}const HT=Me({name:"ph-palette",render:xle}),wle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _le(t,e){return w(),R("svg",wle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M220.27 158.54a8 8 0 0 0-7.7-.46a20 20 0 1 1 0-36.16a8 8 0 0 0 11.43-7.23V72a16 16 0 0 0-16-16h-36.22a35 35 0 0 0 .22-4a36.1 36.1 0 0 0-11.36-26.24a36 36 0 0 0-60.55 23.62a36.6 36.6 0 0 0 .14 6.62H64a16 16 0 0 0-16 16v32.22a35 35 0 0 0-4-.22a36.12 36.12 0 0 0-26.24 11.36a35.7 35.7 0 0 0-9.69 27a36.08 36.08 0 0 0 33.31 33.6a35.7 35.7 0 0 0 6.62-.14V208a16 16 0 0 0 16 16h144a16 16 0 0 0 16-16v-42.69a8 8 0 0 0-3.73-6.77M208 208H64v-42.69a8 8 0 0 0-11.43-7.23a20 20 0 1 1 0-36.16A8 8 0 0 0 64 114.69V72h46.69a8 8 0 0 0 7.23-11.43a20 20 0 1 1 36.16 0A8 8 0 0 0 161.31 72H208v32.23a35.7 35.7 0 0 0-6.62-.14A36 36 0 0 0 204 176a35 35 0 0 0 4-.22Z"},null,-1)])])}const kle=Me({name:"ph-puzzle-piece",render:_le}),Sle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ale(t,e){return w(),R("svg",Sle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M222.16 177.25a8 8 0 0 1-1 11.25c-17.36 14.39-32.86 19.5-47 19.5c-18.58 0-34.82-8.82-49.93-17c-25.35-13.76-47.24-25.64-79.07.74a8 8 0 1 1-10.22-12.31c40.17-33.28 70.32-16.92 96.93-2.48c25.35 13.75 47.24 25.63 79.07-.74a8 8 0 0 1 11.22 1.04m-11.27-57c-31.83 26.38-53.72 14.5-79.07.74c-26.61-14.43-56.76-30.79-96.93 2.49a8 8 0 0 0 10.22 12.31c31.83-26.38 53.72-14.5 79.07-.74c15.11 8.19 31.35 17 49.93 17c14.14 0 29.64-5.11 47-19.5a8 8 0 1 0-10.22-12.31ZM45.11 79.8c31.83-26.37 53.72-14.49 79.07-.74c15.11 8.2 31.35 17 49.93 17c14.14 0 29.64-5.12 47-19.5a8 8 0 1 0-10.22-12.31c-31.83 26.38-53.72 14.5-79.07.74c-26.61-14.41-56.76-30.77-96.93 2.51a8 8 0 1 0 10.22 12.3"},null,-1)])])}const Cle=Me({name:"ph-waves",render:Ale}),$le={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Tle(t,e){return w(),R("svg",$le,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m229.66 197.66l-32 32a8 8 0 0 1-11.32-11.32L204.69 200H80a8 8 0 0 1-8-8V59.31L53.66 77.66a8 8 0 0 1-11.32-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L88 59.31V184h116.69l-18.35-18.34a8 8 0 0 1 11.32-11.32l32 32a8 8 0 0 1 0 11.32"},null,-1)])])}const Mle=Me({name:"ph-vector-two",render:Tle}),Ole={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ble(t,e){return w(),R("svg",Ole,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m235.32 81.37l-60.69-60.68a16 16 0 0 0-22.63 0l-53.63 53.8c-10.66-3.34-35-7.37-60.4 13.14a16 16 0 0 0-1.29 23.78L85 159.71l-42.66 42.63a8 8 0 0 0 11.32 11.32L96.29 171l48.29 48.29A16 16 0 0 0 155.9 224h1.13a15.93 15.93 0 0 0 11.64-6.33c19.64-26.1 17.75-47.32 13.19-60L235.33 104a16 16 0 0 0-.01-22.63M224 92.69l-57.27 57.46a8 8 0 0 0-1.49 9.22c9.46 18.93-1.8 38.59-9.34 48.62L48 100.08c12.08-9.74 23.64-12.31 32.48-12.31A40.1 40.1 0 0 1 96.81 91a8 8 0 0 0 9.25-1.51L163.32 32L224 92.68Z"},null,-1)])])}const Lle=Me({name:"ph-push-pin",render:Ble}),Ple=["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax","showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"];function WT(){const{chartType:t}=pn(),{availableOptionKeys:e}=kn(),{scenes:n}=_n(),o=A(()=>e.value.some(s=>Ple.includes(s))),r=A(()=>e.value.includes("tooltips")||e.value.includes("crosshair")||n.value.length>=1);return{sections:A(()=>{const s=[{key:"type",label:"Type",icon:Ns,tooltip:"Chart Type"},{key:"text",label:"Text",icon:zT},{key:"style",label:"Style",icon:HT}];return["line-multi","bar-multi","bar-split"].includes(t.value)&&s.push({key:"series",label:"Series",icon:Cle}),o.value&&s.push({key:"axes",label:"Axes",icon:Mle}),s.push({key:"layout",label:"Layout",icon:kle}),s.push({key:"annotate",label:"Annotate",icon:Lle}),r.value&&s.push({key:"interactions",label:"Interactions",icon:MT}),s})}}const Dle=le({__name:"ChartEditIconRail",setup(t){const e=dr(),{activeTab:n}=Mt(e),{selectTab:o}=e,{toggleMode:r}=lc(),{sections:i}=WT(),s=A(()=>i.value.map(a=>({value:a.key,icon:a.icon,tooltip:a.tooltip??a.label})));return(a,l)=>{const c=G2;return w(),Q(c,{"active-tab":p(n),items:p(s),onSelect:p(o),onToggleMode:p(r)},null,8,["active-tab","items","onSelect","onToggleMode"])}}}),Ele={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nle(t,e){return w(),R("svg",Ele,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M90.34 61.66a8 8 0 0 1 0-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L136 43.31V96a8 8 0 0 1-16 0V43.31l-18.34 18.35a8 8 0 0 1-11.32 0m64 132.68L136 212.69V160a8 8 0 0 0-16 0v52.69l-18.34-18.35a8 8 0 0 0-11.32 11.32l32 32a8 8 0 0 0 11.32 0l32-32a8 8 0 0 0-11.32-11.32m83.32-72l-32-32a8 8 0 0 0-11.32 11.32L212.69 120H160a8 8 0 0 0 0 16h52.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32M43.31 136H96a8 8 0 0 0 0-16H43.31l18.35-18.34a8 8 0 0 0-11.32-11.32l-32 32a8 8 0 0 0 0 11.32l32 32a8 8 0 0 0 11.32-11.32Z"},null,-1)])])}const Ile=Me({name:"ph-arrows-out-cardinal",render:Nle}),Rle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Fle(t,e){return w(),R("svg",Rle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M165.66 194.34a8 8 0 0 1 0 11.32l-32 32a8 8 0 0 1-11.32 0l-32-32a8 8 0 0 1 11.32-11.32L120 212.69V43.31l-18.34 18.35a8 8 0 0 1-11.32-11.32l32-32a8 8 0 0 1 11.32 0l32 32a8 8 0 0 1-11.32 11.32L136 43.31v169.38l18.34-18.35a8 8 0 0 1 11.32 0"},null,-1)])])}const UT=Me({name:"ph-arrows-vertical",render:Fle}),Vle={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function zle(t,e){return w(),R("svg",Vle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m237.66 133.66l-32 32a8 8 0 0 1-11.32-11.32L212.69 136H43.31l18.35 18.34a8 8 0 0 1-11.32 11.32l-32-32a8 8 0 0 1 0-11.32l32-32a8 8 0 0 1 11.32 11.32L43.31 120h169.38l-18.35-18.34a8 8 0 0 1 11.32-11.32l32 32a8 8 0 0 1 0 11.32"},null,-1)])])}const GT=Me({name:"ph-arrows-horizontal",render:zle}),Hle={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Wle(t,e){return w(),R("svg",Hle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M2 9.75A.75.75 0 0 1 2.75 9h14.5a.75.75 0 0 1 0 1.5H2.75A.75.75 0 0 1 2 9.75"},null,-1)])])}const Z2=Me({name:"fluent-line-horizontal-1-20-filled",render:Wle}),Ule={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Gle(t,e){return w(),R("svg",Ule,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M2 9.75A.75.75 0 0 1 2.75 9h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 2 9.75m6 0A.75.75 0 0 1 8.75 9h2.5a.75.75 0 0 1 0 1.5h-2.5A.75.75 0 0 1 8 9.75m6 0a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75"},null,-1)])])}const qT=Me({name:"fluent-line-horizontal-1-dashes-20-filled",render:Gle}),qle={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Yle(t,e){return w(),R("svg",qle,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M3.5 11a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3M8 11a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m4.5 0a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3m6-1.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0"},null,-1)])])}const YT=Me({name:"fluent-line-horizontal-1-dot-20-filled",render:Yle}),jle={class:"d-flex flex-column gap-3"},Xle=le({__name:"EditorInteractionSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),{layout:r}=pn(),{scenes:i}=_n(),s=A(()=>n.value.includes("tooltips")),a=A(()=>n.value.includes("crosshair")),l=A(()=>i.value.length>=1),c=[{value:"both",text:"Both",icon:Ile},{value:"vertical",text:"Vertical",icon:UT},{value:"horizontal",text:"Horizontal",icon:GT}],u=[{value:"solid",text:"Solid",icon:Z2},{value:"dashed",text:"Dashed",icon:qT},{value:"dotted",text:"Dotted",icon:YT}],d=A({get:()=>r.value.playerType,set:v=>{r.value.playerType=v}}),f=A({get:()=>r.value.playerPosition,set:v=>{r.value.playerPosition=v}}),h=[{value:"buttons",label:"Buttons"},{value:"progress-bar",label:"Progress Bar"},{value:"dot-stepper",label:"Dot Stepper"},{value:"minimal-arrows",label:"Minimal Arrows"},{value:"none",label:"None"}],g=[{value:"left",text:"Left"},{value:"center",text:"Center"},{value:"right",text:"Right"}];return(v,m)=>(w(),R("div",jle,[p(s)?(w(),Q(p(nn),{key:0,"model-value":p(e).tooltips??!1,label:"Tooltips","onUpdate:modelValue":m[0]||(m[0]=b=>p(o)("tooltips",b))},null,8,["model-value"])):se("",!0),p(a)?(w(),Q(p(nn),{key:1,"model-value":p(e).crosshair??!1,label:"Crosshair","onUpdate:modelValue":m[1]||(m[1]=b=>p(o)("crosshair",b))},null,8,["model-value"])):se("",!0),p(a)&&p(e).crosshair?(w(),R(Ge,{key:2},[H(p(Cn),{label:"Direction","model-value":p(e).crosshairDirection??"both",options:c,block:"","onUpdate:modelValue":m[2]||(m[2]=b=>p(o)("crosshairDirection",b))},null,8,["model-value"]),H(p(Cn),{label:"Line style","model-value":p(e).crosshairStyle??"dashed",options:u,block:"","onUpdate:modelValue":m[3]||(m[3]=b=>p(o)("crosshairStyle",b))},null,8,["model-value"]),H(p(Na),{id:"opt-crosshair-color",label:"Color","model-value":p(e).crosshairColor??"#999999","onUpdate:modelValue":m[4]||(m[4]=b=>p(o)("crosshairColor",b))},null,8,["model-value"])],64)):se("",!0),p(l)?(w(),R(Ge,{key:3},[H(p(Nn),{id:"layout-player-type",modelValue:p(d),"onUpdate:modelValue":m[5]||(m[5]=b=>Ze(d)?d.value=b:null),label:"Scene player",options:h,block:""},null,8,["modelValue"]),p(d)==="buttons"||p(d)==="dot-stepper"||p(d)==="minimal-arrows"?(w(),Q(p(Cn),{key:0,modelValue:p(f),"onUpdate:modelValue":m[6]||(m[6]=b=>Ze(f)?f.value=b:null),label:"Player position",options:g,block:""},null,8,["modelValue"])):se("",!0)],64)):se("",!0)]))}}),Kle={},Zle={class:"d-flex flex-column gap-3"};function Qle(t,e){const n=Xle;return w(),R("div",Zle,[H(n)])}const Jle=Be(Kle,[["render",Qle]]),ece={class:"border rounded overflow-hidden bg-body-tertiary"},tce={class:"d-flex align-items-center justify-content-between px-2 py-1 border-bottom"},nce={class:"fw-medium"},oce={class:"p-2 d-flex flex-column gap-2"},rce={class:"d-flex align-items-center gap-2"},ice={class:"text-nowrap",style:{width:"3em"}},sce=le({__name:"EditorAreaFillItem",props:at({id:{},seriesNames:{}},{fill:{required:!0},fillModifiers:{}}),emits:at(["remove"],["update:fill"]),setup(t){const e=t,n=pt(t,"fill"),o=A(()=>e.seriesNames.map(s=>({value:s,text:s}))),r=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}];function i(s,a){const l={...n.value};a===void 0?delete l[s]:l[s]=a,n.value=l}return(s,a)=>{const l=Ho,c=ja,u=Mn,d=ra,f=Hs;return w(),R("div",ece,[T("div",tce,[T("small",nce,be(n.value.from)+" – "+be(n.value.to),1),H(l,{variant:"link",size:"sm",class:"text-danger p-0",onClick:a[0]||(a[0]=h=>s.$emit("remove"))},{default:J(()=>[...a[8]||(a[8]=[T("span",{"aria-hidden":"true"},"×",-1)])]),_:1})]),T("div",oce,[H(u,{label:"From","label-for":`af-from-${t.id}`},{default:J(()=>[H(c,{id:`af-from-${t.id}`,"model-value":n.value.from,options:p(o),"onUpdate:modelValue":a[1]||(a[1]=h=>i("from",h))},null,8,["id","model-value","options"])]),_:1},8,["label-for"]),H(u,{label:"To","label-for":`af-to-${t.id}`},{default:J(()=>[H(c,{id:`af-to-${t.id}`,"model-value":n.value.to,options:p(o),"onUpdate:modelValue":a[2]||(a[2]=h=>i("to",h))},null,8,["id","model-value","options"])]),_:1},8,["label-for"]),H(u,{label:"Color","label-for":`af-color-${t.id}`},{default:J(()=>[H(d,{id:`af-color-${t.id}`,type:"color","model-value":n.value.color??"#cccccc","onUpdate:modelValue":a[3]||(a[3]=h=>i("color",h))},null,8,["id","model-value"])]),_:1},8,["label-for"]),H(u,null,{default:J(()=>[H(f,{"model-value":!!n.value.negativeColor,switch:"","onUpdate:modelValue":a[4]||(a[4]=h=>i("negativeColor",h?"#f28e2b":void 0))},{default:J(()=>[...a[9]||(a[9]=[Xe(" Use different color for negative differences ",-1)])]),_:1},8,["model-value"])]),_:1}),n.value.negativeColor?(w(),Q(u,{key:0,label:"Negative color","label-for":`af-neg-color-${t.id}`},{default:J(()=>[H(d,{id:`af-neg-color-${t.id}`,type:"color","model-value":n.value.negativeColor,"onUpdate:modelValue":a[5]||(a[5]=h=>i("negativeColor",h))},null,8,["id","model-value"])]),_:1},8,["label-for"])):se("",!0),H(u,{label:"Opacity","label-for":`af-opacity-${t.id}`},{default:J(()=>[T("div",rce,[H(d,{id:`af-opacity-${t.id}`,type:"range","model-value":String(n.value.opacity??30),min:"0",max:"100",class:"flex-grow-1","onUpdate:modelValue":a[6]||(a[6]=h=>i("opacity",Number(h)))},null,8,["id","model-value"]),T("small",ice,be(n.value.opacity??30)+"%",1)])]),_:1},8,["label-for"]),H(u,{label:"Interpolation","label-for":`af-interp-${t.id}`},{default:J(()=>[H(c,{id:`af-interp-${t.id}`,"model-value":n.value.interpolation??"linear",options:r,"onUpdate:modelValue":a[7]||(a[7]=h=>i("interpolation",h))},null,8,["id","model-value"])]),_:1},8,["label-for"])])])}}}),ace={class:"d-flex flex-column gap-2"},lce=le({__name:"EditorAreaFills",props:at({seriesNames:{},seriesOverrides:{},globalInterpolation:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=pt(t,"modelValue"),o=A(()=>n.value);function r(a,l){const c=[...o.value];c[a]=l,n.value=c}function i(){const a=e.seriesNames[0]??"",l=e.seriesNames[1]??e.seriesNames[0]??"",c=A2(a,e.globalInterpolation,e.seriesOverrides);n.value=[...o.value,{from:a,to:l,color:"#cccccc",opacity:30,interpolation:c}]}function s(a){const l=[...o.value];l.splice(a,1),n.value=l}return(a,l)=>{const c=sce;return w(),R(Ge,null,[T("div",ace,[(w(!0),R(Ge,null,gt(p(o),(u,d)=>(w(),Q(c,{id:d,key:d,fill:u,"series-names":t.seriesNames,"onUpdate:fill":f=>r(d,f),onRemove:f=>s(d)},null,8,["id","fill","series-names","onUpdate:fill","onRemove"]))),128))]),H(p($l),{label:"Add",onClick:i})],64)}}}),cce={class:"d-flex flex-column gap-3"},uce=le({__name:"EditorHighlightSection",setup(t){const{chartType:e,data:n,highlights:o}=pn(),r=A(()=>gs(n.value)),i=A(()=>[Le.LineMulti,Le.AreaStacked].includes(e.value)),s=A(()=>{var u;return i.value?((u=r.value.series)==null?void 0:u.map(d=>d.name))??[]:r.value.labels}),a=Fe(o.value.length>0),l=A({get(){return o.value.map(u=>u.target)},set(u){o.value=u.map(d=>({target:d}))}});function c(u){a.value=u,u||(o.value=[])}return(u,d)=>(w(),R("div",cce,[H(p(nn),{"model-value":p(a),label:"Highlight specific items","onUpdate:modelValue":c},null,8,["model-value"]),p(a)?(w(),Q(p(Gy),{key:0,selected:p(l),"onUpdate:selected":d[0]||(d[0]=f=>Ze(l)?l.value=f:null),items:p(s)},null,8,["selected","items"])):se("",!0)]))}}),dce=Lo("previewContainer",()=>({containerRef:ze(null)}));function jT(){const t=dce();return Mt(t)}const fce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function hce(t,e){return w(),R("svg",fce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M174 47.75a254.2 254.2 0 0 0-41.45-38.3a8 8 0 0 0-9.18 0A254.2 254.2 0 0 0 82 47.75C54.51 79.32 40 112.6 40 144a88 88 0 0 0 176 0c0-31.4-14.51-64.68-42-96.25M200 144a71 71 0 0 1-.46 8H136v-16h63.64q.36 4 .36 8m-16.61-56H136V72h36.89a176 176 0 0 1 10.5 16M136 200h37.19A71.67 71.67 0 0 1 136 215.54Zm0-16v-16h59.87a72 72 0 0 1-8 16Zm0-64v-16h55.39a117 117 0 0 1 5.45 16Zm23.89-64H136V32.6A257 257 0 0 1 159.89 56M56 144c0-50 42.26-92.71 64-111.4v182.94A72.08 72.08 0 0 1 56 144"},null,-1)])])}const pce=Me({name:"ph-drop-half",render:hce}),mce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function gce(t,e){return w(),R("svg",mce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M201.54 54.46A104 104 0 0 0 54.46 201.54A104 104 0 0 0 201.54 54.46M96 210v-58h64v58a88.33 88.33 0 0 1-64 0m48-74h-32v-35.06l32-16Zm46.22 54.22A88 88 0 0 1 176 201.77V152a16 16 0 0 0-16-16V72a8 8 0 0 0-11.58-7.16l-48 24A8 8 0 0 0 96 96v40a16 16 0 0 0-16 16v49.77a88 88 0 1 1 110.22-11.55"},null,-1)])])}const vce=Me({name:"ph-highlighter-circle",render:gce}),bce={class:"d-flex flex-column gap-2"},yce={class:"d-flex gap-2"},xce=le({__name:"EditorAnnotationFree",props:at({chartWidth:{},chartHeight:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=pt(t,"annotation");function n(s){return typeof s=="number"?`${s}%`:String(s)}function o(s){return s==null?"150px":typeof s=="number"?`${s}px`:String(s)}function r(s,a){const l={...e.value};a===void 0?delete l[s]:l[s]=a,e.value=l}const i=ze(null);return hn(()=>{var a;const s=(a=i.value)==null?void 0:a.$el;s&&(s.focus(),s.select())}),(s,a)=>{const l=$y,c=Mn;return w(),R("div",bce,[H(c,{label:"Text"},{default:J(()=>[H(l,{ref_key:"textRef",ref:i,"model-value":e.value.text,placeholder:"Annotation text",rows:"2","onUpdate:modelValue":a[0]||(a[0]=u=>r("text",u))},null,8,["model-value"])]),_:1}),T("div",yce,[H(p(Kh),{id:"ann-free-x","model-value":n(e.value.x),label:"X position",min:"-50",max:String(t.chartWidth??600),step:"0.1",units:["%","px"],"no-slider":"","center-relative":"",class:"flex-fill","onUpdate:modelValue":a[1]||(a[1]=u=>r("x",u))},null,8,["model-value","max"]),H(p(Kh),{id:"ann-free-y","model-value":n(e.value.y),label:"Y position",min:"-50",max:String(t.chartHeight??400),step:"0.1",units:["%","px"],"no-slider":"","center-relative":"",class:"flex-fill","onUpdate:modelValue":a[2]||(a[2]=u=>r("y",u))},null,8,["model-value","max"])]),H(p(Na),{id:"ann-free-text-color","model-value":e.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":a[3]||(a[3]=u=>r("textColor",u))},null,8,["model-value"]),H(p(nn),{"model-value":e.value.textOutline??!0,label:"Text outline","onUpdate:modelValue":a[4]||(a[4]=u=>r("textOutline",u))},null,8,["model-value"]),H(p(Kh),{id:"ann-free-max-width","model-value":o(e.value.maxWidth),label:"Max width",min:"0",max:String(t.chartWidth??600),units:["px","%"],"onUpdate:modelValue":a[5]||(a[5]=u=>r("maxWidth",u))},null,8,["model-value","max"])])}}}),wce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function _ce(t,e){return w(),R("svg",wce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M48 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m16 64V64a16 16 0 0 1 16-16h96a16 16 0 0 1 16 16v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16m16 0h96V64H80Zm152 48v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16v-40a16 16 0 0 1 16-16h136a16 16 0 0 1 16 16m-16 40v-40H80v40z"},null,-1)])])}const uf=Me({name:"ph-align-left",render:_ce}),kce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Sce(t,e){return w(),R("svg",kce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M208 136h-72v-16h48a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16h-48V32a8 8 0 0 0-16 0v16H72a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h48v16H48a16 16 0 0 0-16 16v40a16 16 0 0 0 16 16h72v16a8 8 0 0 0 16 0v-16h72a16 16 0 0 0 16-16v-40a16 16 0 0 0-16-16M72 64h112v40H72Zm136 128H48v-40h160z"},null,-1)])])}const x0=Me({name:"ph-align-center-horizontal",render:Sce}),Ace={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Cce(t,e){return w(),R("svg",Ace,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m-32 24v40a16 16 0 0 1-16 16H80a16 16 0 0 1-16-16V64a16 16 0 0 1 16-16h96a16 16 0 0 1 16 16m-16 0H80v40h96Zm16 88v40a16 16 0 0 1-16 16H40a16 16 0 0 1-16-16v-40a16 16 0 0 1 16-16h136a16 16 0 0 1 16 16m-16 0H40v40h136Z"},null,-1)])])}const df=Me({name:"ph-align-right",render:Cce}),$ce={class:"d-flex flex-column gap-2"},Tce={class:"d-flex gap-2"},Mce={key:0,class:"d-flex gap-2"},Oce=le({__name:"EditorAnnotationRange",props:at({labels:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=pt(t,"annotation"),o=[{value:"vertical",text:"Vertical"},{value:"horizontal",text:"Horizontal"}],r=A(()=>(n.value.orientation??"vertical")==="vertical"&&e.labels.length>0),i=A(()=>e.labels.map(l=>({value:l,text:l})));function s(l,c){const u={...n.value};c===void 0?delete u[l]:u[l]=c,n.value=u}const a=ze(null);return hn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=ra,d=Mn,f=ja;return w(),R("div",$ce,[H(d,{label:"Text"},{default:J(()=>[H(u,{ref_key:"textRef",ref:a,"model-value":n.value.text??"",placeholder:"Optional label","onUpdate:modelValue":c[0]||(c[0]=h=>s("text",h||void 0))},null,8,["model-value"])]),_:1}),H(d,{label:"Orientation"},{default:J(()=>[H(f,{"model-value":n.value.orientation??"vertical",options:o,"onUpdate:modelValue":c[1]||(c[1]=h=>s("orientation",h))},null,8,["model-value"])]),_:1}),T("div",Tce,[H(d,{label:"Start",class:"flex-fill"},{default:J(()=>[p(r)?(w(),Q(f,{key:0,"model-value":String(n.value.start),options:p(i),"onUpdate:modelValue":c[2]||(c[2]=h=>s("start",h))},null,8,["model-value","options"])):(w(),Q(u,{key:1,"model-value":String(n.value.start),"onUpdate:modelValue":c[3]||(c[3]=h=>s("start",isNaN(Number(h))?h:Number(h)))},null,8,["model-value"]))]),_:1}),H(d,{label:"End",class:"flex-fill"},{default:J(()=>[p(r)?(w(),Q(f,{key:0,"model-value":String(n.value.end),options:p(i),"onUpdate:modelValue":c[4]||(c[4]=h=>s("end",h))},null,8,["model-value","options"])):(w(),Q(u,{key:1,"model-value":String(n.value.end),"onUpdate:modelValue":c[5]||(c[5]=h=>s("end",isNaN(Number(h))?h:Number(h)))},null,8,["model-value"]))]),_:1})]),p(r)?(w(),R("div",Mce,[H(p(Nn),{id:`ann-range-start-anchor-${l.$.uid}`,"model-value":n.value.startAnchor??"center",label:"Start anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[6]||(c[6]=h=>s("startAnchor",h))},{default:J(()=>[H(p(pc),{value:"start",label:"Start"},{icon:J(()=>[H(p(uf))]),_:1}),H(p(pc),{value:"center",label:"Center"},{icon:J(()=>[H(p(x0))]),_:1}),H(p(pc),{value:"end",label:"End"},{icon:J(()=>[H(p(df))]),_:1})]),_:1},8,["id","model-value"]),H(p(Nn),{id:`ann-range-end-anchor-${l.$.uid}`,"model-value":n.value.endAnchor??"center",label:"End anchor","light-label":"",block:"",class:"flex-fill","onUpdate:modelValue":c[7]||(c[7]=h=>s("endAnchor",h))},{default:J(()=>[H(p(pc),{value:"start",label:"Start"},{icon:J(()=>[H(p(uf))]),_:1}),H(p(pc),{value:"center",label:"Center"},{icon:J(()=>[H(p(x0))]),_:1}),H(p(pc),{value:"end",label:"End"},{icon:J(()=>[H(p(df))]),_:1})]),_:1},8,["id","model-value"])])):se("",!0),H(p(Na),{id:"ann-range-bg-color","model-value":n.value.bgColor??"#cccccc",label:"Background color","onUpdate:modelValue":c[8]||(c[8]=h=>s("bgColor",h))},null,8,["model-value"]),H(p(_r),{id:"ann-range-bg-opacity","model-value":String(n.value.bgOpacity??20),label:"Background opacity",min:"0",max:"100",suffix:"%","onUpdate:modelValue":c[9]||(c[9]=h=>s("bgOpacity",Number(h)))},null,8,["model-value"]),n.value.text?(w(),R(Ge,{key:1},[H(p(Na),{id:"ann-range-text-color","model-value":n.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":c[10]||(c[10]=h=>s("textColor",h))},null,8,["model-value"]),H(p($A),{"model-value":n.value.direction??"center",label:"Direction","onUpdate:modelValue":c[11]||(c[11]=h=>s("direction",h))},null,8,["model-value"])],64)):se("",!0)])}}}),Bce={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Lce(t,e){return w(),R("svg",Bce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M6 15.25c0 .414.336.75.75.75h4.5c1.586 0 2.696-.621 3.53-1.588C15.6 13.46 16 12.216 16 11s-.3-2.46-1.12-3.412C14.046 6.621 12.836 6 11.25 6H6.56l2.22-2.22a.75.75 0 0 0-1.06-1.06l-3.5 3.5a.75.75 0 0 0 .02 1.08l3.5 3.25a.75.75 0 0 0 1.02-1.1L6.66 7.5h4.59c1.164 0 1.86.441 2.4 1.068c.554.642.85 1.523.85 2.432s-.296 1.79-.85 2.432c-.54.627-1.236 1.068-2.4 1.068h-4.5a.75.75 0 0 0-.75.75"},null,-1)])])}const Pce=Me({name:"fluent-arrow-hook-up-left-20-filled",render:Lce}),Dce={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Ece(t,e){return w(),R("svg",Dce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M9 6c.06 0-.06-.002 0 0c.023-.002.227 0 .25 0h4.393l-2.268-2.268a.75.75 0 1 1 1.061-1.06l3.353 3.352a.75.75 0 0 1 .212.639a.75.75 0 0 1-.215.443l-3.247 3.248a.75.75 0 1 1-1.06-1.061L13.27 7.5H9a3.5 3.5 0 1 0 0 7h4.25a.75.75 0 0 1 0 1.5H9A5 5 0 0 1 9 6"},null,-1)])])}const Nce=Me({name:"fluent-arrow-hook-up-right-20-filled",render:Ece}),Ice={viewBox:"0 0 20 20",width:"1.2em",height:"1.2em"};function Rce(t,e){return w(),R("svg",Ice,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M16.78 10.72a.75.75 0 0 1 0 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06l2.72 2.72V7A1.5 1.5 0 0 0 10 5.5H3.75a.75.75 0 0 1 0-1.5H10a3 3 0 0 1 3 3v6.44l2.72-2.72a.75.75 0 0 1 1.06 0"},null,-1)])])}const Fce=Me({name:"fluent-arrow-turn-right-down-20-filled",render:Rce}),Vce={class:"d-flex flex-column gap-2"},zce={class:"d-flex flex-column gap-2 mt-2"},Hce={class:"d-flex flex-column gap-2 mt-2"},Wce=le({__name:"EditorAnnotationPoint",props:at({labels:{},chartWidth:{}},{annotation:{required:!0},annotationModifiers:{}}),emits:["update:annotation"],setup(t){const e=t,n=pt(t,"annotation"),o=A(()=>e.labels.map(l=>({value:l,text:l}))),r=[{value:"solid",text:"Solid"},{value:"dotted",text:"Dotted"},{value:"dashed",text:"Dashed"}];function i(l){return l==null?"150px":typeof l=="number"?`${l}px`:String(l)}function s(l,c){const u={...n.value};c===void 0?delete u[l]:u[l]=c,n.value=u}const a=ze(null);return hn(()=>{var c;const l=(c=a.value)==null?void 0:c.$el;l&&(l.focus(),l.select())}),(l,c)=>{const u=$y,d=Mn,f=ja,h=ra,g=Hs;return w(),R("div",Vce,[H(d,{label:"Text"},{default:J(()=>[H(u,{ref_key:"textRef",ref:a,"model-value":n.value.text,placeholder:"Annotation text",rows:"2","onUpdate:modelValue":c[0]||(c[0]=v=>s("text",v))},null,8,["model-value"])]),_:1}),H(d,{label:"Target"},{default:J(()=>[H(f,{"model-value":n.value.target,options:p(o),"onUpdate:modelValue":c[1]||(c[1]=v=>s("target",v))},null,8,["model-value","options"])]),_:1}),H(p(Na),{id:"ann-point-text-color","model-value":n.value.textColor??"#000000",label:"Text color","onUpdate:modelValue":c[2]||(c[2]=v=>s("textColor",v))},null,8,["model-value"]),H(p(nn),{"model-value":n.value.textOutline??!0,label:"Text outline","onUpdate:modelValue":c[3]||(c[3]=v=>s("textOutline",v))},null,8,["model-value"]),H(p(Kh),{id:"ann-point-max-width","model-value":i(n.value.maxWidth),label:"Max width",min:"0",max:String(t.chartWidth??600),units:["px","%"],"onUpdate:modelValue":c[4]||(c[4]=v=>s("maxWidth",v))},null,8,["model-value","max"]),H(p(nn),{"model-value":n.value.showLine??!0,label:"Show line","onUpdate:modelValue":c[10]||(c[10]=v=>s("showLine",v))},ki({_:2},[n.value.showLine?{name:"section",fn:J(()=>[T("div",zce,[H(p(Cn),{"model-value":n.value.lineStyle??"direct",label:"Line style",block:"","onUpdate:modelValue":c[5]||(c[5]=v=>s("lineStyle",v))},{default:J(()=>[H(p(sh),{value:"direct",text:"Direct","icon-left":p(Z2)},null,8,["icon-left"]),H(p(sh),{value:"curve-left",text:"Curve left","icon-left":p(Pce)},null,8,["icon-left"]),H(p(sh),{value:"curve-right",text:"Curve right","icon-left":p(Nce)},null,8,["icon-left"]),H(p(sh),{value:"elbow",text:"Elbow","icon-left":p(Fce)},null,8,["icon-left"])]),_:1},8,["model-value"]),H(d,{label:"Line weight"},{default:J(()=>[H(h,{"model-value":String(n.value.lineWeight??1),type:"number",min:"1",max:"10","onUpdate:modelValue":c[6]||(c[6]=v=>s("lineWeight",Number(v)))},null,8,["model-value"])]),_:1}),H(p($A),{"model-value":n.value.anchorDirection??"N",label:"Anchor position","onUpdate:modelValue":c[7]||(c[7]=v=>s("anchorDirection",v))},null,8,["model-value"]),H(d,null,{default:J(()=>[H(g,{"model-value":n.value.showArrow??!0,switch:"","onUpdate:modelValue":c[8]||(c[8]=v=>s("showArrow",v))},{default:J(()=>[...c[14]||(c[14]=[Xe(" Show arrow ",-1)])]),_:1},8,["model-value"])]),_:1}),H(d,{label:"Line target distance"},{default:J(()=>[H(h,{"model-value":String(n.value.lineTargetDistance??0),type:"number","onUpdate:modelValue":c[9]||(c[9]=v=>s("lineTargetDistance",Number(v)))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"]),H(p(nn),{"model-value":n.value.showCircle??!1,label:"Show circle","onUpdate:modelValue":c[13]||(c[13]=v=>s("showCircle",v))},ki({_:2},[n.value.showCircle?{name:"section",fn:J(()=>[T("div",Hce,[H(d,{label:"Circle size"},{default:J(()=>[H(h,{"model-value":String(n.value.circleSize??4),type:"number",min:"1","onUpdate:modelValue":c[11]||(c[11]=v=>s("circleSize",Number(v)))},null,8,["model-value"])]),_:1}),H(d,{label:"Circle style"},{default:J(()=>[H(f,{"model-value":n.value.circleStyle??"solid",options:r,"onUpdate:modelValue":c[12]||(c[12]=v=>s("circleStyle",v))},null,8,["model-value"])]),_:1})])]),key:"0"}:void 0]),1032,["model-value"])])}}}),Uce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Gce(t,e){return w(),R("svg",Uce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M247.31 124.76c-.35-.79-8.82-19.58-27.65-38.41C194.57 61.26 162.88 48 128 48S61.43 61.26 36.34 86.35C17.51 105.18 9 124 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208s66.57-13.26 91.66-38.34c18.83-18.83 27.3-37.61 27.65-38.4a8 8 0 0 0 0-6.5M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.5 133.5 0 0 1 25 128a133.3 133.3 0 0 1 23.07-30.75C70.33 75.19 97.22 64 128 64s57.67 11.19 79.93 33.25A133.5 133.5 0 0 1 231.05 128c-7.21 13.46-38.62 64-103.05 64m0-112a48 48 0 1 0 48 48a48.05 48.05 0 0 0-48-48m0 80a32 32 0 1 1 32-32a32 32 0 0 1-32 32"},null,-1)])])}const XT=Me({name:"ph-eye",render:Gce}),qce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yce(t,e){return w(),R("svg",qce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M53.92 34.62a8 8 0 1 0-11.84 10.76l19.24 21.17C25 88.84 9.38 123.2 8.69 124.76a8 8 0 0 0 0 6.5c.35.79 8.82 19.57 27.65 38.4C61.43 194.74 93.12 208 128 208a127.1 127.1 0 0 0 52.07-10.83l22 24.21a8 8 0 1 0 11.84-10.76Zm47.33 75.84l41.67 45.85a32 32 0 0 1-41.67-45.85M128 192c-30.78 0-57.67-11.19-79.93-33.25A133.2 133.2 0 0 1 25 128c4.69-8.79 19.66-33.39 47.35-49.38l18 19.75a48 48 0 0 0 63.66 70l14.73 16.2A112 112 0 0 1 128 192m6-95.43a8 8 0 0 1 3-15.72a48.16 48.16 0 0 1 38.77 42.64a8 8 0 0 1-7.22 8.71a6 6 0 0 1-.75 0a8 8 0 0 1-8-7.26A32.09 32.09 0 0 0 134 96.57m113.28 34.69c-.42.94-10.55 23.37-33.36 43.8a8 8 0 1 1-10.67-11.92a132.8 132.8 0 0 0 27.8-35.14a133.2 133.2 0 0 0-23.12-30.77C185.67 75.19 158.78 64 128 64a118.4 118.4 0 0 0-19.36 1.57A8 8 0 1 1 106 49.79A134 134 0 0 1 128 48c34.88 0 66.57 13.26 91.66 38.35c18.83 18.83 27.3 37.62 27.65 38.41a8 8 0 0 1 0 6.5Z"},null,-1)])])}const ff=Me({name:"ph-eye-slash",render:Yce}),jce={class:"badge bg-secondary-subtle text-secondary-emphasis"},Xce=le({__name:"EditorAnnotationHeader",props:{kindLabel:{},summary:{},collapsed:{type:Boolean},hidden:{type:Boolean},canToggleVisibility:{type:Boolean}},emits:["duplicate","remove","toggleCollapse","toggleVisibility"],setup(t){return(e,n)=>(w(),Q(p(XA),{label:t.summary,class:Te({"opacity-50":t.hidden}),onClick:n[3]||(n[3]=o=>e.$emit("toggleCollapse"))},{leading:J(()=>[T("span",jce,be(t.kindLabel),1)]),actions:J(()=>[t.canToggleVisibility?(w(),Q(p(Ho),{key:0,variant:"link",size:"sm",class:"annotation-header__btn text-body-secondary",title:t.hidden?"Show in scene":"Hide in scene",onClick:n[0]||(n[0]=gn(o=>e.$emit("toggleVisibility"),["stop"]))},{default:J(()=>[H(p($f),{name:t.hidden?p(ff):p(XT)},null,8,["name"])]),_:1},8,["title"])):se("",!0),H(p(rG),{onDuplicate:n[1]||(n[1]=o=>e.$emit("duplicate")),onRemove:n[2]||(n[2]=o=>e.$emit("remove"))})]),_:1},8,["label","class"]))}}),Kce=Be(Xce,[["__scopeId","data-v-acf3aff5"]]),Zce={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Qce(t,e){return w(),R("svg",Zce,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 64a40 40 0 1 0 40 40a40 40 0 0 0-40-40m0 64a24 24 0 1 1 24-24a24 24 0 0 1-24 24m0-112a88.1 88.1 0 0 0-88 88c0 31.4 14.51 64.68 42 96.25a254.2 254.2 0 0 0 41.45 38.3a8 8 0 0 0 9.18 0a254.2 254.2 0 0 0 41.37-38.3c27.45-31.57 42-64.85 42-96.25a88.1 88.1 0 0 0-88-88m0 206c-16.53-13-72-60.75-72-118a72 72 0 0 1 144 0c0 57.23-55.47 105-72 118"},null,-1)])])}const Jce=Me({name:"ph-map-pin",render:Qce}),eue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function tue(t,e){return w(),R("svg",eue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M136 40v176a8 8 0 0 1-16 0V40a8 8 0 0 1 16 0m-40 80H35.31l18.35-18.34a8 8 0 0 0-11.32-11.32l-32 32a8 8 0 0 0 0 11.32l32 32a8 8 0 0 0 11.32-11.32L35.31 136H96a8 8 0 0 0 0-16m149.66 2.34l-32-32a8 8 0 0 0-11.32 11.32L220.69 120H160a8 8 0 0 0 0 16h60.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32"},null,-1)])])}const nue=Me({name:"ph-arrows-out-line-horizontal",render:tue}),oue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function rue(t,e){return w(),R("svg",oue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M88 96a8 8 0 0 1 8-8h64a8 8 0 0 1 0 16H96a8 8 0 0 1-8-8m8 40h64a8 8 0 0 0 0-16H96a8 8 0 0 0 0 16m32 16H96a8 8 0 0 0 0 16h32a8 8 0 0 0 0-16m96-104v108.69a15.86 15.86 0 0 1-4.69 11.31L168 219.31a15.86 15.86 0 0 1-11.31 4.69H48a16 16 0 0 1-16-16V48a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16M48 208h104v-48a8 8 0 0 1 8-8h48V48H48Zm120-40v28.7l28.69-28.7Z"},null,-1)])])}const iue=Me({name:"ph-note",render:rue}),sue={class:"d-flex flex-column gap-4"},aue={class:"d-flex flex-column gap-2"},lue={class:"d-flex flex-column gap-2"},cue={class:"d-flex flex-column gap-2"},J6="abcdefghijklmnopqrstuvwxyz0123456789",uue=le({__name:"EditorAnnotations",props:at({labels:{},chartType:{},chartWidth:{},chartHeight:{},hiddenAnnotationIds:{},canToggleVisibility:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:at(["toggle-visibility"],["update:modelValue"]),setup(t,{expose:e,emit:n}){const o=t,r=n,i=pt(t,"modelValue"),s=A(()=>i.value);function a(){let k="";for(let L=0;L<5;L++)k+=J6[Math.floor(Math.random()*J6.length)];return k}const l=A(()=>o.chartType===Le.Pie||o.chartType===Le.Donut),c=ze(null);function u(k){c.value=c.value===k?null:k}e({openIndex:c});const d=A(()=>s.value.map((k,L)=>({ann:k,index:L})).filter(({ann:k})=>k.kind===Pt.Point)),f=A(()=>s.value.map((k,L)=>({ann:k,index:L})).filter(({ann:k})=>k.kind===Pt.Range)),h=A(()=>s.value.map((k,L)=>({ann:k,index:L})).filter(({ann:k})=>k.kind===Pt.Free));function g(k){var L;return!!k.id&&!!((L=o.hiddenAnnotationIds)!=null&&L.has(k.id))}function v(k){k.id&&r("toggle-visibility",k.id,k.kind)}function m(k){return k.kind===Pt.Point?"Point":k.kind===Pt.Range?"Range":"Note"}function b(k){return k.kind===Pt.Point?k.text||k.target||"Empty":k.kind===Pt.Range?k.text||`${k.start} - ${k.end}`:k.text||"Empty"}function y(k,L){const E=s.value.map(I=>({...I}));E[k]=L,i.value=E}function x(){const k={kind:Pt.Point,id:a(),target:o.labels[0]??"",text:"Enter an annotation",showLine:!0,showArrow:!0},L=[...s.value,k];i.value=L,c.value=L.length-1}function _(){const k=o.labels.length>0,L={kind:Pt.Range,id:a(),start:k?o.labels[0]:0,end:k?o.labels[o.labels.length-1]:100},E=[...s.value,L];i.value=E,c.value=E.length-1}function S(){const k={kind:Pt.Free,id:a(),text:"Enter an annotation",x:0,y:0},L=[...s.value,k];i.value=L,c.value=L.length-1}function N(k){const L=[...s.value];L.splice(k+1,0,{...L[k],id:a()}),i.value=L}function B(k){const L=[...s.value];L.splice(k,1),i.value=L,c.value===k?c.value=null:c.value!==null&&c.value>k&&c.value--}return(k,L)=>{const E=Kce,I=Wce,C=Oce,$=xce;return w(),R("div",sue,[p(l)?se("",!0):(w(),Q(p(zo),{key:0,title:"Points",icon:p(Jce)},{default:J(()=>[T("div",aue,[(w(!0),R(Ge,null,gt(p(d),({ann:P,index:M})=>(w(),Q(p(Md),{key:M},{header:J(()=>[H(E,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==M,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>N(M),onRemove:F=>B(M),onToggleCollapse:F=>u(M),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===M?(w(),Q(I,{key:0,annotation:P,labels:t.labels,"chart-width":t.chartWidth,"onUpdate:annotation":F=>y(M,F)},null,8,["annotation","labels","chart-width","onUpdate:annotation"])):se("",!0)]),_:2},1024))),128))]),H(p($l),{label:"Add",onClick:x})]),_:1},8,["icon"])),p(l)?se("",!0):(w(),Q(p(zo),{key:1,title:"Ranges",icon:p(nue)},{default:J(()=>[T("div",lue,[(w(!0),R(Ge,null,gt(p(f),({ann:P,index:M})=>(w(),Q(p(Md),{key:M},{header:J(()=>[H(E,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==M,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>N(M),onRemove:F=>B(M),onToggleCollapse:F=>u(M),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===M?(w(),Q(C,{key:0,annotation:P,labels:t.labels,"onUpdate:annotation":F=>y(M,F)},null,8,["annotation","labels","onUpdate:annotation"])):se("",!0)]),_:2},1024))),128))]),H(p($l),{label:"Add",onClick:_})]),_:1},8,["icon"])),H(p(zo),{title:"Notes",icon:p(iue)},{default:J(()=>[T("div",cue,[(w(!0),R(Ge,null,gt(p(h),({ann:P,index:M})=>(w(),Q(p(Md),{key:M},{header:J(()=>[H(E,{"kind-label":m(P),summary:b(P),collapsed:p(c)!==M,hidden:g(P),"can-toggle-visibility":t.canToggleVisibility,onDuplicate:F=>N(M),onRemove:F=>B(M),onToggleCollapse:F=>u(M),onToggleVisibility:F=>v(P)},null,8,["kind-label","summary","collapsed","hidden","can-toggle-visibility","onDuplicate","onRemove","onToggleCollapse","onToggleVisibility"])]),default:J(()=>[p(c)===M?(w(),Q($,{key:0,annotation:P,"chart-width":t.chartWidth,"chart-height":t.chartHeight,"onUpdate:annotation":F=>y(M,F)},null,8,["annotation","chart-width","chart-height","onUpdate:annotation"])):se("",!0)]),_:2},1024))),128))]),H(p($l),{label:"Add",onClick:S})]),_:1},8,["icon"])])}}});function due(t,e,n,o){let r=null,i=null;function s(){r!=null&&r.parentNode&&r.parentNode.removeChild(r),r=null,i&&(i(),i=null)}function a(){s();const l=t.value,c=n.value;if(!l||c===null)return;const u=e.value[c];if(!u||u.kind==="range")return;const d=l.querySelector("svg");if(!d)return;const f=u.id,h=f?d.querySelector(`g[data-annotation-id="${f}"]`):d.querySelector(`g[data-annotation-index="${c}"]`);if(!h)return;const g=h.querySelector(".bc-annotation-text");if(!g)return;const v=h.querySelector(".bc-annotation-circle"),m=h.querySelector(".bc-annotation-line");let b=null,y=null,x=0;if(v&&(b=parseFloat(v.getAttribute("cx")||"0"),y=parseFloat(v.getAttribute("cy")||"0"),x=parseFloat(v.getAttribute("r")||"0")),b===null&&m){const D=(m.getAttribute("d")||"").split(/[MLA]\s*/).filter(Boolean);if(D.length>=2){const W=D[D.length-1].trim().split(/[\s,]+/);W.length>=2&&(b=parseFloat(W[W.length-2]),y=parseFloat(W[W.length-1]))}}const _=b!==null&&y!==null,S=(u&&"lineStyle"in u?u.lineStyle:"direct")||"direct",N=x>0?x+((u&&"lineTargetDistance"in u?u.lineTargetDistance:5)||5):0,B=parseFloat(g.getAttribute("x")||"0"),k=parseFloat(g.getAttribute("y")||"0"),L=g.getBBox(),I=(g.getAttribute("transform")||"").match(/translate\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*\)/),C=I?parseFloat(I[1]):0,$=I?parseFloat(I[2]):0,P={x:L.x+C,y:L.y+$,width:L.width,height:L.height},M=4,F=u?u.maxWidth:void 0;let V=P.width;if(F!=null){const ce=parseFloat(d.getAttribute("width")||"0");if(typeof F=="number"&&F>0)V=F;else if(typeof F=="string")if(F.endsWith("%")&&ce>0)V=parseFloat(F)/100*ce;else{const D=parseFloat(F);D>0&&(V=D)}}const G=g.getAttribute("text-anchor")||"middle";let K;G==="middle"?K=B-V/2:G==="end"?K=B-V:K=B,r=document.createElementNS("http://www.w3.org/2000/svg","rect"),r.setAttribute("x",String(K-M)),r.setAttribute("y",String(P.y-M)),r.setAttribute("width",String(V+M*2)),r.setAttribute("height",String(P.height+M*2)),r.setAttribute("fill","rgba(255,245,157,0.4)"),r.setAttribute("rx","3"),r.style.cursor="grab",r.style.pointerEvents="all",h.appendChild(r);let ue=!1,de=0,he=0,ge=0,ee=0,fe=0;function xe(){return d.getScreenCTM()}function Z(){const ce=xe();if(!ce)return;const D=(ee-de)/ce.a,W=(fe-he)/ce.d,j=B+D,ne=k+W;g.setAttribute("x",String(j)),g.setAttribute("y",String(ne));const ie=g.querySelectorAll("tspan");for(const q of ie)q.setAttribute("x",String(j));const ae=g.getBBox(),te={x:ae.x+C,y:ae.y+$,width:ae.width,height:ae.height};let Y;const X=g.getAttribute("text-anchor")||"middle";if(X==="middle"?Y=j-V/2:X==="end"?Y=j-V:Y=j,r.setAttribute("x",String(Y-M)),r.setAttribute("y",String(te.y-M)),r.setAttribute("width",String(V+M*2)),r.setAttribute("height",String(te.height+M*2)),m&&_){const q=bboxEdgeToward(te,b,y),re=N>0?shortenToward({x:b,y},q,N):{x:b,y},me=te.x+te.width/2,we=Math.abs(q.x-me)<1;m.setAttribute("d",buildPathD(q,re,S,we))}ge=0}function pe(ce){ce.preventDefault(),ce.stopPropagation(),ue=!0,de=ce.clientX,he=ce.clientY,ee=ce.clientX,fe=ce.clientY,r.style.cursor="grabbing",r.setPointerCapture(ce.pointerId)}function oe(ce){ue&&(ce.preventDefault(),ee=ce.clientX,fe=ce.clientY,ge||(ge=requestAnimationFrame(Z)))}function ve(ce){if(!ue)return;ue=!1,r.style.cursor="grab",ge&&(cancelAnimationFrame(ge),ge=0);const D=xe();if(!D)return;const W=(ce.clientX-de)/D.a,j=(ce.clientY-he)/D.d;if(Math.abs(W)<1&&Math.abs(j)<1){g.setAttribute("x",String(B)),g.setAttribute("y",String(k));const ae=g.querySelectorAll("tspan");for(const te of ae)te.setAttribute("x",String(B));return}const ne=e.value[c];if(!ne)return;const ie={...ne};if(ne.kind==="free"){const ae=h.closest(".bc-annotations"),te=parseFloat((ae==null?void 0:ae.getAttribute("data-ctx-width"))||"")||parseFloat(d.getAttribute("width")||"600"),Y=parseFloat((ae==null?void 0:ae.getAttribute("data-ctx-height"))||"")||parseFloat(d.getAttribute("height")||"400"),X=ne.x,q=ne.y;if(typeof X=="number")ie.x=+(X+W/te*100).toFixed(1);else{const re=String(X);re.endsWith("px")?ie.x=`${Math.round(parseFloat(re)+W)}px`:ie.x=+((parseFloat(re)||0)+W/te*100).toFixed(1)}if(typeof q=="number")ie.y=+(q+j/Y*100).toFixed(1);else{const re=String(q);re.endsWith("px")?ie.y=`${Math.round(parseFloat(re)+j)}px`:ie.y=+((parseFloat(re)||0)+j/Y*100).toFixed(1)}}else if(ne.kind==="point"){const ae=ie.textOffsetX??-42,te=ie.textOffsetY??-42;ie.textOffsetX=Math.round(ae+W),ie.textOffsetY=Math.round(te+j)}o(c,ie)}r.addEventListener("pointerdown",pe),r.addEventListener("pointermove",oe),r.addEventListener("pointerup",ve),i=()=>{ge&&cancelAnimationFrame(ge),r==null||r.removeEventListener("pointerdown",pe),r==null||r.removeEventListener("pointermove",oe),r==null||r.removeEventListener("pointerup",ve)}}je(n,()=>{requestAnimationFrame(a)}),je(e,()=>{n.value!==null&&requestAnimationFrame(a)},{deep:!0}),Ba(s)}const fue={class:"d-flex flex-column gap-4"},hue=le({__name:"EditorAnnotateTab",setup(t){const e=pn(),{chartType:n,data:o,areaFills:r,seriesOverrides:i}=e,{currentOptions:s}=kn(),a=A(()=>s.value.interpolation??"linear"),{pendingAnnotationIndex:l}=Mt(dr()),{scenes:c,activeIndex:u,activeScene:d,update:f}=_n(),h=A(()=>u.value>=0),g=[Le.BarVertical,Le.BarHorizontal,Le.LineMulti,Le.AreaStacked],v=A(()=>g.includes(n.value)),m=A({get(){const M=e._base.annotations.value;if(u.value>=0){const F=za(c.value,u.value),V=(F==null?void 0:F.annotations)??[];return[...M,...V]}return M},set(M){if(u.value>=0&&d.value){const F=new Set(e._base.annotations.value.map(K=>K.id).filter(Boolean)),V=M.filter(K=>K.id&&F.has(K.id)),G=M.filter(K=>!K.id||!F.has(K.id));e._base.annotations.value=V,f(u.value,{annotations:G.length>0?G:void 0});return}e._base.annotations.value=M}}),b=A(()=>{if(u.value<0)return;const M=za(c.value,u.value);return M==null?void 0:M.hiddenAnnotationIds});function y(M,F){var ue;if(u.value<0)return;const V=d.value;if(!V)return;const G=V.annotationVisibility??[];((ue=b.value)==null?void 0:ue.has(M))?G.find(he=>he.id===M&&he.action==="hide")?f(u.value,{annotationVisibility:G.filter(he=>!(he.id===M&&he.action==="hide"))}):f(u.value,{annotationVisibility:[...G,{action:"show",kind:F,id:M}]}):G.find(he=>he.id===M&&he.action==="show")?f(u.value,{annotationVisibility:G.filter(he=>!(he.id===M&&he.action==="show"))}):f(u.value,{annotationVisibility:[...G,{action:"hide",kind:F,id:M}]})}const x=A(()=>n.value===Le.LineMulti),_=A(()=>gs(o.value)),S=A(()=>_.value.labels),N=A(()=>{var M;return((M=_.value.series)==null?void 0:M.map(F=>F.name))??[]}),B=ze(null),k=A(()=>{var M;return((M=B.value)==null?void 0:M.openIndex)??null}),{containerRef:L}=jT(),E=Fe(600),I=Fe(400);function C(){var F;const M=(F=L.value)==null?void 0:F.querySelector("svg");M&&(E.value=parseFloat(M.getAttribute("width")||"600")||600,I.value=parseFloat(M.getAttribute("height")||"400")||400)}let $;hn(()=>{C(),$=new ResizeObserver(C),L.value&&$.observe(L.value)}),Xs(()=>$==null?void 0:$.disconnect());function P(M,F){const V=m.value.map(G=>({...G}));V[M]=F,m.value=V}return due(L,m,k,P),je(l,async M=>{if(M!==null&&(await wn(),B.value)){const F=typeof M=="string"?m.value.findIndex(V=>V.id===M):M;if(F<0){l.value=null;return}B.value.openIndex=B.value.openIndex===F?null:F,l.value=null}},{immediate:!0}),(M,F)=>{const V=uce,G=lce;return w(),R("div",fue,[p(v)?(w(),Q(p(zo),{key:0,title:"Highlight",icon:p(vce)},{default:J(()=>[H(V)]),_:1},8,["icon"])):se("",!0),H(uue,{ref_key:"annotationsRef",ref:B,modelValue:p(m),"onUpdate:modelValue":F[0]||(F[0]=K=>Ze(m)?m.value=K:null),labels:p(S),"chart-type":p(n),"chart-width":p(E),"chart-height":p(I),"hidden-annotation-ids":p(b),"can-toggle-visibility":p(h),onToggleVisibility:y},null,8,["modelValue","labels","chart-type","chart-width","chart-height","hidden-annotation-ids","can-toggle-visibility"]),p(x)?(w(),Q(p(zo),{key:1,title:"Area Fills",icon:p(pce)},{default:J(()=>[H(G,{modelValue:p(r),"onUpdate:modelValue":F[1]||(F[1]=K=>Ze(r)?r.value=K:null),"series-names":p(N),"series-overrides":p(i),"global-interpolation":p(a)},null,8,["modelValue","series-names","series-overrides","global-interpolation"])]),_:1},8,["icon"])):se("",!0)])}}}),pue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function mue(t,e){return w(),R("svg",pue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M243.31 136L144 36.69A15.86 15.86 0 0 0 132.69 32H40a8 8 0 0 0-8 8v92.69A15.86 15.86 0 0 0 36.69 144L136 243.31a16 16 0 0 0 22.63 0l84.68-84.68a16 16 0 0 0 0-22.63m-96 96L48 132.69V48h84.69L232 147.31ZM96 84a12 12 0 1 1-12-12a12 12 0 0 1 12 12"},null,-1)])])}const gue=Me({name:"ph-tag",render:mue}),vue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function bue(t,e){return w(),R("svg",vue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M48 64a8 8 0 0 1 8-8h16V40a8 8 0 0 1 16 0v16h16a8 8 0 0 1 0 16H88v16a8 8 0 0 1-16 0V72H56a8 8 0 0 1-8-8m136 128h-8v-8a8 8 0 0 0-16 0v8h-8a8 8 0 0 0 0 16h8v8a8 8 0 0 0 16 0v-8h8a8 8 0 0 0 0-16m56-48h-16v-16a8 8 0 0 0-16 0v16h-16a8 8 0 0 0 0 16h16v16a8 8 0 0 0 16 0v-16h16a8 8 0 0 0 0-16m-20.69-64L80 219.31a16 16 0 0 1-22.62 0l-20.7-20.68a16 16 0 0 1 0-22.63L176 36.69a16 16 0 0 1 22.63 0l20.68 20.68a16 16 0 0 1 0 22.63m-54.63 32L144 91.31l-96 96L68.68 208ZM208 68.69L187.31 48l-32 32L176 100.69Z"},null,-1)])])}const cb=Me({name:"ph-magic-wand",render:bue}),yue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function xue(t,e){return w(),R("svg",yue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M205.66 138.34a8 8 0 0 1-11.32 11.32L136 91.31V224a8 8 0 0 1-16 0V91.31l-58.34 58.35a8 8 0 0 1-11.32-11.32l72-72a8 8 0 0 1 11.32 0ZM216 32H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const wue=Me({name:"ph-arrow-line-up",render:xue}),_ue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function kue(t,e){return w(),R("svg",_ue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M50.34 117.66a8 8 0 0 1 11.32-11.32L120 164.69V32a8 8 0 0 1 16 0v132.69l58.34-58.35a8 8 0 0 1 11.32 11.32l-72 72a8 8 0 0 1-11.32 0ZM216 208H40a8 8 0 0 0 0 16h176a8 8 0 0 0 0-16"},null,-1)])])}const Sue=Me({name:"ph-arrow-line-down",render:kue}),Aue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Cue(t,e){return w(),R("svg",Aue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 128a8 8 0 0 1-8 8H91.31l58.35 58.34a8 8 0 0 1-11.32 11.32l-72-72a8 8 0 0 1 0-11.32l72-72a8 8 0 0 1 11.32 11.32L91.31 120H224a8 8 0 0 1 8 8M40 32a8 8 0 0 0-8 8v176a8 8 0 0 0 16 0V40a8 8 0 0 0-8-8"},null,-1)])])}const $ue=Me({name:"ph-arrow-line-left",render:Cue}),Tue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Mue(t,e){return w(),R("svg",Tue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M189.66 122.34a8 8 0 0 1 0 11.32l-72 72a8 8 0 0 1-11.32-11.32L164.69 136H32a8 8 0 0 1 0-16h132.69l-58.35-58.34a8 8 0 0 1 11.32-11.32ZM216 32a8 8 0 0 0-8 8v176a8 8 0 0 0 16 0V40a8 8 0 0 0-8-8"},null,-1)])])}const Oue=Me({name:"ph-arrow-line-right",render:Mue}),Bue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Lue(t,e){return w(),R("svg",Bue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 136v64a8 8 0 0 1-16 0v-44.68l-66.34 66.34a8 8 0 0 1-11.32-11.32L100.68 144H56a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8m80-104H80a16 16 0 0 0-16 16v48a8 8 0 0 0 16 0V48h128v128h-48a8 8 0 0 0 0 16h48a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16"},null,-1)])])}const ub=Me({name:"ph-arrow-square-in",render:Lue}),Pue={class:"d-flex flex-column gap-3"},Due=le({__name:"EditorLegendSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("legend")),i=A(()=>n.value.includes("legendPosition")),s=A(()=>n.value.includes("legendAnchor")),a=A(()=>n.value.includes("directLabelling")),l=A(()=>a.value),c=A(()=>n.value.includes("directLabelAnchor")),u=A(()=>e.value.directLabelling?"direct":e.value.legend===!1?"none":"legend"),d=A(()=>{const b=[{value:"legend",text:"Legend",icon:oC},{value:"none",text:"None",icon:ff}];return a.value&&b.splice(1,0,{value:"direct",text:"Direct labelling",icon:gue}),b});function f(b){b==="legend"?(o("legend",!0),o("directLabelling","")):b==="direct"?(o("legend",!1),o("directLabelling","auto")):(o("legend",!1),o("directLabelling",""))}const h=[{value:"auto",text:"Auto",icon:cb},{value:"outside",text:"Outside",icon:Hp},{value:"inside",text:"Inside",icon:ub}],g=[{value:"start",text:"Start",icon:uf},{value:"middle",text:"Middle",icon:x0},{value:"end",text:"End",icon:df}],v=[{value:"top",text:"Top",icon:wue},{value:"bottom",text:"Bottom",icon:Sue},{value:"left",text:"Left",icon:$ue},{value:"right",text:"Right",icon:Oue}],m=[{value:"start",text:"Start",icon:uf},{value:"middle",text:"Middle",icon:x0},{value:"end",text:"End",icon:df}];return(b,y)=>(w(),R("div",Pue,[p(r)?(w(),Q(p(Cn),{key:0,label:"Labels","model-value":p(u),options:p(d),block:"","onUpdate:modelValue":f},null,8,["model-value","options"])):se("",!0),p(l)&&p(u)==="direct"?(w(),Q(p(Cn),{key:1,label:"Direct label style","model-value":p(e).directLabelling||"auto",options:h,block:"","onUpdate:modelValue":y[0]||(y[0]=x=>p(o)("directLabelling",x))},null,8,["model-value"])):se("",!0),p(c)&&p(u)==="direct"&&p(e).directLabelling==="inside"?(w(),Q(p(Cn),{key:2,label:"Label anchor","model-value":p(e).directLabelAnchor||"middle",options:g,block:"","onUpdate:modelValue":y[1]||(y[1]=x=>p(o)("directLabelAnchor",x))},null,8,["model-value"])):se("",!0),p(i)&&p(u)==="legend"?(w(),Q(p(Cn),{key:3,label:"Legend position","model-value":p(e).legendPosition??"top",options:v,block:"","onUpdate:modelValue":y[2]||(y[2]=x=>p(o)("legendPosition",x))},null,8,["model-value"])):se("",!0),p(s)&&p(u)==="legend"?(w(),Q(p(Cn),{key:4,label:"Legend anchor","model-value":p(e).legendAnchor??"start",options:m,block:"","onUpdate:modelValue":y[3]||(y[3]=x=>p(o)("legendAnchor",x))},null,8,["model-value"])):se("",!0)]))}}),Eue={class:"d-flex flex-column gap-3"},Nue={class:"pt-2"},Iue={class:"pt-2"},Rue={class:"pt-2"},Fue={class:"pt-2"},Vue=le({__name:"EditorLayoutSection",setup(t){const{layout:e}=pn(),n=A({get:()=>e.value.sizing,set:h=>{e.value.sizing=h}}),o=A({get:()=>e.value.heightMode,set:h=>{e.value.heightMode=h}}),r=A({get:()=>String(e.value.fixedWidth),set:h=>{e.value.fixedWidth=Number(h)||600}}),i=A({get:()=>String(e.value.fixedHeight),set:h=>{e.value.fixedHeight=Number(h)||400}}),s=A({get:()=>String(e.value.padding),set:h=>{e.value.padding=Number(h)||0}}),a=A({get:()=>e.value.aspectRatio,set:h=>{e.value.aspectRatio=h}}),l=A({get:()=>e.value.transparentBackground,set:h=>{e.value.transparentBackground=h}}),c=A({get:()=>String(e.value.maxWidth),set:h=>{e.value.maxWidth=Number(h)||660}}),u=[{value:"responsive",text:"Responsive"},{value:"max-width",text:"Max width"},{value:"fixed",text:"Fixed"}],d=[{value:"auto",text:"Auto"},{value:"fixed",text:"Fixed"},{value:"aspect-ratio",text:"Aspect ratio"}],f=[{value:"16:9",label:"16:9"},{value:"4:3",label:"4:3"},{value:"3:2",label:"3:2"},{value:"1:1",label:"1:1"},{value:"2:3",label:"2:3"},{value:"9:16",label:"9:16"}];return(h,g)=>(w(),R("div",Eue,[H(p(Cn),{modelValue:p(n),"onUpdate:modelValue":g[2]||(g[2]=v=>Ze(n)?n.value=v:null),label:"Width",options:u,block:""},{"section:fixed":J(()=>[T("div",Nue,[H(p(_r),{id:"layout-fixed-width",modelValue:p(r),"onUpdate:modelValue":g[0]||(g[0]=v=>Ze(r)?r.value=v:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),"section:max-width":J(()=>[T("div",Iue,[H(p(_r),{id:"layout-max-width",modelValue:p(c),"onUpdate:modelValue":g[1]||(g[1]=v=>Ze(c)?c.value=v:null),label:"",min:"200",max:"1200",suffix:"px"},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(Cn),{modelValue:p(o),"onUpdate:modelValue":g[5]||(g[5]=v=>Ze(o)?o.value=v:null),label:"Height",options:d,block:""},{"section:fixed":J(()=>[T("div",Rue,[H(p(_r),{id:"layout-fixed-height",modelValue:p(i),"onUpdate:modelValue":g[3]||(g[3]=v=>Ze(i)?i.value=v:null),label:"",min:"100",max:"800",suffix:"px"},null,8,["modelValue"])])]),"section:aspect-ratio":J(()=>[T("div",Fue,[H(p(Nn),{id:"layout-aspect-ratio",modelValue:p(a),"onUpdate:modelValue":g[4]||(g[4]=v=>Ze(a)?a.value=v:null),options:f,block:""},null,8,["modelValue"])])]),_:1},8,["modelValue"]),H(p(_r),{id:"layout-padding",modelValue:p(s),"onUpdate:modelValue":g[6]||(g[6]=v=>Ze(s)?s.value=v:null),label:"Padding",min:"0",max:"80",suffix:"px"},null,8,["modelValue"]),H(p(nn),{modelValue:p(l),"onUpdate:modelValue":g[7]||(g[7]=v=>Ze(l)?l.value=v:null),label:"Transparent background"},null,8,["modelValue"])]))}}),zue={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Hue(t,e){return w(),R("svg",zue,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M80 64a8 8 0 0 1 8-8h128a8 8 0 0 1 0 16H88a8 8 0 0 1-8-8m136 56H88a8 8 0 0 0 0 16h128a8 8 0 0 0 0-16m0 64H88a8 8 0 0 0 0 16h128a8 8 0 0 0 0-16M44 52a12 12 0 1 0 12 12a12 12 0 0 0-12-12m0 64a12 12 0 1 0 12 12a12 12 0 0 0-12-12m0 64a12 12 0 1 0 12 12a12 12 0 0 0-12-12"},null,-1)])])}const Wue=Me({name:"ph-list-bullets",render:Hue}),Uue={class:"d-flex flex-column gap-4"},Gue=le({__name:"EditorLayoutTab",setup(t){const{availableOptionKeys:e}=kn(),n=A(()=>e.value.includes("legend"));return(o,r)=>{const i=Vue,s=Due;return w(),R("div",Uue,[H(i),p(n)?(w(),Q(p(zo),{key:0,title:"Legend",icon:p(Wue)},{default:J(()=>[H(s)]),_:1},8,["icon"])):se("",!0)])}}}),que={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yue(t,e){return w(),R("svg",que,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M239.24 131.4c-22 46.8-41.4 68.6-61.2 68.6c-25.1 0-40.73-33.32-57.28-68.6C107.7 103.56 92.9 72 78 72c-16.4 0-36.31 37.21-46.72 59.4a8 8 0 0 1-14.48-6.8C38.71 77.8 58.16 56 78 56c25.1 0 40.73 33.32 57.28 68.6C148.3 152.44 163.1 184 178 184c16.4 0 36.31-37.21 46.72-59.4a8 8 0 0 1 14.48 6.8Z"},null,-1)])])}const jue=Me({name:"ph-wave-sine",render:Yue}),Xue={key:0,class:"d-flex flex-column gap-4"},Kue={class:"d-flex flex-column gap-2"},Zue={key:1,class:"text-muted small"},Que=le({__name:"EditorAxisOptions",setup(t){const e=A(()=>l.value.includes("valueLabels")),n=A(()=>l.value.includes("swapLabelValue")),o=[{value:"auto",text:"Auto",icon:cb},{value:"outside",text:"Outside",icon:Hp},{value:"inside",text:"Inside",icon:ub}],r=new Set(["showVerticalAxis","verticalAxisDirection","showVerticalTicks","verticalLabelPosition","verticalGridStyle","verticalNumberFormat","verticalScaleType","verticalRangeMin","verticalRangeMax"]),i=new Set(["showHorizontalAxis","showHorizontalTicks","horizontalLabelPosition","horizontalGridStyle","horizontalNumberFormat","horizontalScaleType","horizontalRangeMin","horizontalRangeMax"]),{currentOptions:s,optionDefs:a,availableOptionKeys:l,setOption:c}=kn();function u($,P){c($,P)}const{displayColumnTypes:d}=Ko(),f=A(()=>d.value[0]??"string"),h=A(()=>d.value[1]??"number"),g=A(()=>a.value.some($=>$.key==="verticalScaleType"));function v($){return $.replace(/^(Show\s+)?(vertical|horizontal)\s+/i,(P,M)=>M??"").replace(/^./,P=>P.toUpperCase())}function m($){return($?!g.value:g.value)?h.value:f.value}function b($,P){if($.type!=="numberFormat")return $;const M=m(P);return M==="date"?{...$,type:"dateFormat",label:$.label.replace(/number\s+format/i,"Date format")}:M==="string"?{...$,type:"__hidden"}:$}const y=A(()=>a.value.filter($=>r.has($.key)).map($=>b({...$,label:v($.label)},!1)).filter($=>$.type!=="__hidden")),x=A(()=>a.value.filter($=>i.has($.key)).map($=>b({...$,label:v($.label)},!0)).filter($=>$.type!=="__hidden")),_={solid:Z2,dashed:qT,dotted:YT,none:ff},S={auto:cb,inside:ub,outside:Hp,off:ff},N={left:uf,right:df},B={linear:ld,log:jue},k={verticalGridStyle:_,horizontalGridStyle:_,verticalLabelPosition:S,horizontalLabelPosition:S,verticalAxisDirection:N,verticalScaleType:B,horizontalScaleType:B},L=($,{emit:P})=>{const{def:M,value:F}=$;if(M.type==="boolean")return Vt(nn,{label:M.label,modelValue:F??M.default??!1,"onUpdate:modelValue":V=>P("update",V)});if(M.type==="select"&&M.choices){const V=k[M.key],G=M.choices.map(K=>({value:K.value,text:K.text,...V!=null&&V[K.value]?{icon:V[K.value]}:{}}));return Vt(Cn,{label:M.label,options:G,block:!0,modelValue:F??M.default??"","onUpdate:modelValue":K=>P("update",K)})}return M.type==="text"?Vt(Sm,{label:M.label,id:`opt-${M.key}`,placeholder:M.placeholder??"",modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):M.type==="numberFormat"?Vt(YV,{label:M.label,id:`opt-${M.key}`,modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):M.type==="dateFormat"?Vt(RH,{label:M.label,id:`opt-${M.key}`,modelValue:F??"","onUpdate:modelValue":V=>P("update",V)}):null};L.props=["def","value"],L.emits=["update"];function E($){return $.endsWith("RangeMin")}function I($){return $.endsWith("RangeMax")}const C=($,{emit:P})=>{const M=[],{defs:F,currentOptions:V}=$;let G=0;for(;G<F.length;){const K=F[G];if(E(K.key)&&G+1<F.length&&I(F[G+1].key)){const ue=F[G+1];M.push(Vt("div",{class:"d-flex gap-2",key:K.key},[Vt("div",{class:"flex-fill",style:"min-width:0"},[Vt(L,{def:K,value:V[K.key],onUpdate:de=>P("update",K.key,de)})]),Vt("div",{class:"flex-fill",style:"min-width:0"},[Vt(L,{def:ue,value:V[ue.key],onUpdate:de=>P("update",ue.key,de)})])])),G+=2}else M.push(Vt(L,{key:K.key,def:K,value:V[K.key],onUpdate:ue=>P("update",K.key,ue)})),G++}return Vt("div",{class:"d-flex flex-column gap-2"},M)};return C.props=["defs","currentOptions"],C.emits=["update"],($,P)=>p(e)||p(y).length>0||p(x).length>0?(w(),R("div",Xue,[p(e)?(w(),Q(p(zo),{key:0,title:"Value Labels",icon:p(zT)},{default:J(()=>[T("div",Kue,[H(p(nn),{"model-value":p(s).valueLabels??!1,label:"Show value labels","onUpdate:modelValue":P[0]||(P[0]=M=>u("valueLabels",M))},null,8,["model-value"]),p(s).valueLabels?(w(),Q(p(Cn),{key:0,label:"Position","model-value":p(s).valueLabelPosition??"auto",options:o,block:"","onUpdate:modelValue":P[1]||(P[1]=M=>u("valueLabelPosition",M))},null,8,["model-value"])):se("",!0),p(s).valueLabels&&p(n)?(w(),Q(p(nn),{key:1,"model-value":p(s).swapLabelValue??!1,label:"Swap labels and values","onUpdate:modelValue":P[2]||(P[2]=M=>u("swapLabelValue",M))},null,8,["model-value"])):se("",!0)])]),_:1},8,["icon"])):se("",!0),p(y).length>0?(w(),Q(p(zo),{key:1,title:"Vertical Axis",icon:p(UT)},{default:J(()=>[H(C,{defs:p(y),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):se("",!0),p(x).length>0?(w(),Q(p(zo),{key:2,title:"Horizontal Axis",icon:p(GT)},{default:J(()=>[H(C,{defs:p(x),"current-options":p(s),onUpdate:u},null,8,["defs","current-options"])]),_:1},8,["icon"])):se("",!0)])):(w(),R("p",Zue," No axis options for this chart type. "))}}),Jue={class:"d-flex flex-column gap-3"},KT=le({__name:"EditorSymbolOptions",props:{shape:{},showOn:{},style:{},size:{},opacity:{},idPrefix:{default:"symbol"}},emits:["update:shape","update:showOn","update:style","update:size","update:opacity"],setup(t){const e=[{value:"circle",text:"Circle"},{value:"square",text:"Square"},{value:"diamond",text:"Diamond"},{value:"triangle",text:"Triangle Up"},{value:"triangleDown",text:"Triangle Down"},{value:"cross",text:"Cross"},{value:"star",text:"Star"}],n=[{value:"firstLast",text:"First & Last"},{value:"first",text:"First"},{value:"last",text:"Last"},{value:"all",text:"All"}],o=[{value:"filled",text:"Filled"},{value:"hollow",text:"Hollow"}];return(r,i)=>{const s=ja,a=Mn;return w(),R("div",Jue,[H(a,{label:"Symbol","label-for":`${t.idPrefix}-shape`},{default:J(()=>[H(s,{id:`${t.idPrefix}-shape`,"model-value":t.shape,options:e,"onUpdate:modelValue":i[0]||(i[0]=l=>r.$emit("update:shape",l))},null,8,["id","model-value"])]),_:1},8,["label-for"]),H(p(Cn),{label:"Show on","model-value":t.showOn,options:n,"onUpdate:modelValue":i[1]||(i[1]=l=>r.$emit("update:showOn",l))},null,8,["model-value"]),H(p(Cn),{label:"Style","model-value":t.style,options:o,"onUpdate:modelValue":i[2]||(i[2]=l=>r.$emit("update:style",l))},null,8,["model-value"]),H(p(_r),{id:`${t.idPrefix}-size`,label:"Size","model-value":t.size,min:"0.5",max:"10",step:"0.5","onUpdate:modelValue":i[3]||(i[3]=l=>r.$emit("update:size",l))},null,8,["id","model-value"]),H(p(_r),{id:`${t.idPrefix}-opacity`,label:"Opacity","model-value":t.opacity,min:"0",max:"1",step:"0.1","onUpdate:modelValue":i[4]||(i[4]=l=>r.$emit("update:opacity",l))},null,8,["id","model-value"])])}}}),ede={class:"d-flex flex-column gap-3"},tde={class:"d-flex gap-2 justify-content-end"},nde=le({__name:"EditorSeriesOptions",props:{selected:{},overrides:{},colors:{},chartType:{}},emits:["update:overrides"],setup(t,{emit:e}){const n=t,o=e;function r(C){return n.overrides.find($=>$.name===C)}function i(){return n.selected.length>0?r(n.selected[0]):void 0}const s=A(()=>n.chartType==="bar-multi"),a=A(()=>n.chartType==="line-multi"),l=A(()=>{var C;return((C=i())==null?void 0:C.color)??"#4e79a7"}),c=A(()=>{var C;return String(((C=i())==null?void 0:C.opacity)??1)}),u=A(()=>{var C;return String(((C=i())==null?void 0:C.lineWidth)??2)}),d=A(()=>{var C;return((C=i())==null?void 0:C.dash)??"solid"}),f=A(()=>{var C;return((C=i())==null?void 0:C.interpolation)??"global"}),h=A(()=>{var C;return((C=i())==null?void 0:C.labelMode)??"global"}),g=A(()=>{var C;return((C=i())==null?void 0:C.valueLabels)??!1}),v=A(()=>{var C;return((C=i())==null?void 0:C.lineSymbols)??!1}),m=A(()=>{var C;return((C=i())==null?void 0:C.symbolShape)??"circle"}),b=A(()=>{var C;return((C=i())==null?void 0:C.symbolShowOn)??"firstLast"}),y=A(()=>{var C;return((C=i())==null?void 0:C.symbolStyle)??"filled"}),x=A(()=>{var C;return String(((C=i())==null?void 0:C.symbolSize)??3.5)}),_=A(()=>{var C;return String(((C=i())==null?void 0:C.symbolOpacity)??1)});function S(C,$){const P=n.overrides.map(M=>({...M}));for(const M of n.selected){let F=P.find(V=>V.name===M);F||(F={name:M},P.push(F)),F[C]=$}o("update:overrides",P)}function N(){if(n.selected.length<2)return;const C=r(n.selected[0]);if(!C)return;const $=n.overrides.map(P=>({...P}));for(let P=1;P<n.selected.length;P++){const M=n.selected[P];let F=$.find(V=>V.name===M);F||(F={name:M},$.push(F)),Object.assign(F,{...C,name:M})}o("update:overrides",$)}function B(){const C=new Set(n.selected),$=n.overrides.filter(P=>!C.has(P.name));o("update:overrides",$)}const k=[{value:"1",text:"1"},{value:"2",text:"2"},{value:"3",text:"3"},{value:"4",text:"4"},{value:"5",text:"5"}],L=[{value:"solid",text:"Solid"},{value:"dotted",text:"Dotted"},{value:"dashed",text:"Dashed"},{value:"dash-dot",text:"Dash-dot"}],E=[{value:"global",text:"Global"},{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}],I=[{value:"global",text:"Global"},{value:"legend",text:"Legend"},{value:"direct",text:"Direct"},{value:"none",text:"None"}];return(C,$)=>{const P=ja,M=Mn,F=KT,V=Ho;return w(),R("div",ede,[H(p(Na),{id:"series-color",label:"Color","model-value":p(l),"onUpdate:modelValue":$[0]||($[0]=G=>S("color",G))},null,8,["model-value"]),H(p(Cn),{label:"Label mode","model-value":p(h),options:I,block:"","onUpdate:modelValue":$[1]||($[1]=G=>S("labelMode",G))},null,8,["model-value"]),H(p(nn),{"model-value":p(g),label:"Value labels","onUpdate:modelValue":$[2]||($[2]=G=>S("valueLabels",G))},null,8,["model-value"]),p(s)?(w(),Q(p(_r),{key:0,id:"series-opacity",label:"Opacity","model-value":p(c),min:"0",max:"1",step:"0.1","onUpdate:modelValue":$[3]||($[3]=G=>S("opacity",Number(G)))},null,8,["model-value"])):se("",!0),p(a)?(w(),R(Ge,{key:1},[H(p(Cn),{label:"Line width","model-value":p(u),options:k,"onUpdate:modelValue":$[4]||($[4]=G=>S("lineWidth",Number(G)))},null,8,["model-value"]),H(p(Cn),{label:"Dash style","model-value":p(d),options:L,"onUpdate:modelValue":$[5]||($[5]=G=>S("dash",G))},null,8,["model-value"]),H(M,{label:"Interpolation","label-for":"series-interpolation"},{default:J(()=>[H(P,{id:"series-interpolation","model-value":p(f),options:E,"onUpdate:modelValue":$[6]||($[6]=G=>S("interpolation",G))},null,8,["model-value"])]),_:1}),H(p(nn),{"model-value":p(v),label:"Line symbols","onUpdate:modelValue":$[7]||($[7]=G=>S("lineSymbols",G))},null,8,["model-value"]),p(v)?(w(),Q(F,{key:0,"id-prefix":"series-symbol",shape:p(m),"show-on":p(b),style:Dt(p(y)),size:p(x),opacity:p(_),"onUpdate:shape":$[8]||($[8]=G=>S("symbolShape",G)),"onUpdate:showOn":$[9]||($[9]=G=>S("symbolShowOn",G)),"onUpdate:style":$[10]||($[10]=G=>S("symbolStyle",G)),"onUpdate:size":$[11]||($[11]=G=>S("symbolSize",Number(G))),"onUpdate:opacity":$[12]||($[12]=G=>S("symbolOpacity",Number(G)))},null,8,["shape","show-on","style","size","opacity"])):se("",!0)],64)):se("",!0),T("div",tde,[t.selected.length>1?(w(),Q(V,{key:0,variant:"outline-secondary",size:"sm",onClick:N},{default:J(()=>[...$[13]||($[13]=[Xe(" Copy from first ",-1)])]),_:1})):se("",!0),H(V,{variant:"outline-danger",size:"sm",onClick:B},{default:J(()=>[...$[14]||($[14]=[Xe(" Reset to default ",-1)])]),_:1})])])}}}),ode=le({__name:"EditorSeriesList",props:{seriesNames:{},selected:{},colors:{},overrides:{}},emits:["update:selected","toggleVisibility"],setup(t){const e=t;function n(r,i){return ln(r,i,e.colors,e.overrides)}function o(r){return nl(r,e.overrides)}return(r,i)=>{const s=Hs;return w(),Q(p(Gy),{items:t.seriesNames,selected:t.selected,"onUpdate:selected":i[1]||(i[1]=a=>r.$emit("update:selected",a))},{"item-leading":J(({item:a,index:l})=>[H(p(km),{color:n(a,l)},null,8,["color"])]),"item-actions":J(({item:a})=>[H(s,{"model-value":!o(a),switch:"",size:"sm",onClick:i[0]||(i[0]=gn(()=>{},["stop"])),"onUpdate:modelValue":l=>r.$emit("toggleVisibility",a,!l)},null,8,["model-value","onUpdate:modelValue"])]),_:1},8,["items","selected"])}}}),rde={class:"d-flex flex-column gap-3"},ide=le({__name:"EditorSeriesPanel",setup(t){const{chartType:e,data:n,seriesOverrides:o}=pn(),{currentOptions:r}=kn(),i=ze([]),s=A(()=>{var u;return((u=gs(n.value).series)==null?void 0:u.map(d=>d.name))??[]}),a=A(()=>K$(r.value).colors??["#4e79a7","#f28e2b","#e15759","#76b7b2","#59a14f","#edc948","#b07aa1","#ff9da7"]);function l(c,u){const d=o.value.map(h=>({...h}));let f=d.find(h=>h.name===c);f||(f={name:c},d.push(f)),f.hidden=u,o.value=d}return(c,u)=>{const d=ode,f=nde;return w(),R("div",rde,[u[2]||(u[2]=T("h6",{class:"fw-bold mb-0"}," Series ",-1)),H(d,{"series-names":p(s),selected:p(i),colors:p(a),overrides:p(o),"onUpdate:selected":u[0]||(u[0]=h=>i.value=h),onToggleVisibility:l},null,8,["series-names","selected","colors","overrides"]),p(i).length>0?(w(),Q(p(Md),{key:0,label:"Editing "+p(i).length+" "+(p(i).length===1?"series: "+p(i)[0]:"series")},{default:J(()=>[H(f,{selected:p(i),overrides:p(o),colors:p(a),"chart-type":p(e),"onUpdate:overrides":u[1]||(u[1]=h=>o.value=h)},null,8,["selected","overrides","colors","chart-type"])]),_:1},8,["label"])):se("",!0)])}}}),sde={class:"d-flex flex-column gap-3"},ade={class:"bc-area-stack-options"},lde=le({__name:"EditorAreaSection",setup(t){const{currentOptions:e,setOption:n}=kn(),o=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}],r=[{value:"none",text:"Keep order"},{value:"ascending",text:"Smallest first"},{value:"descending",text:"Largest first"}];return(i,s)=>{const a=ja,l=Mn,c=rE,u=Hs;return w(),R("div",sde,[H(p(_r),{id:"opt-area-opacity","model-value":String(p(e).areaFillOpacity??"0.85"),label:"Opacity",min:"0",max:"1",step:"0.05","onUpdate:modelValue":s[0]||(s[0]=d=>p(n)("areaFillOpacity",d))},null,8,["model-value"]),H(l,{label:"Interpolation","label-for":"opt-area-interpolation"},{default:J(()=>[H(a,{id:"opt-area-interpolation","model-value":p(e).interpolation??"monotoneX",options:o,"onUpdate:modelValue":s[1]||(s[1]=d=>p(n)("interpolation",String(d)))},null,8,["model-value"])]),_:1}),H(l,{label:"Sort areas"},{default:J(()=>[H(c,{"model-value":p(e).areaSortMode??"none",options:r,stacked:"","onUpdate:modelValue":s[2]||(s[2]=d=>p(n)("areaSortMode",String(d)))},null,8,["model-value"])]),_:1}),H(p(nn),{"model-value":p(e).stacked!==!1,label:"Stack areas","onUpdate:modelValue":s[5]||(s[5]=d=>p(n)("stacked",d))},{section:J(()=>[T("div",ade,[H(u,{"model-value":p(e).stackPercent??!1,"onUpdate:modelValue":s[3]||(s[3]=d=>p(n)("stackPercent",d))},{default:J(()=>[...s[6]||(s[6]=[Xe(" Stack to 100% ",-1)])]),_:1},8,["model-value"]),H(u,{"model-value":p(e).areaLines!==!1,"onUpdate:modelValue":s[4]||(s[4]=d=>p(n)("areaLines",d))},{default:J(()=>[...s[7]||(s[7]=[Xe(" Separate areas with lines ",-1)])]),_:1},8,["model-value"])])]),_:1},8,["model-value"])])}}}),cde=Be(lde,[["__scopeId","data-v-3bf56010"]]),ude={class:"d-flex flex-column gap-3"},dde=le({__name:"EditorSliceSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn();function r(i){return n.value.includes(i)}return(i,s)=>{const a=ra,l=Mn;return w(),R("div",ude,[r("displayAsPercentage")?(w(),Q(p(nn),{key:0,"model-value":p(e).displayAsPercentage??!1,label:"Display as percentage","onUpdate:modelValue":s[0]||(s[0]=c=>p(o)("displayAsPercentage",c))},null,8,["model-value"])):se("",!0),r("showTotal")?(w(),Q(p(nn),{key:1,"model-value":p(e).showTotal??!1,label:"Show total","onUpdate:modelValue":s[1]||(s[1]=c=>p(o)("showTotal",c))},null,8,["model-value"])):se("",!0),r("showLabels")?(w(),Q(p(nn),{key:2,"model-value":p(e).showLabels??!0,label:"Show labels","onUpdate:modelValue":s[2]||(s[2]=c=>p(o)("showLabels",c))},null,8,["model-value"])):se("",!0),r("showValues")?(w(),Q(p(nn),{key:3,"model-value":p(e).showValues??!0,label:"Show values","onUpdate:modelValue":s[3]||(s[3]=c=>p(o)("showValues",c))},null,8,["model-value"])):se("",!0),r("sliceMax")?(w(),Q(p(_r),{key:4,id:"opt-sliceMax",label:"Max slices","model-value":p(e).sliceMax??"6",min:"2",max:"20","onUpdate:modelValue":s[4]||(s[4]=c=>p(o)("sliceMax",String(c)))},null,8,["model-value"])):se("",!0),r("sliceGroupLabel")?(w(),Q(l,{key:5,label:"Group label","label-for":"opt-sliceGroupLabel"},{default:J(()=>[H(a,{id:"opt-sliceGroupLabel","model-value":p(e).sliceGroupLabel??"Others",placeholder:"Others","onUpdate:modelValue":s[5]||(s[5]=c=>p(o)("sliceGroupLabel",c))},null,8,["model-value"])]),_:1})):se("",!0)])}}}),fde={class:"d-flex flex-column gap-3"},ek=.15,hde=le({__name:"EditorBarStyleSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("barBackground")),i=A(()=>n.value.includes("barSeparators")),s=A(()=>n.value.includes("barGap")),a=A(()=>n.value.includes("connectedColumns")),l=A(()=>n.value.includes("waterfall")),c=A(()=>n.value.includes("waterfallTotal")),u=A(()=>n.value.includes("categoryLabelLine"));function d(y){return Math.max(0,Math.min(100,y))}const f=A(()=>{const y=parseFloat(e.value.barGap??""),x=isNaN(y)?of:y;return String(d(x))});function h(y){const x=parseFloat(y),_=isNaN(x)?of:x;o("barGap",String(d(_)))}function g(y){const x=parseFloat(y??""),_=isNaN(x)?ek:x,S=Math.max(0,Math.min(1,_));return String(Math.round(S*100))}function v(y){const x=parseFloat(y);if(isNaN(x))return String(ek);const _=Math.max(0,Math.min(100,x));return String(_/100)}const m=A(()=>g(e.value.connectionsOpacity));function b(y){o("connectionsOpacity",v(y))}return(y,x)=>(w(),R("div",fde,[p(r)?(w(),Q(p(nn),{key:0,"model-value":p(e).barBackground??!1,label:"Bar background","onUpdate:modelValue":x[0]||(x[0]=_=>p(o)("barBackground",_))},null,8,["model-value"])):se("",!0),p(i)?(w(),Q(p(nn),{key:1,"model-value":p(e).barSeparators??!1,label:"Bar separators","onUpdate:modelValue":x[1]||(x[1]=_=>p(o)("barSeparators",_))},null,8,["model-value"])):se("",!0),p(s)?(w(),Q(p(_r),{key:2,id:"opt-bar-gap","model-value":p(f),label:"Bar gap",min:"0",max:"100",step:"1",suffix:"%","onUpdate:modelValue":h},null,8,["model-value"])):se("",!0),p(a)?(w(),Q(p(nn),{key:3,"model-value":p(e).connectedColumns??!1,label:"Connected columns","onUpdate:modelValue":x[2]||(x[2]=_=>p(o)("connectedColumns",_))},null,8,["model-value"])):se("",!0),p(a)&&p(e).connectedColumns?(w(),Q(p(_r),{key:4,id:"opt-connections-opacity","model-value":p(m),label:"Opacity",min:"0",max:"100",step:"1",suffix:"%","onUpdate:modelValue":b},null,8,["model-value"])):se("",!0),p(l)?(w(),Q(p(nn),{key:5,"model-value":p(e).waterfall??!1,label:"Waterfall","onUpdate:modelValue":x[3]||(x[3]=_=>p(o)("waterfall",_))},null,8,["model-value"])):se("",!0),p(c)&&p(e).waterfall?(w(),Q(p(nn),{key:6,"model-value":p(e).waterfallTotal??!1,label:"Waterfall total","onUpdate:modelValue":x[4]||(x[4]=_=>p(o)("waterfallTotal",_))},null,8,["model-value"])):se("",!0),p(u)?(w(),Q(p(nn),{key:7,"model-value":p(e).categoryLabelLine??!1,label:"Labels on separate line","onUpdate:modelValue":x[5]||(x[5]=_=>p(o)("categoryLabelLine",_))},null,8,["model-value"])):se("",!0)]))}}),pde={class:"d-flex flex-column gap-3"},mde=le({__name:"EditorLineSymbols",setup(t){const{currentOptions:e,setOption:n}=kn();return(o,r)=>{const i=KT;return w(),R("div",pde,[H(p(nn),{"model-value":p(e).lineSymbols??!1,label:"Show line symbols","onUpdate:modelValue":r[0]||(r[0]=s=>p(n)("lineSymbols",s))},null,8,["model-value"]),p(e).lineSymbols?(w(),Q(i,{key:0,"id-prefix":"opt-line-symbol",shape:p(e).lineSymbolShape??"circle","show-on":p(e).lineSymbolShowOn??"firstLast",style:Dt(p(e).lineSymbolStyle??"filled"),size:p(e).lineSymbolSize??"3.5",opacity:p(e).lineSymbolOpacity??"1","onUpdate:shape":r[1]||(r[1]=s=>p(n)("lineSymbolShape",s)),"onUpdate:showOn":r[2]||(r[2]=s=>p(n)("lineSymbolShowOn",s)),"onUpdate:style":r[3]||(r[3]=s=>p(n)("lineSymbolStyle",s)),"onUpdate:size":r[4]||(r[4]=s=>p(n)("lineSymbolSize",s)),"onUpdate:opacity":r[5]||(r[5]=s=>p(n)("lineSymbolOpacity",s))},null,8,["shape","show-on","style","size","opacity"])):se("",!0)])}}}),gde={class:"d-flex flex-column gap-3"},vde=le({__name:"EditorLineSection",setup(t){const{currentOptions:e,availableOptionKeys:n,setOption:o}=kn(),r=A(()=>n.value.includes("interpolation")),i=A(()=>n.value.includes("edgePadding")),s=A(()=>n.value.includes("lineSymbols")),a=[{value:"linear",text:"Linear"},{value:"monotoneX",text:"Monotone"},{value:"step",text:"Step"},{value:"stepBefore",text:"Step (before)"},{value:"stepAfter",text:"Step (after)"},{value:"basis",text:"Basis"},{value:"cardinal",text:"Cardinal"},{value:"catmullRom",text:"Catmull-Rom"}];return(l,c)=>{const u=ja,d=Mn,f=mde;return w(),R("div",gde,[p(r)?(w(),Q(d,{key:0,label:"Line interpolation","label-for":"opt-interpolation"},{default:J(()=>[H(u,{id:"opt-interpolation","model-value":p(e).interpolation??"linear",options:a,"onUpdate:modelValue":c[0]||(c[0]=h=>p(o)("interpolation",h))},null,8,["model-value"])]),_:1})):se("",!0),p(i)?(w(),Q(p(nn),{key:1,"model-value":p(e).edgePadding??!1,label:"Edge padding","onUpdate:modelValue":c[1]||(c[1]=h=>p(o)("edgePadding",h))},null,8,["model-value"])):se("",!0),p(s)?(w(),Q(f,{key:2})):se("",!0)])}}}),bde={class:"d-flex flex-column gap-3"},yde=le({__name:"EditorBarAppearance",props:{labels:{},colorizes:{},baseColor:{}},emits:["update:colorizes","update:baseColor"],setup(t,{emit:e}){const n=t,o=e,r=ze([]),i=Fe(n.colorizes.length>0),s=A(()=>{const h=new Map;for(const g of n.colorizes)h.set(g.target,g.color);return h});function a(h){return s.value.get(h)??n.baseColor}const l=A(()=>r.value.length===0?n.baseColor:s.value.get(r.value[0])??n.baseColor);function c(h,g,v){v.ctrlKey||v.metaKey?r.value.indexOf(h)>=0?r.value=r.value.filter(b=>b!==h):r.value=[...r.value,h]:r.value.length===1&&r.value[0]===h?r.value=[]:r.value=[h]}function u(h){const g=new Map(n.colorizes.map(v=>[v.target,v]));for(const v of r.value)g.set(v,{target:v,color:h,label:""});o("update:colorizes",[...g.values()])}function d(){o("update:colorizes",[]),r.value=[]}function f(h){i.value=h,h||(o("update:colorizes",[]),r.value=[])}return(h,g)=>(w(),R("div",bde,[H(p(Na),{id:"bar-base-color",label:"Base color","model-value":t.baseColor,"onUpdate:modelValue":g[0]||(g[0]=v=>h.$emit("update:baseColor",v))},null,8,["model-value"]),H(p(nn),{"model-value":p(i),label:"Customize colors","onUpdate:modelValue":f},null,8,["model-value"]),p(i)?(w(),R(Ge,{key:0},[H(p(Gy),{items:t.labels,selected:p(r),"on-item-click":c,"onUpdate:selected":g[1]||(g[1]=v=>r.value=v)},{"item-leading":J(({item:v})=>[H(p(km),{color:a(v)},null,8,["color"])]),_:1},8,["items","selected"]),p(r).length>0?(w(),Q(p(Md),{key:0,label:"Editing "+p(r).length+" "+(p(r).length===1?"label":"labels")},{default:J(()=>[H(p(Na),{id:"bar-highlight-color",label:"Color for selected","model-value":p(l),"onUpdate:modelValue":u},null,8,["model-value"]),t.colorizes.length>0?(w(),Q(p(Ho),{key:0,variant:"outline-danger",size:"sm",onClick:d},{default:J(()=>[...g[2]||(g[2]=[Xe(" Reset all changes ",-1)])]),_:1})):se("",!0)]),_:1},8,["label"])):se("",!0)],64)):se("",!0)]))}}),xde=Lo("cvdMode",()=>({cvdMode:Fe("")}));function ZT(){const t=xde(),{cvdMode:e}=Mt(t);return{cvdMode:e}}const wde="#ffffff",_de="#1a1a1a",kde={protanopia:"Protan",deuteranopia:"Deutan",tritanopia:"Tritan"};function tk(t,e,n){const r=(n?c$(t,e):t).map(s=>Ste(s,e)),i=Math.min(...r);return{level:Ate(i),ratio:`${i.toFixed(1)}:1`}}function Sde(t,e,n){const o=A(()=>{const s=yt(t);return s.length===0?null:tk(s,wde,yt(e))}),r=A(()=>{const s=yt(t);return s.length===0||!yt(n)?null:tk(s,_de,yt(e))}),i=A(()=>{const s=yt(t);if(s.length===0)return null;const a=s.length>=2?moe(s):[];return a.length===0?{safe:!0,issues:[]}:{safe:!1,issues:a.map(l=>({type:l.type,shortLabel:kde[l.type],tooltip:`${l.label}: ${l.pairs.length} color ${l.pairs.length===1?"pair":"pairs"} may be hard to distinguish.`}))}});return{lightContrastInfo:o,darkContrastInfo:r,cvdInfo:i}}const Ade={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#2563A0" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#D4A63A" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#C94044" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Cde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#4767a2" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#baa62a" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#655e43" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},$de={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#345b9f" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#c5b23f" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#887c40" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Tde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="5.30" y="9.00" width="11.22" height="25.00" fill="#00717a" rx="0.5"/><rect x="17.77" y="14.00" width="11.22" height="20.00" fill="#e69790" rx="0.5"/><rect x="30.23" y="4.00" width="11.22" height="30.00" fill="#dc1a43" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Mde={class:"d-flex flex-column gap-3"},Ode={key:4,class:"d-flex align-items-center gap-2"},Bde={key:5,class:"d-flex align-items-center gap-2"},Lde={key:6,class:"d-flex align-items-center gap-2"},Pde=le({__name:"EditorColorSection",setup(t){const{chartType:e,data:n,colorizes:o}=pn(),{currentOptions:r,availableOptionKeys:i,setOption:s}=kn(),{cvdMode:a}=Mt(ZT()),l=A(()=>[Le.BarVertical,Le.BarHorizontal,Le.VerticalBar,Le.HorizontalBar].includes(e.value)),c=A(()=>i.value.includes("colors")),u=A(()=>i.value.includes("colorPalette")),d=A(()=>gs(n.value)),f=A(()=>d.value.labels),h=A(()=>{const L=r.value.colorPalette;return L?r5(L)??[]:r.value.colors??[]}),g=A(()=>h.value[0]??"#4e79a7");function v(L){r.value.colorPalette&&s("colorPalette",""),s("colors",[L])}const m=A(()=>{if(l.value){const L=o.value.map(I=>I.color),E=g.value;return L.length>0?[E,...L]:[E]}return h.value}),{lightContrastInfo:b,darkContrastInfo:y,cvdInfo:x}=Sde(m,()=>!!r.value.autoContrast,()=>r.value.allowDarkMode??!0),_=mt("cvdSafeBadgeRef"),S=mt("cvdBadgeRefs");function N(L){var I;const E=((I=x.value)==null?void 0:I.issues.findIndex(C=>C.type===L))??-1;return E>=0?S.value[E]:void 0}const B=[{value:"",text:"None",description:"Normal color vision",visual:Me(Ade)},{value:"protanopia",text:"Protanopia",description:"No red cones (1% of males)",visual:Me(Cde)},{value:"deuteranopia",text:"Deuteranopia",description:"No green cones (1% of males)",visual:Me($de)},{value:"tritanopia",text:"Tritanopia",description:"No blue cones (very rare)",visual:Me(Tde)}],k=[{value:"",label:"Custom",colors:[]},...i5().map(L=>({value:L.name,label:L.label,colors:[...L.colors]}))];return(L,E)=>{const I=yde;return w(),R("div",Mde,[p(l)?(w(),Q(I,{key:0,labels:p(f),colorizes:p(o),"base-color":p(g),"onUpdate:colorizes":E[0]||(E[0]=C=>o.value=C),"onUpdate:baseColor":v},null,8,["labels","colorizes","base-color"])):(w(),R(Ge,{key:1},[p(u)?(w(),Q(p(bV),{key:0,id:"opt-palette",label:"Color palette","model-value":p(r).colorPalette??"",palettes:k,"onUpdate:modelValue":E[1]||(E[1]=C=>p(s)("colorPalette",C))},null,8,["model-value"])):se("",!0),p(c)&&!p(r).colorPalette?(w(),Q(p(WF),{key:1,id:"opt-colors",label:"Colors","model-value":p(r).colors??[],"onUpdate:modelValue":E[2]||(E[2]=C=>p(s)("colors",C))},null,8,["model-value"])):se("",!0)],64)),p(u)||p(c)?(w(),Q(p(nn),{key:2,id:"opt-allow-dark-mode",label:"Allow dark mode","model-value":p(r).allowDarkMode??!0,"onUpdate:modelValue":E[3]||(E[3]=C=>p(s)("allowDarkMode",C))},null,8,["model-value"])):se("",!0),p(u)||p(c)?(w(),Q(p(nn),{key:3,id:"opt-auto-contrast",label:"Auto-adjust contrast","model-value":p(r).autoContrast??!1,"onUpdate:modelValue":E[4]||(E[4]=C=>p(s)("autoContrast",C))},null,8,["model-value"])):se("",!0),p(b)?(w(),R("div",Ode,[E[6]||(E[6]=T("span",{class:"form-label mb-0"},"Light contrast",-1)),H(p(a8),{level:p(b).level,ratio:p(b).ratio},null,8,["level","ratio"])])):se("",!0),p(y)?(w(),R("div",Bde,[E[7]||(E[7]=T("span",{class:"form-label mb-0"},"Dark contrast",-1)),H(p(a8),{level:p(y).level,ratio:p(y).ratio},null,8,["level","ratio"])])):se("",!0),p(x)?(w(),R("div",Lde,[E[9]||(E[9]=T("span",{class:"form-label mb-0"},"Colorblind",-1)),p(x).safe?(w(),R("span",{key:0,ref_key:"cvdSafeBadgeRef",ref:_,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--safe"},[H(p(Dy)),E[8]||(E[8]=Xe(" Safe ",-1)),H(p(L1),{class:"editor-color-section__cvd-badge__info"}),H(p(jd),{"teleport-to":"body",target:p(_),title:"All colors remain distinguishable under protanopia, deuteranopia, and tritanopia simulations.",placement:"top"},null,8,["target"])],512)):(w(!0),R(Ge,{key:1},gt(p(x).issues,C=>(w(),R("span",{key:C.type,ref_for:!0,ref_key:"cvdBadgeRefs",ref:S,class:"editor-color-section__cvd-badge editor-color-section__cvd-badge--warn"},[H(p(XT)),Xe(" "+be(C.shortLabel)+" ",1),H(p(L1),{class:"editor-color-section__cvd-badge__info"}),H(p(jd),{"teleport-to":"body",target:()=>N(C.type),title:C.tooltip,placement:"top"},null,8,["target","title"])]))),128))])):se("",!0),H(p(Cn),{modelValue:p(a),"onUpdate:modelValue":E[5]||(E[5]=C=>Ze(a)?a.value=C:null),label:"Colorblind simulation",options:B,block:""},null,8,["modelValue"])])}}}),Dde=Be(Pde,[["__scopeId","data-v-bbe9fd0a"]]),Ede=le({__name:"EditorThemeSection",setup(t){const{chartTheme:e,availableThemes:n}=uT();return(o,r)=>(w(),Q(p(Nn),{modelValue:p(e),"onUpdate:modelValue":r[0]||(r[0]=i=>Ze(e)?e.value=i:null),label:"Chart Theme",options:p(n),block:""},null,8,["modelValue","options"]))}}),Nde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Ide(t,e){return w(),R("svg",Nde,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M238.64 33.36a32 32 0 0 0-45.26 0a32 32 0 0 0 0 45.26c.29.29.6.57.9.85l-26.63 49.46a32.2 32.2 0 0 0-23.9 3.5l-20.18-20.18a32 32 0 0 0-50.2-38.89a32 32 0 0 0 0 45.26c.29.29.59.57.89.85l-26.63 49.47a32 32 0 0 0-30.27 8.44a32 32 0 1 0 45.26 0c-.29-.29-.6-.57-.9-.85l26.63-49.46A32.4 32.4 0 0 0 96 128a32 32 0 0 0 16.25-4.41l20.18 20.18a32 32 0 1 0 50.2-6.38c-.29-.29-.59-.57-.89-.85l26.63-49.46A32.3 32.3 0 0 0 216 88a32 32 0 0 0 22.63-54.62ZM51.3 211.33a16 16 0 0 1-22.63-22.64a16 16 0 1 1 22.63 22.64m33.38-104a16 16 0 0 1 0-22.63a16 16 0 1 1 0 22.63m86.64 64a16 16 0 0 1-22.63-22.63a16 16 0 0 1 22.63 22.63m56-104a16 16 0 1 1-22.62-22.66a16 16 0 0 1 22.63 22.64Z"},null,-1)])])}const Rde=Me({name:"ph-line-segments",render:Ide}),Fde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Vde(t,e){return w(),R("svg",Fde,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 32a8 8 0 0 0-8-8c-44.08 0-89.31 49.71-114.43 82.63A60 60 0 0 0 32 164c0 30.88-19.54 44.73-20.47 45.37A8 8 0 0 0 16 224h76a60 60 0 0 0 57.37-77.57C182.3 121.31 232 76.08 232 32M92 208H34.63C41.38 198.41 48 183.92 48 164a44 44 0 1 1 44 44m32.42-94.45q5.14-6.66 10.09-12.55A76.2 76.2 0 0 1 155 121.49q-5.9 4.94-12.55 10.09a60.5 60.5 0 0 0-18.03-18.03m42.7-2.68a92.6 92.6 0 0 0-22-22c31.78-34.53 55.75-45 69.9-47.91c-2.85 14.16-13.37 38.13-47.9 69.91"},null,-1)])])}const zde=Me({name:"ph-paint-brush",render:Vde}),Hde={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Wde(t,e){return w(),R("svg",Hde,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M232 208a8 8 0 0 1-8 8H32a8 8 0 0 1-8-8V48a8 8 0 0 1 16 0v94.37L90.73 98a8 8 0 0 1 10.07-.38l58.81 44.11L218.73 90a8 8 0 1 1 10.54 12l-64 56a8 8 0 0 1-10.07.38l-58.81-44.09L40 163.63V200h184a8 8 0 0 1 8 8"},null,-1)])])}const Ude=Me({name:"ph-chart-line",render:Wde}),Gde={class:"d-flex flex-column gap-4"},qde=le({__name:"EditorAppearanceTab",setup(t){const{chartType:e}=pn(),{availableOptionKeys:n}=kn(),o=A(()=>e.value.includes("horizontal")||e.value===Le.BarStacked||e.value===Le.BarSplit||e.value===Le.BarGrouped?ad:Ns),r=A(()=>n.value.includes("stacked")),i=A(()=>n.value.includes("interpolation")||n.value.includes("lineSymbols")),s=A(()=>!r.value&&i.value),a=A(()=>n.value.includes("barBackground")||n.value.includes("barSeparators")||n.value.includes("barGap")||n.value.includes("connectedColumns")||n.value.includes("categoryLabelLine")),l=A(()=>n.value.includes("displayAsPercentage"));return(c,u)=>{const d=Ede,f=Dde,h=vde,g=hde,v=dde,m=cde;return w(),R("div",Gde,[H(p(zo),{title:"Theme",icon:p(zde)},{default:J(()=>[H(d)]),_:1},8,["icon"]),H(p(zo),{title:"Colors",icon:p(HT)},{default:J(()=>[H(f)]),_:1},8,["icon"]),p(s)?(w(),Q(p(zo),{key:0,title:"Line Style",icon:p(Rde)},{default:J(()=>[H(h)]),_:1},8,["icon"])):se("",!0),p(a)?(w(),Q(p(zo),{key:1,title:"Bar Style",icon:p(o)},{default:J(()=>[H(g)]),_:1},8,["icon"])):se("",!0),p(l)?(w(),Q(p(zo),{key:2,title:"Slices",icon:p(WA)},{default:J(()=>[H(v)]),_:1},8,["icon"])):se("",!0),p(r)?(w(),Q(p(zo),{key:3,title:"Areas",icon:p(Ude)},{default:J(()=>[H(m)]),_:1},8,["icon"])):se("",!0)])}}}),Yde={class:"d-flex flex-column gap-3"},jde=le({__name:"EditorPropertyForm",setup(t){const{title:e,description:n,byline:o,note:r,source:i,sourceUrl:s}=pn();return(a,l)=>{const c=ra,u=Mn,d=$y;return w(),R("div",Yde,[H(u,{label:"Title","label-for":"prop-title"},{default:J(()=>[H(c,{id:"prop-title",modelValue:p(e),"onUpdate:modelValue":l[0]||(l[0]=f=>Ze(e)?e.value=f:null),placeholder:"Chart title"},null,8,["modelValue"])]),_:1}),H(u,{label:"Description","label-for":"prop-description"},{default:J(()=>[H(d,{id:"prop-description",modelValue:p(n),"onUpdate:modelValue":l[1]||(l[1]=f=>Ze(n)?n.value=f:null),placeholder:"Short description",rows:"2","max-rows":"5"},null,8,["modelValue"])]),_:1}),H(u,{label:"Byline","label-for":"prop-byline"},{default:J(()=>[H(c,{id:"prop-byline",modelValue:p(o),"onUpdate:modelValue":l[2]||(l[2]=f=>Ze(o)?o.value=f:null),placeholder:"Author or byline"},null,8,["modelValue"])]),_:1}),H(u,{label:"Note","label-for":"prop-note"},{default:J(()=>[H(d,{id:"prop-note",modelValue:p(r),"onUpdate:modelValue":l[3]||(l[3]=f=>Ze(r)?r.value=f:null),placeholder:"Additional note or caveat",rows:"2","max-rows":"4"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source","label-for":"prop-source"},{default:J(()=>[H(c,{id:"prop-source",modelValue:p(i),"onUpdate:modelValue":l[4]||(l[4]=f=>Ze(i)?i.value=f:null),placeholder:"Data source"},null,8,["modelValue"])]),_:1}),H(u,{label:"Source URL","label-for":"prop-source-url"},{default:J(()=>[H(c,{id:"prop-source-url",modelValue:p(s),"onUpdate:modelValue":l[5]||(l[5]=f=>Ze(s)?s.value=f:null),type:"url",placeholder:"https://..."},null,8,["modelValue"])]),_:1})])}}}),QT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.466666666666666" y="20.666666666666668" width="11.733333333333334" height="13.333333333333332" fill="#2563A0" rx="0.5"/><rect x="18.13333333333333" y="4" width="11.733333333333334" height="30" fill="#2563A0" rx="0.5"/><rect x="32.8" y="14" width="11.733333333333334" height="20" fill="#2563A0" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},JT={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2.8" width="26.727272727272727" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="10.8" width="42" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="18.8" width="17.181818181818183" height="6.4" fill="#2563A0" rx="0.5"/><rect x="2" y="26.8" width="34.36363636363637" height="6.4" fill="#2563A0" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},eM={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.65" y="17.64" width="5.61" height="16.36" fill="#2563A0" rx="0.5"/><rect x="9.88" y="23.09" width="5.61" height="10.91" fill="#D4A63A" rx="0.5"/><rect x="16.12" y="13.55" width="5.61" height="20.45" fill="#C94044" rx="0.5"/><rect x="25.65" y="9.45" width="5.61" height="24.55" fill="#2563A0" rx="0.5"/><rect x="31.88" y="4.00" width="5.61" height="30.00" fill="#D4A63A" rx="0.5"/><rect x="38.12" y="20.36" width="5.61" height="13.64" fill="#C94044" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},tM={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><polyline points="2.00,32.00 10.80,21.50 19.60,26.75 28.40,11.00 37.20,16.25 46.00,4.00" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},nM={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><polyline points="2.00,32.00 13.00,20.00 24.00,26.00 35.00,8.00 46.00,14.00" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><polyline points="2.00,12.00 13.00,18.00 24.00,4.00 35.00,22.00 46.00,8.00" fill="none" stroke="#D4A63A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><polyline points="2.00,24.00 13.00,16.00 24.00,20.00 35.00,10.00 46.00,4.00" fill="none" stroke="#C94044" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},Xde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><path d="M 2.00,22.67 L 13.00,10.22 L 24.00,16.44 L 35.00,4.00 L 46.00,13.33 L 46.00,34 L 2.00,34 Z" fill="#2563A0" opacity="0.3"/><polyline points="2.00,22.67 13.00,10.22 24.00,16.44 35.00,4.00 46.00,13.33" fill="none" stroke="#2563A0" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',style:"width:100%;height:100%"})}},Kde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><path d="M 2.00,16.92 L 13.00,8.31 L 24.00,12.62 L 35.00,4.00 L 46.00,12.62 L 46.00,23.38 L 35.00,16.92 L 24.00,21.23 L 13.00,19.08 L 2.00,23.38 Z" fill="#D4A63A" opacity="0.7"/><path d="M 2.00,23.38 L 13.00,19.08 L 24.00,21.23 L 35.00,16.92 L 46.00,23.38 L 46.00,34 L 35.00,34 L 24.00,34 L 13.00,34 L 2.00,34 Z" fill="#2563A0" opacity="0.7"/></svg>',style:"width:100%;height:100%"})}},Zde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="3.10" y="24.77" width="8.80" height="9.23" fill="#2563A0" rx="0.5"/><rect x="3.10" y="17.85" width="8.80" height="6.92" fill="#D4A63A" rx="0.5"/><rect x="14.10" y="20.15" width="8.80" height="13.85" fill="#2563A0" rx="0.5"/><rect x="14.10" y="8.62" width="8.80" height="11.54" fill="#D4A63A" rx="0.5"/><rect x="25.10" y="22.46" width="8.80" height="11.54" fill="#2563A0" rx="0.5"/><rect x="25.10" y="13.23" width="8.80" height="9.23" fill="#D4A63A" rx="0.5"/><rect x="36.10" y="17.85" width="8.80" height="16.15" fill="#2563A0" rx="0.5"/><rect x="36.10" y="4.00" width="8.80" height="13.85" fill="#D4A63A" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Qde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2.00" y="2.80" width="12.92" height="6.40" fill="#2563A0" rx="0.5"/><rect x="14.92" y="2.80" width="9.69" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="10.80" width="19.38" height="6.40" fill="#2563A0" rx="0.5"/><rect x="21.38" y="10.80" width="16.15" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="18.80" width="16.15" height="6.40" fill="#2563A0" rx="0.5"/><rect x="18.15" y="18.80" width="12.92" height="6.40" fill="#D4A63A" rx="0.5"/><rect x="2.00" y="26.80" width="22.62" height="6.40" fill="#2563A0" rx="0.5"/><rect x="24.62" y="26.80" width="19.38" height="6.40" fill="#D4A63A" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},Jde={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2.00" y="2.80" width="12.08" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="10.80" width="9.17" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="18.80" width="5.83" height="6.40" fill="#6878E8" rx="0.5"/><rect x="2.00" y="26.80" width="4.17" height="6.40" fill="#6878E8" rx="0.5"/><rect x="17.33" y="2.80" width="13.33" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="10.80" width="10.42" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="18.80" width="6.67" height="6.40" fill="#E07B38" rx="0.5"/><rect x="17.33" y="26.80" width="5.00" height="6.40" fill="#E07B38" rx="0.5"/><rect x="32.67" y="2.80" width="11.25" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="10.80" width="8.33" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="18.80" width="5.00" height="6.40" fill="#B83B5E" rx="0.5"/><rect x="32.67" y="26.80" width="3.33" height="6.40" fill="#B83B5E" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},efe={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 48 36" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2.60" width="38.06" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="4.87" width="28.88" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="7.13" width="18.38" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="10.60" width="42.00" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="12.87" width="32.81" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="15.13" width="21.00" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="18.60" width="35.44" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="20.87" width="26.25" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="23.13" width="15.75" height="2.04" fill="#B83B5E" rx="0.5"/><rect x="2" y="26.60" width="15.75" height="2.04" fill="#6878E8" rx="0.5"/><rect x="2" y="28.87" width="10.50" height="2.04" fill="#E07B38" rx="0.5"/><rect x="2" y="31.13" width="6.56" height="2.04" fill="#B83B5E" rx="0.5"/></svg>',style:"width:100%;height:100%"})}},oM={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M 20.000 2.000 A 18 18 0 0 1 34.562 30.580 L 28.737 26.348 A 10.799999999999999 10.799999999999999 0 0 0 20.000 9.200 Z" fill="#2563A0"/><path d="M 34.562 30.580 A 18 18 0 0 1 9.420 34.562 L 13.652 28.737 A 10.799999999999999 10.799999999999999 0 0 0 28.737 26.348 Z" fill="#D4A63A"/><path d="M 9.420 34.562 A 18 18 0 0 1 3.713 12.336 L 10.228 15.402 A 10.799999999999999 10.799999999999999 0 0 0 13.652 28.737 Z" fill="#C94044"/><path d="M 3.713 12.336 A 18 18 0 0 1 20.000 2.000 L 20.000 9.200 A 10.799999999999999 10.799999999999999 0 0 0 10.228 15.402 Z" fill="#2D8659"/></svg>',style:"width:100%;height:100%"})}},rM={render(){return Vt("div",{innerHTML:'<svg viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M 20 20 L 20.000 2.000 A 18 18 0 0 1 34.562 30.580 Z" fill="#2563A0"/><path d="M 20 20 L 34.562 30.580 A 18 18 0 0 1 9.420 34.562 Z" fill="#D4A63A"/><path d="M 20 20 L 9.420 34.562 A 18 18 0 0 1 3.713 12.336 Z" fill="#C94044"/><path d="M 20 20 L 3.713 12.336 A 18 18 0 0 1 20.000 2.000 Z" fill="#2D8659"/></svg>',style:"width:100%;height:100%"})}},tfe=le({__name:"EditorChartTypePicker",setup(t){const{chartType:e,selectedColumn:n}=pn(),{currentOptions:o,availableOptionKeys:r,setOption:i}=kn(),s=Ko(),a=A(()=>r.value.includes("stackMode")),l=[{value:"normal",text:"Normal"},{value:"percent",text:"Percentage (100%)"}],c=[{value:Le.BarVertical,label:"Columns",description:"Compare values across categories",visual:Me(QT)},{value:Le.BarHorizontal,label:"Bars",description:"Compare values with long labels",visual:Me(JT)},{value:Le.BarMulti,label:"Grouped Columns",description:"Compare multiple series side by side",visual:Me(eM)},{value:Le.ColumnStacked,label:"Stacked Columns",description:"Compare stacked totals",visual:Me(Zde)},{value:Le.BarStacked,label:"Stacked Bars",description:"Compare stacked totals horizontally",visual:Me(Qde)},{value:Le.BarSplit,label:"Split Bars",description:"Compare multiple metrics in separate bar panels",visual:Me(Jde)},{value:Le.BarGrouped,label:"Grouped Bars",description:"Compare multiple series side by side horizontally",visual:Me(efe)},{value:Le.Line,label:"Line",description:"Show trends over time",visual:Me(tM)},{value:Le.LineMulti,label:"Lines",description:"Compare trends across series",visual:Me(nM)},{value:Le.Area,label:"Area",description:"Show magnitude over time",visual:Me(Xde)},{value:Le.AreaStacked,label:"Areas",description:"Compare and stack multiple area series",visual:Me(Kde)},{value:Le.Donut,label:"Donut",description:"Show proportions with a center space",visual:Me(oM)},{value:Le.Pie,label:"Pie",description:"Show parts of a whole",visual:Me(rM)}],u=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.Area,Le.VerticalBar,Le.HorizontalBar],d=A(()=>u.includes(e.value)&&s.columns.value.length>2),f=A(()=>s.columns.value.slice(1).map(h=>({value:h,text:h})));return je([e,()=>s.columns.value],()=>{d.value&&!n.value&&s.columns.value.length>2&&(n.value=s.columns.value[1])},{immediate:!0}),(h,g)=>{const v=Mn,m=ja;return w(),R(Ge,null,[H(v,{label:"Chart type","label-for":"chart-type-select"},{default:J(()=>[H(p(Nn),{id:"chart-type-select",modelValue:p(e),"onUpdate:modelValue":g[0]||(g[0]=b=>Ze(e)?e.value=b:null),block:"",options:c},null,8,["modelValue"])]),_:1}),p(d)?(w(),Q(v,{key:0,label:"Data column","label-for":"column-select",class:"mt-3"},{default:J(()=>[H(m,{id:"column-select",modelValue:p(n),"onUpdate:modelValue":g[1]||(g[1]=b=>Ze(n)?n.value=b:null),options:p(f)},null,8,["modelValue","options"])]),_:1})):se("",!0),p(a)?(w(),Q(v,{key:1,label:"Stack mode","label-for":"opt-stack-mode",class:"mt-3"},{default:J(()=>[H(m,{id:"opt-stack-mode","model-value":p(o).stackMode??"normal",options:l,"onUpdate:modelValue":g[2]||(g[2]=b=>p(i)("stackMode",b))},null,8,["model-value"])]),_:1})):se("",!0)],64)}}}),nfe=100,ofe=Lo("chartHistory",()=>{const t=new Map,e=Fe(!1),n=Fe(!1);let o="",r=!1,i=!1;function s(d){let f=t.get(d);return f||(f={undoStack:[],redoStack:[],currentState:""},t.set(d,f)),f}function a(d,f){const h={config:{chartType:d.chartType,title:d.title,description:d.description,byline:d.byline,note:d.note,source:d.source,sourceUrl:d.sourceUrl,sort:d.sort,data:d.data,selectedColumn:d.selectedColumn,colorizes:JSON.parse(JSON.stringify(d.colorizes)),highlights:JSON.parse(JSON.stringify(d.highlights)),areaFills:JSON.parse(JSON.stringify(d.areaFills)),annotations:JSON.parse(JSON.stringify(d.annotations)),seriesOverrides:JSON.parse(JSON.stringify(d.seriesOverrides??[])),layout:JSON.parse(JSON.stringify(d.layout??lf))},typeOptions:JSON.parse(JSON.stringify(f))};return JSON.stringify(h)}function l(){const d=t.get(o);e.value=d?d.undoStack.length>0:!1,n.value=d?d.redoStack.length>0:!1}function c(d){const f=s(o);d!==f.currentState&&(f.undoStack.push(f.currentState),f.undoStack.length>nfe&&f.undoStack.shift(),f.redoStack.length=0,f.currentState=d,l())}function u(){const d=pn(),{store:f,hydrate:h}=kn(),{sessionId:g}=Qs();function v(){return a({chartType:d.chartType.value,title:d.title.value,description:d.description.value,byline:d.byline.value,note:d.note.value,source:d.source.value,sourceUrl:d.sourceUrl.value,sort:d.sort.value,data:d.data.value,selectedColumn:d.selectedColumn.value,colorizes:d.colorizes.value,highlights:d.highlights.value,areaFills:d.areaFills.value,annotations:d.annotations.value,seriesOverrides:d.seriesOverrides.value,layout:d.layout.value},f)}i||(i=!0,Y0(!0).run(()=>{je(g,_=>{if(r=!0,o=_,_){const S=s(_);S.currentState||(S.currentState=v())}l(),wn(()=>{r=!1})},{immediate:!0,flush:"sync"}),je([d.chartType,d.title,d.description,d.byline,d.note,d.source,d.sourceUrl,d.sort,d.data,d.selectedColumn,d.colorizes,d.highlights,d.areaFills,d.annotations,d.layout,()=>JSON.stringify(f)],()=>{r||!o||c(v())},{deep:!0})}));function m(x){r=!0;const _=JSON.parse(x);d.hydrate(_.config),h(_.typeOptions),wn(()=>{r=!1})}function b(){const x=t.get(o);!x||x.undoStack.length===0||(x.redoStack.push(x.currentState),x.currentState=x.undoStack.pop(),l(),m(x.currentState))}function y(){const x=t.get(o);!x||x.redoStack.length===0||(x.undoStack.push(x.currentState),x.currentState=x.redoStack.pop(),l(),m(x.currentState))}return{undo:b,redo:y}}return{canUndo:A(()=>e.value),canRedo:A(()=>n.value),init:u}});function rfe(){const t=ofe(),{canUndo:e,canRedo:n}=Mt(t),{undo:o,redo:r}=t.init();return{canUndo:e,canRedo:n,undo:o,redo:r}}const ife={class:"chart-edit-toolbar"},sfe=le({__name:"ChartEditToolbar",setup(t){const e=dr(),{viewMode:n}=Mt(e),{setViewMode:o}=e,{canUndo:r,canRedo:i,undo:s,redo:a}=rfe(),l=A({get:()=>n.value,set:u=>o(u)}),c=[{value:"preview",text:"Preview"},{value:"dsl",text:"DSL"}];return(u,d)=>(w(),R("div",ife,[H(p(NW),{disabled:!p(r),onClick:p(s)},null,8,["disabled","onClick"]),H(p(LW),{disabled:!p(i),onClick:p(a)},null,8,["disabled","onClick"]),H(p(dU),{modelValue:p(l),"onUpdate:modelValue":d[0]||(d[0]=f=>Ze(l)?l.value=f:null),options:c,size:"sm"},null,8,["modelValue"])]))}}),afe=Be(sfe,[["__scopeId","data-v-de044834"]]);let db=[],iM=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?iM:db).push(n=n+t[e])})();function lfe(t){if(t<768)return!1;for(let e=0,n=db.length;;){let o=e+n>>1;if(t<db[o])n=o;else if(t>=iM[o])e=o+1;else return!0;if(e==n)return!1}}function nk(t){return t>=127462&&t<=127487}const ok=8205;function cfe(t,e,n=!0,o=!0){return(n?sM:ufe)(t,e,o)}function sM(t,e,n){if(e==t.length)return e;e&&aM(t.charCodeAt(e))&&lM(t.charCodeAt(e-1))&&e--;let o=Pv(t,e);for(e+=rk(o);e<t.length;){let r=Pv(t,e);if(o==ok||r==ok||n&&lfe(r))e+=rk(r),o=r;else if(nk(r)){let i=0,s=e-2;for(;s>=0&&nk(Pv(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function ufe(t,e,n){for(;e>0;){let o=sM(t,e-2,n);if(o<e)return o;e--}return 0}function Pv(t,e){let n=t.charCodeAt(e);if(!lM(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return aM(o)?(n-55296<<10)+(o-56320)+65536:n}function aM(t){return t>=56320&&t<57344}function lM(t){return t>=55296&&t<56320}function rk(t){return t<65536?1:2}class Ut{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,o){[e,n]=fu(this,e,n);let r=[];return this.decompose(0,e,r,2),o.length&&o.decompose(0,o.length,r,3),this.decompose(n,this.length,r,1),Xi.from(r,this.length-(n-e)+o.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=fu(this,e,n);let o=[];return this.decompose(e,n,o,0),Xi.from(o,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),o=this.length-this.scanIdentical(e,-1),r=new Pd(this),i=new Pd(e);for(let s=n,a=n;;){if(r.next(s),i.next(s),s=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=o)return!0}}iter(e=1){return new Pd(this,e)}iterRange(e,n=this.length){return new cM(this,e,n)}iterLines(e,n){let o;if(e==null)o=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;o=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new uM(o)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ut.empty:e.length<=32?new An(e):Xi.from(An.split(e,[]))}}class An extends Ut{constructor(e,n=dfe(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,o,r){for(let i=0;;i++){let s=this.text[i],a=r+s.length;if((n?o:a)>=e)return new ffe(r,a,o,s);r=a+1,o++}}decompose(e,n,o,r){let i=e<=0&&n>=this.length?this:new An(ik(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let s=o.pop(),a=lp(i.text,s.text.slice(),0,i.length);if(a.length<=32)o.push(new An(a,s.length+i.length));else{let l=a.length>>1;o.push(new An(a.slice(0,l)),new An(a.slice(l)))}}else o.push(i)}replace(e,n,o){if(!(o instanceof An))return super.replace(e,n,o);[e,n]=fu(this,e,n);let r=lp(this.text,lp(o.text,ik(this.text,0,e)),n),i=this.length+o.length-(n-e);return r.length<=32?new An(r,i):Xi.from(An.split(r,[]),i)}sliceString(e,n=this.length,o=`
|
|
850
|
-
`){[e,n]=fu(this,e,n);let r="";for(let i=0,s=0;i<=n&&s<this.text.length;s++){let a=this.text[s],l=i+a.length;i>e&&s&&(r+=o),e<l&&n>i&&(r+=a.slice(Math.max(0,e-i),n-i)),i=l+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let o=[],r=-1;for(let i of e)o.push(i),r+=i.length+1,o.length==32&&(n.push(new An(o,r)),o=[],r=-1);return r>-1&&n.push(new An(o,r)),n}}class Xi extends Ut{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let o of e)this.lines+=o.lines}lineInner(e,n,o,r){for(let i=0;;i++){let s=this.children[i],a=r+s.length,l=o+s.lines-1;if((n?l:a)>=e)return s.lineInner(e,n,o,r);r=a+1,o=l+1}}decompose(e,n,o,r){for(let i=0,s=0;s<=n&&i<this.children.length;i++){let a=this.children[i],l=s+a.length;if(e<=l&&n>=s){let c=r&((s<=e?1:0)|(l>=n?2:0));s>=e&&l<=n&&!c?o.push(a):a.decompose(e-s,n-s,o,c)}s=l+1}}replace(e,n,o){if([e,n]=fu(this,e,n),o.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.length;if(e>=i&&n<=a){let l=s.replace(e-i,n-i,o),c=this.lines-s.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[r]=l,new Xi(u,this.length-(n-e)+o.length)}return super.replace(i,a,l)}i=a+1}return super.replace(e,n,o)}sliceString(e,n=this.length,o=`
|
|
851
|
-
`){[e,n]=fu(this,e,n);let r="";for(let i=0,s=0;i<this.children.length&&s<=n;i++){let a=this.children[i],l=s+a.length;s>e&&i&&(r+=o),e<l&&n>s&&(r+=a.sliceString(e-s,n-s,o)),s=l+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof Xi))return 0;let o=0,[r,i,s,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,i+=n){if(r==s||i==a)return o;let l=this.children[r],c=e.children[i];if(l!=c)return o+l.scanIdentical(c,n);o+=l.length+1}}static from(e,n=e.reduce((o,r)=>o+r.length+1,-1)){let o=0;for(let h of e)o+=h.lines;if(o<32){let h=[];for(let g of e)g.flatten(h);return new An(h,n)}let r=Math.max(32,o>>5),i=r<<1,s=r>>1,a=[],l=0,c=-1,u=[];function d(h){let g;if(h.lines>i&&h instanceof Xi)for(let v of h.children)d(v);else h.lines>s&&(l>s||!l)?(f(),a.push(h)):h instanceof An&&l&&(g=u[u.length-1])instanceof An&&h.lines+g.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new An(g.text.concat(h.text),g.length+1+h.length)):(l+h.lines>r&&f(),l+=h.lines,c+=h.length+1,u.push(h))}function f(){l!=0&&(a.push(u.length==1?u[0]:Xi.from(u,c)),c=-1,l=u.length=0)}for(let h of e)d(h);return f(),a.length==1?a[0]:new Xi(a,n)}}Ut.empty=new An([""],0);function dfe(t){let e=-1;for(let n of t)e+=n.length+1;return e}function lp(t,e,n=0,o=1e9){for(let r=0,i=0,s=!0;i<t.length&&r<=o;i++){let a=t[i],l=r+a.length;l>=n&&(l>o&&(a=a.slice(0,o-r)),r<n&&(a=a.slice(n-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=l+1}return e}function ik(t,e,n){return lp(t,[""],e,n)}class Pd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof An?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let o=this.nodes.length-1,r=this.nodes[o],i=this.offsets[o],s=i>>1,a=r instanceof An?r.text.length:r.children.length;if(s==(n>0?a:0)){if(o==0)return this.done=!0,this.value="",this;n>0&&this.offsets[o-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[o]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
852
|
-
`,this;e--}else if(r instanceof An){let l=r.text[s+(n<0?-1:0)];if(this.offsets[o]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[s+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[o]+=n):(n<0&&this.offsets[o]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof An?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class cM{constructor(e,n,o){this.value="",this.done=!1,this.cursor=new Pd(e,n>o?-1:1),this.pos=n>o?e.length:0,this.from=Math.min(n,o),this.to=Math.max(n,o)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let o=n<0?this.pos-this.from:this.to-this.pos;e>o&&(e=o),o-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=o?r:n<0?r.slice(r.length-o):r.slice(0,o),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class uM{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:o,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):o?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ut.prototype[Symbol.iterator]=function(){return this.iter()},Pd.prototype[Symbol.iterator]=cM.prototype[Symbol.iterator]=uM.prototype[Symbol.iterator]=function(){return this});class ffe{constructor(e,n,o,r){this.from=e,this.to=n,this.number=o,this.text=r}get length(){return this.to-this.from}}function fu(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function Oo(t,e,n=!0,o=!0){return cfe(t,e,n,o)}function hfe(t){return t>=56320&&t<57344}function pfe(t){return t>=55296&&t<56320}function mfe(t,e){let n=t.charCodeAt(e);if(!pfe(n)||e+1==t.length)return n;let o=t.charCodeAt(e+1);return hfe(o)?(n-55296<<10)+(o-56320)+65536:n}function gfe(t){return t<65536?1:2}const fb=/\r\n?|\n/;var xr=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(xr||(xr={}));class ss{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let o=this.sections[n+1];e+=o<0?this.sections[n]:o}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,o=0,r=0;n<this.sections.length;){let i=this.sections[n++],s=this.sections[n++];s<0?(e(o,r,i),r+=i):r+=s,o+=i}}iterChangedRanges(e,n=!1){hb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let o=this.sections[n++],r=this.sections[n++];r<0?e.push(o,r):e.push(r,o)}return new ss(e)}composeDesc(e){return this.empty?e:e.empty?this:dM(this,e)}mapDesc(e,n=!1){return e.empty?this:pb(this,e,n)}mapPos(e,n=-1,o=xr.Simple){let r=0,i=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],l=this.sections[s++],c=r+a;if(l<0){if(c>e)return i+(e-r);i+=a}else{if(o!=xr.Simple&&c>=e&&(o==xr.TrackDel&&r<e&&c>e||o==xr.TrackBefore&&r<e||o==xr.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==r||n<0?i:i+l;i+=l}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,n=e){for(let o=0,r=0;o<this.sections.length&&r<=n;){let i=this.sections[o++],s=this.sections[o++],a=r+i;if(s>=0&&r<=n&&a>=e)return r<e&&a>n?"cover":!0;r=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let o=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+o+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ss(e)}static create(e){return new ss(e)}}class Wn extends ss{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return hb(this,(n,o,r,i,s)=>e=e.replace(r,r+(o-n),s),!1),e}mapDesc(e,n=!1){return pb(this,e,n,!0)}invert(e){let n=this.sections.slice(),o=[];for(let r=0,i=0;r<n.length;r+=2){let s=n[r],a=n[r+1];if(a>=0){n[r]=a,n[r+1]=s;let l=r>>1;for(;o.length<l;)o.push(Ut.empty);o.push(s?e.slice(i,i+s):Ut.empty)}i+=s}return new Wn(n,o)}compose(e){return this.empty?e:e.empty?this:dM(this,e,!0)}map(e,n=!1){return e.empty?this:pb(this,e,n,!0)}iterChanges(e,n=!1){hb(this,e,n)}get desc(){return ss.create(this.sections)}filter(e){let n=[],o=[],r=[],i=new hf(this);e:for(let s=0,a=0;;){let l=s==e.length?1e9:e[s++];for(;a<l||a==l&&i.len==0;){if(i.done)break e;let u=Math.min(i.len,l-a);yo(r,u,-1);let d=i.ins==-1?-1:i.off==0?i.ins:0;yo(n,u,d),d>0&&Ca(o,n,i.text),i.forward(u),a+=u}let c=e[s++];for(;a<c;){if(i.done)break e;let u=Math.min(i.len,c-a);yo(n,u,-1),yo(r,u,i.ins==-1?-1:i.off==0?i.ins:0),i.forward(u),a+=u}}return{changes:new Wn(n,o),filtered:ss.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let o=this.sections[n],r=this.sections[n+1];r<0?e.push(o):r==0?e.push([o]):e.push([o].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,o){let r=[],i=[],s=0,a=null;function l(u=!1){if(!u&&!r.length)return;s<n&&yo(r,n-s,-1);let d=new Wn(r,i);a=a?a.compose(d.map(a)):d,r=[],i=[],s=0}function c(u){if(Array.isArray(u))for(let d of u)c(d);else if(u instanceof Wn){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:d,to:f=d,insert:h}=u;if(d>f||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let g=h?typeof h=="string"?Ut.of(h.split(o||fb)):h:Ut.empty,v=g.length;if(d==f&&v==0)return;d<s&&l(),d>s&&yo(r,d-s,-1),yo(r,f-d,v),Ca(i,r,g),s=f}}return c(e),l(!a),a}static empty(e){return new Wn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],o=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="number")n.push(i,-1);else{if(!Array.isArray(i)||typeof i[0]!="number"||i.some((s,a)=>a&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;o.length<r;)o.push(Ut.empty);o[r]=Ut.of(i.slice(1)),n.push(i[0],o[r].length)}}}return new Wn(n,o)}static createSet(e,n){return new Wn(e,n)}}function yo(t,e,n,o=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:o?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function Ca(t,e,n){if(n.length==0)return;let o=e.length-2>>1;if(o<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<o;)t.push(Ut.empty);t.push(n)}}function hb(t,e,n){let o=t.inserted;for(let r=0,i=0,s=0;s<t.sections.length;){let a=t.sections[s++],l=t.sections[s++];if(l<0)r+=a,i+=a;else{let c=r,u=i,d=Ut.empty;for(;c+=a,u+=l,l&&o&&(d=d.append(o[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)a=t.sections[s++],l=t.sections[s++];e(r,c,i,u,d),r=c,i=u}}}function pb(t,e,n,o=!1){let r=[],i=o?[]:null,s=new hf(t),a=new hf(e);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(s.ins==-1&&a.ins==-1){let c=Math.min(s.len,a.len);yo(r,c,-1),s.forward(c),a.forward(c)}else if(a.ins>=0&&(s.ins<0||l==s.i||s.off==0&&(a.len<s.len||a.len==s.len&&!n))){let c=a.len;for(yo(r,a.ins,-1);c;){let u=Math.min(s.len,c);s.ins>=0&&l<s.i&&s.len<=u&&(yo(r,0,s.ins),i&&Ca(i,r,s.text),l=s.i),s.forward(u),c-=u}a.next()}else if(s.ins>=0){let c=0,u=s.len;for(;u;)if(a.ins==-1){let d=Math.min(u,a.len);c+=d,u-=d,a.forward(d)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;yo(r,c,l<s.i?s.ins:0),i&&l<s.i&&Ca(i,r,s.text),l=s.i,s.forward(s.len-u)}else{if(s.done&&a.done)return i?Wn.createSet(r,i):ss.create(r);throw new Error("Mismatched change set lengths")}}}function dM(t,e,n=!1){let o=[],r=n?[]:null,i=new hf(t),s=new hf(e);for(let a=!1;;){if(i.done&&s.done)return r?Wn.createSet(o,r):ss.create(o);if(i.ins==0)yo(o,i.len,0,a),i.next();else if(s.len==0&&!s.done)yo(o,0,s.ins,a),r&&Ca(r,o,s.text),s.next();else{if(i.done||s.done)throw new Error("Mismatched change set lengths");{let l=Math.min(i.len2,s.len),c=o.length;if(i.ins==-1){let u=s.ins==-1?-1:s.off?0:s.ins;yo(o,l,u,a),r&&u&&Ca(r,o,s.text)}else s.ins==-1?(yo(o,i.off?0:i.len,l,a),r&&Ca(r,o,i.textBit(l))):(yo(o,i.off?0:i.len,s.off?0:s.ins,a),r&&!s.off&&Ca(r,o,s.text));a=(i.ins>l||s.ins>=0&&s.len>l)&&(a||o.length>c),i.forward2(l),s.forward(l)}}}}class hf{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Ut.empty:e[n]}textBit(e){let{inserted:n}=this.set,o=this.i-2>>1;return o>=n.length&&!e?Ut.empty:n[o].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class kl{constructor(e,n,o){this.from=e,this.to=n,this.flags=o}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let o,r;return this.empty?o=r=e.mapPos(this.from,n):(o=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),o==this.from&&r==this.to?this:new kl(o,r,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Ue.range(e,n);let o=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Ue.range(this.anchor,o)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ue.range(e.anchor,e.head)}static create(e,n,o){return new kl(e,n,o)}}class Ue{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Ue.create(this.ranges.map(o=>o.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let o=0;o<this.ranges.length;o++)if(!this.ranges[o].eq(e.ranges[o],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Ue([this.main],0)}addRange(e,n=!0){return Ue.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let o=this.ranges.slice();return o[n]=e,Ue.create(o,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Ue(e.ranges.map(n=>kl.fromJSON(n)),e.main)}static single(e,n=e){return new Ue([Ue.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let o=0,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=o:i.from<o)return Ue.normalized(e.slice(),n);o=i.to}return new Ue(e,n)}static cursor(e,n=0,o,r){return kl.create(e,e,(n==0?0:n<0?8:16)|(o==null?7:Math.min(6,o))|(r??16777215)<<6)}static range(e,n,o,r){let i=(o??16777215)<<6|(r==null?7:Math.min(6,r));return n<e?kl.create(n,e,48|i):kl.create(e,n,(n>e?8:0)|i)}static normalized(e,n=0){let o=e[n];e.sort((r,i)=>r.from-i.from),n=e.indexOf(o);for(let r=1;r<e.length;r++){let i=e[r],s=e[r-1];if(i.empty?i.from<=s.to:i.from<s.to){let a=s.from,l=Math.max(i.to,s.to);r<=n&&n--,e.splice(--r,2,i.anchor>i.head?Ue.range(l,a):Ue.range(a,l))}}return new Ue(e,n)}}function fM(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Q2=0;class vt{constructor(e,n,o,r,i){this.combine=e,this.compareInput=n,this.compare=o,this.isStatic=r,this.id=Q2++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new vt(e.combine||(n=>n),e.compareInput||((n,o)=>n===o),e.compare||(e.combine?(n,o)=>n===o:J2),!!e.static,e.enables)}of(e){return new cp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new cp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new cp(e,this,2,n)}from(e,n){return n||(n=o=>o),this.compute([e],o=>n(o.field(e)))}}function J2(t,e){return t==e||t.length==e.length&&t.every((n,o)=>n===e[o])}class cp{constructor(e,n,o,r){this.dependencies=e,this.facet=n,this.type=o,this.value=r,this.id=Q2++}dynamicSlot(e){var n;let o=this.value,r=this.facet.compareInput,i=this.id,s=e[i]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let d of this.dependencies)d=="doc"?l=!0:d=="selection"?c=!0:(((n=e[d.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[d.id]);return{create(d){return d.values[s]=o(d),1},update(d,f){if(l&&f.docChanged||c&&(f.docChanged||f.selection)||mb(d,u)){let h=o(d);if(a?!sk(h,d.values[s],r):!r(h,d.values[s]))return d.values[s]=h,1}return 0},reconfigure:(d,f)=>{let h,g=f.config.address[i];if(g!=null){let v=_0(f,g);if(this.dependencies.every(m=>m instanceof vt?f.facet(m)===d.facet(m):m instanceof ol?f.field(m,!1)==d.field(m,!1):!0)||(a?sk(h=o(d),v,r):r(h=o(d),v)))return d.values[s]=v,0}else h=o(d);return d.values[s]=h,1}}}}function sk(t,e,n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!n(t[o],e[o]))return!1;return!0}function mb(t,e){let n=!1;for(let o of e)Dd(t,o)&1&&(n=!0);return n}function vfe(t,e,n){let o=n.map(l=>t[l.id]),r=n.map(l=>l.type),i=o.filter(l=>!(l&1)),s=t[e.id]>>1;function a(l){let c=[];for(let u=0;u<o.length;u++){let d=_0(l,o[u]);if(r[u]==2)for(let f of d)c.push(f);else c.push(d)}return e.combine(c)}return{create(l){for(let c of o)Dd(l,c);return l.values[s]=a(l),1},update(l,c){if(!mb(l,i))return 0;let u=a(l);return e.compare(u,l.values[s])?0:(l.values[s]=u,1)},reconfigure(l,c){let u=mb(l,o),d=c.config.facets[e.id],f=c.facet(e);if(d&&!u&&J2(n,d))return l.values[s]=f,0;let h=a(l);return e.compare(h,f)?(l.values[s]=f,0):(l.values[s]=h,1)}}}const $h=vt.define({static:!0});class ol{constructor(e,n,o,r,i){this.id=e,this.createF=n,this.updateF=o,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let n=new ol(Q2++,e.create,e.update,e.compare||((o,r)=>o===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet($h).find(o=>o.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:o=>(o.values[n]=this.create(o),1),update:(o,r)=>{let i=o.values[n],s=this.updateF(i,r);return this.compareF(i,s)?0:(o.values[n]=s,1)},reconfigure:(o,r)=>{let i=o.facet($h),s=r.facet($h),a;return(a=i.find(l=>l.field==this))&&a!=s.find(l=>l.field==this)?(o.values[n]=a.create(o),1):r.config.address[this.id]!=null?(o.values[n]=r.field(this),0):(o.values[n]=this.create(o),1)}}}init(e){return[this,$h.of({field:this,create:e})]}get extension(){return this}}const xl={lowest:4,low:3,default:2,high:1,highest:0};function ed(t){return e=>new hM(e,t)}const ex={highest:ed(xl.highest),high:ed(xl.high),default:ed(xl.default),low:ed(xl.low),lowest:ed(xl.lowest)};class hM{constructor(e,n){this.inner=e,this.prec=n}}class gg{of(e){return new gb(this,e)}reconfigure(e){return gg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class gb{constructor(e,n){this.compartment=e,this.inner=n}}class w0{constructor(e,n,o,r,i,s){for(this.base=e,this.compartments=n,this.dynamicSlots=o,this.address=r,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<o.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,o){let r=[],i=Object.create(null),s=new Map;for(let f of bfe(e,n,s))f instanceof ol?r.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let a=Object.create(null),l=[],c=[];for(let f of r)a[f.id]=c.length<<1,c.push(h=>f.slot(h));let u=o==null?void 0:o.config.facets;for(let f in i){let h=i[f],g=h[0].facet,v=u&&u[f]||[];if(h.every(m=>m.type==0))if(a[g.id]=l.length<<1|1,J2(v,h))l.push(o.facet(g));else{let m=g.combine(h.map(b=>b.value));l.push(o&&g.compare(m,o.facet(g))?o.facet(g):m)}else{for(let m of h)m.type==0?(a[m.id]=l.length<<1|1,l.push(m.value)):(a[m.id]=c.length<<1,c.push(b=>m.dynamicSlot(b)));a[g.id]=c.length<<1,c.push(m=>vfe(m,g,h))}}let d=c.map(f=>f(a));return new w0(e,s,d,a,l,i)}}function bfe(t,e,n){let o=[[],[],[],[],[]],r=new Map;function i(s,a){let l=r.get(s);if(l!=null){if(l<=a)return;let c=o[l].indexOf(s);c>-1&&o[l].splice(c,1),s instanceof gb&&n.delete(s.compartment)}if(r.set(s,a),Array.isArray(s))for(let c of s)i(c,a);else if(s instanceof gb){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(s.compartment)||s.inner;n.set(s.compartment,c),i(c,a)}else if(s instanceof hM)i(s.inner,s.prec);else if(s instanceof ol)o[a].push(s),s.provides&&i(s.provides,a);else if(s instanceof cp)o[a].push(s),s.facet.extensions&&i(s.facet.extensions,xl.default);else{let c=s.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(c,a)}}return i(t,xl.default),o.reduce((s,a)=>s.concat(a))}function Dd(t,e){if(e&1)return 2;let n=e>>1,o=t.status[n];if(o==4)throw new Error("Cyclic dependency between fields and/or facets");if(o&2)return o;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function _0(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const pM=vt.define(),vb=vt.define({combine:t=>t.some(e=>e),static:!0}),mM=vt.define({combine:t=>t.length?t[0]:void 0,static:!0}),gM=vt.define(),vM=vt.define(),bM=vt.define(),yM=vt.define({combine:t=>t.length?t[0]:!1});class rl{constructor(e,n){this.type=e,this.value=n}static define(){return new yfe}}class yfe{of(e){return new rl(this,e)}}class xfe{constructor(e){this.map=e}of(e){return new $n(this,e)}}class $n{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new $n(this.type,n)}is(e){return this.type==e}static define(e={}){return new xfe(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let o=[];for(let r of e){let i=r.map(n);i&&o.push(i)}return o}}$n.reconfigure=$n.define();$n.appendConfig=$n.define();class Gn{constructor(e,n,o,r,i,s){this.startState=e,this.changes=n,this.selection=o,this.effects=r,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,o&&fM(o,n.newLength),i.some(a=>a.type==Gn.time)||(this.annotations=i.concat(Gn.time.of(Date.now())))}static create(e,n,o,r,i,s){return new Gn(e,n,o,r,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Gn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Gn.time=rl.define();Gn.userEvent=rl.define();Gn.addToHistory=rl.define();Gn.remote=rl.define();function wfe(t,e){let n=[];for(let o=0,r=0;;){let i,s;if(o<t.length&&(r==e.length||e[r]>=t[o]))i=t[o++],s=t[o++];else if(r<e.length)i=e[r++],s=e[r++];else return n;!n.length||n[n.length-1]<i?n.push(i,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function xM(t,e,n){var o;let r,i,s;return n?(r=e.changes,i=Wn.empty(e.changes.length),s=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),i=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(r)),{changes:s,selection:e.selection?e.selection.map(i):(o=t.selection)===null||o===void 0?void 0:o.map(r),effects:$n.mapEffects(t.effects,r).concat($n.mapEffects(e.effects,i)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function bb(t,e,n){let o=e.selection,r=Hc(e.annotations);return e.userEvent&&(r=r.concat(Gn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Wn?e.changes:Wn.of(e.changes||[],n,t.facet(mM)),selection:o&&(o instanceof Ue?o:Ue.single(o.anchor,o.head)),effects:Hc(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function wM(t,e,n){let o=bb(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let i=1;i<e.length;i++){e[i].filter===!1&&(n=!1);let s=!!e[i].sequential;o=xM(o,bb(t,e[i],s?o.changes.newLength:t.doc.length),s)}let r=Gn.create(t,o.changes,o.selection,o.effects,o.annotations,o.scrollIntoView);return kfe(n?_fe(r):r)}function _fe(t){let e=t.startState,n=!0;for(let r of e.facet(gM)){let i=r(t);if(i===!1){n=!1;break}Array.isArray(i)&&(n=n===!0?i:wfe(n,i))}if(n!==!0){let r,i;if(n===!1)i=t.changes.invertedDesc,r=Wn.empty(e.doc.length);else{let s=t.changes.filter(n);r=s.changes,i=s.filtered.mapDesc(s.changes).invertedDesc}t=Gn.create(e,r,t.selection&&t.selection.map(i),$n.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let o=e.facet(vM);for(let r=o.length-1;r>=0;r--){let i=o[r](t);i instanceof Gn?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof Gn?t=i[0]:t=wM(e,Hc(i),!1)}return t}function kfe(t){let e=t.startState,n=e.facet(bM),o=t;for(let r=n.length-1;r>=0;r--){let i=n[r](t);i&&Object.keys(i).length&&(o=xM(o,bb(e,i,t.changes.newLength),!0))}return o==t?t:Gn.create(e,t.changes,t.selection,o.effects,o.annotations,o.scrollIntoView)}const Sfe=[];function Hc(t){return t==null?Sfe:Array.isArray(t)?t:[t]}var Fs=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Fs||(Fs={}));const Afe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let yb;try{yb=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Cfe(t){if(yb)return yb.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||Afe.test(n)))return!0}return!1}function $fe(t){return e=>{if(!/\S/.test(e))return Fs.Space;if(Cfe(e))return Fs.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Fs.Word;return Fs.Other}}class Qt{constructor(e,n,o,r,i,s){this.config=e,this.doc=n,this.selection=o,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Dd(this,a<<1);this.computeSlot=null}field(e,n=!0){let o=this.config.address[e.id];if(o==null){if(n)throw new RangeError("Field is not present in this state");return}return Dd(this,o),_0(this,o)}update(...e){return wM(this,e,!0)}applyTransaction(e){let n=this.config,{base:o,compartments:r}=n;for(let a of e.effects)a.is(gg.reconfigure)?(n&&(r=new Map,n.compartments.forEach((l,c)=>r.set(c,l)),n=null),r.set(a.value.compartment,a.value.extension)):a.is($n.reconfigure)?(n=null,o=a.value):a.is($n.appendConfig)&&(n=null,o=Hc(o).concat(a.value));let i;n?i=e.startState.values.slice():(n=w0.resolve(o,r,this),i=new Qt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let s=e.startState.facet(vb)?e.newSelection:e.newSelection.asSingle();new Qt(n,e.newDoc,s,i,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Ue.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,o=e(n.ranges[0]),r=this.changes(o.changes),i=[o.range],s=Hc(o.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),u=c.map(r);for(let f=0;f<a;f++)i[f]=i[f].map(u);let d=r.mapDesc(c,!0);i.push(l.range.map(d)),r=r.compose(u),s=$n.mapEffects(s,u).concat($n.mapEffects(Hc(l.effects),d))}return{changes:r,selection:Ue.create(i,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Wn?e:Wn.of(e,this.doc.length,this.facet(Qt.lineSeparator))}toText(e){return Ut.of(e.split(this.facet(Qt.lineSeparator)||fb))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(Dd(this,n),_0(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let o in e){let r=e[o];r instanceof ol&&this.config.address[r.id]!=null&&(n[o]=r.spec.toJSON(this.field(e[o]),this))}return n}static fromJSON(e,n={},o){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(o){for(let i in o)if(Object.prototype.hasOwnProperty.call(e,i)){let s=o[i],a=e[i];r.push(s.init(l=>s.spec.fromJSON(a,l)))}}return Qt.create({doc:e.doc,selection:Ue.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=w0.resolve(e.extensions||[],new Map),o=e.doc instanceof Ut?e.doc:Ut.of((e.doc||"").split(n.staticFacet(Qt.lineSeparator)||fb)),r=e.selection?e.selection instanceof Ue?e.selection:Ue.single(e.selection.anchor,e.selection.head):Ue.single(0);return fM(r,o.length),n.staticFacet(vb)||(r=r.asSingle()),new Qt(n,o,r,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(Qt.tabSize)}get lineBreak(){return this.facet(Qt.lineSeparator)||`
|
|
853
|
-
`}get readOnly(){return this.facet(yM)}phrase(e,...n){for(let o of this.facet(Qt.phrases))if(Object.prototype.hasOwnProperty.call(o,e)){e=o[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(o,r)=>{if(r=="$")return"$";let i=+(r||1);return!i||i>n.length?o:n[i-1]})),e}languageDataAt(e,n,o=-1){let r=[];for(let i of this.facet(pM))for(let s of i(this,n,o))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return $fe(n.length?n[0]:"")}wordAt(e){let{text:n,from:o,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-o,a=e-o;for(;s>0;){let l=Oo(n,s,!1);if(i(n.slice(l,s))!=Fs.Word)break;s=l}for(;a<r;){let l=Oo(n,a);if(i(n.slice(a,l))!=Fs.Word)break;a=l}return s==a?null:Ue.range(s+o,a+o)}}Qt.allowMultipleSelections=vb;Qt.tabSize=vt.define({combine:t=>t.length?t[0]:4});Qt.lineSeparator=mM;Qt.readOnly=yM;Qt.phrases=vt.define({compare(t,e){let n=Object.keys(t),o=Object.keys(e);return n.length==o.length&&n.every(r=>t[r]==e[r])}});Qt.languageData=pM;Qt.changeFilter=gM;Qt.transactionFilter=vM;Qt.transactionExtender=bM;gg.reconfigure=$n.define();function Tfe(t,e,n={}){let o={};for(let r of t)for(let i of Object.keys(r)){let s=r[i],a=o[i];if(a===void 0)o[i]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(n,i))o[i]=n[i](a,s);else throw new Error("Config merge conflict for field "+i)}for(let r in e)o[r]===void 0&&(o[r]=e[r]);return o}class Ul{eq(e){return this==e}range(e,n=e){return xb.create(e,n,this)}}Ul.prototype.startSide=Ul.prototype.endSide=0;Ul.prototype.point=!1;Ul.prototype.mapMode=xr.TrackDel;function tx(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let xb=class _M{constructor(e,n,o){this.from=e,this.to=n,this.value=o}static create(e,n,o){return new _M(e,n,o)}};function wb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class nx{constructor(e,n,o,r){this.from=e,this.to=n,this.value=o,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,o,r=0){let i=o?this.to:this.from;for(let s=r,a=i.length;;){if(s==a)return s;let l=s+a>>1,c=i[l]-e||(o?this.value[l].endSide:this.value[l].startSide)-n;if(l==s)return c>=0?s:a;c>=0?a=l:s=l+1}}between(e,n,o,r){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(o,1e9,!1,i);i<s;i++)if(r(this.from[i]+e,this.to[i]+e,this.value[i])===!1)return!1}map(e,n){let o=[],r=[],i=[],s=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,d=this.to[l]+e,f,h;if(u==d){let g=n.mapPos(u,c.startSide,c.mapMode);if(g==null||(f=h=g,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<f)))continue}else if(f=n.mapPos(u,c.startSide),h=n.mapPos(d,c.endSide),f>h||f==h&&c.startSide>0&&c.endSide<=0)continue;(h-f||c.endSide-c.startSide)<0||(s<0&&(s=f),c.point&&(a=Math.max(a,h-f)),o.push(c),r.push(f-s),i.push(h-s))}return{mapped:o.length?new nx(r,i,o,a):null,pos:s}}}class tn{constructor(e,n,o,r){this.chunkPos=e,this.chunk=n,this.nextLayer=o,this.maxPoint=r}static create(e,n,o,r){return new tn(e,n,o,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:o=!1,filterFrom:r=0,filterTo:i=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(o&&(n=n.slice().sort(wb)),this.isEmpty)return n.length?tn.of(n):this;let a=new kM(this,null,-1).goto(0),l=0,c=[],u=new pf;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let d=n[l++];u.addInner(d.from,d.to,d.value)||c.push(d)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!s||r>this.chunkEnd(a.chunkIndex)||i<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||r>a.to||i<a.from||s(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(xb.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?tn.empty:this.nextLayer.update({add:c,filter:s,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],o=[],r=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],l=this.chunk[s],c=e.touchesRange(a,a+l.length);if(c===!1)r=Math.max(r,l.maxPoint),n.push(l),o.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:d}=l.map(a,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),o.push(d))}}let i=this.nextLayer.map(e);return n.length==0?i:new tn(o,n,i||tn.empty,r)}between(e,n,o){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],s=this.chunk[r];if(n>=i&&e<=i+s.length&&s.between(i,e-i,n-i,o)===!1)return}this.nextLayer.between(e,n,o)}}iter(e=0){return mf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return mf.from(e).goto(n)}static compare(e,n,o,r,i=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),a=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),l=ak(s,a,o),c=new td(s,l,i),u=new td(a,l,i);o.iterGaps((d,f,h)=>lk(c,d,u,f,h,r)),o.empty&&o.length==0&&lk(c,0,u,0,0,r)}static eq(e,n,o=0,r){r==null&&(r=999999999);let i=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),s=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let a=ak(i,s),l=new td(i,a,0).goto(o),c=new td(s,a,0).goto(o);for(;;){if(l.to!=c.to||!_b(l.active,c.active)||l.point&&(!c.point||!tx(l.point,c.point)))return!1;if(l.to>r)return!0;l.next(),c.next()}}static spans(e,n,o,r,i=-1){let s=new td(e,null,i).goto(n),a=n,l=s.openStart;for(;;){let c=Math.min(s.to,o);if(s.point){let u=s.activeForPoint(s.to),d=s.pointFrom<n?u.length+1:s.point.startSide<0?u.length:Math.min(u.length,l);r.point(a,c,s.point,u,d,s.pointRank),l=Math.min(s.openEnd(c),u.length)}else c>a&&(r.span(a,c,s.active,l),l=s.openEnd(c));if(s.to>o)return l+(s.point&&s.to>o?1:0);a=s.to,s.next()}}static of(e,n=!1){let o=new pf;for(let r of e instanceof xb?[e]:n?Mfe(e):e)o.add(r.from,r.to,r.value);return o.finish()}static join(e){if(!e.length)return tn.empty;let n=e[e.length-1];for(let o=e.length-2;o>=0;o--)for(let r=e[o];r!=tn.empty;r=r.nextLayer)n=new tn(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}}tn.empty=new tn([],[],null,-1);function Mfe(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let o=t[n];if(wb(e,o)>0)return t.slice().sort(wb);e=o}return t}tn.empty.nextLayer=tn.empty;class pf{finishChunk(e){this.chunks.push(new nx(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,o){this.addInner(e,n,o)||(this.nextLayer||(this.nextLayer=new pf)).add(e,n,o)}addInner(e,n,o){let r=e-this.lastTo||o.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||o.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=o,this.lastFrom=e,this.lastTo=n,this.value.push(o),o.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let o=n.value.length-1;return this.last=n.value[o],this.lastFrom=n.from[o]+e,this.lastTo=n.to[o]+e,!0}finish(){return this.finishInner(tn.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=tn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function ak(t,e,n){let o=new Map;for(let i of t)for(let s=0;s<i.chunk.length;s++)i.chunk[s].maxPoint<=0&&o.set(i.chunk[s],i.chunkPos[s]);let r=new Set;for(let i of e)for(let s=0;s<i.chunk.length;s++){let a=o.get(i.chunk[s]);a!=null&&(n?n.mapPos(a):a)==i.chunkPos[s]&&!(n!=null&&n.touchesRange(a,a+i.chunk[s].length))&&r.add(i.chunk[s])}return r}class kM{constructor(e,n,o,r=0){this.layer=e,this.skip=n,this.minPoint=o,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,o){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,o=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!o||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],o=e+n.from[this.rangeIndex];if(this.from=o,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class mf{constructor(e){this.heap=e}static from(e,n=null,o=-1){let r=[];for(let i=0;i<e.length;i++)for(let s=e[i];!s.isEmpty;s=s.nextLayer)s.maxPoint>=o&&r.push(new kM(s,n,o,i));return r.length==1?r[0]:new mf(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let o of this.heap)o.goto(e,n);for(let o=this.heap.length>>1;o>=0;o--)Dv(this.heap,o);return this.next(),this}forward(e,n){for(let o of this.heap)o.forward(e,n);for(let o=this.heap.length>>1;o>=0;o--)Dv(this.heap,o);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Dv(this.heap,0)}}}function Dv(t,e){for(let n=t[e];;){let o=(e<<1)+1;if(o>=t.length)break;let r=t[o];if(o+1<t.length&&r.compare(t[o+1])>=0&&(r=t[o+1],o++),n.compare(r)<0)break;t[o]=n,t[e]=r,e=o}}class td{constructor(e,n,o){this.minPoint=o,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=mf.from(e,n,o)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Th(this.active,e),Th(this.activeTo,e),Th(this.activeRank,e),this.minActive=ck(this.active,this.activeTo)}addActive(e){let n=0,{value:o,to:r,rank:i}=this.cursor;for(;n<this.activeRank.length&&(i-this.activeRank[n]||r-this.activeTo[n])>0;)n++;Mh(this.active,n,o),Mh(this.activeTo,n,r),Mh(this.activeRank,n,i),e&&Mh(e,n,this.cursor.from),this.minActive=ck(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let o=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),o&&Th(o,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(o),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=i,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=i.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(o){this.openStart=0;for(let r=o.length-1;r>=0&&o[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let o=this.active.length-1;o>=0&&!(this.activeRank[o]<this.pointRank);o--)(this.activeTo[o]>e||this.activeTo[o]==e&&this.active[o].endSide>=this.point.endSide)&&n.push(this.active[o]);return n.reverse()}openEnd(e){let n=0;for(let o=this.activeTo.length-1;o>=0&&this.activeTo[o]>e;o--)n++;return n}}function lk(t,e,n,o,r,i){t.goto(e),n.goto(o);let s=o+r,a=o,l=o-e,c=!!i.boundChange;for(let u=!1;;){let d=t.to+l-n.to,f=d||t.endSide-n.endSide,h=f<0?t.to+l:n.to,g=Math.min(h,s);if(t.point||n.point?(t.point&&n.point&&tx(t.point,n.point)&&_b(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(a,g,t.point,n.point),u=!1):(u&&i.boundChange(a),g>a&&!_b(t.active,n.active)&&i.compareRange(a,g,t.active,n.active),c&&g<s&&(d||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>s)break;a=h,f<=0&&t.next(),f>=0&&n.next()}}function _b(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!tx(t[n],e[n]))return!1;return!0}function Th(t,e){for(let n=e,o=t.length-1;n<o;n++)t[n]=t[n+1];t.pop()}function Mh(t,e,n){for(let o=t.length-1;o>=e;o--)t[o+1]=t[o];t[e]=n}function ck(t,e){let n=-1,o=1e9;for(let r=0;r<e.length;r++)(e[r]-o||t[r].endSide-t[n].endSide)<0&&(n=r,o=e[r]);return n}function vg(t,e,n=t.length){let o=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(o+=e-o%e,r++):(o++,r=Oo(t,r));return o}function Ofe(t,e,n,o){for(let r=0,i=0;;){if(i>=e)return r;if(r==t.length)break;i+=t.charCodeAt(r)==9?n-i%n:1,r=Oo(t,r)}return t.length}const kb="ͼ",uk=typeof Symbol>"u"?"__"+kb:Symbol.for(kb),Sb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),dk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Ha{constructor(e,n){this.rules=[];let{finish:o}=n||{};function r(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,a,l,c){let u=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&a==null)return l.push(s[0]+";");for(let h in a){let g=a[h];if(/&/.test(h))i(h.split(/,\s*/).map(v=>s.map(m=>v.replace(/&/,m))).reduce((v,m)=>v.concat(m)),g,l);else if(g&&typeof g=="object"){if(!d)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(r(h),g,u,f)}else g!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+g+";")}(u.length||f)&&l.push((o&&!d&&!c?s.map(o):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)i(r(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
|
854
|
-
`)}static newName(){let e=dk[uk]||1;return dk[uk]=e+1,kb+e.toString(36)}static mount(e,n,o){let r=e[Sb],i=o&&o.nonce;r?i&&r.setNonce(i):r=new Bfe(e,i),r.mount(Array.isArray(n)?n:[n],e)}}let fk=new Map;class Bfe{constructor(e,n){let o=e.ownerDocument||e,r=o.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let i=fk.get(o);if(i)return e[Sb]=i;this.sheet=new r.CSSStyleSheet,fk.set(o,this)}else this.styleTag=o.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Sb]=this}mount(e,n){let o=this.sheet,r=0,i=0;for(let s=0;s<e.length;s++){let a=e[s],l=this.modules.indexOf(a);if(l<i&&l>-1&&(this.modules.splice(l,1),i--,l=-1),l==-1){if(this.modules.splice(i++,0,a),o)for(let c=0;c<a.rules.length;c++)o.insertRule(a.rules[c],r++)}else{for(;i<l;)r+=this.modules[i++].rules.length;r+=a.rules.length,i++}}if(o)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
|
855
|
-
`;this.styleTag.textContent=s;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Wa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},gf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Lfe=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pfe=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var io=0;io<10;io++)Wa[48+io]=Wa[96+io]=String(io);for(var io=1;io<=24;io++)Wa[io+111]="F"+io;for(var io=65;io<=90;io++)Wa[io]=String.fromCharCode(io+32),gf[io]=String.fromCharCode(io);for(var Ev in Wa)gf.hasOwnProperty(Ev)||(gf[Ev]=Wa[Ev]);function Dfe(t){var e=Lfe&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Pfe&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?gf:Wa)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}let Fo=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ab=typeof document<"u"?document:{documentElement:{style:{}}};const Cb=/Edge\/(\d+)/.exec(Fo.userAgent),SM=/MSIE \d/.test(Fo.userAgent),$b=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fo.userAgent),bg=!!(SM||$b||Cb),hk=!bg&&/gecko\/(\d+)/i.test(Fo.userAgent),Nv=!bg&&/Chrome\/(\d+)/.exec(Fo.userAgent),Efe="webkitFontSmoothing"in Ab.documentElement.style,Tb=!bg&&/Apple Computer/.test(Fo.vendor),pk=Tb&&(/Mobile\/\w+/.test(Fo.userAgent)||Fo.maxTouchPoints>2);var it={mac:pk||/Mac/.test(Fo.platform),windows:/Win/.test(Fo.platform),linux:/Linux|X11/.test(Fo.platform),ie:bg,ie_version:SM?Ab.documentMode||6:$b?+$b[1]:Cb?+Cb[1]:0,gecko:hk,gecko_version:hk?+(/Firefox\/(\d+)/.exec(Fo.userAgent)||[0,0])[1]:0,chrome:!!Nv,chrome_version:Nv?+Nv[1]:0,ios:pk,android:/Android\b/.test(Fo.userAgent),webkit_version:Efe?+(/\bAppleWebKit\/(\d+)/.exec(Fo.userAgent)||[0,0])[1]:0,safari:Tb,safari_version:Tb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Fo.userAgent)||[0,0])[1]:0,tabSize:Ab.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ox(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const k0=Object.create(null);function rx(t,e,n){if(t==e)return!0;t||(t=k0),e||(e=k0);let o=Object.keys(t),r=Object.keys(e);if(o.length-0!=r.length-0)return!1;for(let i of o)if(i!=n&&(r.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function Nfe(t,e){for(let n=t.attributes.length-1;n>=0;n--){let o=t.attributes[n].name;e[o]==null&&t.removeAttribute(o)}for(let n in e){let o=e[n];n=="style"?t.style.cssText=o:t.getAttribute(n)!=o&&t.setAttribute(n,o)}}function mk(t,e,n){let o=!1;if(e)for(let r in e)n&&r in n||(o=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(o=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return o}function Ife(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let o=t.attributes[n];e[o.name]=o.value}return e}class yg{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,o){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ur=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Ur||(Ur={}));class Zn extends Ul{constructor(e,n,o,r){super(),this.startSide=e,this.endSide=n,this.widget=o,this.spec=r}get heightRelevant(){return!1}static mark(e){return new zf(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),o=!!e.block;return n+=o&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Gl(e,n,n,o,e.widget||null,!1)}static replace(e){let n=!!e.block,o,r;if(e.isBlockGap)o=-5e8,r=4e8;else{let{start:i,end:s}=AM(e,n);o=(i?n?-3e8:-1:5e8)-1,r=(s?n?2e8:1:-6e8)+1}return new Gl(e,o,r,n,e.widget||null,!0)}static line(e){return new Hf(e)}static set(e,n=!1){return tn.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Zn.none=tn.empty;class zf extends Zn{constructor(e){let{start:n,end:o}=AM(e);super(n?-1:5e8,o?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?ox(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||k0}eq(e){return this==e||e instanceof zf&&this.tagName==e.tagName&&rx(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}zf.prototype.point=!1;class Hf extends Zn{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Hf&&this.spec.class==e.spec.class&&rx(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}Hf.prototype.mapMode=xr.TrackBefore;Hf.prototype.point=!0;class Gl extends Zn{constructor(e,n,o,r,i,s){super(n,o,i,e),this.block=r,this.isReplace=s,this.mapMode=r?n<=0?xr.TrackBefore:xr.TrackAfter:xr.TrackDel}get type(){return this.startSide!=this.endSide?Ur.WidgetRange:this.startSide<=0?Ur.WidgetBefore:Ur.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Gl&&Rfe(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}Gl.prototype.point=!0;function AM(t,e=!1){let{inclusiveStart:n,inclusiveEnd:o}=t;return n==null&&(n=t.inclusive),o==null&&(o=t.inclusive),{start:n??e,end:o??e}}function Rfe(t,e){return t==e||!!(t&&e&&t.compare(e))}function Wc(t,e,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=t?n[r]=Math.max(n[r],e):n.push(t,e)}class vf extends Ul{constructor(e,n){super(),this.tagName=e,this.attributes=n}eq(e){return e==this||e instanceof vf&&this.tagName==e.tagName&&rx(this.attributes,e.attributes)}static create(e){return new vf(e.tagName,e.attributes||k0)}static set(e,n=!1){return tn.of(e,n)}}vf.prototype.startSide=vf.prototype.endSide=-1;function bf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Mb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ed(t,e){if(!e.anchorNode)return!1;try{return Mb(t,e.anchorNode)}catch{return!1}}function up(t){return t.nodeType==3?yf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Nd(t,e,n,o){return n?gk(t,e,n,o,-1)||gk(t,e,n,o,1):!1}function Ua(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function S0(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function gk(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:Js(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Ua(t)+(r<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Js(t):0}else return!1}}function Js(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function A0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function Ffe(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function CM(t,e){let n=e.width/t.offsetWidth,o=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(e.height-t.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}function Vfe(t,e,n,o,r,i,s,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,d=!1;u&&!d;)if(u.nodeType==1){let f,h=u==l.body,g=1,v=1;if(h)f=Ffe(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:g,scaleY:v}=CM(u,y)),f={left:y.left,right:y.left+u.clientWidth*g,top:y.top,bottom:y.top+u.clientHeight*v}}let m=0,b=0;if(r=="nearest")e.top<f.top?(b=e.top-(f.top+s),n>0&&e.bottom>f.bottom+b&&(b=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(b=e.bottom-f.bottom+s,n<0&&e.top-b<f.top&&(b=e.top-(f.top+s)));else{let y=e.bottom-e.top,x=f.bottom-f.top;b=(r=="center"&&y<=x?e.top+y/2-x/2:r=="start"||r=="center"&&n<0?e.top-s:e.bottom-x+s)-f.top}if(o=="nearest"?e.left<f.left?(m=e.left-(f.left+i),n>0&&e.right>f.right+m&&(m=e.right-f.right+i)):e.right>f.right&&(m=e.right-f.right+i,n<0&&e.left<f.left+m&&(m=e.left-(f.left+i))):m=(o=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:o=="start"==a?e.left-i:e.right-(f.right-f.left)+i)-f.left,m||b)if(h)c.scrollBy(m,b);else{let y=0,x=0;if(b){let _=u.scrollTop;u.scrollTop+=b/v,x=(u.scrollTop-_)*v}if(m){let _=u.scrollLeft;u.scrollLeft+=m/g,y=(u.scrollLeft-_)*g}e={left:e.left-y,top:e.top-x,right:e.right-y,bottom:e.bottom-x},y&&Math.abs(y-m)<1&&(o="nearest"),x&&Math.abs(x-b)<1&&(r="nearest")}if(h)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function zfe(t){let e=t.ownerDocument,n,o;for(let r=t.parentNode;r&&!(r==e.body||n&&o);)if(r.nodeType==1)!o&&r.scrollHeight>r.clientHeight&&(o=r),!n&&r.scrollWidth>r.clientWidth&&(n=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:n,y:o}}class Hfe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:o}=e;this.set(n,Math.min(e.anchorOffset,n?Js(n):0),o,Math.min(e.focusOffset,o?Js(o):0))}set(e,n,o,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=o,this.focusOffset=r}}let vl=null;it.safari&&it.safari_version>=26&&(vl=!1);function $M(t){if(t.setActive)return t.setActive();if(vl)return t.focus(vl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(vl==null?{get preventScroll(){return vl={preventScroll:!0},!0}}:void 0),!vl){vl=!1;for(let n=0;n<e.length;){let o=e[n++],r=e[n++],i=e[n++];o.scrollTop!=r&&(o.scrollTop=r),o.scrollLeft!=i&&(o.scrollLeft=i)}}}let vk;function yf(t,e,n=e){let o=vk||(vk=document.createRange());return o.setEnd(t,n),o.setStart(t,e),o}function Uc(t,e,n,o){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};o&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=o);let i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.dispatchEvent(i);let s=new KeyboardEvent("keyup",r);return s.synthetic=!0,t.dispatchEvent(s),i.defaultPrevented||s.defaultPrevented}function Wfe(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Ufe(t,e){let n=e.focusNode,o=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=o)return!1;for(o=Math.min(o,Js(n));;)if(o){if(n.nodeType!=1)return!1;let r=n.childNodes[o-1];r.contentEditable=="false"?o--:(n=r,o=Js(n))}else{if(n==t)return!0;o=Ua(n),n=n.parentNode}}function TM(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function MM(t,e){for(let n=t,o=e;;){if(n.nodeType==3&&o>0)return{node:n,offset:o};if(n.nodeType==1&&o>0){if(n.contentEditable=="false")return null;n=n.childNodes[o-1],o=Js(n)}else if(n.parentNode&&!S0(n))o=Ua(n),n=n.parentNode;else return null}}function OM(t,e){for(let n=t,o=e;;){if(n.nodeType==3&&o<n.nodeValue.length)return{node:n,offset:o};if(n.nodeType==1&&o<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[o],o=0}else if(n.parentNode&&!S0(n))o=Ua(n)+1,n=n.parentNode;else return null}}class fi{constructor(e,n,o=!0){this.node=e,this.offset=n,this.precise=o}static before(e,n){return new fi(e.parentNode,Ua(e),n)}static after(e,n){return new fi(e.parentNode,Ua(e)+1,n)}}var En=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(En||(En={}));const ql=En.LTR,ix=En.RTL;function BM(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const Gfe=BM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),qfe=BM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ob=Object.create(null),Hi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Ob[e]=n,Ob[n]=-e}function LM(t){return t<=247?Gfe[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?qfe[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Yfe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Qi{get dir(){return this.level%2?ix:ql}constructor(e,n,o){this.from=e,this.to=n,this.level=o}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,o,r){let i=-1;for(let s=0;s<e.length;s++){let a=e[s];if(a.from<=n&&a.to>=n){if(a.level==o)return s;(i<0||(r!=0?r<0?a.from<n:a.to>n:e[i].level>a.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function PM(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let o=t[n],r=e[n];if(o.from!=r.from||o.to!=r.to||o.direction!=r.direction||!PM(o.inner,r.inner))return!1}return!0}const an=[];function jfe(t,e,n,o,r){for(let i=0;i<=o.length;i++){let s=i?o[i-1].to:e,a=i<o.length?o[i].from:n,l=i?256:r;for(let c=s,u=l,d=l;c<a;c++){let f=LM(t.charCodeAt(c));f==512?f=u:f==8&&d==4&&(f=16),an[c]=f==4?2:f,f&7&&(d=f),u=f}for(let c=s,u=l,d=l;c<a;c++){let f=an[c];if(f==128)c<a-1&&u==an[c+1]&&u&24?f=an[c]=u:an[c]=256;else if(f==64){let h=c+1;for(;h<a&&an[h]==64;)h++;let g=c&&u==8||h<n&&an[h]==8?d==1?1:8:256;for(let v=c;v<h;v++)an[v]=g;c=h-1}else f==8&&d==1&&(an[c]=1);u=f,f&7&&(d=f)}}}function Xfe(t,e,n,o,r){let i=r==1?2:1;for(let s=0,a=0,l=0;s<=o.length;s++){let c=s?o[s-1].to:e,u=s<o.length?o[s].from:n;for(let d=c,f,h,g;d<u;d++)if(h=Ob[f=t.charCodeAt(d)])if(h<0){for(let v=a-3;v>=0;v-=3)if(Hi[v+1]==-h){let m=Hi[v+2],b=m&2?r:m&4?m&1?i:r:0;b&&(an[d]=an[Hi[v]]=b),a=v;break}}else{if(Hi.length==189)break;Hi[a++]=d,Hi[a++]=f,Hi[a++]=l}else if((g=an[d])==2||g==1){let v=g==r;l=v?0:1;for(let m=a-3;m>=0;m-=3){let b=Hi[m+2];if(b&2)break;if(v)Hi[m+2]|=2;else{if(b&4)break;Hi[m+2]|=4}}}}}function Kfe(t,e,n,o){for(let r=0,i=o;r<=n.length;r++){let s=r?n[r-1].to:t,a=r<n.length?n[r].from:e;for(let l=s;l<a;){let c=an[l];if(c==256){let u=l+1;for(;;)if(u==a){if(r==n.length)break;u=n[r++].to,a=r<n.length?n[r].from:e}else if(an[u]==256)u++;else break;let d=i==1,f=(u<e?an[u]:o)==1,h=d==f?d?1:2:o;for(let g=u,v=r,m=v?n[v-1].to:t;g>l;)g==m&&(g=n[--v].from,m=v?n[v-1].to:t),an[--g]=h;l=u}else i=c,l++}}}function Bb(t,e,n,o,r,i,s){let a=o%2?2:1;if(o%2==r%2)for(let l=e,c=0;l<n;){let u=!0,d=!1;if(c==i.length||l<i[c].from){let v=an[l];v!=a&&(u=!1,d=v==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,g=l;e:for(;;)if(c<i.length&&g==i[c].from){if(d)break e;let v=i[c];if(!u)for(let m=v.to,b=c+1;;){if(m==n)break e;if(b<i.length&&i[b].from==m)m=i[b++].to;else{if(an[m]==a)break e;break}}if(c++,f)f.push(v);else{v.from>l&&s.push(new Qi(l,v.from,h));let m=v.direction==ql!=!(h%2);Lb(t,m?o+1:o,r,v.inner,v.from,v.to,s),l=v.to}g=v.to}else{if(g==n||(u?an[g]!=a:an[g]==a))break;g++}f?Bb(t,l,g,o+1,r,f,s):l<g&&s.push(new Qi(l,g,h)),l=g}else for(let l=n,c=i.length;l>e;){let u=!0,d=!1;if(!c||l>i[c-1].to){let v=an[l-1];v!=a&&(u=!1,d=v==16)}let f=!u&&a==1?[]:null,h=u?o:o+1,g=l;e:for(;;)if(c&&g==i[c-1].to){if(d)break e;let v=i[--c];if(!u)for(let m=v.from,b=c;;){if(m==e)break e;if(b&&i[b-1].to==m)m=i[--b].from;else{if(an[m-1]==a)break e;break}}if(f)f.push(v);else{v.to<l&&s.push(new Qi(v.to,l,h));let m=v.direction==ql!=!(h%2);Lb(t,m?o+1:o,r,v.inner,v.from,v.to,s),l=v.from}g=v.from}else{if(g==e||(u?an[g-1]!=a:an[g-1]==a))break;g--}f?Bb(t,g,l,o+1,r,f,s):g<l&&s.push(new Qi(g,l,h)),l=g}}function Lb(t,e,n,o,r,i,s){let a=e%2?2:1;jfe(t,r,i,o,a),Xfe(t,r,i,o,a),Kfe(r,i,o,a),Bb(t,r,i,e,n,o,s)}function Zfe(t,e,n){if(!t)return[new Qi(0,0,e==ix?1:0)];if(e==ql&&!n.length&&!Yfe.test(t))return DM(t.length);if(n.length)for(;t.length>an.length;)an[an.length]=256;let o=[],r=e==ql?0:1;return Lb(t,r,r,n,0,t.length,o),o}function DM(t){return[new Qi(0,t,0)]}let EM="";function Qfe(t,e,n,o,r){var i;let s=o.head-t.from,a=Qi.find(e,s,(i=o.bidiLevel)!==null&&i!==void 0?i:-1,o.assoc),l=e[a],c=l.side(r,n);if(s==c){let f=a+=r?1:-1;if(f<0||f>=e.length)return null;l=e[a=f],s=l.side(!r,n),c=l.side(r,n)}let u=Oo(t.text,s,l.forward(r,n));(u<l.from||u>l.to)&&(u=c),EM=t.text.slice(Math.min(s,u),Math.max(s,u));let d=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return d&&u==c&&d.level+(r?0:1)<l.level?Ue.cursor(d.side(!r,n)+t.from,d.forward(r,n)?1:-1,d.level):Ue.cursor(u+t.from,l.forward(r,n)?-1:1,l.level)}function Jfe(t,e,n){for(let o=e;o<n;o++){let r=LM(t.charCodeAt(o));if(r==1)return ql;if(r==2||r==4)return ix}return ql}const NM=vt.define(),IM=vt.define(),RM=vt.define(),FM=vt.define(),Pb=vt.define(),VM=vt.define(),zM=vt.define(),sx=vt.define(),ax=vt.define(),HM=vt.define({combine:t=>t.some(e=>e)}),ehe=vt.define({combine:t=>t.some(e=>e)}),WM=vt.define();class Gc{constructor(e,n="nearest",o="nearest",r=5,i=5,s=!1){this.range=e,this.y=n,this.x=o,this.yMargin=r,this.xMargin=i,this.isSnapshot=s}map(e){return e.empty?this:new Gc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Gc(Ue.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Oh=$n.define({map:(t,e)=>t.map(e)}),UM=$n.define();function Ji(t,e,n){let o=t.facet(FM);o.length?o[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Es=vt.define({combine:t=>t.length?t[0]:!0});let the=0;const Mc=vt.define({combine(t){return t.filter((e,n)=>{for(let o=0;o<n;o++)if(t[o].plugin==e.plugin)return!1;return!0})}});class Yl{constructor(e,n,o,r,i){this.id=e,this.create=n,this.domEventHandlers=o,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Mc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Mc.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:o,eventObservers:r,provide:i,decorations:s}=n||{};return new Yl(the++,e,o,r,a=>{let l=[];return s&&l.push(xg.of(c=>{let u=c.plugin(a);return u?s(u):Zn.none})),i&&l.push(i(a)),l})}static fromClass(e,n){return Yl.define((o,r)=>new e(o,r),n)}}class Iv{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(o){if(Ji(n.state,o,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Ji(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(o){Ji(e.state,o,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const GM=vt.define(),lx=vt.define(),xg=vt.define(),qM=vt.define(),cx=vt.define(),Wf=vt.define(),YM=vt.define();function bk(t,e){let n=t.state.facet(YM);if(!n.length)return n;let o=n.map(i=>i instanceof Function?i(t):i),r=[];return tn.spans(o,e.from,e.to,{point(){},span(i,s,a,l){let c=i-e.from,u=s-e.from,d=r;for(let f=a.length-1;f>=0;f--,l--){let h=a[f].spec.bidiIsolate,g;if(h==null&&(h=Jfe(e.text,c,u)),l>0&&d.length&&(g=d[d.length-1]).to==c&&g.direction==h)g.to=u,d=g.inner;else{let v={from:c,to:u,direction:h,inner:[]};d.push(v),d=v.inner}}}}),r}const jM=vt.define();function XM(t){let e=0,n=0,o=0,r=0;for(let i of t.state.facet(jM)){let s=i(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(o=Math.max(o,s.top)),s.bottom!=null&&(r=Math.max(r,s.bottom)))}return{left:e,right:n,top:o,bottom:r}}const pd=vt.define();class Fr{constructor(e,n,o,r){this.fromA=e,this.toA=n,this.fromB=o,this.toB=r}join(e){return new Fr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,o=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>o.toA)){if(r.toA<o.fromA)break;o=o.join(r),e.splice(n-1,1)}}return e.splice(n,0,o),e}static extendWithRanges(e,n){if(n.length==0)return e;let o=[];for(let r=0,i=0,s=0;;){let a=r<e.length?e[r].fromB:1e9,l=i<n.length?n[i]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+s,d=c,f=u;for(;;)if(i<n.length&&n[i]<=d){let h=n[i+1];i+=2,d=Math.max(d,h);for(let g=r;g<e.length&&e[g].fromB<=d;g++)s=e[g].toA-e[g].toB;f=Math.max(f,h+s)}else if(r<e.length&&e[r].fromB<=d){let h=e[r++];d=Math.max(d,h.toB),f=Math.max(f,h.toA),s=h.toA-h.toB}else break;o.push(new Fr(u,f,c,d))}return o}}class C0{constructor(e,n,o){this.view=e,this.state=n,this.transactions=o,this.flags=0,this.startState=e.state,this.changes=Wn.empty(this.startState.doc.length);for(let i of o)this.changes=this.changes.compose(i.changes);let r=[];this.changes.iterChangedRanges((i,s,a,l)=>r.push(new Fr(i,s,a,l))),this.changedRanges=r}static create(e,n,o){return new C0(e,n,o)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const nhe=[];class In{constructor(e,n,o=0){this.dom=e,this.length=n,this.flags=o,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return nhe}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&Nfe(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let o=n;for(let r of this.children){if(r==e)return o;o+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let o=Ua(this.dom),r=this.length?e>0:n>0;return new fi(this.parent.dom,o+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof _g)return e;return null}static get(e){return e.cmTile}}class wg extends In{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,o=null,r,i=(e==null?void 0:e.node)==n?e:null,s=0;for(let a of this.children){if(a.sync(e),s+=a.length+a.breakAfter,r=o?o.nextSibling:n.firstChild,i&&r!=a.dom&&(i.written=!0),a.dom.parentNode==n)for(;r&&r!=a.dom;)r=yk(r);else n.insertBefore(a.dom,r);o=a.dom}for(r=o?o.nextSibling:n.firstChild,i&&r&&(i.written=!0);r;)r=yk(r);this.length=s}}function yk(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class _g extends wg{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=In.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],o=this,r=0,i=0;;)if(r==o.children.length){if(!n.length)return;o=o.parent,o.breakAfter&&i++,r=n.pop()}else{let s=o.children[r++];if(s instanceof Gs)n.push(r),o=s,r=0;else{let a=i+s.length,l=e(s,i);if(l!==void 0)return l;i=a+s.breakAfter}}}resolveBlock(e,n){let o,r=-1,i,s=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(o=void 0)}(l<e||e==c&&(n<-1?a.length:a.covers(1)))&&(!o||!a.isWidget()&&o.isWidget())&&(o=a,r=e-l),(c>e||e==l&&(n>1?a.length:a.covers(-1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,s=e-l)}}),!o&&!i)throw new Error("No tile at position "+e);return o&&n<0||!i?{tile:o,offset:r}:{tile:i,offset:s}}}class Gs extends wg{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let o=new Gs(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class hu extends wg{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,o){let r=new hu(n||document.createElement("div"),e);return(!n||!o)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,o){let r=null,i=-1,s=null,a=-1;function l(u,d){for(let f=0,h=0;f<u.children.length&&h<=d;f++){let g=u.children[f],v=h+g.length;v>=d&&(g.isComposite()?l(g,d-h):(!s||s.isHidden&&(n>0||o&&rhe(s,g)))&&(v>d||g.flags&32)?(s=g,a=d-h):(h<d||g.flags&16&&!g.isHidden)&&(r=g,i=d-h)),h=v}}l(this,e);let c=(n<0?r:s)||r||s;return c?{tile:c,offset:c==r?i:a}:null}coordsIn(e,n){let o=this.resolveInline(e,n,!0);return o?o.tile.coordsIn(Math.max(0,o.offset),n):ohe(this)}domIn(e,n){let o=this.resolveInline(e,n);if(o){let{tile:r,offset:i}=o;if(this.dom.contains(r.dom))return r.isText()?new fi(r.dom,Math.min(r.dom.nodeValue.length,i)):r.domPosFor(i,r.flags&16?1:r.flags&32?-1:n);let s=o.tile.parent,a=!1;for(let l of s.children){if(a)return new fi(l.dom,0);l==o.tile&&(a=!0)}}return new fi(this.dom,0)}}function ohe(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=up(e);return n[n.length-1]||null}function rhe(t,e){let n=t.coordsIn(0,1),o=e.coordsIn(0,1);return n&&o&&o.top<n.bottom}class tr extends wg{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let o=new tr(n||document.createElement(e.tagName),e);return n||(o.flags|=4),o}}class Sl extends In{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n){let o=this.dom.nodeValue.length;e>o&&(e=o);let r=e,i=e,s=0;e==0&&n<0||e==o&&n>=0?it.chrome||it.gecko||(e?(r--,s=1):i<o&&(i++,s=-1)):n<0?r--:i<o&&i++;let a=yf(this.dom,r,i).getClientRects();if(!a.length)return null;let l=a[(s?s<0:n>=0)?0:a.length-1];return it.safari&&!s&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),s?A0(l,s<0):l||null}static of(e,n){let o=new Sl(n||document.createTextNode(e),e);return n||(o.flags|=2),o}}class jl extends In{constructor(e,n,o,r){super(e,n,r),this.widget=o}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,o){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(o)return A0(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?i.length-1:0;s=i[l],!(e>0?l==0:l==i.length-1||s.top<s.bottom);l+=a?-1:1);return A0(s,!a)}}get overrideDOMText(){if(!this.length)return Ut.empty;let{root:e}=this;if(!e)return Ut.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,o,r,i){return i||(i=e.toDOM(n),e.editable||(i.contentEditable="false")),new jl(i,o,e,r)}}class $0 extends In{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return Ut.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class ihe{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,o){let{tile:r,index:i,beforeBreak:s,parents:a}=this;for(;e||n>0;)if(r.isComposite())if(s){if(!e)break;o&&o.break(),e--,s=!1}else if(i==r.children.length){if(!e&&!a.length)break;o&&o.leave(r),s=!!r.breakAfter,{tile:r,index:i}=a.pop(),i++}else{let l=r.children[i],c=l.breakAfter;(n>0?l.length<=e:l.length<e)&&(!o||o.skip(l,0,l.length)!==!1||!l.isComposite)?(s=!!c,i++,e-=l.length):(a.push({tile:r,index:i}),r=l,i=0,o&&l.isComposite()&&o.enter(l))}else if(i==r.length)s=!!r.breakAfter,{tile:r,index:i}=a.pop(),i++;else if(e){let l=Math.min(e,r.length-i);o&&o.skip(r,i,i+l),e-=l,i+=l}else break;return this.tile=r,this.index=i,this.beforeBreak=s,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class she{constructor(e,n,o,r){this.from=e,this.to=n,this.wrapper=o,this.rank=r}}class ahe{constructor(e,n,o){this.cache=e,this.root=n,this.blockWrappers=o,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,o,r){var i;this.flushBuffer();let s=this.ensureMarks(n,o),a=s.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=s.children[s.children.length-1]=new Sl(a.dom,a.text+e);l.parent=s}else s.append(r||Sl.of(e,(i=this.cache.find(Sl))===null||i===void 0?void 0:i.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let o=this.curLine;o.dom!=n.line.dom&&(o.setDOM(this.cache.reused.has(n.line)?Rv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=o;for(let a=n.marks.length-1;a>=0;a--){let l=n.marks[a],c=r.lastChild;if(c instanceof tr&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(Rv(l.dom)),r=c;else{if(this.cache.reused.get(l)){let d=In.get(l.dom);d&&d.setDOM(Rv(l.dom))}let u=tr.of(l.mark,l.dom);r.append(u),r=u}this.cache.reused.set(l,2)}let i=In.get(e.text);i&&this.cache.reused.set(i,2);let s=new Sl(e.text,e.text.nodeValue);s.flags|=8,r.append(s)}addInlineWidget(e,n,o){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(n,o);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,o){this.flushBuffer(),this.ensureMarks(n,o).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var o;e||(e=KM);let r=hu.start(e,n||((o=this.cache.find(hu))===null||o===void 0?void 0:o.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var o;let r=this.curLine;for(let i=e.length-1;i>=0;i--){let s=e[i],a;if(n>0&&(a=r.lastChild)&&a instanceof tr&&a.mark.eq(s))r=a,n--;else{let l=tr.of(s,(o=this.cache.find(tr,c=>c.mark.eq(s)))===null||o===void 0?void 0:o.dom);r.append(l),r=l,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!xk(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(it.ios&&xk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Fv,0,32)||new jl(Fv.toDOM(),0,Fv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=new she(e.from,e.to,e.value,e.rank),o=this.wrappers.length;for(;o>0&&(this.wrappers[o-1].rank-n.rank||this.wrappers[o-1].to-n.to)<0;)o--;this.wrappers.splice(o,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let o of this.wrappers){let r=n.lastChild;if(o.from<this.pos&&r instanceof Gs&&r.wrapper.eq(o.wrapper))n=r;else{let i=Gs.of(o.wrapper,(e=this.cache.find(Gs,s=>s.wrapper.eq(o.wrapper)))===null||e===void 0?void 0:e.dom);n.append(i),n=i}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),o=this.cache.find($0,void 0,1);return o&&(o.flags=n),o||new $0(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class lhe{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:i,done:s}=this.cursor.next(this.skipCount);if(this.skipCount=0,s)throw new Error("Ran out of text content when drawing inline views");this.text=r;let a=this.textOff=Math.min(e,r.length);return i?null:r.slice(0,a)}let n=Math.min(this.text.length,this.textOff+e),o=this.text.slice(this.textOff,n);return this.textOff=n,o}}const T0=[jl,hu,Sl,tr,$0,Gs,_g];for(let t=0;t<T0.length;t++)T0[t].bucket=t;class che{constructor(e){this.view=e,this.buckets=T0.map(()=>[]),this.index=T0.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,o=this.buckets[n];o.length<6?o.push(e):o[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,o=2){let r=e.bucket,i=this.buckets[r],s=this.index[r];for(let a=i.length-1;a>=0;a--){let l=(a+s)%i.length,c=i[l];if((!n||n(c))&&!this.reused.has(c))return i.splice(l,1),l<s&&this.index[r]--,this.reused.set(c,o),c}return null}findWidget(e,n,o){let r=this.buckets[0];if(r.length)for(let i=0,s=0;;i++){if(i==r.length){if(s)return null;s=1,i=0}let a=r[i];if(!this.reused.has(a)&&(s==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,a.widget==e&&a.length==n&&(a.flags&497)==o?(this.reused.set(a,1),a):(this.reused.set(a,2),new jl(a.dom,n,e,a.flags&-498|o))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class uhe{constructor(e,n,o,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new che(e),this.text=new lhe(e.state.doc),this.builder=new ahe(this.cache,new _g(e,e.contentDOM),tn.iter(o)),this.cache.reused.set(n,2),this.old=new ihe(n),this.reuseWalker={skip:(s,a,l)=>{if(this.cache.add(s),s.isComposite())return!1},enter:s=>this.cache.add(s),leave:()=>{},break:()=>{}}}run(e,n){let o=n&&this.getCompositionContext(n.text);for(let r=0,i=0,s=0;;){let a=s<e.length?e[s++]:null,l=a?a.fromA:this.old.root.length;if(l>r){let c=l-r;this.preserve(c,!s,!a),r=l,i+=c}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(i,n.range.fromB),this.cache.clear(),this.builder.addComposition(n,o),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(i,a.toB)),i=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,o){let r=hhe(this.old),i=this.openMarks;this.old.advance(e,o?1:-1,{skip:(s,a,l)=>{if(s.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<s.length?jl.of(s.widget,this.view,l-a,s.flags&496,this.cache.maybeReuse(s)):this.cache.reuse(s);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,i),i=r.length)}else if(s.isText())this.builder.ensureLine(null),!a&&l==s.length?this.builder.addText(s.text,r,i,this.cache.reuse(s)):(this.cache.add(s),this.builder.addText(s.text.slice(a,l),r,i)),i=r.length;else if(s.isLine())s.flags&=-2,this.cache.reused.set(s,1),this.builder.addLine(s);else if(s instanceof $0)this.cache.add(s);else if(s instanceof tr)this.builder.ensureLine(null),this.builder.addMark(s,r,i),this.cache.reused.set(s,1),i=r.length;else return!1;this.openWidget=!1},enter:s=>{s.isLine()?this.builder.addLineStart(s.attrs,this.cache.maybeReuse(s)):(this.cache.add(s),s instanceof tr&&r.unshift(s.mark)),this.openWidget=!1},leave:s=>{s.isLine()?r.length&&(r.length=i=0):s instanceof tr&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let o=null,r=this.builder,i=0,s=tn.spans(this.decorations,e,n,{point:(a,l,c,u,d,f)=>{if(c instanceof Gl){if(this.disallowBlockEffectsFor[f]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(i=u.length,d>u.length)r.continueWidget(l-a);else{let h=c.widget||(c.block?pu.block:pu.inline),g=dhe(c),v=this.cache.findWidget(h,l-a,g)||jl.of(h,this.view,l-a,g);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(o),r.addBlockWidget(v)):(r.ensureLine(o),r.addInlineWidget(v,u,d))}o=null}else o=fhe(o,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let d=a;d<l;){let f=this.text.next(Math.min(512,l-d));f==null?(r.addLineStartIfNotCovered(o),r.addBreak(),d++):(r.ensureLine(o),r.addText(f,c,d==a?u:c.length),d+=f.length),o=null}}});r.addLineStartIfNotCovered(o),this.openWidget=s>i,this.openMarks=s}forward(e,n,o=1){n-e<=10?this.old.advance(n-e,o,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,o,this.reuseWalker))}getCompositionContext(e){let n=[],o=null;for(let r=e.parentNode;;r=r.parentNode){let i=In.get(r);if(r==this.view.contentDOM)break;i instanceof tr?n.push(i):i!=null&&i.isLine()?o=i:i instanceof Gs||(r.nodeName=="DIV"&&!o&&r!=this.view.contentDOM?o=new hu(r,KM):o||n.push(tr.of(new zf({tagName:r.nodeName.toLowerCase(),attributes:Ife(r)}),r)))}return{line:o,marks:n}}}function xk(t,e){let n=o=>{for(let r of o.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function dhe(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const KM={class:"cm-line"};function fhe(t,e){let n=e.spec.attributes,o=e.spec.class;return!n&&!o||(t||(t={class:"cm-line"}),n&&ox(n,t),o&&(t.class+=" "+o)),t}function hhe(t){let e=[];for(let n=t.parents.length;n>1;n--){let o=n==t.parents.length?t.tile:t.parents[n].tile;o instanceof tr&&e.push(o.mark)}return e}function Rv(t){let e=In.get(t);return e&&e.setDOM(t.cloneNode()),t}class pu extends yg{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}pu.inline=new pu("span");pu.block=new pu("div");const Fv=new class extends yg{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class wk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Zn.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new _g(e,e.contentDOM),this.updateInner([new Fr(0,0,0,e.state.doc.length)],null)}update(e){var n;let o=e.changedRanges;this.minWidth>0&&o.length&&(o.every(({fromA:u,toA:d})=>d<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!_he(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let i=r>-1?mhe(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:d}=this.hasComposition;o=new Fr(u,d,e.changes.mapPos(u,-1),e.changes.mapPos(d,1)).addToSet(o.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(it.ie||it.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,a=this.blockWrappers;this.updateDeco();let l=bhe(s,this.decorations,e.changes);l.length&&(o=Fr.extendWithRanges(o,l));let c=xhe(a,this.blockWrappers,e.changes);return c.length&&(o=Fr.extendWithRanges(o,c)),i&&!o.some(u=>u.fromA<=i.range.fromA&&u.toA>=i.range.toA)&&(o=i.range.addToSet(o.slice())),this.tile.flags&2&&o.length==0?!1:(this.updateInner(o,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:o}=this.view;o.ignore(()=>{if(n||e.length){let s=this.tile,a=new uhe(this.view,s,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,n),Db(s,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let i=it.chrome||it.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(i),i&&(i.written||o.selectionRange.focusNode!=i.node||!this.tile.dom.contains(i.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let i of this.tile.children)i.isWidget()&&i.widget instanceof Vv&&r.push(i.dom);o.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let o of n.effects)o.is(UM)&&(this.editContextFormatting=o.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:o}=this.tile,r=this.view.root.activeElement,i=r==o,s=!i&&!(this.view.state.facet(Es)||o.tabIndex>-1)&&Ed(o,this.view.observer.selectionRange)&&!(r&&o.contains(r));if(!(i||n||s))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),it.gecko&&l.empty&&!this.hasComposition&&phe(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=u=new fi(f,0),a=!0}let d=this.view.observer.selectionRange;(a||!d.focusNode||(!Nd(c.node,c.offset,d.anchorNode,d.anchorOffset)||!Nd(u.node,u.offset,d.focusNode,d.focusOffset))&&!this.suppressWidgetCursorChange(d,l))&&(this.view.observer.ignore(()=>{it.android&&it.chrome&&o.contains(d.focusNode)&&whe(d.focusNode,o)&&(o.blur(),o.focus({preventScroll:!0}));let f=bf(this.view.root);if(f)if(l.empty){if(it.gecko){let h=ghe(c.node,c.offset);if(h&&h!=3){let g=(h==1?MM:OM)(c.node,c.offset);g&&(c=new fi(g.node,g.offset))}}f.collapse(c.node,c.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(h)}s&&this.view.root.activeElement==o&&(o.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new fi(d.anchorNode,d.anchorOffset),this.impreciseHead=u.precise?null:new fi(d.focusNode,d.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Nd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,o=bf(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!o||!n.empty||!n.assoc||!o.modify)return;let s=this.lineAt(n.head,n.assoc);if(!s)return;let a=s.posAtStart;if(n.head==a||n.head==a+s.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);o.collapse(u.node,u.offset),o.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&o.collapse(r,i)}posFromDOM(e,n){let o=this.tile.nearest(e);if(!o)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=o.posAtStart;if(o.isComposite()){let i;if(e==o.dom)i=o.dom.childNodes[n];else{let s=Js(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==o.dom)break;s==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?s=-1:s=1),e=a}s<0?i=e:i=e.nextSibling}if(i==o.dom.firstChild)return r;for(;i&&!In.get(i);)i=i.nextSibling;if(!i)return r+o.length;for(let s=0,a=r;;s++){let l=o.children[s];if(l.dom==i)return a;a+=l.length+l.breakAfter}}else return o.isText()?e==o.dom?r+n:r+(n?o.length:0):r}domAtPos(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.domPosFor(e,n):o.domIn(r,n)}inlineDOMNearPos(e,n){let o,r=-1,i=!1,s,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(i=!0)}else{let d=u+c.length;if(u<=e&&(o=c,r=e-u,i=d<e),d>=e&&!s&&(s=c,a=e-u,l=u>e),u>e&&s)return!0}}),!o&&!s?this.domAtPos(e,n):(i&&s?o=null:l&&o&&(s=null),o&&n<0||!s?o.domIn(r,n):s.domIn(a,n))}coordsAt(e,n){let{tile:o,offset:r}=this.tile.resolveBlock(e,n);return o.isWidget()?o.widget instanceof Vv?null:o.coordsInWidget(r,n,!0):o.coordsIn(r,n)}lineAt(e,n){let{tile:o}=this.tile.resolveBlock(e,n);return o.isLine()?o:null}coordsForChar(e){let{tile:n,offset:o}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(i,s){if(i.isComposite())for(let a of i.children){if(a.length>=s){let l=r(a,s);if(l)return l}if(s-=a.length,s<0)break}else if(i.isText()&&s<i.length){let a=Oo(i.text,s);if(a==s)return null;let l=yf(i.dom,s,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,o)}measureVisibleLineHeights(e){let n=[],{from:o,to:r}=e,i=this.view.contentDOM.clientWidth,s=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==En.LTR,c=0,u=(d,f,h)=>{for(let g=0;g<d.children.length&&!(f>r);g++){let v=d.children[g],m=f+v.length,b=v.dom.getBoundingClientRect(),{height:y}=b;if(h&&!g&&(c+=b.top-h.top),v instanceof Gs)m>o&&u(v,f,b);else if(f>=o&&(c>0&&n.push(-c),n.push(y+c),c=0,s)){let x=v.dom.lastChild,_=x?up(x):[];if(_.length){let S=_[_.length-1],N=l?S.right-b.left:b.right-S.left;N>a&&(a=N,this.minWidth=i,this.minWidthFrom=f,this.minWidthTo=m)}}h&&g==d.children.length-1&&(c+=h.bottom-b.bottom),f=m+v.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?En.RTL:En.LTR}measureTextSize(){let e=this.tile.blockTiles(s=>{if(s.isLine()&&s.children.length&&s.length<=20){let a=0,l;for(let c of s.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=up(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:s.dom.getBoundingClientRect().height,charWidth:a/s.length,textHeight:l}}});if(e)return e;let n=document.createElement("div"),o,r,i;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let s=up(n.firstChild)[0];o=n.getBoundingClientRect().height,r=s&&s.width?s.width/27:7,i=s&&s.height?s.height:o,n.remove()}),{lineHeight:o,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let o=0,r=0;;r++){let i=r==n.viewports.length?null:n.viewports[r],s=i?i.from-1:this.view.state.doc.length;if(s>o){let a=(n.lineBlockAt(s).bottom-n.lineBlockAt(o).top)/this.view.scaleY;e.push(Zn.replace({widget:new Vv(a),block:!0,inclusive:!0,isBlockGap:!0}).range(o,s))}if(!i)break;o=i.to+1}return Zn.set(e)}updateDeco(){let e=1,n=this.view.state.facet(xg).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),o=!1,r=this.view.state.facet(cx).map((i,s)=>{let a=typeof i=="function";return a&&(o=!0),a?i(this.view):i});for(r.length&&(this.dynamicDecorationMap[e++]=o,n.push(tn.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(qM).map(i=>typeof i=="function"?i(this.view):i)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(WM))try{if(c(this.view,e.range,e))return!0}catch(u){Ji(this.view.state,u,"scroll handler")}let{range:n}=e,o=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),r;if(!o)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,r.left),top:Math.min(o.top,r.top),right:Math.max(o.right,r.right),bottom:Math.max(o.bottom,r.bottom)});let i=XM(this.view),s={left:o.left-i.left,top:o.top-i.top,right:o.right+i.right,bottom:o.bottom+i.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;if(Vfe(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==En.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(o.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||o.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=o=>o.isWidget()||o.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Db(this.tile)}}function Db(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let o of t.children)Db(o,e)}}function phe(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function ZM(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let o=MM(n.focusNode,n.focusOffset),r=OM(n.focusNode,n.focusOffset),i=o||r;if(r&&o&&r.node!=o.node){let a=In.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)i=r;else if(t.docView.lastCompositionAfterCursor){let l=In.get(o.node);!l||l.isText()&&l.text!=o.node.nodeValue||(i=r)}}if(t.docView.lastCompositionAfterCursor=i!=o,!i)return null;let s=e-i.offset;return{from:s,to:s+i.node.nodeValue.length,node:i.node}}function mhe(t,e,n){let o=ZM(t,n);if(!o)return null;let{node:r,from:i,to:s}=o,a=r.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(o.from,o.to)!=a)return null;let l=e.invertedDesc;return{range:new Fr(l.mapPos(i),l.mapPos(s),i,s),text:r}}function ghe(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let vhe=class{constructor(){this.changes=[]}compareRange(e,n){Wc(e,n,this.changes)}comparePoint(e,n){Wc(e,n,this.changes)}boundChange(e){Wc(e,e,this.changes)}};function bhe(t,e,n){let o=new vhe;return tn.compare(t,e,n,o),o.changes}class yhe{constructor(){this.changes=[]}compareRange(e,n){Wc(e,n,this.changes)}comparePoint(){}boundChange(e){Wc(e,e,this.changes)}}function xhe(t,e,n){let o=new yhe;return tn.compare(t,e,n,o),o.changes}function whe(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function _he(t,e){let n=!1;return e&&t.iterChangedRanges((o,r)=>{o<e.to&&r>e.from&&(n=!0)}),n}class Vv extends yg{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function khe(t,e,n=1){let o=t.charCategorizer(e),r=t.doc.lineAt(e),i=e-r.from;if(r.length==0)return Ue.cursor(e);i==0?n=1:i==r.length&&(n=-1);let s=i,a=i;n<0?s=Oo(r.text,i,!1):a=Oo(r.text,i);let l=o(r.text.slice(s,a));for(;s>0;){let c=Oo(r.text,s,!1);if(o(r.text.slice(c,s))!=l)break;s=c}for(;a<r.length;){let c=Oo(r.text,a);if(o(r.text.slice(a,c))!=l)break;a=c}return Ue.range(s+r.from,a+r.from)}function She(t,e,n,o,r){let i=Math.round((o-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((r-n.top-(t.defaultLineHeight-a)*.5)/a);i+=l*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+Ofe(s,i,t.state.tabSize)}function Ahe(t,e,n){let o=t.lineBlockAt(e);if(Array.isArray(o.type)){let r;for(let i of o.type){if(i.from>e)break;if(!(i.to<e)){if(i.from<e&&i.to>e)return i;(!r||i.type==Ur.Text&&(r.type!=i.type||(n<0?i.from<e:i.to>e)))&&(r=i)}}return r||o}return o}function Che(t,e,n,o){let r=Ahe(t,e.head,e.assoc||-1),i=!o||r.type!=Ur.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),a=t.textDirectionAt(r.from),l=t.posAtCoords({x:n==(a==En.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(l!=null)return Ue.cursor(l,n?-1:1)}return Ue.cursor(n?r.to:r.from,n?-1:1)}function _k(t,e,n,o){let r=t.state.doc.lineAt(e.head),i=t.bidiSpans(r),s=t.textDirectionAt(r.from);for(let a=e,l=null;;){let c=Qfe(r,i,s,a,n),u=EM;if(!c){if(r.number==(n?t.state.doc.lines:1))return a;u=`
|
|
856
|
-
`,r=t.state.doc.line(r.number+(n?1:-1)),i=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(l){if(!l(u))return a}else{if(!o)return c;l=o(u)}a=c}}function $he(t,e,n){let o=t.state.charCategorizer(e),r=o(n);return i=>{let s=o(i);return r==Fs.Space&&(r=s),r==s}}function The(t,e,n,o){let r=e.head,i=n?1:-1;if(r==(n?t.state.doc.length:0))return Ue.cursor(r,e.assoc);let s=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,(e.empty?e.assoc:0)||(n?1:-1)),u=t.documentTop;if(c)s==null&&(s=c.left-l.left),a=i<0?c.top:c.bottom;else{let g=t.viewState.lineBlockAt(r);s==null&&(s=Math.min(l.right-l.left,t.defaultCharacterWidth*(r-g.from))),a=(i<0?g.top:g.bottom)+u}let d=l.left+s,f=o??t.viewState.heightOracle.textHeight>>1,h=Eb(t,{x:d,y:a+f*i},!1,i);return Ue.cursor(h.pos,h.assoc,void 0,s)}function Id(t,e,n){for(;;){let o=0;for(let r of t)r.between(e-1,e+1,(i,s,a)=>{if(e>i&&e<s){let l=o||n||(e-i<s-e?-1:1);e=l<0?i:s,o=l}});if(!o)return e}}function QM(t,e){let n=null;for(let o=0;o<e.ranges.length;o++){let r=e.ranges[o],i=null;if(r.empty){let s=Id(t,r.from,0);s!=r.from&&(i=Ue.cursor(s,-1))}else{let s=Id(t,r.from,-1),a=Id(t,r.to,1);(s!=r.from||a!=r.to)&&(i=Ue.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}i&&(n||(n=e.ranges.slice()),n[o]=i)}return n?Ue.create(n,e.mainIndex):e}function zv(t,e,n){let o=Id(t.state.facet(Wf).map(r=>r(t)),n.from,e.head>n.from?-1:1);return o==n.from?n:Ue.cursor(o,o<n.from?1:-1)}class Ki{constructor(e,n){this.pos=e,this.assoc=n}}function Eb(t,e,n,o){let r=t.contentDOM.getBoundingClientRect(),i=r.top+t.viewState.paddingTop,{x:s,y:a}=e,l=a-i,c;for(;;){if(l<0)return new Ki(0,1);if(l>t.viewState.docHeight)return new Ki(t.state.doc.length,-1);if(c=t.elementAtHeight(l),o==null)break;if(c.type==Ur.Text){if(o<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let f=t.docView.coordsAt(o<0?c.from:c.to,o>0?-1:1);if(f&&(o<0?f.top<=l+i:f.bottom>=l+i))break}let d=t.viewState.heightOracle.textHeight/2;l=o>0?c.bottom+d:c.top-d}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==Ur.Text){let d=She(t,r,c,s,a);return new Ki(d,d==c.from?1:-1)}}if(c.type!=Ur.Text)return l<(c.top+c.bottom)/2?new Ki(c.from,1):new Ki(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new Mhe(t,s,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class Mhe{constructor(e,n,o,r){this.view=e,this.x=n,this.y=o,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[Qi.find(r,e-o.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:o,spans:r}=this.bidiSpansAt(e);return r[Qi.find(r,e-o.from,-1,n)].dir}bidiIn(e,n){let{spans:o,line:r}=this.bidiSpansAt(e);return o.length>1||o.length&&(o[0].level!=this.baseDir||o[0].to+r.from<n)}scan(e,n){let o=0,r=e.length-1,i=new Set,s=this.bidiIn(e[0],e[r]),a,l,c=-1,u=1e9,d;e:for(;o<r;){let h=r-o,g=o+r>>1;t:if(i.has(g)){let m=o+Math.floor(Math.random()*h);for(let b=0;b<h;b++){if(!i.has(m)){g=m;break t}m++,m==r&&(m=o)}break e}i.add(g);let v=n(g);if(v)for(let m=0;m<v.length;m++){let b=v[m],y=0;if(b.bottom<this.y)(!a||a.bottom<b.bottom)&&(a=b),y=1;else if(b.top>this.y)(!l||l.top>b.top)&&(l=b),y=-1;else{let x=b.left>this.x?this.x-b.left:b.right<this.x?this.x-b.right:0,_=Math.abs(x);_<u&&(c=g,u=_,d=b),x&&(y=x<0==(this.baseDir==En.LTR)?-1:1)}y==-1&&(!s||this.baseDirAt(e[g],1))?r=g:y==1&&(!s||this.baseDirAt(e[g+1],-1))&&(o=g+1)}}if(!d){let h=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(h.top+h.bottom)/2,this.scan(e,n)}let f=(s?this.dirAt(e[c],1):this.baseDir)==En.LTR;return{i:c,after:this.x>(d.left+d.right)/2==f}}scanText(e,n){let o=[];for(let i=0;i<e.length;i=Oo(e.text,i))o.push(n+i);o.push(n+e.length);let r=this.scan(o,i=>{let s=o[i]-n,a=o[i+1]-n;return yf(e.dom,s,a).getClientRects()});return r.after?new Ki(o[r.i+1],-1):new Ki(o[r.i],1)}scanTile(e,n){if(!e.length)return new Ki(n,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let o=[n];for(let a=0,l=n;a<e.children.length;a++)o.push(l+=e.children[a].length);let r=this.scan(o,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:yf(l.dom,0,l.length)).getClientRects()}),i=e.children[r.i],s=o[r.i];return i.isText()?this.scanText(i,s):i.isComposite()?this.scanTile(i,s):r.after?new Ki(o[r.i+1],-1):new Ki(s,1)}}const md="";class Ohe{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Qt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=md}readRange(e,n){if(!e)return this;let o=e.parentNode;for(let r=e;;){this.findPointBefore(o,r);let i=this.text.length;this.readNode(r);let s=In.get(r),a=r.nextSibling;if(a==n){s!=null&&s.breakAfter&&!a&&o!=this.view.contentDOM&&this.lineBreak();break}let l=In.get(a);(s&&l?s.breakAfter:(s?s.breakAfter:S0(r))||S0(a)&&(r.nodeName!="BR"||s!=null&&s.isWidget())&&this.text.length>i)&&!Lhe(a,n)&&this.lineBreak(),r=a}return this.findPointBefore(o,n),this}readTextNode(e){let n=e.nodeValue;for(let o of this.points)o.node==e&&(o.pos=this.text.length+Math.min(o.offset,n.length));for(let o=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,s=1,a;if(this.lineSeparator?(i=n.indexOf(this.lineSeparator,o),s=this.lineSeparator.length):(a=r.exec(n))&&(i=a.index,s=a[0].length),this.append(n.slice(o,i<0?n.length:i)),i<0)break;if(this.lineBreak(),s>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=s-1);o=i+s}}readNode(e){let n=In.get(e),o=n&&n.overrideDOMText;if(o!=null){this.findPointInside(e,o.length);for(let r=o.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let o of this.points)o.node==e&&e.childNodes[o.offset]==n&&(o.pos=this.text.length)}findPointInside(e,n){for(let o of this.points)(e.nodeType==3?o.node==e:e.contains(o.node))&&(o.pos=this.text.length+(Bhe(e,o.node,o.offset)?n:0))}}function Bhe(t,e,n){for(;;){if(!e||n<Js(e))return!1;if(e==t)return!0;n=Ua(e)+1,e=e.parentNode}}function Lhe(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let o=In.get(t);if(!(o!=null&&o.isWidget()))return!1;o&&(n||(n=[])).push(o)}if(n)for(let o of n){let r=o.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class kk{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Phe{constructor(e,n,o,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:i,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=JM(e.docView.tile,n,o,0))){let a=i||s?[]:Ehe(e),l=new Ohe(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=Nhe(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=i&&i.node==a.focusNode&&i.offset==a.focusOffset||!Mb(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!Mb(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((it.ios||it.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let d=Math.min(l,c),f=Math.max(l,c),h=u.from-d,g=u.to-f;(h==0||h==1||d==0)&&(g==0||g==-1||f==e.state.doc.length)&&(l=0,c=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Ue.range(c,l)):this.newSel=Ue.single(c,l)}}}function JM(t,e,n,o){if(t.isComposite()){let r=-1,i=-1,s=-1,a=-1;for(let l=0,c=o,u=o;l<t.children.length;l++){let d=t.children[l],f=c+d.length;if(c<e&&f>n)return JM(d,e,n,c);if(f>=e&&r==-1&&(r=l,i=c),c>n&&d.dom.parentNode==t.dom){s=l,a=u;break}u=f,c=f+d.breakAfter}return{from:i,to:a<0?o+t.length:a,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:s<t.children.length&&s>=0?t.children[s].dom:null}}else return t.isText()?{from:o,to:o+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function eO(t,e){let n,{newSel:o}=e,r=t.state.selection.main,i=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,l=r.from,c=null;(i===8||it.android&&e.text.length<a-s)&&(l=r.to,c="end");let u=tO(t.state.doc.sliceString(s,a,md),e.text,l-s,c);u&&(it.chrome&&i==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==md+md&&u.toB--,n={from:s+u.from,to:s+u.toA,insert:Ut.of(e.text.slice(u.from,u.toB).split(md))})}else o&&(!t.hasFocus&&t.state.facet(Es)||M0(o,r))&&(o=null);if(!n&&!o)return!1;if(!n&&e.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(it.mac||it.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(o&&n.insert.length==2&&(o=Ue.single(o.main.anchor-1,o.main.head-1)),n={from:n.from,to:n.to,insert:Ut.of([n.insert.toString().replace("."," ")])}):n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,r.to))}:t.state.doc.lineAt(r.from).to<r.to&&t.docView.lineHasWidget(r.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:r.from,to:r.to,insert:t.state.toText(t.inputState.insertingText)}:it.chrome&&n&&n.from==n.to&&n.from==r.head&&n.insert.toString()==`
|
|
857
|
-
`&&t.lineWrapping&&(o&&(o=Ue.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:Ut.of([" "])}),n)return ux(t,n,o,i);if(o&&!M0(o,r)){let s=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(o=QM(t.state.facet(Wf).map(l=>l(t)),o))),t.dispatch({selection:o,scrollIntoView:s,userEvent:a}),!0}else return!1}function ux(t,e,n,o=-1){if(it.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(it.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Uc(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||o==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Uc(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Uc(t.contentDOM,"Delete",46)))return!0;let i=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let s,a=()=>s||(s=Dhe(t,e,n));return t.state.facet(VM).some(l=>l(t,e.from,e.to,i,a))||t.dispatch(a()),!0}function Dhe(t,e,n){let o,r=t.state,i=r.selection.main,s=-1;if(e.from==e.to&&e.from<i.from||e.from>i.to){let l=e.from<i.from?-1:1,c=l<0?i.from:i.to,u=Id(r.facet(Wf).map(d=>d(t)),c,l);e.from==u&&(s=u)}if(s>-1)o={changes:e,selection:Ue.cursor(e.from+e.insert.length,-1)};else if(e.from>=i.from&&e.to<=i.to&&e.to-e.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=i.from<e.from?r.sliceDoc(i.from,e.from):"",c=i.to>e.to?r.sliceDoc(e.to,i.to):"";o=r.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let l=r.changes(e),c=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=i.to+10&&e.to>=i.to-10){let u=t.state.sliceDoc(e.from,e.to),d,f=n&&ZM(t,n.main.head);if(f){let g=e.insert.length-(e.to-e.from);d={from:f.from,to:f.to-g}}else d=t.state.doc.lineAt(i.head);let h=i.to-e.to;o=r.changeByRange(g=>{if(g.from==i.from&&g.to==i.to)return{changes:l,range:c||g.map(l)};let v=g.to-h,m=v-u.length;if(t.state.sliceDoc(m,v)!=u||v>=d.from&&m<=d.to)return{range:g};let b=r.changes({from:m,to:v,insert:e.insert}),y=g.to-i.to;return{changes:b,range:c?Ue.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):g.map(b)}})}else o={changes:l,selection:c&&r.selection.replaceRange(c)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:a,scrollIntoView:!0})}function tO(t,e,n,o){let r=Math.min(t.length,e.length),i=0;for(;i<r&&t.charCodeAt(i)==e.charCodeAt(i);)i++;if(i==r&&t.length==e.length)return null;let s=t.length,a=e.length;for(;s>0&&a>0&&t.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(o=="end"){let l=Math.max(0,i-Math.min(s,a));n-=s+l-i}if(s<i&&t.length<e.length){let l=n<=i&&n>=s?i-n:0;i-=l,a=i+(a-s),s=i}else if(a<i){let l=n<=i&&n>=a?i-n:0;i-=l,s=i+(s-a),a=i}return{from:i,toA:s,toB:a}}function Ehe(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=t.observer.selectionRange;return n&&(e.push(new kk(n,o)),(r!=n||i!=o)&&e.push(new kk(r,i))),e}function Nhe(t,e){if(t.length==0)return null;let n=t[0].pos,o=t.length==2?t[1].pos:n;return n>-1&&o>-1?Ue.single(n+e,o+e):null}function M0(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class Ihe{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,it.safari&&e.contentDOM.addEventListener("input",()=>null),it.gecko&&Qhe(e.contentDOM.ownerDocument)}handleEvent(e){!Ghe(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let o=this.handlers[e];if(o){for(let r of o.observers)r(this.view,n);for(let r of o.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=Rhe(e),o=this.handlers,r=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,a=o[i];a&&s!=!a.handlers.length&&(r.removeEventListener(i,this.handleEvent),a=null),a||r.addEventListener(i,this.handleEvent,{passive:s})}for(let i in o)i!="scroll"&&!n[i]&&r.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&oO.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),it.android&&it.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return it.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=nO.find(o=>o.keyCode==e.keyCode))&&!e.ctrlKey||Fhe.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Uc(this.view.contentDOM,n.key,n.keyCode,n instanceof KeyboardEvent?n:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:it.safari&&!it.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Sk(t,e){return(n,o)=>{try{return e.call(t,o,n)}catch(r){Ji(n.state,r)}}}function Rhe(t){let e=Object.create(null);function n(o){return e[o]||(e[o]={observers:[],handlers:[]})}for(let o of t){let r=o.spec,i=r&&r.plugin.domEventHandlers,s=r&&r.plugin.domEventObservers;if(i)for(let a in i){let l=i[a];l&&n(a).handlers.push(Sk(o.value,l))}if(s)for(let a in s){let l=s[a];l&&n(a).observers.push(Sk(o.value,l))}}for(let o in Li)n(o).handlers.push(Li[o]);for(let o in jr)n(o).observers.push(jr[o]);return e}const nO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Fhe="dthko",oO=[16,17,18,20,91,92,224,225],Bh=6;function Lh(t){return Math.max(0,t)*.7+8}function Vhe(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class zhe{constructor(e,n,o,r){this.view=e,this.startEvent=n,this.style=o,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=zfe(e.contentDOM),this.atoms=e.state.facet(Wf).map(s=>s(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Qt.allowMultipleSelections)&&Hhe(e,n),this.dragging=Uhe(e,n)&&sO(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Vhe(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,o=0,r=0,i=0,s=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:s}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:i,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=XM(this.view);e.clientX-l.left<=r+Bh?n=-Lh(r-e.clientX):e.clientX+l.right>=s-Bh&&(n=Lh(e.clientX-s)),e.clientY-l.top<=i+Bh?o=-Lh(i-e.clientY):e.clientY+l.bottom>=a-Bh&&(o=Lh(e.clientY-a)),this.setScrollSpeed(n,o)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,o=QM(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!o.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:o,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Hhe(t,e){let n=t.state.facet(NM);return n.length?n[0](e):it.mac?e.metaKey:e.ctrlKey}function Whe(t,e){let n=t.state.facet(IM);return n.length?n[0](e):it.mac?!e.altKey:!e.ctrlKey}function Uhe(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let o=bf(t.root);if(!o||o.rangeCount==0)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i<r.length;i++){let s=r[i];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function Ghe(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,o;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(o=In.get(n))&&o.isWidget()&&!o.isHidden&&o.widget.ignoreEvent(e))return!1;return!0}const Li=Object.create(null),jr=Object.create(null),rO=it.ie&&it.ie_version<15||it.ios&&it.webkit_version<604;function qhe(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),iO(t,n.value)},50)}function kg(t,e,n){for(let o of t.facet(e))n=o(n,t);return n}function iO(t,e){e=kg(t.state,sx,e);let{state:n}=t,o,r=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(Nb!=null&&n.selection.ranges.every(l=>l.empty)&&Nb==i.toString()){let l=-1;o=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let d=n.toText((s?i.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:d},range:Ue.cursor(c.from+d.length)}})}else s?o=n.changeByRange(l=>{let c=i.line(r++);return{changes:{from:l.from,to:l.to,insert:c.text},range:Ue.cursor(l.from+c.length)}}):o=n.replaceSelection(i);t.dispatch(o,{userEvent:"input.paste",scrollIntoView:!0})}jr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Li.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);jr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};jr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Li.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of t.state.facet(RM))if(n=o(t,e),n)break;if(!n&&e.button==0&&(n=jhe(t,e)),n){let o=!t.hasFocus;t.inputState.startMouseSelection(new zhe(t,e,n,o)),o&&t.observer.ignore(()=>{$M(t.contentDOM);let i=t.root.activeElement;i&&!i.contains(t.contentDOM)&&i.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function Ak(t,e,n,o){if(o==1)return Ue.cursor(e,n);if(o==2)return khe(t.state,e,n);{let r=t.docView.lineAt(e,n),i=t.state.doc.lineAt(r?r.posAtEnd:e),s=r?r.posAtStart:i.from,a=r?r.posAtEnd:i.to;return a<t.state.doc.length&&a==i.to&&a++,Ue.range(s,a)}}const Yhe=it.ie&&it.ie_version<=11;let Ck=null,$k=0,Tk=0;function sO(t){if(!Yhe)return t.detail;let e=Ck,n=Tk;return Ck=t,Tk=Date.now(),$k=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?($k+1)%3:1}function jhe(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),o=sO(e),r=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),r=r.map(i.changes))},get(i,s,a){let l=t.posAndSideAtCoords({x:i.clientX,y:i.clientY},!1),c,u=Ak(t,l.pos,l.assoc,o);if(n.pos!=l.pos&&!s){let d=Ak(t,n.pos,n.assoc,o),f=Math.min(d.from,u.from),h=Math.max(d.to,u.to);u=f<u.from?Ue.range(f,h):Ue.range(h,f)}return s?r.replaceRange(r.main.extend(u.from,u.to)):a&&o==1&&r.ranges.length>1&&(c=Xhe(r,l.pos))?c:a?r.addRange(u):Ue.create([u])}}}function Xhe(t,e){for(let n=0;n<t.ranges.length;n++){let{from:o,to:r}=t.ranges[n];if(o<=e&&r>=e)return Ue.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}Li.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let i=r.posAtStart,s=i+r.length;(i>=n.to||s<=n.from)&&(n=Ue.range(i,s))}}let{inputState:o}=t;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",kg(t.state,ax,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Li.dragend=t=>(t.inputState.draggedContent=null,!1);function Mk(t,e,n,o){if(n=kg(t.state,sx,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=o&&i&&Whe(t,e)?{from:i.from,to:i.to}:null,a={from:r,insert:n},l=t.state.changes(s?[s,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Li.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&Mk(t,e,o.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let a=new FileReader;a.onerror=i,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(o[s]=a.result),i()},a.readAsText(n[s])}return!0}else{let o=e.dataTransfer.getData("Text");if(o)return Mk(t,e,o,!0),!0}return!1};Li.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=rO?null:e.clipboardData;return n?(iO(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(qhe(t),!1)};function Khe(t,e){let n=t.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=e,o.focus(),o.selectionEnd=e.length,o.selectionStart=0,setTimeout(()=>{o.remove(),t.focus()},50)}function Zhe(t){let e=[],n=[],o=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:i}of t.selection.ranges){let s=t.doc.lineAt(i);s.number>r&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),r=s.number}o=!0}return{text:kg(t,ax,e.join(t.lineBreak)),ranges:n,linewise:o}}let Nb=null;Li.copy=Li.cut=(t,e)=>{if(!Ed(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:o,linewise:r}=Zhe(t.state);if(!n&&!r)return!1;Nb=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=rO?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(Khe(t,n),!1)};const aO=rl.define();function lO(t,e){let n=[];for(let o of t.facet(zM)){let r=o(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:aO.of(!0)}):null}function cO(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=lO(t.state,e);n?t.dispatch(n):t.update([])}},10)}jr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),cO(t)};jr.blur=t=>{t.observer.clearSelectionRange(),cO(t)};jr.compositionstart=jr.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};jr.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,it.chrome&&it.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};jr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Li.beforeinput=(t,e)=>{var n,o;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let i=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),s=e.getTargetRanges();if(i&&s.length){let a=s[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return ux(t,{from:l,to:c,insert:t.state.toText(i)},null),!0}}let r;if(it.chrome&&it.android&&(r=nO.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return it.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),it.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>jr.compositionend(t,e),20),!1};const Ok=new Set;function Qhe(t){Ok.has(t)||(Ok.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Bk=["pre-wrap","normal","pre-line","break-spaces"];let mu=!1;function Lk(){mu=!1}class Jhe{constructor(e){this.lineWrapping=e,this.doc=Ut.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let o=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(o+=Math.max(0,Math.ceil((n-e-o*this.lineLength*.5)/this.lineLength))),this.lineHeight*o}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Bk.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let o=0;o<e.length;o++){let r=e[o];r<0?o++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,o,r,i,s){let a=Bk.indexOf(e)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(o-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=o,this.textHeight=r,this.lineLength=i,l){this.heightSamples={};for(let c=0;c<s.length;c++){let u=s[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class epe{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class li{constructor(e,n,o,r,i){this.from=e,this.length=n,this.top=o,this.height=r,this._content=i}get type(){return typeof this._content=="number"?Ur.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Gl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new li(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var dn=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(dn||(dn={}));const dp=.001;class Uo{constructor(e,n,o=2){this.length=e,this.height=n,this.flags=o}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>dp&&(mu=!0),this.height=e)}replace(e,n,o){return Uo.of(o)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,o,r){let i=this,s=o.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:d}=r[a],f=i.lineAt(l,dn.ByPosNoHeight,o.setDoc(n),0,0),h=f.to>=c?f:i.lineAt(c,dn.ByPosNoHeight,o,0,0);for(d+=h.to-c,c=h.to;a>0&&f.from<=r[a-1].toA;)l=r[a-1].fromA,u=r[a-1].fromB,a--,l<f.from&&(f=i.lineAt(l,dn.ByPosNoHeight,o,0,0));u+=f.from-l,l=f.from;let g=dx.build(o.setDoc(s),e,u,d);i=O0(i,i.replace(l,c,g))}return i.updateHeight(o,0)}static empty(){return new br(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,o=e.length,r=0,i=0;for(;;)if(n==o)if(r>i*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),o+=1+a.break,r-=a.size}else if(i>r*2){let a=e[o];a.break?e.splice(o,1,a.left,null,a.right):e.splice(o,1,a.left,a.right),o+=2+a.break,i-=a.size}else break;else if(r<i){let a=e[n++];a&&(r+=a.size)}else{let a=e[--o];a&&(i+=a.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,o++),new npe(Uo.of(e.slice(0,n)),s,Uo.of(e.slice(o)))}}function O0(t,e){return t==e?t:(t.constructor!=e.constructor&&(mu=!0),e)}Uo.prototype.size=1;const tpe=Zn.replace({});class uO extends Uo{constructor(e,n,o){super(e,n),this.deco=o,this.spaceAbove=0}mainBlock(e,n){return new li(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,o,r){return this.spaceAbove&&e<o+this.spaceAbove?new li(r,0,o,this.spaceAbove,tpe):this.mainBlock(o,r)}lineAt(e,n,o,r,i){let s=this.mainBlock(r,i);return this.spaceAbove?this.blockAt(0,o,r,i).join(s):s}forEachLine(e,n,o,r,i,s){e<=i+this.length&&n>=i&&s(this.lineAt(0,dn.ByPos,o,r,i))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,o=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class br extends uO{constructor(e,n,o){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=o}mainBlock(e,n){return new li(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,o){let r=o[0];return o.length==1&&(r instanceof br||r instanceof oo&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof oo?r=new br(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Uo.of(o)}updateHeight(e,n=0,o=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(o||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class oo extends Uo{constructor(e){super(e,0)}heightMetrics(e,n){let o=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,i=r-o+1,s,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*i);s=l/i,this.length>i+1&&(a=(this.height-l)/(this.length-i-1))}else s=this.height/i;return{firstLine:o,lastLine:r,perLine:s,perChar:a}}blockAt(e,n,o,r){let{firstLine:i,lastLine:s,perLine:a,perChar:l}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-o)/this.height))*this.length)),u=n.doc.lineAt(c),d=a+u.length*l,f=Math.max(o,e-d/2);return new li(u.from,u.length,f,d,0)}else{let c=Math.max(0,Math.min(s-i,Math.floor((e-o)/a))),{from:u,length:d}=n.doc.line(i+c);return new li(u,d,o+a*c,a,0)}}lineAt(e,n,o,r,i){if(n==dn.ByHeight)return this.blockAt(e,o,r,i);if(n==dn.ByPosNoHeight){let{from:h,to:g}=o.doc.lineAt(e);return new li(h,g-h,0,0,0)}let{firstLine:s,perLine:a,perChar:l}=this.heightMetrics(o,i),c=o.doc.lineAt(e),u=a+c.length*l,d=c.number-s,f=r+a*d+l*(c.from-i-d);return new li(c.from,c.length,Math.max(r,Math.min(f,r+this.height-u)),u,0)}forEachLine(e,n,o,r,i,s){e=Math.max(e,i),n=Math.min(n,i+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(o,i);for(let u=e,d=r;u<=n;){let f=o.doc.lineAt(u);if(u==e){let g=f.number-a;d+=l*g+c*(e-i-g)}let h=l+c*f.length;s(new li(f.from,f.length,d,h,0)),d+=h,u=f.to+1}}replace(e,n,o){let r=this.length-n;if(r>0){let i=o[o.length-1];i instanceof oo?o[o.length-1]=new oo(i.length+r):o.push(null,new oo(r-1))}if(e>0){let i=o[0];i instanceof oo?o[0]=new oo(e+i.length):o.unshift(new oo(e-1),null)}return Uo.of(o)}decomposeLeft(e,n){n.push(new oo(e-1),null)}decomposeRight(e,n){n.push(null,new oo(this.length-e-1))}updateHeight(e,n=0,o=!1,r){let i=n+this.length;if(r&&r.from<=n+this.length&&r.more){let s=[],a=Math.max(n,r.from),l=-1;for(r.from>n&&s.push(new oo(r.from-n-1).updateHeight(e,n));a<=i&&r.more;){let u=e.doc.lineAt(a).length;s.length&&s.push(null);let d=r.heights[r.index++],f=0;d<0&&(f=-d,d=r.heights[r.index++]),l==-1?l=d:Math.abs(d-l)>=dp&&(l=-2);let h=new br(u,d,f);h.outdated=!1,s.push(h),a+=u+1}a<=i&&s.push(null,new oo(i-a).updateHeight(e,a));let c=Uo.of(s);return(l<0||Math.abs(c.height-this.height)>=dp||Math.abs(l-this.heightMetrics(e,n).perLine)>=dp)&&(mu=!0),O0(this,c)}else(o||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class npe extends Uo{constructor(e,n,o){super(e.length+n+o.length,e.height+o.height,n|(e.outdated||o.outdated?2:0)),this.left=e,this.right=o,this.size=e.size+o.size}get break(){return this.flags&1}blockAt(e,n,o,r){let i=o+this.left.height;return e<i?this.left.blockAt(e,n,o,r):this.right.blockAt(e,n,i,r+this.left.length+this.break)}lineAt(e,n,o,r,i){let s=r+this.left.height,a=i+this.left.length+this.break,l=n==dn.ByHeight?e<s:e<a,c=l?this.left.lineAt(e,n,o,r,i):this.right.lineAt(e,n,o,s,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=n==dn.ByPosNoHeight?dn.ByPosNoHeight:dn.ByPos;return l?c.join(this.right.lineAt(a,u,o,s,a)):this.left.lineAt(a,u,o,r,i).join(c)}forEachLine(e,n,o,r,i,s){let a=r+this.left.height,l=i+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,o,r,i,s),n>=l&&this.right.forEachLine(e,n,o,a,l,s);else{let c=this.lineAt(l,dn.ByPos,o,r,i);e<c.from&&this.left.forEachLine(e,c.from-1,o,r,i,s),c.to>=e&&c.from<=n&&s(c),n>c.to&&this.right.forEachLine(c.to+1,n,o,a,l,s)}}replace(e,n,o){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,o),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,o));let i=[];e>0&&this.decomposeLeft(e,i);let s=i.length;for(let a of o)i.push(a);if(e>0&&Pk(i,s-1),n<this.length){let a=i.length;this.decomposeRight(n,i),Pk(i,a)}return Uo.of(i)}decomposeLeft(e,n){let o=this.left.length;if(e<=o)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(o++,e>=o&&n.push(null)),e>o&&this.right.decomposeLeft(e-o,n)}decomposeRight(e,n){let o=this.left.length,r=o+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<o&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Uo.of(this.break?[e,null,n]:[e,n]):(this.left=O0(this.left,e),this.right=O0(this.right,n),this.setHeight(e.height+n.height),this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,o=!1,r){let{left:i,right:s}=this,a=n+i.length+this.break,l=null;return r&&r.from<=n+i.length&&r.more?l=i=i.updateHeight(e,n,o,r):i.updateHeight(e,n,o),r&&r.from<=a+s.length&&r.more?l=s=s.updateHeight(e,a,o,r):s.updateHeight(e,a,o),l?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Pk(t,e){let n,o;t[e]==null&&(n=t[e-1])instanceof oo&&(o=t[e+1])instanceof oo&&t.splice(e-1,3,new oo(n.length+1+o.length))}const ope=5;class dx{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let o=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof br?r.length+=o-this.pos:(o>this.pos||!this.isCovered)&&this.nodes.push(new br(o-this.pos,-1,0)),this.writtenTo=o,n>o&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,o){if(e<n||o.heightRelevant){let r=o.widget?o.widget.estimatedHeight:0,i=o.widget?o.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let s=n-e;o.block?this.addBlock(new uO(s,r,o)):(s||i||r>=ope)&&this.addLineDeco(r,i,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new br(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let o=new oo(n-e);return this.oracle.doc.lineAt(e).to==n&&(o.flags|=4),o}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof br)return e;let n=new br(0,-1,0);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,o){let r=this.ensureLine();r.length+=o,r.collapsed+=o,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+o}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof br)&&!this.isCovered?this.nodes.push(new br(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let o=e;for(let r of this.nodes)r instanceof br&&r.updateHeight(this.oracle,o),o+=r?r.length:1;return this.nodes}static build(e,n,o,r){let i=new dx(o,e);return tn.spans(n,o,r,i,0),i.finish(o)}}function rpe(t,e,n){let o=new ipe;return tn.compare(t,e,n,o,0),o.changes}class ipe{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,o,r){(e<n||o&&o.heightRelevant||r&&r.heightRelevant)&&Wc(e,n,this.changes,5)}}function spe(t,e){let n=t.getBoundingClientRect(),o=t.ownerDocument,r=o.defaultView||window,i=Math.max(0,n.left),s=Math.min(r.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=o.body;)if(c.nodeType==1){let u=c,d=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&d.overflow!="visible"){let f=u.getBoundingClientRect();i=Math.max(i,f.left),s=Math.min(s,f.right),a=Math.max(a,f.top),l=Math.min(c==t.parentNode?r.innerHeight:l,f.bottom)}c=d.position=="absolute"||d.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:i-n.left,right:Math.max(i,s)-n.left,top:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function ape(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function lpe(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Hv{constructor(e,n,o,r){this.from=e,this.to=n,this.size=o,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++){let r=e[o],i=n[o];if(r.from!=i.from||r.to!=i.to||r.size!=i.size)return!1}return!0}draw(e,n){return Zn.replace({widget:new cpe(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class cpe extends yg{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Dk{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Ek,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=En.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(lx).some(o=>typeof o!="function"&&o.class=="cm-lineWrapping");this.heightOracle=new Jhe(n),this.stateDeco=Nk(e),this.heightMap=Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle.setDoc(e.doc),[new Fr(0,0,0,e.doc.length)]);for(let o=0;o<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());o++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Zn.set(this.lineGaps.map(o=>o.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let o=0;o<=1;o++){let r=o?n.head:n.anchor;if(!e.some(({from:i,to:s})=>r>=i&&r<=s)){let{from:i,to:s}=this.lineBlockAt(r);e.push(new Ph(i,s))}}return this.viewports=e.sort((o,r)=>o.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ek:new fx(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(gd(e,this.scaler))})}update(e,n=null){this.state=e.state;let o=this.stateDeco;this.stateDeco=Nk(this.state);let r=e.changedRanges,i=Fr.extendWithRanges(r,rpe(o,this.stateDeco,e?e.changes:Wn.empty(this.state.doc.length))),s=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Lk(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),i),(this.heightMap.height!=s||mu)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=s);let l=i.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(ehe)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,o=window.getComputedStyle(n),r=this.heightOracle,i=o.whiteSpace;this.defaultTextDirection=o.direction=="rtl"?En.RTL:En.LTR;let s=this.heightOracle.mustRefreshForWrapping(i)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=s||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:_,scaleY:S}=CM(n,a);(_>.005&&Math.abs(this.scaleX-_)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=_,this.scaleY=S,c|=16,s=l=!0)}let d=(parseInt(o.paddingTop)||0)*this.scaleY,f=(parseInt(o.paddingBottom)||0)*this.scaleY;(this.paddingTop!=d||this.paddingBottom!=f)&&(this.paddingTop=d,this.paddingBottom=f,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=TM(e.scrollDOM);let g=(this.printing?lpe:spe)(n,this.paddingTop),v=g.top-this.pixelViewport.top,m=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!ape(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let _=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(_)&&(s=!0),s||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:S,charWidth:N,textHeight:B}=e.docView.measureTextSize();s=S>0&&r.refresh(i,S,N,B,Math.max(5,y/N),_),s&&(e.docView.minWidth=0,c|=16)}v>0&&m>0?u=Math.max(v,m):v<0&&m<0&&(u=Math.min(v,m)),Lk();for(let S of this.viewports){let N=S.from==this.viewport.from?_:e.docView.measureVisibleLineHeights(S);this.heightMap=(s?Uo.empty().applyChanges(this.stateDeco,Ut.empty,this.heightOracle,[new Fr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,s,new epe(S.from,N))}mu&&(c|=2)}let x=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let o=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,i=this.heightOracle,{visibleTop:s,visibleBottom:a}=this,l=new Ph(r.lineAt(s-o*1e3,dn.ByHeight,i,0,0).from,r.lineAt(a+(1-o)*1e3,dn.ByHeight,i,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),d=r.lineAt(c,dn.ByPos,i,0,0),f;n.y=="center"?f=(d.top+d.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?f=d.top:f=d.bottom-u,l=new Ph(r.lineAt(f-1e3/2,dn.ByHeight,i,0,0).from,r.lineAt(f+u+1e3/2,dn.ByHeight,i,0,0).to)}}return l}mapViewport(e,n){let o=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new Ph(this.heightMap.lineAt(o,dn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,dn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},o=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,dn.ByPos,this.heightOracle,0,0),{bottom:i}=this.heightMap.lineAt(n,dn.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:a}=this;return(e==0||r<=s-Math.max(10,Math.min(-o,250)))&&(n==this.state.doc.length||i>=a+Math.max(10,Math.min(o,250)))&&r>s-2*1e3&&i<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let o=[];for(let r of e)n.touchesRange(r.from,r.to)||o.push(new Hv(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return o}ensureLineGaps(e,n){let o=this.heightOracle.lineWrapping,r=o?1e4:2e3,i=r>>1,s=r<<1;if(this.defaultTextDirection!=En.LTR&&!o)return[];let a=[],l=(u,d,f,h)=>{if(d-u<i)return;let g=this.state.selection.main,v=[g.from];g.empty||v.push(g.to);for(let b of v)if(b>u&&b<d){l(u,b-10,f,h),l(b+10,d,f,h);return}let m=dpe(e,b=>b.from>=f.from&&b.to<=f.to&&Math.abs(b.from-u)<i&&Math.abs(b.to-d)<i&&!v.some(y=>b.from<y&&b.to>y));if(!m){if(d<f.to&&n&&o&&n.visibleRanges.some(x=>x.from<=d&&x.to>=d)){let x=n.moveToLineBoundary(Ue.cursor(d),!1,!0).head;x>u&&(d=x)}let b=this.gapSize(f,u,d,h),y=o||b<2e6?b:2e6;m=new Hv(u,d,b,y)}a.push(m)},c=u=>{if(u.length<s||u.type!=Ur.Text)return;let d=upe(u.from,u.to,this.stateDeco);if(d.total<s)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,h,g;if(o){let v=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,b;if(f!=null){let y=Eh(d,f),x=((this.visibleBottom-this.visibleTop)/2+v)/u.height;m=y-x,b=y+x}else m=(this.visibleTop-u.top-v)/u.height,b=(this.visibleBottom-u.top+v)/u.height;h=Dh(d,m),g=Dh(d,b)}else{let v=d.total*this.heightOracle.charWidth,m=r*this.heightOracle.charWidth,b=0;if(v>2e6)for(let N of e)N.from>=u.from&&N.from<u.to&&N.size!=N.displaySize&&N.from*this.heightOracle.charWidth+b<this.pixelViewport.left&&(b=N.size-N.displaySize);let y=this.pixelViewport.left+b,x=this.pixelViewport.right+b,_,S;if(f!=null){let N=Eh(d,f),B=((x-y)/2+m)/v;_=N-B,S=N+B}else _=(y-m)/v,S=(x+m)/v;h=Dh(d,_),g=Dh(d,S)}h>u.from&&l(u.from,h,u,d),g<u.to&&l(g,u.to,u,d)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,n,o,r){let i=Eh(r,o)-Eh(r,n);return this.heightOracle.lineWrapping?e.height*i:r.total*this.heightOracle.charWidth*i}updateLineGaps(e){Hv.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Zn.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let o=[];tn.spans(n,this.viewport.from,this.viewport.to,{span(i,s){o.push({from:i,to:s})},point(){}},20);let r=0;if(o.length!=this.visibleRanges.length)r=12;else for(let i=0;i<o.length&&!(r&8);i++){let s=this.visibleRanges[i],a=o[i];(s.from!=a.from||s.to!=a.to)&&(r|=4,e&&e.mapPos(s.from,-1)==a.from&&e.mapPos(s.to,1)==a.to||(r|=8))}return this.visibleRanges=o,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||gd(this.heightMap.lineAt(e,dn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||gd(this.heightMap.lineAt(this.scaler.fromDOM(e),dn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return gd(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ph{constructor(e,n){this.from=e,this.to=n}}function upe(t,e,n){let o=[],r=t,i=0;return tn.spans(n,t,e,{span(){},point(s,a){s>r&&(o.push({from:r,to:s}),i+=s-r),r=a}},20),r<e&&(o.push({from:r,to:e}),i+=e-r),{total:i,ranges:o}}function Dh({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let o=Math.floor(t*n);for(let r=0;;r++){let{from:i,to:s}=e[r],a=s-i;if(o<=a)return i+o;o-=a}}function Eh(t,e){let n=0;for(let{from:o,to:r}of t.ranges){if(e<=r){n+=e-o;break}n+=r-o}return n/t.total}function dpe(t,e){for(let n of t)if(e(n))return n}const Ek={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Nk(t){let e=t.facet(xg).filter(o=>typeof o!="function"),n=t.facet(cx).filter(o=>typeof o!="function");return n.length&&e.push(tn.join(n)),e}class fx{constructor(e,n,o){let r=0,i=0,s=0;this.viewports=o.map(({from:a,to:l})=>{let c=n.lineAt(a,dn.ByPos,e,0,0).top,u=n.lineAt(l,dn.ByPos,e,0,0).bottom;return r+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let a of this.viewports)a.domTop=s+(a.top-i)*this.scale,s=a.domBottom=a.domTop+(a.bottom-a.top),i=a.bottom}toDOM(e){for(let n=0,o=0,r=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.top)return r+(e-o)*this.scale;if(e<=i.bottom)return i.domTop+(e-i.top);o=i.bottom,r=i.domBottom}}fromDOM(e){for(let n=0,o=0,r=0;;n++){let i=n<this.viewports.length?this.viewports[n]:null;if(!i||e<i.domTop)return o+(e-r)/this.scale;if(e<=i.domBottom)return i.top+(e-i.domTop);o=i.bottom,r=i.domBottom}}eq(e){return e instanceof fx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,o)=>n.from==e.viewports[o].from&&n.to==e.viewports[o].to):!1}}function gd(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),o=e.toDOM(t.bottom);return new li(t.from,t.length,n,o-n,Array.isArray(t._content)?t._content.map(r=>gd(r,e)):t._content)}const Nh=vt.define({combine:t=>t.join(" ")}),Ib=vt.define({combine:t=>t.indexOf(!0)>-1}),Rb=Ha.newName(),dO=Ha.newName(),fO=Ha.newName(),hO={"&light":"."+dO,"&dark":"."+fO};function Fb(t,e,n){return new Ha(e,{finish(o){return/&/.test(o)?o.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+o}})}const fpe=Fb("."+Rb,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},hO),hpe={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wv=it.ie&&it.ie_version<=11;class ppe{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Hfe,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let o of n)this.queue.push(o);(it.ie&&it.ie_version<=11||it.ios&&e.composing)&&n.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&it.android&&e.constructor.EDIT_CONTEXT!==!1&&!(it.chrome&&it.chrome_version<126)&&(this.editContext=new gpe(e),e.state.facet(Es)&&(e.contentDOM.editContext=this.editContext.editContext)),Wv&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,o)=>n!=e[o]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:o}=this,r=this.selectionRange;if(o.state.facet(Es)?o.root.activeElement!=this.dom:!Ed(this.dom,r))return;let i=r.anchorNode&&o.docView.tile.nearest(r.anchorNode);if(i&&i.isWidget()&&i.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(it.ie&&it.ie_version<=11||it.android&&it.chrome)&&!o.state.selection.main.empty&&r.focusNode&&Nd(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=bf(e.root);if(!n)return!1;let o=it.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&mpe(this.view,n)||n;if(!o||this.selectionRange.eq(o))return!1;let r=Ed(this.dom,o);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Ufe(this.dom,o)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(o),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let o=this.dom;o;)if(o.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==o?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let o of this.scrollTargets)o.removeEventListener("scroll",this.onScroll);for(let o of this.scrollTargets=n)o.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,hpe),Wv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var o;if(!this.delayedAndroidKey){let r=()=>{let i=this.delayedAndroidKey;i&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=i.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&i.force&&Uc(this.dom,i.key,i.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((o=this.delayedAndroidKey)===null||o===void 0)&&o.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,o=-1,r=!1;for(let i of e){let s=this.readMutation(i);s&&(s.typeOver&&(r=!0),n==-1?{from:n,to:o}=s:(n=Math.min(s.from,n),o=Math.max(s.to,o)))}return{from:n,to:o,typeOver:r}}readChange(){let{from:e,to:n,typeOver:o}=this.processRecords(),r=this.selectionChanged&&Ed(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let i=new Phe(this.view,e,n,o);return this.view.docView.domChanged={newSel:i.newSel?i.newSel.main:null},i}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let o=this.view.state,r=eO(this.view,n);return this.view.state==o&&(n.domChanged||n.newSel&&!M0(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let o=Ik(n,e.previousSibling||e.target.previousSibling,-1),r=Ik(n,e.nextSibling||e.target.nextSibling,1);return{from:o?n.posAfter(o):n.posAtStart,to:r?n.posBefore(r):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Es)!=e.state.facet(Es)&&(e.view.contentDOM.editContext=e.state.facet(Es)?this.editContext.editContext:null))}destroy(){var e,n,o;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(o=this.resizeScroll)===null||o===void 0||o.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Ik(t,e,n){for(;e;){let o=In.get(e);if(o&&o.parent==t)return o;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function Rk(t,e){let n=e.startContainer,o=e.startOffset,r=e.endContainer,i=e.endOffset,s=t.docView.domAtPos(t.state.selection.main.anchor,1);return Nd(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function mpe(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Rk(t,r)}let n=null;function o(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",o,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",o,!0),n?Rk(t,n):null}class gpe{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=o=>{let r=e.state.selection.main,{anchor:i,head:s}=r,a=this.toEditorPos(o.updateRangeStart),l=this.toEditorPos(o.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:o.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>o.text.length;a==this.from&&i<this.from?a=i:l==this.to&&i>this.to&&(l=i);let u=tO(e.state.sliceDoc(a,l),o.text,(c?r.from:r.to)-a,c?"end":null);if(!u){let f=Ue.single(this.toEditorPos(o.selectionStart),this.toEditorPos(o.selectionEnd));M0(f,r)||e.dispatch({selection:f,userEvent:"select"});return}let d={from:u.from+a,to:u.toA+a,insert:Ut.of(o.text.slice(u.from,u.toB).split(`
|
|
858
|
-
`))};if((it.mac||it.android)&&d.from==s-1&&/^\. ?$/.test(o.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:a,to:l,insert:Ut.of([o.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let f=this.to-this.from+(d.to-d.from+d.insert.length);ux(e,d,Ue.single(this.toEditorPos(o.selectionStart,f),this.toEditorPos(o.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),d.from<d.to&&!d.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,o.updateRangeStart-1),Math.min(n.text.length,o.updateRangeStart+1)))&&this.handlers.compositionend(o)},this.handlers.characterboundsupdate=o=>{let r=[],i=null;for(let s=this.toEditorPos(o.rangeStart),a=this.toEditorPos(o.rangeEnd);s<a;s++){let l=e.coordsForChar(s);i=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||i||new DOMRect,r.push(i)}n.updateCharacterBounds(o.rangeStart,r)},this.handlers.textformatupdate=o=>{let r=[];for(let i of o.getTextFormats()){let s=i.underlineStyle,a=i.underlineThickness;if(!/none/i.test(s)&&!/none/i.test(a)){let l=this.toEditorPos(i.rangeStart),c=this.toEditorPos(i.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;r.push(Zn.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:UM.of(Zn.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:o}=this.composing;this.composing=null,o&&this.reset(e.state)}};for(let o in this.handlers)n.addEventListener(o,this.handlers[o]);this.measureReq={read:o=>{this.editContext.updateControlBounds(o.contentDOM.getBoundingClientRect());let r=bf(o.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,o=!1,r=this.pendingContextChange;return e.changes.iterChanges((i,s,a,l,c)=>{if(o)return;let u=c.length-(s-i);if(r&&s>=r.to)if(r.from==i&&r.to==s&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(i+=n,s+=n,s<=this.from)this.from+=u,this.to+=u;else if(i<this.to){if(i<this.from||s>this.to||this.to-this.from+c.length>3e4){o=!0;return}this.editContext.updateText(this.toContextPos(i),this.toContextPos(s),c.toString()),this.to+=u}n+=u}),r&&!o&&this.revertPending(e.state),!o}update(e){let n=this.pendingContextChange,o=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(o.from,o.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,o=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=o||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(o,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let o=this.composing;return o&&o.drifted?o.editorBase+(e-o.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class St{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:o}=e;this.dispatchTransactions=e.dispatchTransactions||o&&(r=>r.forEach(i=>o(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Wfe(e.parent)||document,this.viewState=new Dk(e.state||Qt.create(e)),e.scrollTo&&e.scrollTo.is(Oh)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Mc).map(r=>new Iv(r));for(let r of this.plugins)r.update(this);this.observer=new ppe(this),this.inputState=new Ihe(this),this.inputState.ensureHandlers(this.plugins),this.docView=new wk(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof Gn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,o=!1,r,i=this.state;for(let f of e){if(f.startState!=i)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");i=f.state}if(this.destroyed){this.viewState.state=i;return}let s=this.hasFocus,a=0,l=null;e.some(f=>f.annotation(aO))?(this.inputState.notifiedFocused=s,a=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,l=lO(i,s),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(i.doc)||!this.state.selection.eq(i.selection))&&(u=null)):this.observer.clear(),i.facet(Qt.phrases)!=this.state.facet(Qt.phrases))return this.setState(i);r=C0.create(this,i,e),r.flags|=a;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(d&&(d=d.map(f.changes)),f.scrollIntoView){let{main:h}=f.state.selection;d=new Gc(h.empty?h:Ue.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of f.effects)h.is(Oh)&&(d=h.value.clip(this.state))}this.viewState.update(r,d),this.bidiCache=B0.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(pd)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(Nh)!=r.state.facet(Nh)&&(this.viewState.mustMeasureContent=!0),(n||o||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(Pb))try{f(r)}catch(h){Ji(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!eO(this,u)&&c.force&&Uc(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let o of this.plugins)o.destroy(this);this.viewState=new Dk(e),this.plugins=e.facet(Mc).map(o=>new Iv(o)),this.pluginMap.clear();for(let o of this.plugins)o.update(this);this.docView.destroy(),this.docView=new wk(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Mc),o=e.state.facet(Mc);if(n!=o){let r=[];for(let i of o){let s=n.indexOf(i);if(s<0)r.push(new Iv(i));else{let a=this.plugins[s];a.mustUpdate=e,r.push(a)}}for(let i of this.plugins)i.mustUpdate!=e&&i.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=o&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(o){Ji(this.state,o,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,o=this.scrollDOM,r=o.scrollTop*this.scaleY,{scrollAnchorPos:i,scrollAnchorHeight:s}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(s<0)if(TM(o))i=-1,s=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(r);i=h.from,s=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(g){return Ji(this.state,g),Fk}}),d=C0.create(this,this.state,[]),f=!1;d.flags|=l,n?n.flags|=l:n=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=Fk)try{let g=c[h];g.write&&g.write(u[h],this)}catch(g){Ji(this.state,g)}if(f&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let g=(i<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(i).top)-s;if(g>1||g<-1){r=r+g,o.scrollTop=r/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(Pb))a(n)}get themeClasses(){return Rb+" "+(this.state.facet(Ib)?fO:dO)+" "+this.state.facet(Nh)}updateAttrs(){let e=Vk(this,GM,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Es)?"true":"false",class:"cm-content",style:`${it.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),Vk(this,lx,n);let o=this.observer.ignore(()=>{let r=mk(this.contentDOM,this.contentAttrs,n),i=mk(this.dom,this.editorAttrs,e);return r||i});return this.editorAttrs=e,this.contentAttrs=n,o}showAnnouncements(e){let n=!0;for(let o of e)for(let r of o.effects)if(r.is(St.announce)){n&&(this.announceDOM.textContent=""),n=!1;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(pd);let e=this.state.facet(St.cspNonce);Ha.mount(this.root,this.styleModules.concat(fpe).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(o=>o.plugin==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,o){return zv(this,e,_k(this,e,n,o))}moveByGroup(e,n){return zv(this,e,_k(this,e,n,o=>$he(this,e.head,o)))}visualLineSide(e,n){let o=this.bidiSpans(e),r=this.textDirectionAt(e.from),i=o[n?o.length-1:0];return Ue.cursor(i.side(n,r)+e.from,i.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,o=!0){return Che(this,e,n,o)}moveVertically(e,n,o){return zv(this,e,The(this,e,n,o))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let o=Eb(this,e,n);return o&&o.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),Eb(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let o=this.docView.coordsAt(e,n);if(!o||o.left==o.right)return o;let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),s=i[Qi.find(i,e-r.from,-1,n)];return A0(o,s.dir==En.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(HM)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>vpe)return DM(e.length);let n=this.textDirectionAt(e.from),o;for(let i of this.bidiCache)if(i.from==e.from&&i.dir==n&&(i.fresh||PM(i.isolates,o=bk(this,e))))return i.order;o||(o=bk(this,e));let r=Zfe(e.text,n,o);return this.bidiCache.push(new B0(e.from,e.to,n,o,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||it.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{$M(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Oh.of(new Gc(typeof e=="number"?Ue.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,o=this.viewState.scrollAnchorAt(e);return Oh.of(new Gc(Ue.cursor(o.from),"start","start",o.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Yl.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Yl.define(()=>({}),{eventObservers:e})}static theme(e,n){let o=Ha.newName(),r=[Nh.of(o),pd.of(Fb(`.${o}`,e))];return n&&n.dark&&r.push(Ib.of(!0)),r}static baseTheme(e){return ex.lowest(pd.of(Fb("."+Rb,e,hO)))}static findFromDOM(e){var n;let o=e.querySelector(".cm-content"),r=o&&In.get(o)||In.get(e);return((n=r==null?void 0:r.root)===null||n===void 0?void 0:n.view)||null}}St.styleModule=pd;St.inputHandler=VM;St.clipboardInputFilter=sx;St.clipboardOutputFilter=ax;St.scrollHandler=WM;St.focusChangeEffect=zM;St.perLineTextDirection=HM;St.exceptionSink=FM;St.updateListener=Pb;St.editable=Es;St.mouseSelectionStyle=RM;St.dragMovesSelection=IM;St.clickAddsSelectionRange=NM;St.decorations=xg;St.blockWrappers=qM;St.outerDecorations=cx;St.atomicRanges=Wf;St.bidiIsolatedRanges=YM;St.scrollMargins=jM;St.darkTheme=Ib;St.cspNonce=vt.define({combine:t=>t.length?t[0]:""});St.contentAttributes=lx;St.editorAttributes=GM;St.lineWrapping=St.contentAttributes.of({class:"cm-lineWrapping"});St.announce=$n.define();const vpe=4096,Fk={};class B0{constructor(e,n,o,r,i,s){this.from=e,this.to=n,this.dir=o,this.isolates=r,this.fresh=i,this.order=s}static update(e,n){if(n.empty&&!e.some(i=>i.fresh))return e;let o=[],r=e.length?e[e.length-1].dir:En.LTR;for(let i=Math.max(0,e.length-10);i<e.length;i++){let s=e[i];s.dir==r&&!n.touchesRange(s.from,s.to)&&o.push(new B0(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return o}}function Vk(t,e,n){for(let o=t.state.facet(e),r=o.length-1;r>=0;r--){let i=o[r],s=typeof i=="function"?i(t):i;s&&ox(s,n)}return n}const bpe=it.mac?"mac":it.windows?"win":it.linux?"linux":"key";function ype(t,e){const n=t.split(/-(?!$)/);let o=n[n.length-1];o=="Space"&&(o=" ");let r,i,s,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(o="Alt-"+o),i&&(o="Ctrl-"+o),a&&(o="Meta-"+o),s&&(o="Shift-"+o),o}function Ih(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const xpe=ex.default(St.domEventHandlers({keydown(t,e){return Spe(wpe(e.state),t,e,"editor")}})),pO=vt.define({enables:xpe}),zk=new WeakMap;function wpe(t){let e=t.facet(pO),n=zk.get(e);return n||zk.set(e,n=kpe(e.reduce((o,r)=>o.concat(r),[]))),n}let _a=null;const _pe=4e3;function kpe(t,e=bpe){let n=Object.create(null),o=Object.create(null),r=(s,a)=>{let l=o[s];if(l==null)o[s]=a;else if(l!=a)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},i=(s,a,l,c,u)=>{var d,f;let h=n[s]||(n[s]=Object.create(null)),g=a.split(/ (?!$)/).map(b=>ype(b,e));for(let b=1;b<g.length;b++){let y=g.slice(0,b).join(" ");r(y,!0),h[y]||(h[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let _=_a={view:x,prefix:y,scope:s};return setTimeout(()=>{_a==_&&(_a=null)},_pe),!0}]})}let v=g.join(" ");r(v,!1);let m=h[v]||(h[v]={preventDefault:!1,stopPropagation:!1,run:((f=(d=h._any)===null||d===void 0?void 0:d.run)===null||f===void 0?void 0:f.slice())||[]});l&&m.run.push(l),c&&(m.preventDefault=!0),u&&(m.stopPropagation=!0)};for(let s of t){let a=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:d}=s;for(let f in u)u[f].run.push(h=>d(h,Vb))}let l=s[e]||s.key;if(l)for(let c of a)i(c,l,s.run,s.preventDefault,s.stopPropagation),s.shift&&i(c,"Shift-"+l,s.shift,s.preventDefault,s.stopPropagation)}return n}let Vb=null;function Spe(t,e,n,o){Vb=e;let r=Dfe(e),i=mfe(r,0),s=gfe(i)==r.length&&r!=" ",a="",l=!1,c=!1,u=!1;_a&&_a.view==n&&_a.scope==o&&(a=_a.prefix+" ",oO.indexOf(e.keyCode)<0&&(c=!0,_a=null));let d=new Set,f=m=>{if(m){for(let b of m.run)if(!d.has(b)&&(d.add(b),b(n)))return m.stopPropagation&&(u=!0),!0;m.preventDefault&&(m.stopPropagation&&(u=!0),c=!0)}return!1},h=t[o],g,v;return h&&(f(h[a+Ih(r,e,!s)])?l=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(it.windows&&e.ctrlKey&&e.altKey)&&!(it.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(g=Wa[e.keyCode])&&g!=r?(f(h[a+Ih(g,e,!0)])||e.shiftKey&&(v=gf[e.keyCode])!=r&&v!=g&&f(h[a+Ih(v,e,!1)]))&&(l=!0):s&&e.shiftKey&&f(h[a+Ih(r,e,!0)])&&(l=!0),!l&&f(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),Vb=null,l}class gu extends Ul{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}gu.prototype.elementClass="";gu.prototype.toDOM=void 0;gu.prototype.mapMode=xr.TrackBefore;gu.prototype.startSide=gu.prototype.endSide=-1;gu.prototype.point=!0;const mO=1024;let Ape=0;class Uv{constructor(e,n){this.from=e,this.to=n}}class Et{constructor(e={}){this.id=Ape++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ur.match(e)),n=>{let o=e(n);return o===void 0?null:[this,o]}}}Et.closedBy=new Et({deserialize:t=>t.split(" ")});Et.openedBy=new Et({deserialize:t=>t.split(" ")});Et.group=new Et({deserialize:t=>t.split(" ")});Et.isolate=new Et({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Et.contextHash=new Et({perNode:!0});Et.lookAhead=new Et({perNode:!0});Et.mounted=new Et({perNode:!0});class Rd{constructor(e,n,o,r=!1){this.tree=e,this.overlay=n,this.parser=o,this.bracketed=r}static get(e){return e&&e.props&&e.props[Et.mounted.id]}}const Cpe=Object.create(null);class ur{constructor(e,n,o,r=0){this.name=e,this.props=n,this.id=o,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):Cpe,o=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ur(e.name||"",n,e.id,o);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(r)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Et.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let o in e)for(let r of o.split(" "))n[r]=e[o];return o=>{for(let r=o.prop(Et.group),i=-1;i<(r?r.length:0);i++){let s=n[i<0?o.name:r[i]];if(s)return s}}}}ur.none=new ur("",Object.create(null),0,8);class hx{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let o of this.types){let r=null;for(let i of e){let s=i(o);if(s){r||(r=Object.assign({},o.props));let a=s[1],l=s[0];l.combine&&l.id in r&&(a=l.combine(r[l.id],a)),r[l.id]=a}}n.push(r?new ur(o.name,r,o.id,o.flags):o)}return new hx(n)}}const Rh=new WeakMap,Hk=new WeakMap;var xn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(xn||(xn={}));class Tn{constructor(e,n,o,r,i){if(this.type=e,this.children=n,this.positions=o,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[s,a]of i)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=Rd.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let o of this.children){let r=o.toString();r&&(n&&(n+=","),n+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new Hb(this.topNode,e)}cursorAt(e,n=0,o=0){let r=Rh.get(this)||this.topNode,i=new Hb(r);return i.moveTo(e,n),Rh.set(this,i._tree),i}get topNode(){return new Gr(this,0,0,null)}resolve(e,n=0){let o=xf(Rh.get(this)||this.topNode,e,n,!1);return Rh.set(this,o),o}resolveInner(e,n=0){let o=xf(Hk.get(this)||this.topNode,e,n,!0);return Hk.set(this,o),o}resolveStack(e,n=0){return Mpe(this,e,n)}iterate(e){let{enter:n,leave:o,from:r=0,to:i=this.length}=e,s=e.mode||0,a=(s&xn.IncludeAnonymous)>0;for(let l=this.cursor(s|xn.IncludeAnonymous);;){let c=!1;if(l.from<=i&&l.to>=r&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&o&&(a||!l.type.isAnonymous)&&o(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:gx(ur.none,this.children,this.positions,0,this.children.length,0,this.length,(n,o,r)=>new Tn(this.type,n,o,r,this.propValues),e.makeTree||((n,o,r)=>new Tn(ur.none,n,o,r)))}static build(e){return Ope(e)}}Tn.empty=new Tn(ur.none,[],[],0);class px{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new px(this.buffer,this.index)}}class Ga{constructor(e,n,o){this.buffer=e,this.length=n,this.set=o}get type(){return ur.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],o=this.buffer[e+3],r=this.set.types[n],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,o==e)return i;let s=[];for(;e<o;)s.push(this.childString(e)),e=this.buffer[e+3];return i+"("+s.join(",")+")"}findChild(e,n,o,r,i){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(gO(i,r,s[l+1],s[l+2])&&(a=l,o>0));l=s[l+3]);return a}slice(e,n,o){let r=this.buffer,i=new Uint16Array(n-e),s=0;for(let a=e,l=0;a<n;){i[l++]=r[a++],i[l++]=r[a++]-o;let c=i[l++]=r[a++]-o;i[l++]=r[a++]-e,s=Math.max(s,c)}return new Ga(i,s,this.set)}}function gO(t,e,n,o){switch(t){case-2:return n<e;case-1:return o>=e&&n<e;case 0:return n<e&&o>e;case 1:return n<=e&&o>e;case 2:return o>e;case 4:return!0}}function xf(t,e,n,o){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!o&&t instanceof Gr&&t.index<0?null:t.parent;if(!s)return t;t=s}let i=o?0:xn.IgnoreOverlays;if(o)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Gr&&s.index<0&&((r=a.enter(e,n,i))===null||r===void 0?void 0:r.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,i);if(!s)return t;t=s}}class vO{cursor(e=0){return new Hb(this,e)}getChild(e,n=null,o=null){let r=Wk(this,e,n,o);return r.length?r[0]:null}getChildren(e,n=null,o=null){return Wk(this,e,n,o)}resolve(e,n=0){return xf(this,e,n,!1)}resolveInner(e,n=0){return xf(this,e,n,!0)}matchContext(e){return zb(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),o=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(o=n,n=r.prevSibling):n=r}return o}get node(){return this}get next(){return this.parent}}class Gr extends vO{constructor(e,n,o,r){super(),this._tree=e,this.from=n,this.index=o,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,o,r,i=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let u=a[e],d=l[e]+s.from,f;if(!(!(i&xn.EnterBracketed&&u instanceof Tn&&(f=Rd.get(u))&&!f.overlay&&f.bracketed&&o>=d&&o<=d+u.length)&&!gO(r,o,d,d+u.length))){if(u instanceof Ga){if(i&xn.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,o-d,r);if(h>-1)return new $a(new $pe(s,u,e,d),null,h)}else if(i&xn.IncludeAnonymous||!u.type.isAnonymous||mx(u)){let h;if(!(i&xn.IgnoreMounts)&&(h=Rd.get(u))&&!h.overlay)return new Gr(h.tree,d,e,s);let g=new Gr(u,d,e,s);return i&xn.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(n<0?u.children.length-1:0,n,o,r,i)}}}if(i&xn.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,o=0){let r;if(!(o&xn.IgnoreOverlays)&&(r=Rd.get(this._tree))&&r.overlay){let i=e-this.from,s=o&xn.EnterBracketed&&r.bracketed;for(let{from:a,to:l}of r.overlay)if((n>0||s?a<=i:a<i)&&(n<0||s?l>=i:l>i))return new Gr(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,o)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Wk(t,e,n,o){let r=t.cursor(),i=[];if(!r.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=r.type.is(n),!r.nextSibling())return i}for(;;){if(o!=null&&r.type.is(o))return i;if(r.type.is(e)&&i.push(r.node),!r.nextSibling())return o==null?i:[]}}function zb(t,e,n=e.length-1){for(let o=t;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}class $pe{constructor(e,n,o,r){this.parent=e,this.buffer=n,this.index=o,this.start=r}}class $a extends vO{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,o){super(),this.context=e,this._parent=n,this.index=o,this.type=e.buffer.set.types[e.buffer.buffer[o]]}child(e,n,o){let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,o);return i<0?null:new $a(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,o=0){if(o&xn.ExcludeBuffers)return null;let{buffer:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new $a(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new $a(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new $a(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:o}=this.context,r=this.index+4,i=o.buffer[this.index+3];if(i>r){let s=o.buffer[this.index+1];e.push(o.slice(r,i,s)),n.push(0)}return new Tn(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function bO(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;i<t.length;i++){let s=t[i];(s.from>n.from||s.to<n.to)&&(n=s,e=i)}let o=n instanceof Gr&&n.index<0?null:n.parent,r=t.slice();return o?r[e]=o:r.splice(e,1),new Tpe(r,n)}class Tpe{constructor(e,n){this.heads=e,this.node=n}get next(){return bO(this.heads)}}function Mpe(t,e,n){let o=t.resolveInner(e,n),r=null;for(let i=o instanceof Gr?o:o.context.parent;i;i=i.parent)if(i.index<0){let s=i.parent;(r||(r=[o])).push(s.resolve(e,n)),i=s}else{let s=Rd.get(i.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let a=new Gr(s.tree,s.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(xf(a,e,n,!1))}}return r?bO(r):o}class Hb{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~xn.EnterBracketed,e instanceof Gr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let o=e._parent;o;o=o._parent)this.stack.unshift(o.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:o,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=o+r.buffer[e+1],this.to=o+r.buffer[e+2],!0}yield(e){return e?e instanceof Gr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,o){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,o,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,o);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,o=this.mode){return this.buffer?o&xn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,o))}parent(){if(!this.buffer)return this.yieldNode(this.mode&xn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&xn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,o=this.stack.length-1;if(e<0){let r=o<0?0:this.stack[o]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(o<0?n.buffer.length:n.buffer[this.stack[o]+3]))return this.yieldBuf(r)}return o<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,o,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let i=0;i<this.index;i++)if(r.buffer.buffer[i+3]<this.index)return!1;({index:n,parent:o}=r)}else({index:n,_parent:o}=this._tree);for(;o;{index:n,_parent:o}=o)if(n>-1)for(let i=n+e,s=e<0?-1:o._tree.children.length;i!=s;i+=e){let a=o._tree.children[i];if(this.mode&xn.IncludeAnonymous||a instanceof Ga||!a.type.isAnonymous||mx(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,o=0;if(e&&e.context==this.buffer)e:for(let r=this.index,i=this.stack.length;i>=0;){for(let s=e;s;s=s._parent)if(s.index==r){if(r==this.index)return s;n=s,o=i+1;break e}r=this.stack[--i]}for(let r=o;r<this.stack.length;r++)n=new $a(this.buffer,n,this.stack[r]);return this.bufferNode=new $a(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let o=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){o++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!o)return;if(this.nextSibling())break;this.parent(),o--,r=!0}}}matchContext(e){if(!this.buffer)return zb(this.node.parent,e);let{buffer:n}=this.buffer,{types:o}=n.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return zb(this._tree,e,r);let s=o[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[r]&&e[r]!=s.name)return!1;r--}}return!0}}function mx(t){return t.children.some(e=>e instanceof Ga||!e.type.isAnonymous||mx(e))}function Ope(t){var e;let{buffer:n,nodeSet:o,maxBufferLength:r=mO,reused:i=[],minRepeatType:s=o.types.length}=t,a=Array.isArray(n)?new px(n,n.length):n,l=o.types,c=0,u=0;function d(S,N,B,k,L,E){let{id:I,start:C,end:$,size:P}=a,M=u,F=c;if(P<0)if(a.next(),P==-1){let de=i[I];B.push(de),k.push(C-S);return}else if(P==-3){c=I;return}else if(P==-4){u=I;return}else throw new RangeError(`Unrecognized record size: ${P}`);let V=l[I],G,K,ue=C-S;if($-C<=r&&(K=m(a.pos-N,L))){let de=new Uint16Array(K.size-K.skip),he=a.pos-K.size,ge=de.length;for(;a.pos>he;)ge=b(K.start,de,ge);G=new Ga(de,$-K.start,o),ue=K.start-S}else{let de=a.pos-P;a.next();let he=[],ge=[],ee=I>=s?I:-1,fe=0,xe=$;for(;a.pos>de;)ee>=0&&a.id==ee&&a.size>=0?(a.end<=xe-r&&(g(he,ge,C,fe,a.end,xe,ee,M,F),fe=he.length,xe=a.end),a.next()):E>2500?f(C,de,he,ge):d(C,de,he,ge,ee,E+1);if(ee>=0&&fe>0&&fe<he.length&&g(he,ge,C,fe,C,xe,ee,M,F),he.reverse(),ge.reverse(),ee>-1&&fe>0){let Z=h(V,F);G=gx(V,he,ge,0,he.length,0,$-C,Z,Z)}else G=v(V,he,ge,$-C,M-$,F)}B.push(G),k.push(ue)}function f(S,N,B,k){let L=[],E=0,I=-1;for(;a.pos>N;){let{id:C,start:$,end:P,size:M}=a;if(M>4)a.next();else{if(I>-1&&$<I)break;I<0&&(I=P-r),L.push(C,$,P),E++,a.next()}}if(E){let C=new Uint16Array(E*4),$=L[L.length-2];for(let P=L.length-3,M=0;P>=0;P-=3)C[M++]=L[P],C[M++]=L[P+1]-$,C[M++]=L[P+2]-$,C[M++]=M;B.push(new Ga(C,L[2]-$,o)),k.push($-S)}}function h(S,N){return(B,k,L)=>{let E=0,I=B.length-1,C,$;if(I>=0&&(C=B[I])instanceof Tn){if(!I&&C.type==S&&C.length==L)return C;($=C.prop(Et.lookAhead))&&(E=k[I]+C.length+$)}return v(S,B,k,L,E,N)}}function g(S,N,B,k,L,E,I,C,$){let P=[],M=[];for(;S.length>k;)P.push(S.pop()),M.push(N.pop()+B-L);S.push(v(o.types[I],P,M,E-L,C-E,$)),N.push(L-B)}function v(S,N,B,k,L,E,I){if(E){let C=[Et.contextHash,E];I=I?[C].concat(I):[C]}if(L>25){let C=[Et.lookAhead,L];I=I?[C].concat(I):[C]}return new Tn(S,N,B,k,I)}function m(S,N){let B=a.fork(),k=0,L=0,E=0,I=B.end-r,C={size:0,start:0,skip:0};e:for(let $=B.pos-S;B.pos>$;){let P=B.size;if(B.id==N&&P>=0){C.size=k,C.start=L,C.skip=E,E+=4,k+=4,B.next();continue}let M=B.pos-P;if(P<0||M<$||B.start<I)break;let F=B.id>=s?4:0,V=B.start;for(B.next();B.pos>M;){if(B.size<0)if(B.size==-3||B.size==-4)F+=4;else break e;else B.id>=s&&(F+=4);B.next()}L=V,k+=P,E+=F}return(N<0||k==S)&&(C.size=k,C.start=L,C.skip=E),C.size>4?C:void 0}function b(S,N,B){let{id:k,start:L,end:E,size:I}=a;if(a.next(),I>=0&&k<s){let C=B;if(I>4){let $=a.pos-(I-4);for(;a.pos>$;)B=b(S,N,B)}N[--B]=C,N[--B]=E-S,N[--B]=L-S,N[--B]=k}else I==-3?c=k:I==-4&&(u=k);return B}let y=[],x=[];for(;a.pos>0;)d(t.start||0,t.bufferStart||0,y,x,-1,0);let _=(e=t.length)!==null&&e!==void 0?e:y.length?x[0]+y[0].length:0;return new Tn(l[t.topID],y.reverse(),x.reverse(),_)}const Uk=new WeakMap;function fp(t,e){if(!t.isAnonymous||e instanceof Ga||e.type!=t)return 1;let n=Uk.get(e);if(n==null){n=1;for(let o of e.children){if(o.type!=t||!(o instanceof Tn)){n=1;break}n+=fp(t,o)}Uk.set(e,n)}return n}function gx(t,e,n,o,r,i,s,a,l){let c=0;for(let g=o;g<r;g++)c+=fp(t,e[g]);let u=Math.ceil(c*1.5/8),d=[],f=[];function h(g,v,m,b,y){for(let x=m;x<b;){let _=x,S=v[x],N=fp(t,g[x]);for(x++;x<b;x++){let B=fp(t,g[x]);if(N+B>=u)break;N+=B}if(x==_+1){if(N>u){let B=g[_];h(B.children,B.positions,0,B.children.length,v[_]+y);continue}d.push(g[_])}else{let B=v[x-1]+g[x-1].length-S;d.push(gx(t,g,v,_,x,S,B,null,l))}f.push(S+y-i)}}return h(e,n,o,r,0),(a||l)(d,f,s)}class Ll{constructor(e,n,o,r,i=!1,s=!1){this.from=e,this.to=n,this.tree=o,this.offset=r,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],o=!1){let r=[new Ll(0,e.length,e,0,!1,o)];for(let i of n)i.to>e.length&&r.push(i);return r}static applyChanges(e,n,o=128){if(!n.length)return e;let r=[],i=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,d=u?u.fromA:1e9;if(d-l>=o)for(;s&&s.from<d;){let f=s;if(l>=f.from||d<=f.to||c){let h=Math.max(f.from,l)-c,g=Math.min(f.to,d)-c;f=h>=g?null:new Ll(h,g,f.tree,f.offset+c,a>0,!!u)}if(f&&r.push(f),s.to>d)break;s=i<e.length?e[i++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return r}}class yO{startParse(e,n,o){return typeof e=="string"&&(e=new Bpe(e)),o=o?o.length?o.map(r=>new Uv(r.from,r.to)):[new Uv(0,0)]:[new Uv(0,e.length)],this.createParse(e,n||[],o)}parse(e,n,o){let r=this.startParse(e,n,o);for(;;){let i=r.advance();if(i)return i}}}class Bpe{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new Et({perNode:!0});let Lpe=0;class Ir{constructor(e,n,o,r){this.name=e,this.set=n,this.base=o,this.modified=r,this.id=Lpe++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let o=typeof e=="string"?e:"?";if(e instanceof Ir&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let r=new Ir(o,[],null,[]);if(r.set.push(r),n)for(let i of n.set)r.set.push(i);return r}static defineModifier(e){let n=new L0(e);return o=>o.modified.indexOf(n)>-1?o:L0.get(o.base||o,o.modified.concat(n).sort((r,i)=>r.id-i.id))}}let Ppe=0;class L0{constructor(e){this.name=e,this.instances=[],this.id=Ppe++}static get(e,n){if(!n.length)return e;let o=n[0].instances.find(a=>a.base==e&&Dpe(n,a.modified));if(o)return o;let r=[],i=new Ir(e.name,r,e,n);for(let a of n)a.instances.push(i);let s=Epe(n);for(let a of e.set)if(!a.modified.length)for(let l of s)r.push(L0.get(a,l));return i}}function Dpe(t,e){return t.length==e.length&&t.every((n,o)=>n==e[o])}function Epe(t){let e=[[]];for(let n=0;n<t.length;n++)for(let o=0,r=e.length;o<r;o++)e.push(e[o].concat(t[n]));return e.sort((n,o)=>o.length-n.length)}function xO(t){let e=Object.create(null);for(let n in t){let o=t[n];Array.isArray(o)||(o=[o]);for(let r of n.split(" "))if(r){let i=[],s=2,a=r;for(let d=0;;){if(a=="..."&&d>0&&d+3==r.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+r);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==r.length)break;let h=r[d++];if(d==r.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+r);a=r.slice(d)}let l=i.length-1,c=i[l];if(!c)throw new RangeError("Invalid path: "+r);let u=new wf(o,s,l>0?i.slice(0,l):null);e[c]=u.sort(e[c])}}return wO.add(e)}const wO=new Et({combine(t,e){let n,o,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let i=new wf(r.tags,r.mode,r.context);n?n.next=i:o=i,n=i}return o}});class wf{constructor(e,n,o,r){this.tags=e,this.mode=n,this.context=o,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}wf.empty=new wf([],2,null);function _O(t,e){let n=Object.create(null);for(let i of t)if(!Array.isArray(i.tag))n[i.tag.id]=i.class;else for(let s of i.tag)n[s.id]=i.class;let{scope:o,all:r=null}=e||{};return{style:i=>{let s=r;for(let a of i)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:o}}function Npe(t,e){let n=null;for(let o of t){let r=o.style(e);r&&(n=n?n+" "+r:r)}return n}function kO(t,e,n,o=0,r=t.length){let i=new Ipe(o,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),o,r,"",i.highlighters),i.flush(r)}class Ipe{constructor(e,n,o){this.at=e,this.highlighters=n,this.span=o,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,o,r,i){let{type:s,from:a,to:l}=e;if(a>=o||l<=n)return;s.isTop&&(i=this.highlighters.filter(h=>!h.scope||h.scope(s)));let c=r,u=Rpe(e)||wf.empty,d=Npe(i,u.tags);if(d&&(c&&(c+=" "),c+=d,u.mode==1&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(n,a),c),u.opaque)return;let f=e.tree&&e.tree.prop(Et.mounted);if(f&&f.overlay){let h=e.node.enter(f.overlay[0].from+a,1),g=this.highlighters.filter(m=>!m.scope||m.scope(f.tree.type)),v=e.firstChild();for(let m=0,b=a;;m++){let y=m<f.overlay.length?f.overlay[m]:null,x=y?y.from+a:l,_=Math.max(n,b),S=Math.min(o,x);if(_<S&&v)for(;e.from<S&&(this.highlightRange(e,_,S,r,i),this.startSpan(Math.min(S,e.to),c),!(e.to>=x||!e.nextSibling())););if(!y||x>o)break;b=y.to+a,b>n&&(this.highlightRange(h.cursor(),Math.max(n,y.from+a),Math.min(o,b),"",g),this.startSpan(Math.min(o,b),c))}v&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=n)){if(e.from>=o)break;this.highlightRange(e,n,o,r,i),this.startSpan(Math.min(o,e.to),c)}while(e.nextSibling());e.parent()}}}function Rpe(t){let e=t.type.prop(wO);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ke=Ir.define,Fh=Ke(),ya=Ke(),Gk=Ke(ya),qk=Ke(ya),xa=Ke(),Vh=Ke(xa),Gv=Ke(xa),Gi=Ke(),fl=Ke(Gi),Wi=Ke(),Ui=Ke(),Wb=Ke(),nd=Ke(Wb),zh=Ke(),ut={comment:Fh,lineComment:Ke(Fh),blockComment:Ke(Fh),docComment:Ke(Fh),name:ya,variableName:Ke(ya),typeName:Gk,tagName:Ke(Gk),propertyName:qk,attributeName:Ke(qk),className:Ke(ya),labelName:Ke(ya),namespace:Ke(ya),macroName:Ke(ya),literal:xa,string:Vh,docString:Ke(Vh),character:Ke(Vh),attributeValue:Ke(Vh),number:Gv,integer:Ke(Gv),float:Ke(Gv),bool:Ke(xa),regexp:Ke(xa),escape:Ke(xa),color:Ke(xa),url:Ke(xa),keyword:Wi,self:Ke(Wi),null:Ke(Wi),atom:Ke(Wi),unit:Ke(Wi),modifier:Ke(Wi),operatorKeyword:Ke(Wi),controlKeyword:Ke(Wi),definitionKeyword:Ke(Wi),moduleKeyword:Ke(Wi),operator:Ui,derefOperator:Ke(Ui),arithmeticOperator:Ke(Ui),logicOperator:Ke(Ui),bitwiseOperator:Ke(Ui),compareOperator:Ke(Ui),updateOperator:Ke(Ui),definitionOperator:Ke(Ui),typeOperator:Ke(Ui),controlOperator:Ke(Ui),punctuation:Wb,separator:Ke(Wb),bracket:nd,angleBracket:Ke(nd),squareBracket:Ke(nd),paren:Ke(nd),brace:Ke(nd),content:Gi,heading:fl,heading1:Ke(fl),heading2:Ke(fl),heading3:Ke(fl),heading4:Ke(fl),heading5:Ke(fl),heading6:Ke(fl),contentSeparator:Ke(Gi),list:Ke(Gi),quote:Ke(Gi),emphasis:Ke(Gi),strong:Ke(Gi),link:Ke(Gi),monospace:Ke(Gi),strikethrough:Ke(Gi),inserted:Ke(),deleted:Ke(),changed:Ke(),invalid:Ke(),meta:zh,documentMeta:Ke(zh),annotation:Ke(zh),processingInstruction:Ke(zh),definition:Ir.defineModifier("definition"),constant:Ir.defineModifier("constant"),function:Ir.defineModifier("function"),standard:Ir.defineModifier("standard"),local:Ir.defineModifier("local"),special:Ir.defineModifier("special")};for(let t in ut){let e=ut[t];e instanceof Ir&&(e.name=t)}const SO=_O([{tag:ut.link,class:"tok-link"},{tag:ut.heading,class:"tok-heading"},{tag:ut.emphasis,class:"tok-emphasis"},{tag:ut.strong,class:"tok-strong"},{tag:ut.keyword,class:"tok-keyword"},{tag:ut.atom,class:"tok-atom"},{tag:ut.bool,class:"tok-bool"},{tag:ut.url,class:"tok-url"},{tag:ut.labelName,class:"tok-labelName"},{tag:ut.inserted,class:"tok-inserted"},{tag:ut.deleted,class:"tok-deleted"},{tag:ut.literal,class:"tok-literal"},{tag:ut.string,class:"tok-string"},{tag:ut.number,class:"tok-number"},{tag:[ut.regexp,ut.escape,ut.special(ut.string)],class:"tok-string2"},{tag:ut.variableName,class:"tok-variableName"},{tag:ut.local(ut.variableName),class:"tok-variableName tok-local"},{tag:ut.definition(ut.variableName),class:"tok-variableName tok-definition"},{tag:ut.special(ut.variableName),class:"tok-variableName2"},{tag:ut.definition(ut.propertyName),class:"tok-propertyName tok-definition"},{tag:ut.typeName,class:"tok-typeName"},{tag:ut.namespace,class:"tok-namespace"},{tag:ut.className,class:"tok-className"},{tag:ut.macroName,class:"tok-macroName"},{tag:ut.propertyName,class:"tok-propertyName"},{tag:ut.operator,class:"tok-operator"},{tag:ut.comment,class:"tok-comment"},{tag:ut.meta,class:"tok-meta"},{tag:ut.invalid,class:"tok-invalid"},{tag:ut.punctuation,class:"tok-punctuation"}]);var qv;const Oc=new Et;function Fpe(t){return vt.define({combine:t?e=>e.concat(t):void 0})}const Vpe=new Et;class hi{constructor(e,n,o=[],r=""){this.data=e,this.name=r,Qt.prototype.hasOwnProperty("tree")||Object.defineProperty(Qt.prototype,"tree",{get(){return us(this)}}),this.parser=n,this.extension=[bu.of(this),Qt.languageData.of((i,s,a)=>{let l=Yk(i,s,a),c=l.type.prop(Oc);if(!c)return[];let u=i.facet(c),d=l.type.prop(Vpe);if(d){let f=l.resolve(s-l.from,a);for(let h of d)if(h.test(f,i)){let g=i.facet(h.facet);return h.type=="replace"?g:g.concat(u)}}return u})].concat(o)}isActiveAt(e,n,o=-1){return Yk(e,n,o).type.prop(Oc)==this.data}findRegions(e){let n=e.facet(bu);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let o=[],r=(i,s)=>{if(i.prop(Oc)==this.data){o.push({from:s,to:s+i.length});return}let a=i.prop(Et.mounted);if(a){if(a.tree.prop(Oc)==this.data){if(a.overlay)for(let l of a.overlay)o.push({from:l.from+s,to:l.to+s});else o.push({from:s,to:s+i.length});return}else if(a.overlay){let l=o.length;if(r(a.tree,a.overlay[0].from+s),o.length>l)return}}for(let l=0;l<i.children.length;l++){let c=i.children[l];c instanceof Tn&&r(c,i.positions[l]+s)}};return r(us(e),0),o}get allowsNesting(){return!0}}hi.setState=$n.define();function Yk(t,e,n){let o=t.facet(bu),r=us(t).topNode;if(!o||o.allowsNesting)for(let i=r;i;i=i.enter(e,n,xn.ExcludeBuffers|xn.EnterBracketed))i.type.isTop&&(r=i);return r}class P0 extends hi{constructor(e,n,o){super(e,n,[],o),this.parser=n}static define(e){let n=Fpe(e.languageData);return new P0(n,e.parser.configure({props:[Oc.add(o=>o.isTop?n:void 0)]}),e.name)}configure(e,n){return new P0(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function us(t){let e=t.field(hi.state,!1);return e?e.tree:Tn.empty}class zpe{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let o=this.cursorPos-this.string.length;return e<o||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-o,n-o)}}let od=null;class D0{constructor(e,n,o=[],r,i,s,a,l){this.parser=e,this.state=n,this.fragments=o,this.tree=r,this.treeLen=i,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,o){return new D0(e,n,[],Tn.empty,0,o,[],null)}startParse(){return this.parser.startParse(new zpe(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Tn.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var o;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Ll.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(o=this.parse.stoppedAt)!==null&&o!==void 0?o:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Ll.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=od;od=this;try{return e()}finally{od=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=jk(e,n.from,n.to);return e}changes(e,n){let{fragments:o,tree:r,treeLen:i,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,d,f)=>l.push({fromA:c,toA:u,fromB:d,toB:f})),o=Ll.applyChanges(o,l),r=Tn.empty,i=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),d=e.mapPos(c.to,-1);u<d&&a.push({from:u,to:d})}}}return new D0(this.parser,n,o,r,i,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let o=0;o<this.skipped.length;o++){let{from:r,to:i}=this.skipped[o];r<e.to&&i>e.from&&(this.fragments=jk(this.fragments,r,i),this.skipped.splice(o--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends yO{createParse(n,o,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let l=od;if(l){for(let c of r)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new Tn(ur.none,[],[],s-i)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return od}}function jk(t,e,n){return Ll.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class vu{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),o=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,o)||n.takeTree(),new vu(n)}static init(e){let n=Math.min(3e3,e.doc.length),o=D0.create(e.facet(bu).parser,e,{from:0,to:n});return o.work(20,n)||o.takeTree(),new vu(o)}}hi.state=ol.define({create:vu.init,update(t,e){for(let n of e.effects)if(n.is(hi.setState))return n.value;return e.startState.facet(bu)!=e.state.facet(bu)?vu.init(e.state):t.apply(e)}});let AO=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(AO=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Yv=typeof navigator<"u"&&(!((qv=navigator.scheduling)===null||qv===void 0)&&qv.isInputPending)?()=>navigator.scheduling.isInputPending():null,Hpe=Yl.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(hi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(hi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=AO(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:o,viewport:{to:r}}=this.view,i=o.field(hi.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!Yv?Math.max(25,e.timeRemaining()-5):1e9),a=i.context.treeLen<r&&o.doc.length>r+1e3,l=i.context.work(()=>Yv&&Yv()||Date.now()>s,r+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:hi.setState.of(new vu(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ji(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),bu=vt.define({combine(t){return t.length?t[0]:null},enables:t=>[hi.state,Hpe,St.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Wpe{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const Upe=vt.define(),vx=vt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function E0(t){let e=t.facet(vx);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function N0(t,e){let n="",o=t.tabSize,r=t.facet(vx)[0];if(r==" "){for(;e>=o;)n+=" ",e-=o;r=" "}for(let i=0;i<e;i++)n+=r;return n}function CO(t,e){t instanceof Qt&&(t=new Sg(t));for(let o of t.state.facet(Upe)){let r=o(t,e);if(r!==void 0)return r}let n=us(t.state);return n.length>=e?qpe(t,n,e):null}class Sg{constructor(e,n={}){this.state=e,this.options=n,this.unit=E0(e)}lineAt(e,n=1){let o=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return r!=null&&r>=o.from&&r<=o.to?i&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:o.text.slice(r-o.from),from:r}:{text:o.text.slice(0,r-o.from),from:o.from}:o}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:o,from:r}=this.lineAt(e,n);return o.slice(e-r,Math.min(o.length,e+100-r))}column(e,n=1){let{text:o,from:r}=this.lineAt(e,n),i=this.countColumn(o,e-r),s=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return s>-1&&(i+=s-this.countColumn(o,o.search(/\S|$/))),i}countColumn(e,n=e.length){return vg(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:o,from:r}=this.lineAt(e,n),i=this.options.overrideIndentation;if(i){let s=i(r);if(s>-1)return s}return this.countColumn(o,o.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Gpe=new Et;function qpe(t,e,n){let o=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=o.node){let i=[];for(let s=r;s&&!(s.from<o.node.from||s.to>o.node.to||s.from==o.node.from&&s.type==o.node.type);s=s.parent)i.push(s);for(let s=i.length-1;s>=0;s--)o={node:i[s],next:o}}return $O(o,t,n)}function $O(t,e,n){for(let o=t;o;o=o.next){let r=jpe(o.node);if(r)return r(bx.create(e,n,o))}return 0}function Ype(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function jpe(t){let e=t.type.prop(Gpe);if(e)return e;let n=t.firstChild,o;if(n&&(o=n.type.prop(Et.closedBy))){let r=t.lastChild,i=r&&o.indexOf(r.name)>-1;return s=>Qpe(s,!0,1,void 0,i&&!Ype(s)?r.from:void 0)}return t.parent==null?Xpe:null}function Xpe(){return 0}class bx extends Sg{constructor(e,n,o){super(e.state,e.options),this.base=e,this.pos=n,this.context=o}get node(){return this.context.node}static create(e,n,o){return new bx(e,n,o)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let o=e.resolve(n.from);for(;o.parent&&o.parent.from==o.from;)o=o.parent;if(Kpe(o,e))break;n=this.state.doc.lineAt(o.from)}return this.lineIndent(n.from)}continue(){return $O(this.context.next,this.base,this.pos)}}function Kpe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Zpe(t){let e=t.node,n=e.childAfter(e.from),o=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,i=t.state.doc.lineAt(n.from),s=r==null||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==o)return null;if(!l.type.isSkipped){if(l.from>=s)return null;let c=/^ */.exec(i.text.slice(n.to-i.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function Qpe(t,e,n,o,r){let i=t.textAfter,s=i.match(/^\s*/)[0].length,a=o&&i.slice(s,s+o.length)==o||r==t.pos+s,l=Zpe(t);return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}class yx{constructor(e,n){this.specs=e;let o;function r(a){let l=Ha.newName();return(o||(o=Object.create(null)))["."+l]=a,l}const i=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,s=n.scope;this.scope=s instanceof hi?a=>a.prop(Oc)==s.data:s?a=>a==s:void 0,this.style=_O(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=o?new Ha(o):null,this.themeType=n.themeType}static define(e,n){return new yx(e,n||{})}}const Ub=vt.define(),Jpe=vt.define({combine(t){return t.length?[t[0]]:null}});function jv(t){let e=t.facet(Ub);return e.length?e:t.facet(Jpe)}function e0e(t,e){let n=[n0e],o;return t instanceof yx&&(t.module&&n.push(St.styleModule.of(t.module)),o=t.themeType),o?n.push(Ub.computeN([St.darkTheme],r=>r.facet(St.darkTheme)==(o=="dark")?[t]:[])):n.push(Ub.of(t)),n}class t0e{constructor(e){this.markCache=Object.create(null),this.tree=us(e.state),this.decorations=this.buildDeco(e,jv(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=us(e.state),o=jv(e.state),r=o!=jv(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);n.length<i.to&&!r&&n.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,o),this.decoratedTo=i.to)}buildDeco(e,n){if(!n||!this.tree.length)return Zn.none;let o=new pf;for(let{from:r,to:i}of e.visibleRanges)kO(this.tree,n,(s,a,l)=>{o.add(s,a,this.markCache[l]||(this.markCache[l]=Zn.mark({class:l})))},r,i);return o.finish()}}const n0e=ex.high(Yl.fromClass(t0e,{decorations:t=>t.decorations})),o0e=1e4,r0e="()[]{}",i0e=new Et;function Gb(t,e,n){let o=t.prop(e<0?Et.openedBy:Et.closedBy);if(o)return o;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function qb(t){let e=t.type.prop(i0e);return e?e(t.node):t}function Bc(t,e,n,o={}){let r=o.maxScanDistance||o0e,i=o.brackets||r0e,s=us(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Gb(l.type,n,i);if(c&&l.from<l.to){let u=qb(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return s0e(t,e,n,l,u,c,i)}}return a0e(t,e,n,s,a.type,r,i)}function s0e(t,e,n,o,r,i,s){let a=o.parent,l={from:r.from,to:r.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do if(n<0?u.to<=o.from:u.from>=o.to){if(c==0&&i.indexOf(u.type.name)>-1&&u.from<u.to){let d=qb(u);return{start:l,end:d?{from:d.from,to:d.to}:void 0,matched:!0}}else if(Gb(u.type,n,s))c++;else if(Gb(u.type,-n,s)){if(c==0){let d=qb(u);return{start:l,end:d&&d.from<d.to?{from:d.from,to:d.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function a0e(t,e,n,o,r,i,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),d=0;for(let f=0;!u.next().done&&f<=i;){let h=u.value;n<0&&(f+=h.length);let g=e+f*n;for(let v=n>0?0:h.length-1,m=n>0?h.length:-1;v!=m;v+=n){let b=s.indexOf(h[v]);if(!(b<0||o.resolveInner(g+v,1).type!=r))if(b%2==0==n>0)d++;else{if(d==1)return{start:c,end:{from:g+v,to:g+v+1},matched:b>>1==l>>1};d--}}n>0&&(f+=h.length)}return u.done?{start:c,matched:!1}:null}const l0e=Object.create(null),Xk=[ur.none],Kk=[],Zk=Object.create(null),c0e=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])c0e[t]=u0e(l0e,e);function Xv(t,e){Kk.indexOf(t)>-1||(Kk.push(t),console.warn(e))}function u0e(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||ut[c];u?typeof u=="function"?l.length?l=l.map(u):Xv(c,`Modifier ${c} used at start of tag`):l.length?Xv(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Xv(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let o=e.replace(/ /g,"_"),r=o+" "+n.map(a=>a.id),i=Zk[r];if(i)return i.id;let s=Zk[r]=ur.define({id:Xk.length,name:o,props:[xO({[o]:n})]});return Xk.push(s),s.id}En.RTL,En.LTR;const d0e=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),o=wx(t.state,n.from);return o.line?f0e(t):o.block?p0e(t):!1};function xx(t,e){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(o(n.update(r)),!0):!1}}const f0e=xx(v0e,0),h0e=xx(TO,0),p0e=xx((t,e)=>TO(t,e,g0e(e)),0);function wx(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const rd=50;function m0e(t,{open:e,close:n},o,r){let i=t.sliceDoc(o-rd,o),s=t.sliceDoc(r,r+rd),a=/\s*$/.exec(i)[0].length,l=/^\s*/.exec(s)[0].length,c=i.length-a;if(i.slice(c-e.length,c)==e&&s.slice(l,l+n.length)==n)return{open:{pos:o-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let u,d;r-o<=2*rd?u=d=t.sliceDoc(o,r):(u=t.sliceDoc(o,o+rd),d=t.sliceDoc(r-rd,r));let f=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(d)[0].length,g=d.length-h-n.length;return u.slice(f,f+e.length)==e&&d.slice(g,g+n.length)==n?{open:{pos:o+f+e.length,margin:/\s/.test(u.charAt(f+e.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(d.charAt(g-1))?1:0}}:null}function g0e(t){let e=[];for(let n of t.selection.ranges){let o=t.doc.lineAt(n.from),r=n.to<=o.to?o:t.doc.lineAt(n.to);r.from>o.from&&r.from==n.to&&(r=n.to==o.to+1?o:t.doc.lineAt(n.to-1));let i=e.length-1;i>=0&&e[i].to>o.from?e[i].to=r.to:e.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return e}function TO(t,e,n=e.selection.ranges){let o=n.map(i=>wx(e,i.from).block);if(!o.every(i=>i))return null;let r=n.map((i,s)=>m0e(e,o[s],i.from,i.to));if(t!=2&&!r.every(i=>i))return{changes:e.changes(n.map((i,s)=>r[s]?[]:[{from:i.from,insert:o[s].open+" "},{from:i.to,insert:" "+o[s].close}]))};if(t!=1&&r.some(i=>i)){let i=[];for(let s=0,a;s<r.length;s++)if(a=r[s]){let l=o[s],{open:c,close:u}=a;i.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:i}}return null}function v0e(t,e,n=e.selection.ranges){let o=[],r=-1;e:for(let{from:i,to:s}of n){let a=o.length,l=1e9,c;for(let u=i;u<=s;){let d=e.doc.lineAt(u);if(c==null&&(c=wx(e,d.from).line,!c))continue e;if(d.from>r&&(i==s||s>d.from)){r=d.from;let f=/^\s*/.exec(d.text)[0].length,h=f==d.length,g=d.text.slice(f,f+c.length)==c?f:-1;f<d.text.length&&f<l&&(l=f),o.push({line:d,comment:g,token:c,indent:f,empty:h,single:!1})}u=d.to+1}if(l<1e9)for(let u=a;u<o.length;u++)o[u].indent<o[u].line.text.length&&(o[u].indent=l);o.length==a+1&&(o[a].single=!0)}if(t!=2&&o.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:a,token:l,indent:c,empty:u,single:d}of o)(d||!u)&&i.push({from:a.from+c,insert:l+" "});let s=e.changes(i);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&o.some(i=>i.comment>=0)){let i=[];for(let{line:s,comment:a,token:l}of o)if(a>=0){let c=s.from+a,u=c+l.length;s.text[u-s.from]==" "&&u++,i.push({from:c,to:u})}return{changes:i}}return null}const Yb=rl.define(),b0e=rl.define(),y0e=vt.define(),MO=vt.define({combine(t){return Tfe(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(o,r)=>e(o,r)||n(o,r)})}}),OO=ol.define({create(){return es.empty},update(t,e){let n=e.state.facet(MO),o=e.annotation(Yb);if(o){let l=ir.fromTransaction(e,o.selection),c=o.side,u=c==0?t.undone:t.done;return l?u=I0(u,u.length,n.minDepth,l):u=PO(u,e.startState.selection),new es(c==0?o.rest:u,c==0?u:o.rest)}let r=e.annotation(b0e);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Gn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=ir.fromTransaction(e),s=e.annotation(Gn.time),a=e.annotation(Gn.userEvent);return i?t=t.addChanges(i,s,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,a,n.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new es(t.done.map(ir.fromJSON),t.undone.map(ir.fromJSON))}});function x0e(t={}){return[OO,MO.of(t),St.domEventHandlers({beforeinput(e,n){let o=e.inputType=="historyUndo"?BO:e.inputType=="historyRedo"?jb:null;return o?(e.preventDefault(),o(n)):!1}})]}function Ag(t,e){return function({state:n,dispatch:o}){if(!e&&n.readOnly)return!1;let r=n.field(OO,!1);if(!r)return!1;let i=r.pop(t,n,e);return i?(o(i),!0):!1}}const BO=Ag(0,!1),jb=Ag(1,!1),w0e=Ag(0,!0),_0e=Ag(1,!0);class ir{constructor(e,n,o,r,i){this.changes=e,this.effects=n,this.mapped=o,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new ir(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,o;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(o=this.startSelection)===null||o===void 0?void 0:o.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new ir(e.changes&&Wn.fromJSON(e.changes),[],e.mapped&&ss.fromJSON(e.mapped),e.startSelection&&Ue.fromJSON(e.startSelection),e.selectionsAfter.map(Ue.fromJSON))}static fromTransaction(e,n){let o=Vr;for(let r of e.startState.facet(y0e)){let i=r(e);i.length&&(o=o.concat(i))}return!o.length&&e.changes.empty?null:new ir(e.changes.invert(e.startState.doc),o,void 0,n||e.startState.selection,Vr)}static selection(e){return new ir(void 0,Vr,void 0,void 0,e)}}function I0(t,e,n,o){let r=e+1>n+20?e-n-1:0,i=t.slice(r,e);return i.push(o),i}function k0e(t,e){let n=[],o=!1;return t.iterChangedRanges((r,i)=>n.push(r,i)),e.iterChangedRanges((r,i,s,a)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];a>=c&&s<=u&&(o=!0)}}),o}function S0e(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,o)=>n.empty!=e.ranges[o].empty).length===0}function LO(t,e){return t.length?e.length?t.concat(e):t:e}const Vr=[],A0e=200;function PO(t,e){if(t.length){let n=t[t.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-A0e));return o.length&&o[o.length-1].eq(e)?t:(o.push(e),I0(t,t.length-1,1e9,n.setSelAfter(o)))}else return[ir.selection([e])]}function C0e(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Kv(t,e){if(!t.length)return t;let n=t.length,o=Vr;for(;n;){let r=$0e(t[n-1],e,o);if(r.changes&&!r.changes.empty||r.effects.length){let i=t.slice(0,n);return i[n-1]=r,i}else e=r.mapped,n--,o=r.selectionsAfter}return o.length?[ir.selection(o)]:Vr}function $0e(t,e,n){let o=LO(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):Vr,n);if(!t.changes)return ir.selection(o);let r=t.changes.map(e),i=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(i):i;return new ir(r,$n.mapEffects(t.effects,e),s,t.startSelection.map(i),o)}const T0e=/^(input\.type|delete)($|\.)/;class es{constructor(e,n,o=0,r=void 0){this.done=e,this.undone=n,this.prevTime=o,this.prevUserEvent=r}isolate(){return this.prevTime?new es(this.done,this.undone):this}addChanges(e,n,o,r,i){let s=this.done,a=s[s.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!o||T0e.test(o))&&(!a.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,k0e(a.changes,e.changes))||o=="input.type.compose")?s=I0(s,s.length-1,r.minDepth,new ir(e.changes.compose(a.changes),LO($n.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Vr)):s=I0(s,s.length,r.minDepth,e),new es(s,Vr,n,o)}addSelection(e,n,o,r){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:Vr;return i.length>0&&n-this.prevTime<r&&o==this.prevUserEvent&&o&&/^select($|\.)/.test(o)&&S0e(i[i.length-1],e)?this:new es(PO(this.done,e),this.undone,n,o)}addMapping(e){return new es(Kv(this.done,e),Kv(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,o){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],s=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):n.selection);if(o&&i.selectionsAfter.length)return n.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:Yb.of({side:e,rest:C0e(r),selection:s}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let a=r.length==1?Vr:r.slice(0,r.length-1);return i.mapped&&(a=Kv(a,i.mapped)),n.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:Yb.of({side:e,rest:a,selection:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}es.empty=new es(Vr,Vr);const M0e=[{key:"Mod-z",run:BO,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:jb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:jb,preventDefault:!0},{key:"Mod-u",run:w0e,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:_0e,preventDefault:!0}];function Iu(t,e){return Ue.create(t.ranges.map(e),t.mainIndex)}function Ii(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ri({state:t,dispatch:e},n){let o=Iu(t.selection,n);return o.eq(t.selection,!0)?!1:(e(Ii(t,o)),!0)}function Cg(t,e){return Ue.cursor(e?t.to:t.from)}function DO(t,e){return Ri(t,n=>n.empty?t.moveByChar(n,e):Cg(n,e))}function Po(t){return t.textDirectionAt(t.state.selection.main.head)==En.LTR}const EO=t=>DO(t,!Po(t)),NO=t=>DO(t,Po(t));function IO(t,e){return Ri(t,n=>n.empty?t.moveByGroup(n,e):Cg(n,e))}const O0e=t=>IO(t,!Po(t)),B0e=t=>IO(t,Po(t));function L0e(t,e,n){if(e.type.prop(n))return!0;let o=e.to-e.from;return o&&(o>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function $g(t,e,n){let o=us(t).resolveInner(e.head),r=n?Et.closedBy:Et.openedBy;for(let l=e.head;;){let c=n?o.childAfter(l):o.childBefore(l);if(!c)break;L0e(t,c,r)?o=c:l=n?c.to:c.from}let i=o.type.prop(r),s,a;return i&&(s=n?Bc(t,o.from,1):Bc(t,o.to,-1))&&s.matched?a=n?s.end.to:s.end.from:a=n?o.to:o.from,Ue.cursor(a,n?-1:1)}const P0e=t=>Ri(t,e=>$g(t.state,e,!Po(t))),D0e=t=>Ri(t,e=>$g(t.state,e,Po(t)));function RO(t,e){return Ri(t,n=>{if(!n.empty)return Cg(n,e);let o=t.moveVertically(n,e);return o.head!=n.head?o:t.moveToLineBoundary(n,e)})}const FO=t=>RO(t,!1),VO=t=>RO(t,!0);function zO(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,o=0,r;if(e){for(let i of t.state.facet(St.scrollMargins)){let s=i(t);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(o=Math.max(s==null?void 0:s.bottom,o))}r=t.scrollDOM.clientHeight-n-o}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:o,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function HO(t,e){let n=zO(t),{state:o}=t,r=Iu(o.selection,s=>s.empty?t.moveVertically(s,e,n.height):Cg(s,e));if(r.eq(o.selection))return!1;let i;if(n.selfScroll){let s=t.coordsAtPos(o.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;s&&s.top>l&&s.bottom<c&&(i=St.scrollIntoView(r.main.head,{y:"start",yMargin:s.top-l}))}return t.dispatch(Ii(o,r),{effects:i}),!0}const Qk=t=>HO(t,!1),Xb=t=>HO(t,!0);function il(t,e,n){let o=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?o.to:o.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==o.from&&o.length){let i=/^\s*/.exec(t.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;i&&e.head!=o.from+i&&(r=Ue.cursor(o.from+i))}return r}const E0e=t=>Ri(t,e=>il(t,e,!0)),N0e=t=>Ri(t,e=>il(t,e,!1)),I0e=t=>Ri(t,e=>il(t,e,!Po(t))),R0e=t=>Ri(t,e=>il(t,e,Po(t))),F0e=t=>Ri(t,e=>Ue.cursor(t.lineBlockAt(e.head).from,1)),V0e=t=>Ri(t,e=>Ue.cursor(t.lineBlockAt(e.head).to,-1));function z0e(t,e,n){let o=!1,r=Iu(t.selection,i=>{let s=Bc(t,i.head,-1)||Bc(t,i.head,1)||i.head>0&&Bc(t,i.head-1,1)||i.head<t.doc.length&&Bc(t,i.head+1,-1);if(!s||!s.end)return i;o=!0;let a=s.start.from==i.head?s.end.to:s.end.from;return Ue.cursor(a)});return o?(e(Ii(t,r)),!0):!1}const H0e=({state:t,dispatch:e})=>z0e(t,e);function ei(t,e){let n=Iu(t.state.selection,o=>{let r=e(o);return Ue.range(o.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch(Ii(t.state,n)),!0)}function WO(t,e){return ei(t,n=>t.moveByChar(n,e))}const UO=t=>WO(t,!Po(t)),GO=t=>WO(t,Po(t));function qO(t,e){return ei(t,n=>t.moveByGroup(n,e))}const W0e=t=>qO(t,!Po(t)),U0e=t=>qO(t,Po(t)),G0e=t=>ei(t,e=>$g(t.state,e,!Po(t))),q0e=t=>ei(t,e=>$g(t.state,e,Po(t)));function YO(t,e){return ei(t,n=>t.moveVertically(n,e))}const jO=t=>YO(t,!1),XO=t=>YO(t,!0);function KO(t,e){return ei(t,n=>t.moveVertically(n,e,zO(t).height))}const Jk=t=>KO(t,!1),eS=t=>KO(t,!0),Y0e=t=>ei(t,e=>il(t,e,!0)),j0e=t=>ei(t,e=>il(t,e,!1)),X0e=t=>ei(t,e=>il(t,e,!Po(t))),K0e=t=>ei(t,e=>il(t,e,Po(t))),Z0e=t=>ei(t,e=>Ue.cursor(t.lineBlockAt(e.head).from)),Q0e=t=>ei(t,e=>Ue.cursor(t.lineBlockAt(e.head).to)),tS=({state:t,dispatch:e})=>(e(Ii(t,{anchor:0})),!0),nS=({state:t,dispatch:e})=>(e(Ii(t,{anchor:t.doc.length})),!0),oS=({state:t,dispatch:e})=>(e(Ii(t,{anchor:t.selection.main.anchor,head:0})),!0),rS=({state:t,dispatch:e})=>(e(Ii(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),J0e=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),eme=({state:t,dispatch:e})=>{let n=Tg(t).map(({from:o,to:r})=>Ue.range(o,Math.min(r+1,t.doc.length)));return e(t.update({selection:Ue.create(n),userEvent:"select"})),!0},tme=({state:t,dispatch:e})=>{let n=Iu(t.selection,o=>{let r=us(t),i=r.resolveStack(o.from,1);if(o.empty){let s=r.resolveStack(o.from,-1);s.node.from>=i.node.from&&s.node.to<=i.node.to&&(i=s)}for(let s=i;s;s=s.next){let{node:a}=s;if((a.from<o.from&&a.to>=o.to||a.to>o.to&&a.from<=o.from)&&s.next)return Ue.range(a.to,a.from)}return o});return n.eq(t.selection)?!1:(e(Ii(t,n)),!0)};function ZO(t,e){let{state:n}=t,o=n.selection,r=n.selection.ranges.slice();for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head);if(e?s.to<t.state.doc.length:s.from>0)for(let a=i;;){let l=t.moveVertically(a,e);if(l.head<s.from||l.head>s.to){r.some(c=>c.head==l.head)||r.push(l);break}else{if(l.head==a.head)break;a=l}}}return r.length==o.ranges.length?!1:(t.dispatch(Ii(n,Ue.create(r,r.length-1))),!0)}const nme=t=>ZO(t,!1),ome=t=>ZO(t,!0),rme=({state:t,dispatch:e})=>{let n=t.selection,o=null;return n.ranges.length>1?o=Ue.create([n.main]):n.main.empty||(o=Ue.create([Ue.cursor(n.main.head)])),o?(e(Ii(t,o)),!0):!1};function Uf(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:o}=t,r=o.changeByRange(i=>{let{from:s,to:a}=i;if(s==a){let l=e(i);l<s?(n="delete.backward",l=Hh(t,l,!1)):l>s&&(n="delete.forward",l=Hh(t,l,!0)),s=Math.min(s,l),a=Math.max(a,l)}else s=Hh(t,s,!1),a=Hh(t,a,!0);return s==a?{range:i}:{changes:{from:s,to:a},range:Ue.cursor(s,s<i.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(o.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?St.announce.of(o.phrase("Selection deleted")):void 0})),!0)}function Hh(t,e,n){if(t instanceof St)for(let o of t.state.facet(St.atomicRanges).map(r=>r(t)))o.between(e,e,(r,i)=>{r<e&&i>e&&(e=n?i:r)});return e}const QO=(t,e,n)=>Uf(t,o=>{let r=o.from,{state:i}=t,s=i.doc.lineAt(r),a,l;if(n&&!e&&r>s.from&&r<s.from+200&&!/[^ \t]/.test(a=s.text.slice(0,r-s.from))){if(a[a.length-1]==" ")return r-1;let c=vg(a,i.tabSize),u=c%E0(i)||E0(i);for(let d=0;d<u&&a[a.length-1-d]==" ";d++)r--;l=r}else l=Oo(s.text,r-s.from,e,e)+s.from,l==r&&s.number!=(e?i.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(s.text.slice(l-s.from,r-s.from))&&(l=Oo(s.text,l-s.from,!1,!1)+s.from);return l}),Kb=t=>QO(t,!1,!0),JO=t=>QO(t,!0,!1),eB=(t,e)=>Uf(t,n=>{let o=n.head,{state:r}=t,i=r.doc.lineAt(o),s=r.charCategorizer(o);for(let a=null;;){if(o==(e?i.to:i.from)){o==n.head&&i.number!=(e?r.doc.lines:1)&&(o+=e?1:-1);break}let l=Oo(i.text,o-i.from,e)+i.from,c=i.text.slice(Math.min(o,l)-i.from,Math.max(o,l)-i.from),u=s(c);if(a!=null&&u!=a)break;(c!=" "||o!=n.head)&&(a=u),o=l}return o}),tB=t=>eB(t,!1),ime=t=>eB(t,!0),sme=t=>Uf(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),ame=t=>Uf(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),lme=t=>Uf(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),cme=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(o=>({changes:{from:o.from,to:o.to,insert:Ut.of(["",""])},range:Ue.cursor(o.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},ume=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(o=>{if(!o.empty||o.from==0||o.from==t.doc.length)return{range:o};let r=o.from,i=t.doc.lineAt(r),s=r==i.from?r-1:Oo(i.text,r-i.from,!1)+i.from,a=r==i.to?r+1:Oo(i.text,r-i.from,!0)+i.from;return{changes:{from:s,to:a,insert:t.doc.slice(r,a).append(t.doc.slice(s,r))},range:Ue.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Tg(t){let e=[],n=-1;for(let o of t.selection.ranges){let r=t.doc.lineAt(o.from),i=t.doc.lineAt(o.to);if(!o.empty&&o.to==i.from&&(i=t.doc.lineAt(o.to-1)),n>=r.number){let s=e[e.length-1];s.to=i.to,s.ranges.push(o)}else e.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return e}function nB(t,e,n){if(t.readOnly)return!1;let o=[],r=[];for(let i of Tg(t)){if(n?i.to==t.doc.length:i.from==0)continue;let s=t.doc.lineAt(n?i.to+1:i.from-1),a=s.length+1;if(n){o.push({from:i.to,to:s.to},{from:i.from,insert:s.text+t.lineBreak});for(let l of i.ranges)r.push(Ue.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{o.push({from:s.from,to:i.from},{from:i.to,insert:t.lineBreak+s.text});for(let l of i.ranges)r.push(Ue.range(l.anchor-a,l.head-a))}}return o.length?(e(t.update({changes:o,scrollIntoView:!0,selection:Ue.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const dme=({state:t,dispatch:e})=>nB(t,e,!1),fme=({state:t,dispatch:e})=>nB(t,e,!0);function oB(t,e,n){if(t.readOnly)return!1;let o=[];for(let i of Tg(t))n?o.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):o.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});let r=t.changes(o);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const hme=({state:t,dispatch:e})=>oB(t,e,!1),pme=({state:t,dispatch:e})=>oB(t,e,!0),mme=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Tg(e).map(({from:r,to:i})=>(r>0?r--:i<e.doc.length&&i++,{from:r,to:i}))),o=Iu(e.selection,r=>{let i;if(t.lineWrapping){let s=t.lineBlockAt(r.head),a=t.coordsAtPos(r.head,r.assoc||1);a&&(i=s.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,i)}).map(n);return t.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0};function gme(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=us(t).resolveInner(e),o=n.childBefore(e),r=n.childAfter(e),i;return o&&r&&o.to<=e&&r.from>=e&&(i=o.type.prop(Et.closedBy))&&i.indexOf(r.name)>-1&&t.doc.lineAt(o.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(o.to,r.from))?{from:o.to,to:r.from}:null}const iS=rB(!1),vme=rB(!0);function rB(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let o=e.changeByRange(r=>{let{from:i,to:s}=r,a=e.doc.lineAt(i),l=!t&&i==s&&gme(e,i);t&&(i=s=(s<=a.to?a:e.doc.lineAt(s)).to);let c=new Sg(e,{simulateBreak:i,simulateDoubleBreak:!!l}),u=CO(c,i);for(u==null&&(u=vg(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));s<a.to&&/\s/.test(a.text[s-a.from]);)s++;l?{from:i,to:s}=l:i>a.from&&i<a.from+100&&!/\S/.test(a.text.slice(0,i))&&(i=a.from);let d=["",N0(e,u)];return l&&d.push(N0(e,c.lineIndent(a.from,-1))),{changes:{from:i,to:s,insert:Ut.of(d)},range:Ue.cursor(i+1+d[1].length)}});return n(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0}}function _x(t,e){let n=-1;return t.changeByRange(o=>{let r=[];for(let s=o.from;s<=o.to;){let a=t.doc.lineAt(s);a.number>n&&(o.empty||o.to>a.from)&&(e(a,r,o),n=a.number),s=a.to+1}let i=t.changes(r);return{changes:r,range:Ue.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}})}const bme=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),o=new Sg(t,{overrideIndentation:i=>{let s=n[i];return s??-1}}),r=_x(t,(i,s,a)=>{let l=CO(o,i.from);if(l==null)return;/\S/.test(i.text)||(l=0);let c=/^\s*/.exec(i.text)[0],u=N0(t,l);(c!=u||a.from<i.from+c.length)&&(n[i.from]=l,s.push({from:i.from,to:i.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},yme=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_x(t,(n,o)=>{o.push({from:n.from,insert:t.facet(vx)})}),{userEvent:"input.indent"})),!0),xme=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(_x(t,(n,o)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let i=vg(r,t.tabSize),s=0,a=N0(t,Math.max(0,i-E0(t)));for(;s<r.length&&s<a.length&&r.charCodeAt(s)==a.charCodeAt(s);)s++;o.push({from:n.from+s,to:n.from+r.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),wme=t=>(t.setTabFocusMode(),!0),_me=[{key:"Ctrl-b",run:EO,shift:UO,preventDefault:!0},{key:"Ctrl-f",run:NO,shift:GO},{key:"Ctrl-p",run:FO,shift:jO},{key:"Ctrl-n",run:VO,shift:XO},{key:"Ctrl-a",run:F0e,shift:Z0e},{key:"Ctrl-e",run:V0e,shift:Q0e},{key:"Ctrl-d",run:JO},{key:"Ctrl-h",run:Kb},{key:"Ctrl-k",run:sme},{key:"Ctrl-Alt-h",run:tB},{key:"Ctrl-o",run:cme},{key:"Ctrl-t",run:ume},{key:"Ctrl-v",run:Xb}],kme=[{key:"ArrowLeft",run:EO,shift:UO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:O0e,shift:W0e,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:I0e,shift:X0e,preventDefault:!0},{key:"ArrowRight",run:NO,shift:GO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:B0e,shift:U0e,preventDefault:!0},{mac:"Cmd-ArrowRight",run:R0e,shift:K0e,preventDefault:!0},{key:"ArrowUp",run:FO,shift:jO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:tS,shift:oS},{mac:"Ctrl-ArrowUp",run:Qk,shift:Jk},{key:"ArrowDown",run:VO,shift:XO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:nS,shift:rS},{mac:"Ctrl-ArrowDown",run:Xb,shift:eS},{key:"PageUp",run:Qk,shift:Jk},{key:"PageDown",run:Xb,shift:eS},{key:"Home",run:N0e,shift:j0e,preventDefault:!0},{key:"Mod-Home",run:tS,shift:oS},{key:"End",run:E0e,shift:Y0e,preventDefault:!0},{key:"Mod-End",run:nS,shift:rS},{key:"Enter",run:iS,shift:iS},{key:"Mod-a",run:J0e},{key:"Backspace",run:Kb,shift:Kb,preventDefault:!0},{key:"Delete",run:JO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:tB,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ime,preventDefault:!0},{mac:"Mod-Backspace",run:ame,preventDefault:!0},{mac:"Mod-Delete",run:lme,preventDefault:!0}].concat(_me.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),Sme=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:P0e,shift:G0e},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:D0e,shift:q0e},{key:"Alt-ArrowUp",run:dme},{key:"Shift-Alt-ArrowUp",run:hme},{key:"Alt-ArrowDown",run:fme},{key:"Shift-Alt-ArrowDown",run:pme},{key:"Mod-Alt-ArrowUp",run:nme},{key:"Mod-Alt-ArrowDown",run:ome},{key:"Escape",run:rme},{key:"Mod-Enter",run:vme},{key:"Alt-l",mac:"Ctrl-l",run:eme},{key:"Mod-i",run:tme,preventDefault:!0},{key:"Mod-[",run:xme},{key:"Mod-]",run:yme},{key:"Mod-Alt-\\",run:bme},{key:"Shift-Mod-k",run:mme},{key:"Shift-Mod-\\",run:H0e},{key:"Mod-/",run:d0e},{key:"Alt-A",run:h0e},{key:"Ctrl-m",mac:"Shift-Alt-m",run:wme}].concat(kme);var sS={};class R0{constructor(e,n,o,r,i,s,a,l,c,u=0,d){this.p=e,this.stack=n,this.state=o,this.reducePos=r,this.pos=i,this.score=s,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=d}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,o=0){let r=e.parser.context;return new R0(e,[],n,o,o,0,[],0,r?new aS(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let o=e>>19,r=e&65535,{parser:i}=this.p,s=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=i.dynamicPrecedence(r);if(a&&(this.score+=a),o==0){this.pushState(i.getGoto(this.state,r,!0),this.reducePos),r<i.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,s?8:4,!0),this.reduceContext(r,this.reducePos);return}let l=this.stack.length-(o-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let d=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-d;if(r<i.minRepeatTerm||e&131072){let h=i.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,h,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=i.getGoto(h,r,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,o,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,a=this.buffer.length;if(a==0&&s.parent&&(a=s.bufferBase-s.parent.bufferBase,s=s.parent),a>0&&s.buffer[a-4]==0&&s.buffer[a-1]>-1){if(n==o)return;if(s.buffer[a-2]>=n){s.buffer[a-2]=o;return}}}if(!i||this.pos==o)this.buffer.push(e,n,o,r);else{let s=this.buffer.length;if(s>0&&(this.buffer[s-4]!=0||this.buffer[s-1]<0)){let a=!1;for(let l=s;l>0&&this.buffer[l-2]>o;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;s>0&&this.buffer[s-2]>o;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,r>4&&(r-=4)}this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=o,this.buffer[s+3]=r}}shift(e,n,o,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let i=e,{parser:s}=this.p;this.pos=r;let a=s.stateFlag(i,1);!a&&(r>o||n<=s.maxNode)&&(this.reducePos=r),this.pushState(i,a?o:Math.min(o,this.reducePos)),this.shiftContext(n,o),n<=s.maxNode&&this.buffer.push(n,o,r,4)}else this.pos=r,this.shiftContext(n,o),n<=this.p.parser.maxNode&&this.buffer.push(n,o,r,4)}apply(e,n,o,r){e&65536?this.reduce(e):this.shift(e,n,o,r)}useNode(e,n){let o=this.p.reused.length-1;(o<0||this.p.reused[o]!=e)&&(this.p.reused.push(e),o++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(o,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let o=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new R0(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,o,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let o=e<=this.p.parser.maxNode;o&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,o?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new Ame(this);;){let o=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(o==0)return!1;if((o&65536)==0)return!0;n.reduce(o)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let r=[];for(let i=0,s;i<n.length;i+=2)(s=n[i+1])!=this.state&&this.p.parser.hasAction(s,e)&&r.push(n[i],s);if(this.stack.length<120)for(let i=0;r.length<8&&i<n.length;i+=2){let s=n[i+1];r.some((a,l)=>l&1&&a==s)||r.push(n[i],s)}n=r}let o=[];for(let r=0;r<n.length&&o.length<4;r+=2){let i=n[r+1];if(i==this.state)continue;let s=this.split();s.pushState(i,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[r],this.pos),s.reducePos=this.pos,s.score-=200,o.push(s)}return o}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let o=n>>19,r=n&65535,i=this.stack.length-o*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],o=(r,i)=>{if(!n.includes(r))return n.push(r),e.allActions(r,s=>{if(!(s&393216))if(s&65536){let a=(s>>19)-i;if(a>1){let l=s&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=o(s,i+1);if(a!=null)return a}})};return o(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new aS(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class aS{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class Ame{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,o=e>>19;o==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(o-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}}class F0{constructor(e,n,o){this.stack=e,this.pos=n,this.index=o,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new F0(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new F0(this.stack,this.pos,this.index)}}function Wh(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let o=0,r=0;o<t.length;){let i=0;for(;;){let s=t.charCodeAt(o++),a=!1;if(s==126){i=65535;break}s>=92&&s--,s>=34&&s--;let l=s-32;if(l>=46&&(l-=46,a=!0),i+=l,a)break;i*=46}n?n[r++]=i:n=new e(i)}return n}class hp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const lS=new hp;class Cme{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=lS,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let o=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<o.from;){if(!r)return null;let s=this.ranges[--r];i-=o.from-s.to,o=s}for(;n<0?i>o.to:i>=o.to;){if(r==this.ranges.length-1)return null;let s=this.ranges[++r];i+=s.from-o.to,o=s}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,o,r;if(n>=0&&n<this.chunk.length)o=this.pos+e,r=this.chunk.charCodeAt(n);else{let i=this.resolveOffset(e,1);if(i==null)return-1;if(o=i,o>=this.chunk2Pos&&o<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(o-this.chunk2Pos);else{let s=this.rangeIndex,a=this.range;for(;a.to<=o;)a=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=o),o+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-o)),r=this.chunk2.charCodeAt(0)}}return o>=this.token.lookAhead&&(this.token.lookAhead=o+1),r}acceptToken(e,n=0){let o=n?this.resolveOffset(n,-1):this.pos;if(o==null||o<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=o}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=lS,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let o="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(o+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return o}}class qc{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:o}=n.p;$me(this.data,e,n,this.id,o.data,o.tokenPrecTable)}}qc.prototype.contextual=qc.prototype.fallback=qc.prototype.extend=!1;qc.prototype.fallback=qc.prototype.extend=!1;function $me(t,e,n,o,r,i){let s=0,a=1<<o,{dialect:l}=n.p.parser;e:for(;(a&t[s])!=0;){let c=t[s+1];for(let h=s+3;h<c;h+=2)if((t[h+1]&a)>0){let g=t[h];if(l.allows(g)&&(e.token.value==-1||e.token.value==g||Tme(g,e.token.value,r,i))){e.acceptToken(g);break}}let u=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[c+f*3-3]==65535){s=t[c+f*3-1];continue e}for(;d<f;){let h=d+f>>1,g=c+h+(h<<1),v=t[g],m=t[g+1]||65536;if(u<v)f=h;else if(u>=m)d=h+1;else{s=t[g+2],e.advance();continue e}}break}}function cS(t,e,n){for(let o=e,r;(r=t[o])!=65535;o++)if(r==n)return o-e;return-1}function Tme(t,e,n,o){let r=cS(n,o,e);return r<0||cS(n,o,t)<r}const mr=typeof process<"u"&&sS&&/\bparse\b/.test(sS.LOG);let Zv=null;function uS(t,e,n){let o=t.cursor(xn.IncludeAnonymous);for(o.moveTo(e);;)if(!(n<0?o.childBefore(e):o.childAfter(e)))for(;;){if((n<0?o.to<e:o.from>e)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,e-25)):Math.min(t.length,Math.max(o.from+1,e+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:t.length}}class Mme{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?uS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?uS(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let o=this.trees[n],r=this.index[n];if(r==o.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=o.children[r],s=this.start[n]+o.positions[r];if(s>e)return this.nextStart=s,null;if(i instanceof Tn){if(s==e){if(s<this.safeFrom)return null;let a=s+i.length;if(a<=this.safeTo){let l=i.prop(Et.lookAhead);if(!l||a+l<this.fragment.to)return i}}this.index[n]++,s+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class Ome{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(o=>new hp)}getActions(e){let n=0,o=null,{parser:r}=e.p,{tokenizers:i}=r,s=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<i.length;c++){if((1<<c&s)==0)continue;let u=i[c],d=this.tokens[c];if(!(o&&!u.fallback)&&((u.contextual||d.start!=e.pos||d.mask!=s||d.context!=a)&&(this.updateCachedToken(d,u,e),d.mask=s,d.context=a),d.lookAhead>d.end+25&&(l=Math.max(d.lookAhead,l)),d.value!=0)){let f=n;if(d.extended>-1&&(n=this.addActions(e,d.extended,d.end,n)),n=this.addActions(e,d.value,d.end,n),!u.extend&&(o=d,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!o&&e.pos==this.stream.end&&(o=new hp,o.value=e.p.parser.eofTerm,o.start=o.end=e.pos,n=this.addActions(e,o.value,o.end,n)),this.mainToken=o,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new hp,{pos:o,p:r}=e;return n.start=o,n.end=Math.min(o+1,r.stream.end),n.value=o==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,o){let r=this.stream.clipPos(o.pos);if(n.token(this.stream.reset(r,e),o),e.value>-1){let{parser:i}=o.p;for(let s=0;s<i.specialized.length;s++)if(i.specialized[s]==e.value){let a=i.specializers[s](this.stream.read(e.start,e.end),o);if(a>=0&&o.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,o,r){for(let i=0;i<r;i+=3)if(this.actions[i]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=o,r}addActions(e,n,o,r){let{state:i}=e,{parser:s}=e.p,{data:a}=s;for(let l=0;l<2;l++)for(let c=s.stateSlot(i,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=Bs(a,c+2);else{r==0&&a[c+1]==2&&(r=this.putAction(Bs(a,c+2),n,o,r));break}a[c]==n&&(r=this.putAction(Bs(a,c+1),n,o,r))}return r}}class Bme{constructor(e,n,o,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Cme(n,r),this.tokens=new Ome(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[R0.start(this,e.top[0],i)],this.fragments=o.length&&this.stream.end-i>e.bufferLength*4?new Mme(o,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,o=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let a=e[s];for(;;){if(this.tokens.mainToken=null,a.pos>n)o.push(a);else{if(this.advanceStack(a,o,e))continue;{r||(r=[],i=[]),r.push(a);let l=this.tokens.getMainToken(a);i.push(l.value,l.end)}}break}}if(!o.length){let s=r&&Pme(r);if(s)return mr&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw mr&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&r){let s=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,o);if(s)return mr&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(o.length>s)for(o.sort((a,l)=>l.score-a.score);o.length>s;)o.pop();o.some(a=>a.reducePos>n)&&this.recovering--}else if(o.length>1){e:for(let s=0;s<o.length-1;s++){let a=o[s];for(let l=s+1;l<o.length;l++){let c=o[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)o.splice(l--,1);else{o.splice(s--,1);continue e}}}o.length>12&&(o.sort((s,a)=>a.score-s.score),o.splice(12,o.length-12))}this.minStackPos=o[0].pos;for(let s=1;s<o.length;s++)o[s].pos<this.minStackPos&&(this.minStackPos=o[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,o){let r=e.pos,{parser:i}=this,s=mr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let d=this.fragments.nodeAt(r);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?i.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!c||(d.prop(Et.contextHash)||0)==u))return e.useNode(d,f),mr&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(d.type.id)})`),!0;if(!(d instanceof Tn)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Tn&&d.positions[0]==0)d=h;else break}}let a=i.stateSlot(e.state,4);if(a>0)return e.reduce(a),mr&&console.log(s+this.stackID(e)+` (via always-reduce ${i.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],d=l[c++],f=l[c++],h=c==l.length||!o,g=h?e:e.split(),v=this.tokens.mainToken;if(g.apply(u,d,v?v.start:g.pos,f),mr&&console.log(s+this.stackID(g)+` (via ${(u&65536)==0?"shift":`reduce of ${i.getName(u&65535)}`} for ${i.getName(d)} @ ${r}${g==e?"":", split"})`),h)return!0;g.pos>r?n.push(g):o.push(g)}return!1}advanceFully(e,n){let o=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>o)return dS(e,n),!0}}runRecovery(e,n,o){let r=null,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=n[s<<1],c=n[(s<<1)+1],u=mr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(i||(i=!0,a.restart(),mr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,o))))continue;let d=a.split(),f=u;for(let h=0;h<10&&d.forceReduce()&&(mr&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,o));h++)mr&&(f=this.stackID(d)+" -> ");for(let h of a.recoverByInsert(l))mr&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,o);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),mr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),dS(a,o)):(!r||r.score<d.score)&&(r=d)}return r}stackToTree(e){return e.close(),Tn.build({buffer:F0.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(Zv||(Zv=new WeakMap)).get(e);return n||Zv.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function dS(t,e){for(let n=0;n<e.length;n++){let o=e[n];if(o.pos==t.pos&&o.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class Lme{constructor(e,n,o){this.source=e,this.flags=n,this.disabled=o}allows(e){return!this.disabled||this.disabled[e]==0}}class V0 extends yO{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let a=0;a<e.repeatNodeCount;a++)n.push("");let o=Object.keys(e.topRules).map(a=>e.topRules[a][1]),r=[];for(let a=0;a<n.length;a++)r.push([]);function i(a,l,c){r[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=Et[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)i(u,l,a[c++]);else{let d=a[c+-u];for(let f=-u;f>0;f--)i(a[c++],l,d);c++}}}this.nodeSet=new hx(n.map((a,l)=>ur.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:o.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=mO;let s=Wh(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(fS),this.states=Wh(e.states,Uint32Array),this.data=Wh(e.stateData),this.goto=Wh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new qc(s,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,o){let r=new Bme(this,e,n,o);for(let i of this.wrappers)r=i(r,e,n,o);return r}getGoto(e,n,o=!1){let r=this.goto;if(n>=r[0])return-1;for(let i=r[n+1];;){let s=r[i++],a=s&1,l=r[i++];if(a&&o)return l;for(let c=i+(s>>1);i<c;i++)if(r[i]==e)return l;if(a)return-1}}hasAction(e,n){let o=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),s;;i+=3){if((s=o[i])==65535)if(o[i+1]==1)s=o[i=Bs(o,i+2)];else{if(o[i+1]==2)return Bs(o,i+2);break}if(s==n||s==0)return Bs(o,i+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,o=>o==n?!0:null)}allActions(e,n){let o=this.stateSlot(e,4),r=o?n(o):void 0;for(let i=this.stateSlot(e,1);r==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Bs(this.data,i+2);else break;r=n(Bs(this.data,i+1))}return r}nextStates(e){let n=[];for(let o=this.stateSlot(e,1);;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=Bs(this.data,o+2);else break;if((this.data[o+2]&1)==0){let r=this.data[o+1];n.some((i,s)=>s&1&&i==r)||n.push(this.data[o],r)}}return n}configure(e){let n=Object.assign(Object.create(V0.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let o=this.topRules[e.top];if(!o)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=o}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(o=>{let r=e.tokenizers.find(i=>i.from==o);return r?r.to:o})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((o,r)=>{let i=e.specializers.find(a=>a.from==o.external);if(!i)return o;let s=Object.assign(Object.assign({},o),{external:i.to});return n.specializers[r]=fS(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),o=n.map(()=>!1);if(e)for(let i of e.split(" ")){let s=n.indexOf(i);s>=0&&(o[s]=!0)}let r=null;for(let i=0;i<n.length;i++)if(!o[i])for(let s=this.dialects[n[i]],a;(a=this.data[s++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[a]=1;return new Lme(e,o,r)}static deserialize(e){return new V0(e)}}function Bs(t,e){return t[e]|t[e+1]<<16}function Pme(t){let e=null;for(let n of t){let o=n.p.stoppedAt;(n.pos==n.p.stream.end||o!=null&&n.pos>o)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function fS(t){if(t.external){let e=t.extend?1:0;return(n,o)=>t.external(n,o)<<1|e}return t.get}const Dme={__proto__:null,chart:10,data:16,colorize:38,highlight:40,areafill:44,range:48,note:52,annotation:56,series:60,scene:64,step:66,transform:72},Eme=V0.deserialize({version:14,states:",`OYQPOOQOQPOOO_QPO'#C_OdQPO,58yO!dQPO1G.eOOQO'#Cf'#CfO!kQPO'#CmOOQO'#Cb'#CbOOQO'#DR'#DRO!pQPO7+$PO!wQPO'#CcO!|QPO'#CnO#RQPO'#CqO#WQPO'#CsO#]QPO'#CuO#bQPO'#CwO#gQPO'#CyO#lQPO'#DPO#qQPO'#C{OOQO7+$P7+$PO#yQPO,59XOOQO-E7P-E7POOQO<<Gk<<GkO$XQPO,58}O$dQPO,59YO$iQPO,59]O$nQPO,59_O$yQPO,59aO%UQPO,59cO%ZQPO,59eO%`QPO,59kO&YQPO,59gO&aQPO,59gOOQO'#Cj'#CjOOQO1G.s1G.sO&fQPO'#CmOOQO'#Ce'#CeOOQO'#DS'#DSO&kQPO1G.iOOQO1G.i1G.iO&vQPO1G.tO'RQPO1G.wOOQO'#DU'#DUO'WQPO1G.yOOQO1G.y1G.yO'cQPO1G.{OOQO1G.{1G.{O'nQPO1G.}O'yQPO1G/PO(UQPO1G/VOOQO'#DO'#DOOOQO'#DV'#DVO(aQPO1G/ROOQO1G/R1G/RO(aQPO1G/RO#yQPO,59XOOQO-E7Q-E7QOOQO7+$T7+$TO(hQPO7+$`OOQO7+$`7+$`O(sQPO7+$cOOQO-E7S-E7SOOQO7+$e7+$eOOQO7+$g7+$gO)OQPO7+$iOOQO7+$i7+$iO)ZQPO7+$kOOQO7+$k7+$kO)fQPO7+$qOOQO7+$q7+$qOOQO-E7T-E7TOOQO7+$m7+$mO)qQPO7+$mO)xQPO1G.sOOQO1G.k1G.kOOQO<<Gz<<GzO*WQPO<<G}OOQO<<G}<<G}OOQO<<HT<<HTOOQO<<HV<<HVOOQO<<H]<<H]OOQO<<HX<<HXO#yQPO'#DTO*cQPO,59TOOQOAN=iAN=iOOQO,59o,59oOOQO-E7R-E7R",stateData:"*w~O|OSPOS~OTQO~OSRO~O}SO~OSTOWYOZTOcZOdZOf[Oh]Oj^Ol_On`OpbOqbOtaO~O!PcO~PiO[dO~O!PfO~PiO}gO~OZhO~OZiO~O}jO~O}kO~OZlO~OZmO~OSnO~OZpO}oO~OSqOZqO_qO`qO~OSTOZTO!PwO~O}xO~OZyO~OSTOZTO!P|O~OSTOZTO!P!OO~O}!PO~O}!QO~O}!RO~OSTOWYOZTOcZOdZOf[Oh]Oj^Ol_On`OtaO~O!P!VO~P%eO}!WO~O[!XO~OSTOZTO!P!ZO~OSTOZTO!P!]O~O}!^O~OSTOZTO!P!`O~OSTOZTO!P!aO~OSTOZTO!P!cO~OSTOZTO!P!eO~OSTOZTO!P!gO~O!P!iO~P%eOSTOZTO!P!mO~OSTOZTO!P!oO~OSTOZTO!P!pO~OSTOZTO!P!qO~OSTOZTO!P!rO~O!P!sO~P%eO!O!tOSaiZai!Pai~OSTOZTO!P!vO~O!O!tOS]aZ]a!P]a~O_`PSP~",goto:"%`zPPP{PP!O!SP!^!bPP!|#PPP#Y!SPP!SP!SP!SP!SP!SP#xPP#|!SP$S$Y$`$f%URPOTWSXSVSXX!So!U!W!jTugvxUSXjkox{}!P!Q!R!U!W![!^!b!d!f!j!nTsgvR!l!XQrdQ!k!XR!w!tSVSXStgvlzjkx{}!P!Q!R![!^!b!d!f!nX!So!U!W!jTVSXX!To!U!W!jQXSReXQvgR!YvQ!u!kR!x!uQ{jQ}kQ![x^!_{}![!b!d!f!nQ!b!PQ!d!QQ!f!RR!n!^Q!UoS!h!U!jR!j!W",nodeNames:"⚠ LineComment Chart ChartDecl Identifier chart ChartMember DataBlock data DataEntry PropertyKey String Equals ValueList PropertyValue Percentage Number Property Colorize colorize highlight AreaFill areafill RangeAnnotation range NoteAnnotation note Annotation annotation Series series Scene scene step SceneMember Transform transform",maxTerm:47,skippedNodes:[0,1],repeatNodeCount:5,tokenData:"']~RfX^!gpq!grs#[st$u|}%^}!O%c!P!Q&_!Q![%i!_!`&|!c!}$u#R#S$u#T#o$u#o#p'R#q#r'W#y#z!g$f$g!g#BY#BZ!g$IS$I_!g$I|$JO!g$JT$JU!g$KV$KW!g&FU&FV!g~!lY|~X^!gpq!g#y#z!g$f$g!g#BY#BZ!g$IS$I_!g$I|$JO!g$JT$JU!g$KV$KW!g&FU&FV!g~#_VOr#[rs#ts#O#[#O#P#y#P;'S#[;'S;=`$o<%lO#[~#yOZ~~#|ZOr#[rs#[s#O#[#O#P#[#P#b#[#b#c#[#c#h#[#h#i#[#i;'S#[;'S;=`$o<%lO#[~$rP;=`<%l#[~$zUS~st$u}!O$u!Q![$u!c!}$u#R#S$u#T#o$u~%cO!O~~%fP!Q![%i~%nR`~uv%w!O!P%|!Q![%i~%|O_~~&PP!Q![&S~&XQ`~uv%w!Q![&S~&bP!P!Q&e~&jSP~OY&eZ;'S&e;'S;=`&v<%lO&e~&yP;=`<%l&e~'RO[~~'WO}~~']O!P~",tokenizers:[0],topRules:{Chart:[0,2]},specialized:[{term:4,get:t=>Dme[t]||-1}],tokenPrec:447}),iB=Eme.configure({props:[xO({chart:ut.keyword,data:ut.keyword,colorize:ut.keyword,highlight:ut.keyword,areafill:ut.keyword,annotation:ut.keyword,range:ut.keyword,note:ut.keyword,series:ut.keyword,scene:ut.keyword,step:ut.keyword,transform:ut.keyword,Identifier:ut.variableName,String:ut.string,Number:ut.number,Percentage:ut.number,Equals:ut.operator,LineComment:ut.lineComment,"{ }":ut.brace})]}),Nme=P0.define({parser:iB,languageData:{commentTokens:{line:"//"}}}),Ime=e0e(SO);function Rme(){return new Wpe(Nme)}function Qv(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Tbe(t){const e=iB.parse(t);let n=0,o="";return kO(e,SO,(r,i,s)=>{r>n&&(o+=Qv(t.slice(n,r))),o+=`<span class="${s}">${Qv(t.slice(r,i))}</span>`,n=i}),n<t.length&&(o+=Qv(t.slice(n))),o}const Fme={class:"d-flex flex-column h-100"},Vme={key:0,class:"text-danger small mt-1"},zme=le({__name:"ChartEditDsl",setup(t){const{dsl:e}=Ff(),{applyDsl:n}=zc(),o=mt("editorEl"),r=ze();let i,s=!1;function a(l){if(!l.docChanged||s)return;const c=l.state.doc.toString(),u=n(c);u.success?r.value=void 0:r.value=u.error}return hn(()=>{const l=Qt.create({doc:e.value,extensions:[pO.of([...Sme,...M0e]),x0e(),Rme(),Ime,St.updateListener.of(a),St.theme({"&":{height:"100%",backgroundColor:"var(--bc-tile-bg-elevated)"},".cm-scroller":{overflow:"auto"},".cm-content":{fontFamily:"var(--bs-font-monospace)"},".cm-gutters":{backgroundColor:"var(--bc-tile-bg-elevated)",color:"var(--bs-secondary-color)",borderRight:"1px solid var(--bs-border-color)"}})]});i=new St({state:l,parent:o.value})}),je(e,l=>{!i||i.state.doc.toString()===l||(s=!0,i.dispatch({changes:{from:0,to:i.state.doc.length,insert:l}}),s=!1)}),na(()=>{i==null||i.destroy(),i=void 0}),(l,c)=>(w(),R("div",Fme,[T("div",{ref_key:"editorEl",ref:o,class:"flex-grow-1 overflow-auto"},null,512),p(r)?(w(),R("div",Vme,be(p(r)),1)):se("",!0)]))}}),Hme={key:1,class:"position-absolute",width:"0",height:"0","aria-hidden":"true"},Wme=le({__name:"PreviewChart",setup(t){const e=mt("containerRef");K2(e);const{containerRef:n}=jT();je(e,E=>{n.value=E},{immediate:!0});const{selectAnnotation:o}=dr();function r(E){var M;const C=E.target.closest("g[data-annotation-index]");if(!C)return;E.preventDefault(),(M=window.getSelection())==null||M.removeAllRanges();const $=C.getAttribute("data-annotation-id");if($){o($);return}const P=parseInt(C.getAttribute("data-annotation-index")||"",10);isNaN(P)||o(P)}hn(()=>{var E;(E=e.value)==null||E.addEventListener("dblclick",r)}),Xs(()=>{var E;(E=e.value)==null||E.removeEventListener("dblclick",r)});const{cvdMode:i}=Mt(ZT()),s=mt("cvdDefsRef");je([i,s],([E,I])=>{if(I){for(;I.firstChild;)I.removeChild(I.firstChild);E&&I.appendChild(doe(E))}},{immediate:!0});const a=A(()=>{if(i.value)return{filter:`url(#${J$(i.value)})`}}),{layout:l}=pn(),{scenes:c,activeIndex:u,playing:d,setActive:f,nextScene:h,previousScene:g,startPlayback:v,stopPlayback:m}=_n(),b=ze(null),y={buttons:P1,"progress-bar":JA,"dot-stepper":eC,"minimal-arrows":tC},x=A(()=>y[l.value.playerType]),_=A(()=>c.value.length+1),S=A(()=>u.value+2),N=A(()=>c.value.length>=1&&l.value.playerType!=="none");function B(E){f(E-2)}let k=null;function L(){const E=e.value;return E?E.querySelector(".bc-frame-footer"):null}return je(e,E=>{if(k&&(k.disconnect(),k=null),!E){b.value=null;return}b.value=L(),k=new MutationObserver(()=>{b.value=L()}),k.observe(E,{childList:!0,subtree:!0})},{immediate:!0}),Xs(()=>{k&&(k.disconnect(),k=null)}),(E,I)=>(w(),R(Ge,null,[T("div",{ref_key:"containerRef",ref:e,class:"w-100 h-100",style:Dt(p(a))},null,4),p(b)&&p(N)?(w(),Q(sy,{key:0,to:p(b)},[(w(),Q(Gt(p(x)),{total:p(_),current:p(S),playing:p(d),position:p(l).playerPosition,"onUpdate:current":B,onPrevious:p(g),onNext:p(h),onPlay:p(v),onPause:p(m)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):se("",!0),p(i)?(w(),R("svg",Hme,[T("defs",{ref_key:"cvdDefsRef",ref:s},null,512)])):se("",!0)],64))}}),sB=Symbol("sceneTimeline"),Ume={key:0,class:"floating-scene-timeline"},Gme=le({__name:"FloatingSceneTimeline",setup(t){const e=jt(sB,null),{isNarrow:n}=bi();return(o,r)=>p(e)&&!p(n)&&p(e).showTimeline.value?(w(),R("div",Ume,[H(p(VG),{scenes:p(e).scenes.value,"active-index":p(e).activeIndex.value,playing:p(e).playing.value,floating:"","onUpdate:activeIndex":p(e).onSelect,onAdd:p(e).onAdd,onRemove:p(e).onRemove,onPlay:p(e).onPlay,onPause:p(e).onPause},null,8,["scenes","active-index","playing","onUpdate:activeIndex","onAdd","onRemove","onPlay","onPause"])])):se("",!0)}}),aB=Be(Gme,[["__scopeId","data-v-05a62bbc"]]),qme={class:"chart-edit-panel__canvas-frame"},Yme=le({__name:"ChartEditPanel",setup(t){const e=dr(),{viewMode:n,activeTab:o,canvasMode:r,showDimensions:i}=Mt(e),{selectTab:s,setLastNarrowEditTab:a}=e,{mode:l}=lc(),{isNarrow:c}=bi(),{layout:u}=pn(),{cardClass:d,cardStyle:f}=X2(u,"chart-edit-panel__canvas__card"),{sections:h}=WT(),g=A({get:()=>!!o.value,set:I=>{I||s("")}});je(l,I=>{I==="drawer"&&o.value&&(a(o.value),s(""))},{immediate:!0});function v(I){a(I),s(I)}const m=A(()=>h.value.map(I=>({key:I.key,label:I.label,icon:I.icon}))),b=A(()=>({"chart-edit-panel--narrow":c.value})),y=A(()=>({[`chart-edit-panel__canvas--${r.value}`]:r.value!=="blueprint","chart-edit-panel__canvas--dsl":n.value!=="preview","chart-edit-panel__canvas--dimensions":n.value==="preview"&&i.value})),x={type:"Chart Type",text:"Text",style:"Style",layout:"Layout",series:"Series",axes:"Axes",annotate:"Annotate",interactions:"Interactions"},_=A(()=>x[o.value]??"Panel"),S=mt("canvasRef"),N=mt("cardRef"),B=Fe(0),k=Fe(0);function L(){const I=N.value;I&&(B.value=I.offsetLeft,k.value=I.offsetTop)}ls(S,L),ls(N,L);const E=A(()=>({"--grid-offset-x":`${B.value}px`,"--grid-offset-y":`${k.value}px`}));return(I,C)=>{const $=Wme,P=zme,M=VT,F=FT,V=j2,G=afe,K=tfe,ue=jde,de=qde,he=ide,ge=Que,ee=Gue,fe=hue,xe=Jle,Z=Y2,pe=pg,oe=Dle;return w(),R("div",{class:Te(["chart-edit-panel",p(b)])},[T("div",qme,[T("div",{ref_key:"canvasRef",ref:S,class:Te(["chart-edit-panel__canvas",p(y)]),style:Dt(p(E))},[p(n)==="preview"?(w(),R("div",{key:0,ref_key:"cardRef",ref:N,class:Te(["chart-edit-panel__canvas__card",p(d)]),style:Dt(p(f))},[H($)],6)):(w(),Q(P,{key:1,class:"chart-edit-panel__canvas__dsl"})),p(n)==="preview"&&p(i)?(w(),Q(M,{key:2,"card-ref":p(N),"canvas-ref":p(S),layout:p(u)},null,8,["card-ref","canvas-ref","layout"])):se("",!0),H(aB)],6),p(n)==="preview"?(w(),Q(F,{key:0})):se("",!0)]),H(pe,{"drawer-open":p(g),"onUpdate:drawerOpen":C[0]||(C[0]=ve=>Ze(g)?g.value=ve:null),title:p(_),"container-ref":p(S),onClose:C[1]||(C[1]=ve=>p(s)(""))},ki({default:J(()=>[p(o)==="type"?(w(),Q(K,{key:0})):p(o)==="text"?(w(),Q(ue,{key:1})):p(o)==="style"?(w(),Q(de,{key:2})):p(o)==="series"?(w(),Q(he,{key:3})):p(o)==="axes"?(w(),Q(ge,{key:4})):p(o)==="layout"?(w(),Q(ee,{key:5})):p(o)==="annotate"?(w(),Q(fe,{key:6})):p(o)==="interactions"?(w(),Q(xe,{key:7})):se("",!0)]),_:2},[p(l)==="drawer"?{name:"tabs",fn:J(()=>[H(V,{tabs:p(m),"model-value":p(o),sticky:"","onUpdate:modelValue":v},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(l)!=="drawer"?{name:"header",fn:J(()=>[H(G)]),key:"1"}:void 0,p(l)!=="drawer"?{name:"footer",fn:J(()=>[H(Z)]),key:"2"}:void 0]),1032,["drawer-open","title","container-ref"]),p(c)?se("",!0):(w(),Q(oe,{key:0}))],2)}}}),jme=Be(Yme,[["__scopeId","data-v-9b66c576"]]),Xme={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Kme(t,e){return w(),R("svg",Xme,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M104 32H64a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m0 176H64V48h40Zm88-176h-40a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h40a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16m0 176h-40V48h40Z"},null,-1)])])}const Zme=Me({name:"ph-columns",render:Kme}),Qme={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Jme(t,e){return w(),R("svg",Qme,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"m245.66 74.34l-32-32a8 8 0 0 0-11.32 11.32L220.69 72H208c-49.33 0-61.05 28.12-71.38 52.92c-9.38 22.51-16.92 40.59-49.48 42.84a40 40 0 1 0 .1 16c43.26-2.65 54.34-29.15 64.14-52.69C161.41 107 169.33 88 208 88h12.69l-18.35 18.34a8 8 0 0 0 11.32 11.32l32-32a8 8 0 0 0 0-11.32M48 200a24 24 0 1 1 24-24a24 24 0 0 1-24 24"},null,-1)])])}const ege=Me({name:"ph-flow-arrow",render:Jme}),tge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function nge(t,e){return w(),R("svg",tge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M176 232a8 8 0 0 1-8 8H88a8 8 0 0 1 0-16h80a8 8 0 0 1 8 8m40-128a87.55 87.55 0 0 1-33.64 69.21A16.24 16.24 0 0 0 176 186v6a16 16 0 0 1-16 16H96a16 16 0 0 1-16-16v-6a16 16 0 0 0-6.23-12.66A87.59 87.59 0 0 1 40 104.49C39.74 56.83 78.26 17.14 125.88 16A88 88 0 0 1 216 104m-16 0a72 72 0 0 0-73.74-72c-39 .92-70.47 33.39-70.26 72.39a71.65 71.65 0 0 0 27.64 56.3A32 32 0 0 1 96 186v6h64v-6a32.15 32.15 0 0 1 12.47-25.35A71.65 71.65 0 0 0 200 104m-16.11-9.34a57.6 57.6 0 0 0-46.56-46.55a8 8 0 0 0-2.66 15.78c16.57 2.79 30.63 16.85 33.44 33.45A8 8 0 0 0 176 104a9 9 0 0 0 1.35-.11a8 8 0 0 0 6.54-9.23"},null,-1)])])}const oge=Me({name:"ph-lightbulb",render:nge});function lB(){return{sections:[{key:"column",label:"Columns",icon:Zme},{key:"transforms",label:"Transforms",icon:ege},{key:"parsing",label:"Parsing",icon:IT},{key:"reco",label:"Recommendations",icon:oge}]}}const rge=le({__name:"DataSideIconRail",props:{disabledTabs:{default:()=>[]}},setup(t){const e=t,n=dr(),{dataPanelTab:o}=Mt(n),{openDataPanel:r}=n,{mode:i,toggleMode:s}=lc(),{sections:a}=lB(),l=A(()=>a.filter(d=>!e.disabledTabs.includes(d.key)).map(d=>({value:d.key,icon:d.icon,tooltip:d.tooltip??d.label})));function c(d){r(d)}function u(){i.value==="closed"&&r(o.value||"column"),s()}return(d,f)=>{const h=G2;return w(),Q(h,{"active-tab":p(o),items:p(l),onSelect:c,onToggleMode:u},null,8,["active-tab","items"])}}}),ige={class:"reco-card__preview"},sge={class:"reco-card__body"},age={class:"reco-card__body__title"},lge={class:"reco-card__body__reason"},cge=le({__name:"DataRecommendationCard",props:{chartType:{},label:{},fitness:{},reason:{}},emits:["select"],setup(t){const e={[Le.BarVertical]:Me(QT),[Le.BarHorizontal]:Me(JT),[Le.BarMulti]:Me(eM),[Le.Line]:Me(tM),[Le.LineMulti]:Me(nM),[Le.Donut]:Me(oM),[Le.Pie]:Me(rM)},n=t,o=A(()=>e[n.chartType]),r=A(()=>n.fitness==="best"?"reco-card__body__title__badge--best":n.fitness==="good"?"reco-card__body__title__badge--good":"reco-card__body__title__badge--alt"),i=A(()=>n.fitness==="best"?"Best match":n.fitness==="good"?"Good fit":"Alternative");return(s,a)=>(w(),R("button",{class:Te(["reco-card",{"reco-card--best":t.fitness==="best"}]),onClick:a[0]||(a[0]=l=>s.$emit("select",t.chartType))},[T("div",ige,[p(o)?(w(),Q(Gt(p(o)),{key:0,class:"reco-card__preview__thumb-svg"})):se("",!0)]),T("div",sge,[T("div",age,[Xe(be(t.label)+" ",1),T("span",{class:Te(["reco-card__body__title__badge",p(r)])},be(p(i)),3)]),T("div",lge,be(t.reason),1)])],2))}}),uge=Be(cge,[["__scopeId","data-v-0e22d5d1"]]);function dge(){const{displayRows:t,displayColumnTypes:e}=Ko(),n=A(()=>{const r=e.value,i=r.filter(c=>c==="string").length,s=r.filter(c=>c==="number").length,a=r.filter(c=>c==="date").length,l=[];return i>0&&l.push(`${i} categorical`),a>0&&l.push(`${a} date`),s>0&&l.push(`${s} numeric`),l.length>0?`${l.join(" + ")} column${r.length!==1?"s":""}`:"No data"});return{recommendations:A(()=>coe(e.value,t.value.length)),dataSummary:n}}const fge={class:"data-recommendations"},hge={class:"data-recommendations__summary"},pge={key:0,class:"text-muted text-center py-3"},mge=le({__name:"DataRecommendations",setup(t){const{recommendations:e,dataSummary:n}=dge(),o=pn();function r(i){o.chartType.value=i}return(i,s)=>{const a=uge;return w(),R("div",fge,[T("p",hge," Based on your data: "+be(p(n)),1),p(e).length===0?(w(),R("div",pge," Load data to see recommendations ")):se("",!0),(w(!0),R(Ge,null,gt(p(e),l=>(w(),Q(a,{key:l.chartType,"chart-type":l.chartType,label:l.label,fitness:l.fitness,reason:l.reason,onSelect:r},null,8,["chart-type","label","fitness","reason"]))),128))])}}}),gge=Be(mge,[["__scopeId","data-v-47bbaf64"]]),hS={firstRowIsHeader:!0,delimiter:"auto",decimalSeparator:".",treatEmptyAsNull:!0,trimWhitespace:!0},vge=Lo("parseOptions",()=>{const t=ar({...hS});function e(o,r){t[o]=r}function n(){Object.assign(t,{...hS})}return{...J0(t),setOption:e,reset:n}});function cB(){const t=vge(),{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i}=Mt(t);return{firstRowIsHeader:e,delimiter:n,decimalSeparator:o,treatEmptyAsNull:r,trimWhitespace:i,setOption:t.setOption,reset:t.reset}}const bge={class:"data-parse-settings"},yge={class:"data-parse-settings__field"},xge={class:"data-parse-settings__field"},wge=le({__name:"DataParseSettings",setup(t){const e=cB(),{firstRowIsHeader:n,delimiter:o,decimalSeparator:r,treatEmptyAsNull:i,trimWhitespace:s}=Mt(e),{setOption:a}=e,{sourceFormat:l}=Ko(),c=A(()=>l.value!=="delimited"),u=A({get:()=>n.value,set:b=>a("firstRowIsHeader",b)}),d=A({get:()=>o.value,set:b=>a("delimiter",b)}),f=A({get:()=>r.value,set:b=>a("decimalSeparator",b)}),h=A({get:()=>i.value,set:b=>a("treatEmptyAsNull",b)}),g=A({get:()=>s.value,set:b=>a("trimWhitespace",b)}),v=[{value:"auto",label:"Auto-detect"},{value:",",label:"Comma (,)"},{value:" ",label:"Tab"},{value:";",label:"Semicolon (;)"},{value:"|",label:"Pipe (|)"}],m=[{value:".",label:"Period (.)"},{value:",",label:"Comma (,)"}];return(b,y)=>(w(),R("div",bge,[H(p(Hs),{modelValue:p(u),"onUpdate:modelValue":y[0]||(y[0]=x=>Ze(u)?u.value=x:null),switch:""},{default:J(()=>[...y[5]||(y[5]=[Xe(" First row is header ",-1)])]),_:1},8,["modelValue"]),T("div",yge,[y[6]||(y[6]=T("div",{class:"data-parse-settings__field__label"}," Delimiter ",-1)),H(p(Nn),{modelValue:p(d),"onUpdate:modelValue":y[1]||(y[1]=x=>Ze(d)?d.value=x:null),label:"",options:v,disabled:p(c),block:""},null,8,["modelValue","disabled"])]),T("div",xge,[y[7]||(y[7]=T("div",{class:"data-parse-settings__field__label"}," Decimal Separator ",-1)),H(p(Nn),{modelValue:p(f),"onUpdate:modelValue":y[2]||(y[2]=x=>Ze(f)?f.value=x:null),label:"",options:m,block:""},null,8,["modelValue"])]),H(p(Hs),{modelValue:p(h),"onUpdate:modelValue":y[3]||(y[3]=x=>Ze(h)?h.value=x:null),switch:""},{default:J(()=>[...y[8]||(y[8]=[Xe(" Treat empty as null ",-1)])]),_:1},8,["modelValue"]),H(p(Hs),{modelValue:p(g),"onUpdate:modelValue":y[4]||(y[4]=x=>Ze(g)?g.value=x:null),switch:""},{default:J(()=>[...y[9]||(y[9]=[Xe(" Trim whitespace ",-1)])]),_:1},8,["modelValue"])]))}}),_ge=Be(wge,[["__scopeId","data-v-872473d2"]]),kge={class:"output-block"},Sge={class:"output-block__meta"},Age=le({__name:"DataTransformOutputBlock",props:{columns:{},rows:{}},setup(t){return(e,n)=>(w(),R("div",kge,[n[0]||(n[0]=T("span",{class:"output-block__icon"},[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[T("path",{d:"M20 6L9 17l-5-5"})])],-1)),n[1]||(n[1]=T("span",null,"Output",-1)),T("span",Sge,be(t.columns)+" cols · "+be(t.rows)+" rows",1)]))}}),Cge=Be(Age,[["__scopeId","data-v-b1080d62"]]),$ge={class:"add-wrap"},Tge={key:0,class:"add-wrap__dropdown"},Mge=["disabled","onClick"],Oge={class:"add-wrap__dropdown__item__text"},Bge={class:"add-wrap__dropdown__item__text__name"},Lge={class:"add-wrap__dropdown__item__text__desc"},Pge=le({__name:"DataTransformAddButton",emits:["add"],setup(t,{emit:e}){const n=e,o=Fe(!1),r=[{value:et.Sort,label:"Sort",desc:"Reorder rows by column values",disabled:!1},{value:et.Filter,label:"Filter",desc:"Keep or exclude rows by condition",disabled:!1},{value:et.HideColumns,label:"Hide Columns",desc:"Remove columns from output",disabled:!1},{value:et.Transpose,label:"Transpose",desc:"Swap rows and columns",disabled:!1},{value:et.Parse,label:"Parse",desc:"Transform column values",disabled:!1},{value:et.Rename,label:"Rename Column",desc:"Change a column name",disabled:!1},{value:et.GroupBy,label:"Group By",desc:"Aggregate rows by column values",disabled:!1},{value:et.Computed,label:"Computed Column",desc:"Derive new column (coming soon)",disabled:!0}];function i(l){return{[et.Sort]:"add-wrap__dropdown__item__icon--sort",[et.Filter]:"add-wrap__dropdown__item__icon--filter",[et.HideColumns]:"add-wrap__dropdown__item__icon--hide-columns",[et.Transpose]:"add-wrap__dropdown__item__icon--transpose",[et.Parse]:"add-wrap__dropdown__item__icon--parse",[et.Rename]:"add-wrap__dropdown__item__icon--rename",[et.GroupBy]:"add-wrap__dropdown__item__icon--group",[et.Computed]:"add-wrap__dropdown__item__icon--computed"}[l]??""}function s(l){return{[et.Sort]:"S",[et.Filter]:"F",[et.HideColumns]:"H",[et.Transpose]:"T",[et.Parse]:"P",[et.Rename]:"R",[et.GroupBy]:"G",[et.Computed]:"C"}[l]??"?"}function a(l){n("add",l),o.value=!1}return(l,c)=>(w(),R("div",$ge,[H(p($l),{label:"Add",onClick:c[0]||(c[0]=u=>o.value=!p(o))}),p(o)?(w(),R("div",Tge,[(w(),R(Ge,null,gt(r,u=>T("button",{key:u.value,class:"add-wrap__dropdown__item",disabled:u.disabled,onClick:d=>a(u.value)},[T("span",{class:Te(["add-wrap__dropdown__item__icon",i(u.value)])},be(s(u.value)),3),T("div",Oge,[T("div",Bge,be(u.label),1),T("div",Lge,be(u.desc),1)])],8,Mge)),64))])):se("",!0)]))}}),Dge=Be(Pge,[["__scopeId","data-v-ac055819"]]),Ege={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Nge(t,e){return w(),R("svg",Ege,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M128 128a8 8 0 0 1-8 8H48a8 8 0 0 1 0-16h72a8 8 0 0 1 8 8M48 72h136a8 8 0 0 0 0-16H48a8 8 0 0 0 0 16m56 112H48a8 8 0 0 0 0 16h56a8 8 0 0 0 0-16m125.66-21.66a8 8 0 0 0-11.32 0L192 188.69V112a8 8 0 0 0-16 0v76.69l-26.34-26.35a8 8 0 0 0-11.32 11.32l40 40a8 8 0 0 0 11.32 0l40-40a8 8 0 0 0 0-11.32"},null,-1)])])}const Ige=Me({name:"ph-sort-ascending",render:Nge}),Rge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Fge(t,e){return w(),R("svg",Rge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M230.6 49.53A15.81 15.81 0 0 0 216 40H40a16 16 0 0 0-11.81 26.76l.08.09L96 139.17V216a16 16 0 0 0 24.87 13.32l32-21.34a16 16 0 0 0 7.13-13.32v-55.49l67.74-72.32l.08-.09a15.8 15.8 0 0 0 2.78-17.23m-84.42 81.05A8 8 0 0 0 144 136v58.66L112 216v-80a8 8 0 0 0-2.16-5.47L40 56h176Z"},null,-1)])])}const Vge=Me({name:"ph-funnel",render:Fge}),zge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Hge(t,e){return w(),R("svg",zge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 48v48a8 8 0 0 1-8 8h-48a8 8 0 0 1 0-16h28.69l-14.63-14.63a79.56 79.56 0 0 0-56.13-23.43h-.45a79.52 79.52 0 0 0-55.89 22.77a8 8 0 0 1-11.18-11.44a96 96 0 0 1 135 .79L208 76.69V48a8 8 0 0 1 16 0m-37.59 135.29a80 80 0 0 1-112.47-.66L59.31 168H88a8 8 0 0 0 0-16H40a8 8 0 0 0-8 8v48a8 8 0 0 0 16 0v-28.69l14.63 14.63A95.43 95.43 0 0 0 130 222.06h.53a95.36 95.36 0 0 0 67.07-27.33a8 8 0 0 0-11.18-11.44Z"},null,-1)])])}const uB=Me({name:"ph-arrows-clockwise",render:Hge}),Wge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Uge(t,e){return w(),R("svg",Wge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M226.76 69a8 8 0 0 0-12.84-2.88l-40.3 37.19l-17.23-3.7l-3.7-17.23l37.19-40.3A8 8 0 0 0 187 29.24A72 72 0 0 0 88 96a72.3 72.3 0 0 0 6 28.94L33.79 177c-.15.12-.29.26-.43.39a32 32 0 0 0 45.26 45.26c.13-.13.27-.28.39-.42L131.06 162A72 72 0 0 0 232 96a71.6 71.6 0 0 0-5.24-27M160 152a56.14 56.14 0 0 1-27.07-7a8 8 0 0 0-9.92 1.77l-55.9 64.74a16 16 0 0 1-22.62-22.62L109.18 133a8 8 0 0 0 1.77-9.93a56 56 0 0 1 58.36-82.31l-31.2 33.81a8 8 0 0 0-1.94 7.1l5.66 26.33a8 8 0 0 0 6.14 6.14l26.35 5.66a8 8 0 0 0 7.1-1.94l33.81-31.2A56.06 56.06 0 0 1 160 152"},null,-1)])])}const Gge=Me({name:"ph-wrench",render:Uge}),qge={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function Yge(t,e){return w(),R("svg",qge,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M230.91 172a8 8 0 0 1-2.91 10.91l-96 56a8 8 0 0 1-8.06 0l-96-56A8 8 0 0 1 36 169.09l92 53.65l92-53.65a8 8 0 0 1 10.91 2.91M220 121.09l-92 53.65l-92-53.65a8 8 0 0 0-8 13.82l96 56a8 8 0 0 0 8.06 0l96-56a8 8 0 1 0-8.06-13.82M24 80a8 8 0 0 1 4-6.91l96-56a8 8 0 0 1 8.06 0l96 56a8 8 0 0 1 0 13.82l-96 56a8 8 0 0 1-8.06 0l-96-56A8 8 0 0 1 24 80m23.88 0L128 126.74L208.12 80L128 33.26Z"},null,-1)])])}const jge=Me({name:"ph-stack",render:Yge}),Xge={[et.Sort]:{iconClass:"step-card__body__icon--sort",iconComponent:Ige,fallback:"S",label:"Sort"},[et.Filter]:{iconClass:"step-card__body__icon--filter",iconComponent:Vge,fallback:"F",label:"Filter"},[et.HideColumns]:{iconClass:"step-card__body__icon--hide-columns",iconComponent:ff,fallback:"H",label:"Hide Columns"},[et.Transpose]:{iconClass:"step-card__body__icon--transpose",iconComponent:uB,fallback:"T",label:"Transpose"},[et.Parse]:{iconClass:"step-card__body__icon--parse",iconComponent:Gge,fallback:"P",label:"Parse"},[et.Rename]:{iconClass:"step-card__body__icon--rename",iconComponent:U2,fallback:"R",label:"Rename"},[et.GroupBy]:{iconClass:"step-card__body__icon--group",iconComponent:jge,fallback:"G",label:"Group By"},[et.Computed]:{iconClass:"step-card__body__icon--computed",fallback:"C",label:"Computed"}},Kge={class:"step-card__number"},Zge={class:"step-card__body"},Qge={key:1},Jge={class:"step-card__body__text"},eve={class:"step-card__body__text__name"},tve={class:"step-card__actions"},nve=le({__name:"DataTransformStepCard",props:{step:{},index:{},active:{type:Boolean},error:{}},emits:["select","delete"],setup(t){const e=t,n=A(()=>Xge[e.step.type]),o=A(()=>n.value.iconClass),r=A(()=>n.value.iconComponent??null),i=A(()=>n.value.fallback),s=A(()=>n.value.label),a=A(()=>{const{step:l}=e;if(l.type===et.Sort&&l.config.column)return`${l.config.column} ${l.config.direction??Jt.Ascending}`;if(l.type===et.Filter&&l.config.column)return`${l.config.column} ${l.config.condition??bo.Equals} ${l.config.value??""}`;if(l.type===et.HideColumns){const c=l.config.columns?l.config.columns.split(",").map(u=>u.trim()).filter(Boolean):[];return c.length>0?`Hiding ${c.join(", ")}`:"Configure..."}if(l.type===et.Transpose)return"Swap rows ↔ columns";if(l.type===et.Parse&&l.config.column&&l.config.operation)return`${l.config.column} → ${l.config.operation}`;if(l.type===et.Rename&&l.config.column&&l.config.newName)return`${l.config.column} → ${l.config.newName}`;if(l.type===et.GroupBy&&l.config.groupColumns&&l.config.aggregates){const c=l.config.groupColumns.split(",").map(d=>d.trim()).filter(Boolean).join(", "),u=l.config.aggregates.split(",").map(d=>{const f=d.lastIndexOf(":");return f<0?d.trim():`${d.slice(f+1).trim()}(${d.slice(0,f).trim()})`}).join(", ");return`Group by ${c} — ${u}`}return"Configure..."});return(l,c)=>(w(),R("div",{class:Te(["step-card",{"step-card--active":t.active,"step-card--error":t.error}]),onClick:c[2]||(c[2]=u=>l.$emit("select"))},[T("div",Kge,be(t.index+1),1),T("div",Zge,[T("span",{class:Te(["step-card__body__icon",p(o)])},[p(r)?(w(),Q(Gt(p(r)),{key:0})):(w(),R("span",Qge,be(p(i)),1))],2),T("div",Jge,[T("div",eve,be(p(s)),1),T("div",{class:Te(["step-card__body__text__desc",{"step-card__body__text__desc--error":t.error}])},be(t.error||p(a)),3)])]),T("div",tve,[T("button",{class:"step-card__actions__btn","aria-label":"Remove step",onClick:c[0]||(c[0]=gn(u=>l.$emit("delete"),["stop"]))},[...c[3]||(c[3]=[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("path",{d:"M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})],-1)])])]),t.active&&l.$slots.default?(w(),R("div",{key:0,class:"step-card__config",onClick:c[1]||(c[1]=gn(()=>{},["stop"]))},[Ae(l.$slots,"default",{},void 0,!0)])):se("",!0)],2))}}),ove=Be(nve,[["__scopeId","data-v-4ba65e45"]]),rve={class:"group-by-step"},ive={class:"group-by-step__field"},sve={class:"group-by-step__field__columns"},ave=["checked","onChange"],lve={key:0,class:"group-by-step__field"},cve={class:"group-by-step__field__agg-list"},uve={class:"group-by-step__field__agg-list__row"},dve={class:"group-by-step__field__agg-list__row__check"},fve=["checked"],hve={class:"group-by-step__field__agg-list__row__check"},pve=["checked","onChange"],mve=["value","onChange"],gve=le({__name:"DataTransformStepGroupBy",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Dr(),o=A(()=>e.step.config.groupColumns?e.step.config.groupColumns.split(",").map(v=>v.trim()).filter(Boolean):[]),r=A(()=>e.columns.filter(v=>!o.value.includes(v))),i=A(()=>e.step.config.aggregates?e.step.config.aggregates.split(",").map(v=>v.trim()).filter(Boolean).map(v=>{const m=v.lastIndexOf(":");return m<0?null:{col:v.slice(0,m),fn:v.slice(m+1)}}).filter(v=>v!==null):[]),s=A(()=>i.value.some(v=>v.fn==="count"));function a(v){return i.value.some(m=>m.col===v&&m.fn!=="count")}function l(v){const m=i.value.find(b=>b.col===v&&b.fn!=="count");return(m==null?void 0:m.fn)??"sum"}function c(v){return v.map(m=>`${m.col}:${m.fn}`).join(",")}function u(v,m){const b={...e.step.config};v.length>0?b.groupColumns=v.join(","):delete b.groupColumns,m.length>0?b.aggregates=c(m):delete b.aggregates,n(e.step.id,b)}function d(v){const m=[...o.value],b=m.indexOf(v);b>=0?m.splice(b,1):m.push(v);const y=i.value.filter(x=>x.fn==="count"||!m.includes(x.col));u(m,y)}function f(){const v=[...i.value],m=v.findIndex(b=>b.fn==="count");m>=0?v.splice(m,1):v.push({col:"rows",fn:"count"}),u(o.value,v)}function h(v){const m=[...i.value],b=m.findIndex(y=>y.col===v&&y.fn!=="count");b>=0?m.splice(b,1):m.push({col:v,fn:"sum"}),u(o.value,m)}function g(v,m){const b=i.value.map(y=>y.col===v&&y.fn!=="count"?{...y,fn:m}:y);u(o.value,b)}return(v,m)=>(w(),R("div",rve,[T("div",ive,[m[0]||(m[0]=T("label",{class:"group-by-step__field__label"},"Group by",-1)),T("div",sve,[(w(!0),R(Ge,null,gt(t.columns,b=>(w(),R("label",{key:b,class:"group-by-step__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(b),onChange:y=>d(b)},null,40,ave),Xe(" "+be(b),1)]))),128))])]),p(r).length>0||p(o).length>0?(w(),R("div",lve,[m[4]||(m[4]=T("label",{class:"group-by-step__field__label"},"Aggregates",-1)),T("div",cve,[T("div",uve,[T("label",dve,[T("input",{type:"checkbox",checked:p(s),onChange:f},null,40,fve),m[1]||(m[1]=Xe(" Row count ",-1))]),m[2]||(m[2]=T("span",{class:"group-by-step__field__agg-list__row__fn-label"},"count",-1))]),(w(!0),R(Ge,null,gt(p(r),b=>(w(),R("div",{key:b,class:"group-by-step__field__agg-list__row"},[T("label",hve,[T("input",{type:"checkbox",checked:a(b),onChange:y=>h(b)},null,40,pve),Xe(" "+be(b),1)]),a(b)?(w(),R("select",{key:0,class:"group-by-step__field__agg-list__row__fn",value:l(b),onChange:y=>g(b,y.target.value)},[...m[3]||(m[3]=[T("option",{value:"sum"}," Sum ",-1),T("option",{value:"avg"}," Average ",-1),T("option",{value:"min"}," Min ",-1),T("option",{value:"max"}," Max ",-1)])],40,mve)):se("",!0)]))),128))])])):se("",!0)]))}}),vve=Be(gve,[["__scopeId","data-v-c53de076"]]),bve={class:"data-transform-step-rename"},yve=le({__name:"DataTransformStepRename",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Dr(),o=A(()=>e.columns.map(i=>({value:i,label:i})));function r(i,s){n(e.step.id,{...e.step.config,[i]:s})}return(i,s)=>(w(),R("div",bve,[H(p(Nn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":s[0]||(s[0]=a=>r("column",a))},null,8,["model-value","options"]),H(p(Sm),{id:"rename-new-name","model-value":t.step.config.newName??"",label:"New Name",placeholder:"Enter new column name","onUpdate:modelValue":s[1]||(s[1]=a=>r("newName",a))},null,8,["model-value"])]))}}),xve=Be(yve,[["__scopeId","data-v-5f4cb34e"]]),wve={class:"data-transform-step-parse"},_ve=le({__name:"DataTransformStepParse",props:{step:{},columns:{}},setup(t){var v;const e=t,{updateStep:n}=Dr(),o=A(()=>e.columns.map(m=>({value:m,label:m}))),r=[{value:"type",label:"Type Conversions"},{value:"string",label:"String"},{value:"numeric",label:"Numeric"},{value:"date",label:"Date/Time"}],i=A(()=>sp.find(m=>m.id===e.step.config.operation)),s=Fe(((v=i.value)==null?void 0:v.category)??"type");je(()=>e.step.config.operation,m=>{if(m){const b=sp.find(y=>y.id===m);b&&(s.value=b.category)}});const a=A(()=>sp.filter(m=>m.category===s.value).map(m=>({value:m.id,label:m.label,description:m.description}))),l=A(()=>{var m;return((m=i.value)==null?void 0:m.params)??[]}),c={decimals:"Decimal places",pattern:"Regex pattern",replacement:"Replacement",start:"Start index",end:"End index",length:"Length",char:"Pad character",separator:"Separator",limit:"Limit",min:"Minimum",max:"Maximum",size:"Bucket size",key:"JSON key",amount:"Amount",unit:"Unit",period:"Period",reference:"Reference date"},u={decimals:"0",pattern:"\\d+",replacement:"",start:"0",end:"",length:"10",char:" ",separator:",",limit:"",min:"0",max:"100",size:"10",key:"",amount:"1",unit:"days",period:"month",reference:"YYYY-MM-DD"};function d(m){return c[m]??m}function f(m){return u[m]??""}function h(m){s.value=m;const b={...e.step.config};delete b.operation,n(e.step.id,b)}function g(m,b){n(e.step.id,{...e.step.config,[m]:b})}return(m,b)=>(w(),R("div",wve,[H(p(Nn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":b[0]||(b[0]=y=>g("column",y))},null,8,["model-value","options"]),H(p(Nn),{"model-value":p(s),label:"Category",options:r,block:"","onUpdate:modelValue":h},null,8,["model-value"]),H(p(Nn),{"model-value":t.step.config.operation??"",label:"Operation",placeholder:"Select an operation",options:p(a),block:"","onUpdate:modelValue":b[1]||(b[1]=y=>g("operation",y))},null,8,["model-value","options"]),p(l).length>0?(w(!0),R(Ge,{key:0},gt(p(l),y=>(w(),Q(p(Sm),{id:`parse-${y}`,key:y,"model-value":t.step.config[y]??"",label:d(y),placeholder:f(y),"onUpdate:modelValue":x=>g(y,x)},null,8,["id","model-value","label","placeholder","onUpdate:modelValue"]))),128)):se("",!0)]))}}),kve=Be(_ve,[["__scopeId","data-v-37e3f025"]]),Sve={class:"data-transform-step-hide-columns"},Ave={class:"data-transform-step-hide-columns__field"},Cve={class:"data-transform-step-hide-columns__field__columns"},$ve=["checked","onChange"],Tve=le({__name:"DataTransformStepHideColumns",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Dr(),o=A(()=>e.step.config.columns?e.step.config.columns.split(",").map(i=>i.trim()).filter(Boolean):e.step.config.column?[e.step.config.column]:[]);function r(i){const s=[...o.value],a=s.indexOf(i);a>=0?s.splice(a,1):s.push(i);const l={...e.step.config};delete l.column,s.length===0?delete l.columns:l.columns=s.join(","),n(e.step.id,l)}return(i,s)=>(w(),R("div",Sve,[T("div",Ave,[s[0]||(s[0]=T("label",{class:"data-transform-step-hide-columns__field__label"},"Hide columns",-1)),T("div",Cve,[(w(!0),R(Ge,null,gt(t.columns,a=>(w(),R("label",{key:a,class:"data-transform-step-hide-columns__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(a),onChange:l=>r(a)},null,40,$ve),Xe(" "+be(a),1)]))),128))])])]))}}),Mve=Be(Tve,[["__scopeId","data-v-a74ff0f2"]]),Ove={class:"data-transform-step-filter"},Bve=le({__name:"DataTransformStepFilter",props:{step:{},columns:{}},setup(t){const e=t,{updateStep:n}=Dr(),o=A(()=>e.columns.map(s=>({value:s,label:s}))),r=[{value:bo.Equals,label:"Equals"},{value:bo.NotEquals,label:"Not equals"},{value:bo.Contains,label:"Contains"},{value:bo.GreaterThan,label:"Greater than"},{value:bo.LessThan,label:"Less than"}];function i(s,a){n(e.step.id,{...e.step.config,[s]:a})}return(s,a)=>(w(),R("div",Ove,[H(p(Nn),{"model-value":t.step.config.column??"",label:"Column",placeholder:"Select a column",options:p(o),block:"","onUpdate:modelValue":a[0]||(a[0]=l=>i("column",l))},null,8,["model-value","options"]),H(p(Nn),{"model-value":t.step.config.condition??p(bo).Equals,label:"Condition",options:r,block:"","onUpdate:modelValue":a[1]||(a[1]=l=>i("condition",l))},null,8,["model-value"]),H(p(Sm),{id:"filter-value","model-value":t.step.config.value??"",label:"Value",placeholder:"Filter value","onUpdate:modelValue":a[2]||(a[2]=l=>i("value",l))},null,8,["model-value"])]))}}),Lve=Be(Bve,[["__scopeId","data-v-65704d71"]]),Pve={class:"data-transform-step-sort"},Dve={class:"data-transform-step-sort__field"},Eve={class:"data-transform-step-sort__field__columns"},Nve=["checked","onChange"],Ive=le({__name:"DataTransformStepSort",props:{step:{},columns:{},columnTypes:{}},setup(t){const e=t,{updateStep:n}=Dr(),o=A(()=>e.step.config.columns?e.step.config.columns.split(",").map(c=>c.trim()).filter(Boolean):e.step.config.column?[e.step.config.column]:[]),r=A(()=>o.value.every(c=>{const u=e.columns.indexOf(c);return u>=0&&e.columnTypes[u]==="number"}));function i(c){const u=[...o.value],d=u.indexOf(c);d>=0?u.splice(d,1):u.push(c);const f={...e.step.config};delete f.column,u.length===0?delete f.columns:f.columns=u.join(",");const h=u.every(g=>{const v=e.columns.indexOf(g);return v>=0&&e.columnTypes[v]==="number"});(u.length<=1||!h)&&delete f.operation,n(e.step.id,f)}const s=[{value:"",text:"None"},{value:"sum",text:"Sum"},{value:"avg",text:"Avg"}],a=[{value:Jt.Ascending,text:"Ascending"},{value:Jt.Descending,text:"Descending"}];function l(c,u){n(e.step.id,{...e.step.config,[c]:u})}return(c,u)=>(w(),R("div",Pve,[T("div",Dve,[u[2]||(u[2]=T("label",{class:"data-transform-step-sort__field__label"},"Sort by",-1)),T("div",Eve,[(w(!0),R(Ge,null,gt(t.columns,d=>(w(),R("label",{key:d,class:"data-transform-step-sort__field__columns__column"},[T("input",{type:"checkbox",checked:p(o).includes(d),onChange:f=>i(d)},null,40,Nve),Xe(" "+be(d),1)]))),128))])]),p(o).length>1&&p(r)?(w(),Q(p(Cn),{key:0,"model-value":t.step.config.operation??"",label:"Operation",options:s,block:"","onUpdate:modelValue":u[0]||(u[0]=d=>l("operation",d))},null,8,["model-value"])):se("",!0),H(p(Cn),{"model-value":t.step.config.direction??p(Jt).Ascending,label:"Direction",options:a,block:"","onUpdate:modelValue":u[1]||(u[1]=d=>l("direction",d))},null,8,["model-value"])]))}}),Rve=Be(Ive,[["__scopeId","data-v-73ae8834"]]),Fve={},Vve={class:"pipeline-connector"};function zve(t,e){return w(),R("div",Vve)}const Hve=Be(Fve,[["render",zve],["__scopeId","data-v-a3406500"]]),Wve={class:"source-block"},Uve={class:"source-block__meta"},Gve=le({__name:"DataTransformSourceBlock",props:{columns:{},rows:{},label:{default:"Raw Data"}},setup(t){return(e,n)=>(w(),R("div",Wve,[n[0]||(n[0]=T("span",{class:"source-block__icon"},[T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",width:"14",height:"14"},[T("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),T("path",{d:"M3 9h18M9 21V9"})])],-1)),T("span",null,be(t.label),1),T("span",Uve,be(t.columns)+" cols · "+be(t.rows)+" rows",1)]))}}),qve=Be(Gve,[["__scopeId","data-v-6b491dca"]]),Yve={class:"pipeline","data-testid":"transform-pipeline"},jve={key:6,class:"pipeline__config-info"},Xve={key:7,class:"text-muted text-center py-3"},Kve=le({__name:"DataTransformPipeline",setup(t){const{columns:e,rows:n,columnTypes:o}=Ko(),{steps:r,addStep:i,removeStep:s,applyTransforms:a,getColumnsAtStep:l,validateStep:c}=Dr(),{activeScene:u,activeIndex:d,scenes:f}=_n(),h=A(()=>{if(!u.value)return"Raw Data";if(d.value<=0)return"Data from Scene 1";const I=f.value[d.value-1];return`Data from ${(I==null?void 0:I.name)||`Scene ${d.value}`}`}),g=Fe(""),v=ze(new Set),m=A(()=>r.value.findIndex(I=>I.id===g.value)),b=A(()=>m.value<0?{columns:[],columnTypes:[]}:l(m.value,e.value,n.value,o.value)),y=A(()=>b.value.columns),x=A(()=>b.value.columnTypes),_=A(()=>{const I={};for(let C=0;C<r.value.length;C++){const $=r.value[C];if(v.value.has($.id)){I[$.id]=null;continue}const P=l(C,e.value,n.value,o.value);I[$.id]=c($,P.columns,P.columnTypes)}return I}),S=A(()=>a(e.value,n.value,o.value)),N=A(()=>S.value.columns.length),B=A(()=>S.value.rows.length);function k(I){const C=g.value;C&&C!==I&&v.value.delete(C),g.value=I}function L(I){const C=i(I);v.value.add(C),k(C)}function E(I){v.value.delete(I),s(I),g.value===I&&(g.value=r.value.length>0?r.value[r.value.length-1].id:"")}return(I,C)=>{const $=qve,P=Hve,M=Rve,F=Lve,V=Mve,G=kve,K=xve,ue=vve,de=ove,he=Dge,ge=Cge;return w(),R("div",Yve,[H($,{columns:p(e).length,rows:p(n).length,label:p(h)},null,8,["columns","rows","label"]),(w(!0),R(Ge,null,gt(p(r),(ee,fe)=>(w(),R(Ge,{key:ee.id},[H(P),H(de,{step:ee,index:fe,active:p(g)===ee.id,error:p(_)[ee.id],onSelect:xe=>k(ee.id),onDelete:xe=>E(ee.id)},{default:J(()=>[ee.type===p(et).Sort?(w(),Q(M,{key:0,step:ee,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):ee.type===p(et).Filter?(w(),Q(F,{key:1,step:ee,columns:p(y)},null,8,["step","columns"])):ee.type===p(et).HideColumns?(w(),Q(V,{key:2,step:ee,columns:p(y)},null,8,["step","columns"])):ee.type===p(et).Parse?(w(),Q(G,{key:3,step:ee,columns:p(y)},null,8,["step","columns"])):ee.type===p(et).Rename?(w(),Q(K,{key:4,step:ee,columns:p(y)},null,8,["step","columns"])):ee.type===p(et).GroupBy?(w(),Q(ue,{key:5,step:ee,columns:p(y),"column-types":p(x)},null,8,["step","columns","column-types"])):ee.type===p(et).Transpose?(w(),R("div",jve," Transpose swaps rows and columns. The first column values become headers and column headers become the first column. ")):(w(),R("div",Xve," Coming soon "))]),_:2},1032,["step","index","active","error","onSelect","onDelete"])],64))),128)),H(P),H(he,{onAdd:L}),H(P),H(ge,{columns:p(N),rows:p(B)},null,8,["columns","rows"])])}}}),Zve=Be(Kve,[["__scopeId","data-v-b653c7ed"]]),Qve=[0,.30103,.17609,.12494,.09691,.07918,.06695,.05799,.05115,.04576],dB=10,Jve=.1;function e1e(t){const e=parseFloat(t);if(!Number.isFinite(e)||e===0)return null;const o=Math.abs(e).toExponential(),r=parseInt(o[0],10);return r>=1&&r<=9?r:null}function t1e(t,e,n){if(t==="number")return!0;let o=0;for(const r of e){const i=r[n];if(i!=null&&i!==""){const s=parseFloat(i);Number.isFinite(s)&&o++}}return o>=dB}function fB(t,e,n){const o=[];let r=!1;for(let i=0;i<t.length;i++){if(!t1e(n[i],e,i))continue;const s=new Array(10).fill(0);let a=0;for(const c of e){const u=e1e(c[i]);u!==null&&(s[u]++,a++)}if(a<dB)continue;r=!0;let l=!1;for(let c=1;c<=9;c++){const u=s[c]/a;if(Math.abs(u-Qve[c])>Jve){l=!0;break}}l&&o.push(t[i])}return{pass:o.length===0,suspicious:o,eligible:r}}const n1e={class:"data-column-settings"},o1e={class:"data-column-settings__field"},r1e={class:"data-column-settings__section"},i1e={class:"data-column-settings__section__detections"},s1e={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--success"},a1e={class:"data-column-settings__section__detections__item data-column-settings__section__detections__item--info"},l1e={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},c1e={key:0,d:"M20 6L9 17l-5-5"},u1e={key:1,d:"M12 9v4M12 17h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"},d1e={key:1,class:"data-column-settings__picker"},f1e=le({__name:"DataColumnSettings",setup(t){const e=dr(),{selectedColumnIndex:n}=Mt(e),{selectColumn:o}=e,{columns:r,rows:i,columnTypes:s,setColumnType:a}=Ko(),l=Fe("string"),c=[{value:"string",label:"String"},{value:"number",label:"Number"},{value:"date",label:"Date"}];je(n,b=>{b>=0&&b<r.value.length&&(l.value=s.value[b]??"string")},{immediate:!0});function u(b){a(n.value,b)}const d=A(()=>r.value.map((b,y)=>({value:String(y),label:b})));function f(b){o(parseInt(b,10))}const h=A(()=>{const b=n.value;if(b<0)return{unique:0,total:0};const y=i.value.map(_=>_[b]??"").filter(_=>_.length>0);return{unique:new Set(y).size,total:y.length}}),g=A(()=>{const{unique:b,total:y}=h.value;return b===y?`${b} unique values — no duplicates`:`${y-b} duplicates found`}),v=A(()=>{const b=s.value[n.value];return b==="number"?"Numeric measure detected":b==="date"?"Date axis detected":"Categorical dimension detected"}),m=A(()=>{const b=n.value;if(b<0)return null;const y=r.value[b],x=fB([y],i.value.map(_=>[_[b]]),[s.value[b]]);return x.eligible?{pass:x.pass,label:x.pass?"Follows Benford's law":"Doesn't follow Benford's law"}:null});return(b,y)=>(w(),R("div",n1e,[p(n)>=0&&p(n)<p(r).length?(w(),R(Ge,{key:0},[T("div",o1e,[y[1]||(y[1]=T("div",{class:"data-column-settings__field__label"}," Type ",-1)),H(p(Nn),{modelValue:p(l),"onUpdate:modelValue":[y[0]||(y[0]=x=>Ze(l)?l.value=x:null),u],label:"",options:c,block:""},null,8,["modelValue"])]),y[5]||(y[5]=T("hr",{class:"data-column-settings__divider"},null,-1)),T("div",r1e,[y[4]||(y[4]=T("div",{class:"data-column-settings__section__title"}," Detections ",-1)),T("div",i1e,[T("span",s1e,[y[2]||(y[2]=T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("path",{d:"M20 6L9 17l-5-5"})],-1)),Xe(" "+be(p(g)),1)]),T("span",a1e,[y[3]||(y[3]=T("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[T("circle",{cx:"12",cy:"12",r:"10"}),T("path",{d:"M12 16v-4M12 8h.01"})],-1)),Xe(" "+be(p(v)),1)]),p(m)?(w(),R("span",{key:0,class:Te(["data-column-settings__section__detections__item",p(m).pass?"data-column-settings__section__detections__item--success":"data-column-settings__section__detections__item--warn"])},[(w(),R("svg",l1e,[p(m).pass?(w(),R("path",c1e)):(w(),R("path",u1e))])),Xe(" "+be(p(m).label),1)],2)):se("",!0)])])],64)):(w(),R("div",d1e,[y[6]||(y[6]=T("div",{class:"data-column-settings__picker__label"}," Column ",-1)),H(p(Nn),{"model-value":"",label:"",options:p(d),block:"",placeholder:"Select a column…","onUpdate:modelValue":f},null,8,["options"])]))]))}}),h1e=Be(f1e,[["__scopeId","data-v-fadb97cc"]]),p1e={key:0,class:"data-check-empty"},m1e={key:1,class:"data-check-table"},g1e={class:"data-check-table__col-header__name"},v1e={class:"data-check-table__col-header__type"},b1e=le({__name:"DataCheckTable",setup(t){const e=dr(),{selectedColumnIndex:n}=Mt(e),{selectColumn:o}=e,{displayColumns:r,displayRows:i,displayColumnTypes:s}=Ko(),a=A(()=>i.value.length===0);return(l,c)=>p(a)?(w(),R("div",p1e,[H(p(Uy),{class:"data-check-empty__icon"}),c[0]||(c[0]=T("p",null,"No rows match your filters",-1))])):(w(),R("div",m1e,[H(p(tN),{hover:"",bordered:""},{default:J(()=>[H(p(aN),null,{default:J(()=>[H(p(h_),null,{default:J(()=>[H(p(f_),{class:"data-check-table__row-num"},{default:J(()=>[...c[1]||(c[1]=[Xe(" # ",-1)])]),_:1}),(w(!0),R(Ge,null,gt(p(r),(u,d)=>(w(),Q(p(f_),{key:d,class:Te(["data-check-table__col-header",{"data-check-table__col--selected":d===p(n)}]),onClick:f=>p(o)(d)},{default:J(()=>[T("div",g1e,be(u),1),T("div",v1e,be(p(s)[d]??"string"),1)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1}),H(p(nN),null,{default:J(()=>[(w(!0),R(Ge,null,gt(p(i),(u,d)=>(w(),Q(p(h_),{key:d},{default:J(()=>[H(p(d_),{class:"data-check-table__row-num"},{default:J(()=>[Xe(be(d+1),1)]),_:2},1024),(w(!0),R(Ge,null,gt(u,(f,h)=>(w(),Q(p(d_),{key:h,class:Te({"data-check-table__col--selected":h===p(n),"data-check-table__cell--numeric":p(s)[h]==="number"})},{default:J(()=>[Xe(be(f),1)]),_:2},1032,["class"]))),128))]),_:2},1024))),128))]),_:1})]),_:1})]))}}),y1e=Be(b1e,[["__scopeId","data-v-670500db"]]),x1e={class:"data-insight-badges"},w1e={class:"data-insight-badge data-insight-badge--shape"},_1e={class:"data-insight-badge__icon"},k1e={class:"data-insight-badge__icon"},S1e=le({__name:"DataInsightBadges",props:{columns:{},rows:{},columnTypes:{}},setup(t){const e=t,n=mt("benfordBadgeRef"),o=A(()=>{let d=0;for(const f of e.rows)for(let h=0;h<e.columns.length;h++){const g=f[h];(g==null||g==="")&&d++}return d}),r=A(()=>o.value===0?"✓":"⚠"),i=A(()=>o.value===0?"No missing values":`${o.value} missing value${o.value===1?"":"s"}`),s=A(()=>o.value===0?"data-insight-badge--quality-ok":"data-insight-badge--quality-warn"),a=A(()=>{const d=fB(e.columns,e.rows,e.columnTypes);return d.eligible?d:null}),l=A(()=>{var d;return(d=a.value)!=null&&d.pass?"✓":"⚠"}),c=A(()=>{var d;return(d=a.value)!=null&&d.pass?"data-insight-badge--benford-ok":"data-insight-badge--benford-warn"}),u=A(()=>a.value?a.value.pass?"All numeric columns follow Benford's Law — the expected distribution of leading digits in real-world data.":`Column(s) ${a.value.suspicious.join(", ")} don't follow Benford's Law — the expected distribution of leading digits. This may indicate fabricated or anomalous data.`:"");return(d,f)=>(w(),R("div",x1e,[T("span",w1e,be(t.columns.length)+" cols · "+be(t.rows.length)+" rows ",1),T("span",{class:Te(["data-insight-badge",p(s)])},[T("span",_1e,be(p(r)),1),Xe(" "+be(p(i)),1)],2),p(a)?(w(),R("span",{key:0,ref_key:"benfordBadgeRef",ref:n,class:Te(["data-insight-badge",p(c)])},[T("span",k1e,be(p(l)),1),f[0]||(f[0]=Xe(" Benford's law ",-1)),H(p(jd),{"teleport-to":"body",target:p(n),title:p(u),placement:"top"},null,8,["target","title"])],2)):se("",!0)]))}}),A1e=Be(S1e,[["__scopeId","data-v-d0fa5a33"]]),C1e={class:"data-structure-panel__main__pills-bar"},$1e={key:0,class:"data-structure-panel__main__scene-banner"},T1e=le({__name:"DataStructurePanel",setup(t){const{columns:e,rows:n,columnTypes:o}=Ko(),r=dr(),{dataPanelOpen:i,dataPanelTab:s}=Mt(r),{openDataPanel:a,closeDataPanel:l,setDataView:c,setLastNarrowDataTab:u}=r,{mode:d}=lc(),{activeScene:f,activeIndex:h,scenes:g}=_n(),v=A(()=>f.value!==null);je(d,P=>{P==="drawer"&&s.value&&(u(s.value),l())},{immediate:!0});const m=A(()=>aT(g.value,h.value)),b=A(()=>{const P=m.value;if(P===h.value)return"Custom data on this scene.";if(P>=0){const M=g.value[P];return`Data inherited from ${(M==null?void 0:M.name)||`Scene ${P+1}`}.`}return"Scene override active."}),y=A(()=>{const P=m.value;return P===h.value?"This scene uses its own data, independent of the base dataset.":P>=0?"Replace data to set different data for this scene.":"The table below shows the base data. Replace data to set custom data for this scene."});function x(){c("upload")}function _(P){u(P),a(P)}const{isNarrow:S}=bi(),N=mt("mainRef"),{sections:B}=lB(),k=A(()=>v.value?["parsing"]:[]),L=A(()=>v.value?B.filter(P=>P.key!=="parsing"):B),E=A({get:()=>!!s.value,set:P=>{P||l()}}),I={column:"Column Settings",transforms:"Transforms",parsing:"Parsing",reco:"Recommendations"},C=A(()=>I[s.value]??"Panel"),$=A(()=>({"data-structure-panel--narrow":S.value}));return(P,M)=>{const F=A1e,V=y1e,G=j2,K=h1e,ue=Zve,de=_ge,he=gge,ge=Y2,ee=pg,fe=rge;return w(),R("div",{class:Te(["data-structure-panel",p($)])},[T("div",{ref_key:"mainRef",ref:N,class:"data-structure-panel__main"},[T("div",C1e,[p(v)?(w(),R("div",$1e,[T("strong",null,be(p(b)),1),Xe(" "+be(p(y)),1)])):(w(),Q(F,{key:1,columns:p(e),rows:p(n),"column-types":p(o)},null,8,["columns","rows","column-types"])),H(p(Qn),{"icon-left":p(uB),label:"Replace data",variant:"outline-primary",size:"sm",onClick:x},null,8,["icon-left"])]),H(V),H(aB)],512),p(i)?(w(),Q(ee,{key:0,"drawer-open":p(E),"onUpdate:drawerOpen":M[0]||(M[0]=xe=>Ze(E)?E.value=xe:null),title:p(C),"container-ref":p(N),onClose:p(l)},ki({default:J(()=>[p(s)==="column"?(w(),Q(K,{key:0})):p(s)==="transforms"?(w(),Q(ue,{key:1})):p(s)==="parsing"?(w(),Q(de,{key:2})):p(s)==="reco"?(w(),Q(he,{key:3})):se("",!0)]),_:2},[p(d)==="drawer"?{name:"tabs",fn:J(()=>[H(G,{tabs:p(L),"model-value":p(s),sticky:"","onUpdate:modelValue":_},null,8,["tabs","model-value"])]),key:"0"}:void 0,p(d)!=="drawer"?{name:"footer",fn:J(()=>[H(ge)]),key:"1"}:void 0]),1032,["drawer-open","title","container-ref","onClose"])):se("",!0),p(S)?se("",!0):(w(),Q(fe,{key:1,"disabled-tabs":p(k)},null,8,["disabled-tabs"]))],2)}}}),M1e=Be(T1e,[["__scopeId","data-v-3f93b45b"]]),O1e={class:"samples-grid"},B1e=["onClick","onKeydown"],L1e={class:"sample-card__thumb"},P1e=["src","alt"],D1e={class:"sample-card__info"},E1e={class:"sample-card__info__name"},N1e={class:"sample-card__info__meta"},I1e=le({__name:"DataUploadSamples",emits:["select"],setup(t){const e={[Le.BarVertical]:"Columns",[Le.BarHorizontal]:"Bars",[Le.BarMulti]:"Grouped Columns",[Le.Line]:"Line",[Le.LineMulti]:"Lines",[Le.Donut]:"Donut",[Le.Pie]:"Pie",[Le.Area]:"Area",[Le.AreaStacked]:"Stacked Area",[Le.ColumnStacked]:"Stacked Columns",[Le.BarStacked]:"Stacked Bars",[Le.BarSplit]:"Split Bars",[Le.BarGrouped]:"Grouped Bars"};function n(i){const s=i.split(`
|
|
859
|
-
`).filter(a=>a.trim().length>0);return Math.max(0,s.length-1)}const o=ar(new Map),r=A(()=>D6.map(i=>({...i,typeLabel:e[i.chartType]??i.chartType,rowCount:n(i.tsvData),thumbSrc:o.get(i.id)})));return hn(()=>{for(const i of D6)if(i.dsl){const s=yT(i.dsl);s&&o.set(i.id,Tc(s))}}),(i,s)=>(w(),R("div",O1e,[(w(!0),R(Ge,null,gt(p(r),a=>(w(),R("div",{key:a.id,class:"sample-card",role:"button",tabindex:"0",onClick:l=>i.$emit("select",a),onKeydown:nr(l=>i.$emit("select",a),["enter"])},[T("div",L1e,[a.thumbSrc?(w(),R("img",{key:0,class:"sample-card__thumb__img",src:a.thumbSrc,alt:a.title},null,8,P1e)):se("",!0)]),T("div",D1e,[T("div",E1e,be(a.title),1),T("div",N1e,[Xe(be(a.typeLabel)+" ",1),s[0]||(s[0]=T("span",{class:"sample-card__info__meta__sep"},"·",-1)),Xe(" "+be(a.rowCount)+" rows ",1)])])],40,B1e))),128))]))}}),R1e=Be(I1e,[["__scopeId","data-v-23920b61"]]),F1e=le({__name:"DataUploadFileDrop",emits:["loaded","bpc","dragState"],setup(t,{emit:e}){const n=e,o=ze(null),r=Fe(!1);function i(f){r.value=f,n("dragState",f)}function s(){i(!0)}function a(){i(!1)}function l(f){return f.name.toLowerCase().endsWith(".bpc")}function c(f){const h=new globalThis.FileReader;h.onload=()=>{typeof h.result=="string"&&n(l(f)?"bpc":"loaded",h.result,f.name)},h.readAsText(f)}function u(f){var g;i(!1);const h=(g=f.dataTransfer)==null?void 0:g.files[0];h&&c(h)}function d(f){var v;const h=f.target,g=(v=h.files)==null?void 0:v[0];g&&c(g),h.value=""}return(f,h)=>(w(),R("div",{class:Te(["file-drop",{"file-drop--active":p(r)}]),onDragover:gn(s,["prevent"]),onDragleave:gn(a,["prevent"]),onDrop:gn(u,["prevent"]),onClick:h[1]||(h[1]=g=>{var v;return(v=p(o))==null?void 0:v.click()})},[h[2]||(h[2]=WL('<div class="file-drop__icon" data-v-f6ebbbc1><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" data-v-f6ebbbc1><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12" data-v-f6ebbbc1></path></svg></div><div class="file-drop__title" data-v-f6ebbbc1> Drag & drop your file here </div><div class="file-drop__or" data-v-f6ebbbc1> or </div>',3)),T("button",{class:"file-drop__btn",onClick:h[0]||(h[0]=gn(g=>{var v;return(v=p(o))==null?void 0:v.click()},["stop"]))}," Browse files "),h[3]||(h[3]=T("div",{class:"file-drop__formats"},[T("span",{class:"file-drop__formats__tag"},".csv"),T("span",{class:"file-drop__formats__tag"},".tsv"),T("span",{class:"file-drop__formats__tag"},".bpc")],-1)),T("input",{ref_key:"fileInput",ref:o,type:"file",accept:".csv,.tsv,.txt,.bpc",class:"file-drop__input",onChange:d},null,544)],34))}}),V1e=Be(F1e,[["__scopeId","data-v-f6ebbbc1"]]),z1e={class:"upload-card"},H1e={class:"input-card__tabs"},W1e=["onClick"],U1e={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},G1e={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},q1e={key:2,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Y1e={key:1,class:"upload-card__paste"},j1e={class:"upload-card__paste__wrap"},X1e={key:0,class:"upload-card__paste__wrap__placeholder"},K1e={class:"upload-card__paste__footer"},Z1e=["disabled"],Q1e=le({__name:"DataUploadCard",emits:["loaded","bpc","sample","cancel"],setup(t){const{rawInput:e,sourceFormat:n,columns:o,rows:r,displayColumns:i,displayRows:s}=Ko(),{activeIndex:a,scenes:l}=_n();function c(){if(a.value<0)return!1;const b=za(l.value,a.value);return!!(b!=null&&b.data)}function u(){return c()?H6(i.value,s.value):(n==null?void 0:n.value)==="bpc"&&o.value.length>0?H6(o.value,r.value):e.value}const d=Fe("paste"),f=Fe(u()),h=mt("pasteArea"),g=Fe(!1);function v(b){var x;const y=(x=b.clipboardData)==null?void 0:x.getData("text/plain");y&&(b.preventDefault(),f.value=y,wn(()=>{h.value&&h.value.focus()}))}const m=[{value:"file",text:"File"},{value:"paste",text:"Paste"},{value:"samples",text:"Samples"}];return(b,y)=>{const x=V1e,_=R1e;return w(),R("div",z1e,[y[12]||(y[12]=T("h2",{class:"upload-card__title"}," Add your data ",-1)),y[13]||(y[13]=T("p",{class:"upload-card__subtitle"}," Drop a file, paste from a spreadsheet, or pick a sample dataset ",-1)),p(o).length>0?(w(),R("button",{key:0,class:"upload-card__back",onClick:y[0]||(y[0]=S=>b.$emit("cancel"))}," ← Back to table ")):se("",!0),T("div",{class:Te(["input-card",{"input-card--drag-over":p(g)}])},[T("div",H1e,[(w(),R(Ge,null,gt(m,S=>T("button",{key:S.value,class:Te(["input-card__tabs__tab",{"input-card__tabs__tab--active":p(d)===S.value}]),onClick:N=>d.value=S.value},[S.value==="file"?(w(),R("svg",U1e,[...y[7]||(y[7]=[T("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12"},null,-1)])])):S.value==="paste"?(w(),R("svg",G1e,[...y[8]||(y[8]=[T("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1"},null,-1),T("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"},null,-1)])])):(w(),R("svg",q1e,[...y[9]||(y[9]=[T("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"},null,-1),T("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"},null,-1)])])),Xe(" "+be(S.text),1)],10,W1e)),64))]),p(d)==="file"?(w(),Q(x,{key:0,onLoaded:y[1]||(y[1]=(S,N)=>b.$emit("loaded",S,N)),onBpc:y[2]||(y[2]=(S,N)=>b.$emit("bpc",S,N)),onDragState:y[3]||(y[3]=S=>g.value=S)})):p(d)==="paste"?(w(),R("div",Y1e,[T("div",j1e,[p(f)?se("",!0):(w(),R("div",X1e,[...y[10]||(y[10]=[Xe(" category Gold Silver Bronze",-1),T("br",null,null,-1),Xe(" USA 40 44 42",-1),T("br",null,null,-1),Xe(" China 38 32 19 ",-1)])])),sr(T("textarea",{ref_key:"pasteArea",ref:h,"onUpdate:modelValue":y[4]||(y[4]=S=>Ze(f)?f.value=S:null),class:"upload-card__paste__wrap__area",spellcheck:"false",onPaste:v},null,544),[[Ap,p(f)]])]),T("div",K1e,[y[11]||(y[11]=T("div",{class:"upload-card__paste__footer__hint"},[T("span",{class:"upload-card__paste__footer__hint__kbd"},"⌘"),T("span",{class:"upload-card__paste__footer__hint__kbd"},"V"),Xe(" paste from spreadsheet ")],-1)),T("button",{class:"upload-card__paste__footer__btn",disabled:!p(f).trim(),onClick:y[5]||(y[5]=S=>b.$emit("loaded",p(f),"Pasted"))}," Load data ",8,Z1e)])])):p(d)==="samples"?(w(),Q(_,{key:2,onSelect:y[6]||(y[6]=S=>b.$emit("sample",S))})):se("",!0)],2)])}}}),J1e=Be(Q1e,[["__scopeId","data-v-b501779f"]]),ebe=le({__name:"DataPanel",setup(t){const e=dr(),{dataView:n}=Mt(e),{setDataView:o}=e,r=Ko(),{applyDsl:i}=zc(),{loadSample:s}=Qs(),{next:a}=q2(),l=Mt(cB()),{activeScene:c,activeIndex:u,update:d}=_n(),f=A(()=>c.value!==null);hn(()=>{r.columns.value.length>0?o("structure"):o("upload")});function h(){if(!r.rawInput.value||r.sourceFormat.value!=="delimited")return;const b=rb(r.rawInput.value,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value});r.loadParsed(b)}function g(b,y){if(f.value&&u.value>=0){const x=rb(b,{firstRowIsHeader:l.firstRowIsHeader.value,delimiter:l.delimiter.value,decimalSeparator:l.decimalSeparator.value,trimWhitespace:l.trimWhitespace.value}),_=hg(x.columns,x.rows);d(u.value,{data:_}),o("structure");return}r.rawInput.value=b,r.sourceFormat.value="delimited",r.sourceLabel.value=y||"Pasted",h(),o("structure")}function v(b,y){i(b),r.sourceLabel.value=y||"Blueprint file",a()}function m(b){if(f.value&&u.value>=0){d(u.value,{data:b.serializedData}),o("structure");return}s(b),a()}return je([()=>l.firstRowIsHeader.value,()=>l.delimiter.value,()=>l.decimalSeparator.value,()=>l.trimWhitespace.value],()=>{r.rawInput.value&&n.value==="structure"&&h()}),(b,y)=>{const x=J1e,_=M1e;return w(),R("div",{class:Te(["data-panel",{"data-panel--structure":p(n)==="structure"}])},[p(n)==="upload"?(w(),Q(x,{key:0,onLoaded:g,onBpc:v,onSample:m,onCancel:y[0]||(y[0]=S=>p(o)("structure"))})):(w(),Q(_,{key:1}))],2)}}}),tbe=Be(ebe,[["__scopeId","data-v-4fa651c7"]]),nbe=["aria-label","aria-disabled","disabled"],obe={class:"panel-open-button__label"},rbe=le({__name:"PanelOpenButton",props:{label:{},icon:{default:()=>LT},disabled:{type:Boolean,default:!1}},emits:["open"],setup(t,{emit:e}){const n=e;function o(){n("open")}return(r,i)=>(w(),R("button",{class:"panel-open-button",type:"button","aria-label":t.label,"aria-disabled":t.disabled?"true":void 0,disabled:t.disabled,onClick:o},[(w(),Q(Gt(t.icon),{class:"panel-open-button__icon","aria-hidden":"true"})),T("span",obe,be(t.label),1)],8,nbe))}}),ibe=Be(rbe,[["__scopeId","data-v-218f5209"]]),sbe={class:"layout-narrow-dock",role:"toolbar","aria-label":"Wizard controls"},abe={class:"layout-narrow-dock__timeline"},lbe={class:"layout-narrow-dock__action"},cbe=le({__name:"LayoutNarrowDock",props:{showTimeline:{type:Boolean},scenes:{},activeIndex:{},playing:{type:Boolean},panelLabel:{},panelIcon:{default:void 0},panelDisabled:{type:Boolean,default:!1},scenesSheetOpen:{type:Boolean,default:!1}},emits:["update:activeIndex","play","pause","expand-timeline","open-panel"],setup(t,{emit:e}){const n=e;function o(r){n("update:activeIndex",r)}return(r,i)=>(w(),R("div",sbe,[T("div",abe,[t.showTimeline?(w(),Q(p(jG),{key:0,scenes:t.scenes,"active-index":t.activeIndex,playing:t.playing,expanded:t.scenesSheetOpen,"onUpdate:activeIndex":o,onPlay:i[0]||(i[0]=s=>n("play")),onPause:i[1]||(i[1]=s=>n("pause")),onExpand:i[2]||(i[2]=s=>n("expand-timeline"))},null,8,["scenes","active-index","playing","expanded"])):se("",!0)]),T("div",lbe,[H(ibe,{label:t.panelLabel,icon:t.panelIcon,disabled:t.panelDisabled,onOpen:i[3]||(i[3]=s=>n("open-panel"))},null,8,["label","icon","disabled"])])]))}}),ube=Be(cbe,[["__scopeId","data-v-cc656101"]]),dbe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function fbe(t,e){return w(),R("svg",dbe,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M224 48H32a8 8 0 0 0-8 8v136a16 16 0 0 0 16 16h176a16 16 0 0 0 16-16V56a8 8 0 0 0-8-8M40 112h40v32H40Zm56 0h120v32H96Zm120-48v32H40V64ZM40 160h40v32H40Zm176 32H96v-32h120z"},null,-1)])])}const pS=Me({name:"ph-table",render:fbe}),hbe={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"};function pbe(t,e){return w(),R("svg",hbe,[...e[0]||(e[0]=[T("path",{fill:"currentColor",d:"M216 112v96a16 16 0 0 1-16 16H56a16 16 0 0 1-16-16v-96a16 16 0 0 1 16-16h24a8 8 0 0 1 0 16H56v96h144v-96h-24a8 8 0 0 1 0-16h24a16 16 0 0 1 16 16M93.66 69.66L120 43.31V136a8 8 0 0 0 16 0V43.31l26.34 26.35a8 8 0 0 0 11.32-11.32l-40-40a8 8 0 0 0-11.32 0l-40 40a8 8 0 0 0 11.32 11.32"},null,-1)])])}const mS=Me({name:"ph-export",render:pbe}),mbe={class:"wizard-shell"},gbe=["title","aria-label"],vbe={class:"wizard-shell__main"},bbe={class:"wizard-shell__content"},ybe=le({__name:"WizardShell",setup(t){const{currentStep:e,currentIndex:n,steps:o,registerCreateSession:r}=q2(),i=Ko(),s=pn(),{sessionId:a,createSession:l,lastSavedAt:c}=Qs(),u=_n(),{scenes:d,activeIndex:f,activeScene:h,playing:g,startPlayback:v,stopPlayback:m}=u,b=A(()=>h.value!==null),{baseOptions:y}=kn(),x=Dr(),_=ze([]),S=A(()=>c.value?new Date(c.value):""),N=QI(S),B=A(()=>S.value?`saved ${N.value}`:null),{isNarrow:k}=bi("lg"),{isNarrow:L}=bi("md"),{isNarrow:E}=bi(),I=dr(),{dataView:C}=Mt(I),$=mg(),P=ze(!1),M=A(()=>{switch(e.value.key){case"data":return"Data panel";case"edit":return"Edit panel";case"export":return"Export panel";default:return"Open panel"}}),F=A(()=>{switch(e.value.key){case"data":return pS;case"edit":return Ns;case"export":return mS;default:return Ns}}),V=A(()=>e.value.key==="data"&&i.rows.value.length===0);function G(){if(!V.value)if(e.value.key==="data"){let te=I.lastNarrowDataTab.value;b.value&&te==="parsing"&&(te="column"),I.openDataPanel(te)}else e.value.key==="edit"?I.selectTab(I.lastNarrowEditTab.value):e.value.key==="export"&&$.setExportTab($.lastNarrowExportTab.value)}function K(){P.value=!0}function ue(te){j(te),P.value=!1}const de={data:pS,edit:Ns,export:mS},he=o.map(te=>({label:te.label,key:te.key,icon:de[te.key]})),ge=A(()=>i.rows.value.length>0?[]:[1,2]);function ee(){u.add(),u.setActive(d.value.length-1)}const fe=ze({}),xe=[Le.BarVertical,Le.BarHorizontal,Le.Line,Le.VerticalBar,Le.HorizontalBar];function Z(te){var X,q,re;const Y=gs(te.dataStr);if((X=Y.series)!=null&&X.length&&xe.includes(te.chartType)){const me=Y.series.find(we=>we.name===s._base.selectedColumn.value);me&&(Y.values=me.values),delete Y.series}return W2(te.chartType,Y,te.typeOpts,te.sort,{colorizes:(q=te.colorizes)!=null&&q.length?te.colorizes:void 0,seriesOverrides:(re=te.seriesOverrides)!=null&&re.length?te.seriesOverrides:void 0})}function pe(te,Y){var X;if((te==null?void 0:te.data)!==void 0)return te.data;if((X=te==null?void 0:te.transforms)!=null&&X.length&&i.columns.value.length>0){const q=x.applyStepList(te.transforms,i.columns.value,i.rows.value,i.columnTypes.value);return hg(q.columns,q.rows)}return Y}function oe(){const te=s._base,Y={};Y[0]=Z({chartType:te.chartType.value,dataStr:te.data.value,typeOpts:y.value,sort:te.sort.value,colorizes:te.colorizes.value,seriesOverrides:te.seriesOverrides.value});for(let X=0;X<d.value.length;X++){const q=za(d.value,X);Y[X+1]=Z({chartType:(q==null?void 0:q.chartType)??te.chartType.value,dataStr:pe(q,te.data.value),typeOpts:q!=null&&q.chartTypeOptions?{...y.value,...q.chartTypeOptions}:y.value,sort:lT(q)??te.sort.value,colorizes:(q==null?void 0:q.colorizes)??te.colorizes.value,seriesOverrides:(q==null?void 0:q.seriesOverrides)??te.seriesOverrides.value})}fe.value=Y}const ve=NI(oe,300);je([()=>d.value,s._base.chartType,s._base.data,s._base.sort,s._base.colorizes,s._base.seriesOverrides,s._base.selectedColumn,y,e],()=>{e.value.key==="edit"&&ve()},{deep:!0});function ce(te){var re;const Y=s._base.title.value;if(te<0)return Y||" ";const X=za(d.value,te),q=(re=X==null?void 0:X.properties)==null?void 0:re.title;return q!==void 0?q||" ":Y||" "}const D=A(()=>{const te={name:ce(-1),index:0,removable:!1,thumbnail:fe.value[0]??null,hint:"base scene"},Y=d.value.map((X,q)=>{const re=q+1,me=aT(d.value,q);let we;return me===q?we="custom data":me<0?we="inherits base":we=`inherits ${ce(me)||`Scene ${me+1}`}`,{name:ce(q),index:re,removable:!0,thumbnail:fe.value[re]??null,hint:we}});return[te,...Y]}),W=A(()=>f.value+1);function j(te){u.setActive(te-1)}function ne(te){te<=0||u.remove(te-1)}const ie=A(()=>{const te=e.value.key;return te==="export"||te==="data"&&C.value==="upload"?!1:te==="edit"?!0:d.value.length>=1});gi(sB,{scenes:D,activeIndex:W,playing:g,showTimeline:ie,onSelect:j,onAdd:ee,onRemove:ne,onPlay:v,onPause:m}),je(f,(te,Y)=>{var X,q;e.value.key==="data"&&(Y===-1&&te>=0?(_.value=x.snapshot(),x.hydrate(((X=d.value[te])==null?void 0:X.transforms)??[])):Y>=0&&te===-1?(u.update(Y,{transforms:x.snapshot()}),x.hydrate(_.value)):Y>=0&&te>=0&&(u.update(Y,{transforms:x.snapshot()}),x.hydrate(((q=d.value[te])==null?void 0:q.transforms)??[])))}),hn(()=>{e.value.key==="edit"&&s._base.data.value&&oe()});function ae(){f.value>=0&&(u.update(f.value,{transforms:x.snapshot()}),x.hydrate(_.value),u.setActive(-1)),s._base.data.value=i.serialize();const te=s._base.chartType.value,Y=te.includes("multi")||te.includes("stacked")||te===Le.BarSplit||te===Le.BarGrouped;if(i.columns.value.length>2&&!Y){const X=i.columnTypes.value[0]==="date";s._base.chartType.value=X?Le.LineMulti:Le.BarMulti}}return r(()=>(ae(),l())),je(()=>e.value.key,(te,Y)=>{Y==="data"&&te==="edit"&&a.value&&ae()}),eI(()=>{Fre()}),(te,Y)=>{const X=tbe,q=jme,re=gle;return w(),R("div",mbe,[H(OT,{class:"wizard-shell__header"},{start:J(()=>[H(BT),p(B)&&p(k)?(w(),R("span",{key:0,class:"wizard-shell__saved-dot",role:"status","aria-live":"polite",title:p(B),"aria-label":p(B)},null,8,gbe)):se("",!0)]),center:J(()=>[H(p(uU),{"current-step":p(n),"onUpdate:currentStep":Y[0]||(Y[0]=me=>Ze(n)?n.value=me:null),steps:p(he),"disabled-steps":p(ge),layout:p(L)?"stacked":"inline"},null,8,["current-step","steps","disabled-steps","layout"])]),end:J(()=>[p(B)&&!p(k)?(w(),Q(p(Ay),{key:0,variant:"success",pill:"",class:"wizard-shell__saved",role:"status","aria-live":"polite"},{default:J(()=>[Y[2]||(Y[2]=T("span",{class:"wizard-shell__saved__dot"},null,-1)),Xe(" "+be(p(B)),1)]),_:1})):se("",!0)]),_:1}),T("div",vbe,[T("div",bbe,[p(e).key==="data"?(w(),Q(X,{key:0})):p(e).key==="edit"?(w(),Q(q,{key:1})):p(e).key==="export"?(w(),Q(re,{key:2})):se("",!0)]),p(E)?(w(),Q(ube,{key:0,"show-timeline":p(ie),scenes:p(D),"active-index":p(W),playing:p(g),"panel-label":p(M),"panel-icon":p(F),"panel-disabled":p(V),"scenes-sheet-open":p(P),"onUpdate:activeIndex":j,onPlay:p(v),onPause:p(m),onExpandTimeline:K,onOpenPanel:G},null,8,["show-timeline","scenes","active-index","playing","panel-label","panel-icon","panel-disabled","scenes-sheet-open","onPlay","onPause"])):se("",!0),p(E)?(w(),Q(p(qA),{key:1,modelValue:p(P),"onUpdate:modelValue":Y[1]||(Y[1]=me=>Ze(P)?P.value=me:null),title:"Scenes"},{default:J(()=>[H(p(aq),{scenes:p(D),"active-index":p(W),playing:p(g),"onUpdate:activeIndex":ue,onAdd:ee,onRemove:ne,onPlay:p(v),onPause:p(m)},null,8,["scenes","active-index","playing","onPlay","onPause"])]),_:1},8,["modelValue"])):se("",!0)])])}}}),Uh=Be(ybe,[["__scopeId","data-v-7fff2056"]]),xbe={class:"render-page"},wbe=le({__name:"RenderPage",setup(t){const e=Jl(),n=mt("containerRef"),{applyDsl:o}=zc();K2(n);const{layout:r}=pn(),{cardClass:i,cardStyle:s}=X2(r,"render-page__card"),{scenes:a,activeIndex:l,playing:c,setActive:u,nextScene:d,previousScene:f,startPlayback:h,stopPlayback:g}=_n(),v={buttons:P1,"progress-bar":JA,"dot-stepper":eC,"minimal-arrows":tC},m=A(()=>v[r.value.playerType]||P1),b=A(()=>a.value.length+1),y=A(()=>l.value+2),x=A(()=>a.value.length>=1);function _(k){u(k-2)}const S=ze(null);function N(){var k;return((k=n.value)==null?void 0:k.querySelector(".bc-frame-footer"))??null}let B=null;return je(n,k=>{if(B&&(B.disconnect(),B=null),!k){S.value=null;return}S.value=N(),B=new MutationObserver(()=>{S.value=N()}),B.observe(k,{childList:!0,subtree:!0})},{immediate:!0}),Xs(()=>{B&&(B.disconnect(),B=null)}),hn(()=>{const k=e.query.bpc64;if(k)try{const L=globalThis.atob(k),E=Uint8Array.from(L,C=>C.charCodeAt(0)),I=new TextDecoder().decode(E);o(I)}catch{}}),(k,L)=>(w(),R("div",xbe,[T("div",{ref_key:"containerRef",ref:n,class:Te(["render-page__card",p(i)]),style:Dt(p(s))},null,6),p(S)&&p(x)?(w(),Q(sy,{key:0,to:p(S)},[(w(),Q(Gt(p(m)),{total:p(b),current:p(y),playing:p(c),position:p(r).playerPosition,"onUpdate:current":_,onPrevious:p(f),onNext:p(d),onPlay:p(h),onPause:p(g)},null,40,["total","current","playing","position","onPrevious","onNext","onPlay","onPause"]))],8,["to"])):se("",!0)]))}}),_be=Be(wbe,[["__scopeId","data-v-76a513dd"]]);function Jv(t){const{sessionId:e,loadChart:n,startAutoSave:o}=Qs();if(e.value===t.params.id)return;if(!n(t.params.id))return"/charts";o()}function kbe(t){if(!t)return null;try{const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e.length%4===0?"":"=".repeat(4-e.length%4),o=atob(e+n),r=new Uint8Array(o.length);for(let i=0;i<o.length;i++)r[i]=o.charCodeAt(i);return new TextDecoder().decode(r)}catch{return null}}const Sbe=TI({history:sI(),scrollBehavior(t,e,n){return n||(t.hash?{el:t.hash,behavior:"smooth"}:{top:0})},routes:[{path:"/",component:()=>K6(()=>import("./LandingPage-B7LxmH7R.js"),__vite__mapDeps([0,1]))},{path:"/charts",component:Mse},{path:"/new",component:Uh,beforeEnter:()=>{const{prepareNew:t}=Qs();t()}},{path:"/edit/:id",redirect:t=>`/edit/${t.params.id}/visualize`},{path:"/copy",component:()=>K6(()=>import("./CopyRedirect-DWJqAXhM.js"),[]),meta:{bare:!0},beforeEnter:t=>{const e=t.query.bpc64,n=kbe(typeof e=="string"?e:"");if(!n)return"/";const{createFromDsl:o}=Qs(),r=o(n);if(!r)return"/";t.meta.copyTarget=`/edit/${r}/visualize`}},{path:"/edit/:id/data",component:Uh,beforeEnter:Jv},{path:"/edit/:id/visualize",component:Uh,beforeEnter:Jv},{path:"/edit/:id/export",component:Uh,beforeEnter:Jv},{path:"/render",component:_be,meta:{bare:!0}}]}),hB=LP();hB.use(HP);MP(xie).use(hB).use(Sbe).use(xN()).mount("#app");export{sy as $,$f as A,Qn as B,II as C,tT as D,mt as E,zt as F,D6 as G,Ay as H,Kre as I,Ry as J,Ge as K,gt as L,be as M,bU as N,Me as O,Te as P,Tbe as Q,Sue as R,zT as S,HT as T,Gge as U,U2 as V,uB as W,Fe as X,Xs as Y,Ese as Z,Be as _,T as a,P1 as a0,Jl as a1,Oy as a2,se as b,R as c,le as d,Py as e,Q as f,p as g,H as h,Xe as i,nC as j,A as k,im as l,iC as m,rC as n,w as o,Yq as p,Uq as q,Ae as r,zq as s,je as t,Mf as u,ls as v,J as w,dg as x,ze as y,Ze as z};
|