@devframes/plugin-data-inspector--assets 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{browser-agent-rpc-DdVlhEv8.js → browser-agent-rpc-BOWBkYow.js} +1 -1
- package/dist/assets/index-BCd2OQjI.js +952 -0
- package/dist/assets/index-BMx6GWey.css +1 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/index-BcJC1Klf.css +0 -1
- package/dist/assets/index-DrPmlTfv.js +0 -952
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function u(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var d={},f=[],p=()=>{},m=()=>!1,h=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),g=e=>e.startsWith(`onUpdate:`),_=Object.assign,v=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},y=Object.prototype.hasOwnProperty,b=(e,t)=>y.call(e,t),x=Array.isArray,S=e=>M(e)===`[object Map]`,C=e=>M(e)===`[object Set]`,w=e=>M(e)===`[object Date]`,T=e=>M(e)===`[object RegExp]`,E=e=>typeof e==`function`,D=e=>typeof e==`string`,O=e=>typeof e==`symbol`,k=e=>typeof e==`object`&&!!e,A=e=>(k(e)||E(e))&&E(e.then)&&E(e.catch),j=Object.prototype.toString,M=e=>j.call(e),ee=e=>M(e).slice(8,-1),te=e=>M(e)===`[object Object]`,N=e=>D(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ne=u(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),re=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ie=/-\w/g,ae=re(e=>e.replace(ie,e=>e.slice(1).toUpperCase())),P=/\B([A-Z])/g,F=re(e=>e.replace(P,`-$1`).toLowerCase()),I=re(e=>e.charAt(0).toUpperCase()+e.slice(1)),oe=re(e=>e?`on${I(e)}`:``),se=(e,t)=>!Object.is(e,t),L=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ce=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},le=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ue=e=>{let t=D(e)?Number(e):NaN;return isNaN(t)?e:t},de,fe=()=>de||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof globalThis<`u`?globalThis:{},pe=u(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function me(e){if(x(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=D(r)?ve(r):me(r);if(i)for(let e in i)t[e]=i[e]}return t}if(D(e)||k(e))return e}var he=/;(?![^(]*\))/g,ge=/:([^]+)/,_e=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ve(e){let t={};return e.replace(_e,e=>e.startsWith(`/*`)?``:e).split(he).forEach(e=>{if(e){let n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ye(e){let t=``;if(D(e))t=e;else if(x(e))for(let n=0;n<e.length;n++){let r=ye(e[n]);r&&(t+=r+` `)}else if(k(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function be(e){if(!e)return null;let{class:t,style:n}=e;return t&&!D(t)&&(e.class=ye(t)),n&&(e.style=me(n)),e}var xe=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,Se=u(xe);xe+``;function Ce(e){return!!e||e===``}function we(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Oe(e[i],t[i],n);return r}function Te(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Oe(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ee(e,t,n){let r=S(e),i=S(t);if(r||i||(r=C(e),i=C(t),r||i))return r&&i?Te(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Oe(e[r],t[r],n))return!1}return String(e)===String(t)}function De(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Oe(e,t,n){if(e===t)return!0;let r=w(e),i=w(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=O(e),i=O(t),r||i?e===t:(r=x(e),i=x(t),r||i?r&&i?De(e,t,n,we):!1:(r=k(e),i=k(t),r||i?!r||!i?!1:De(e,t,n,Ee):String(e)===String(t))))}function ke(e,t){return e.findIndex(e=>Oe(e,t))}var Ae=e=>!!(e&&e.__v_isRef===!0),je=e=>D(e)?e:e==null?``:x(e)||k(e)&&(e.toString===j||!E(e.toString))?Ae(e)?je(e.value):JSON.stringify(e,Me,2):String(e),Me=(e,t)=>Ae(t)?Me(e,t.value):S(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ne(t,r)+` =>`]=n,e),{})}:C(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ne(e))}:O(t)?Ne(t):k(t)&&!x(t)&&!te(t)?String(t):t,Ne=(e,t=``)=>O(e)?`Symbol(${e.description??t})`:e;function Pe(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var R,Fe=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&R&&(R.active?(this.parent=R,this.index=(R.scopes||(R.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=R;try{return R=this,e()}finally{R=t}}}on(){++this._on===1&&(this.prevScope=R,R=this)}off(){if(this._on>0&&--this._on===0){if(R===this)R=this.prevScope;else{let e=R;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Ie(e){return new Fe(e)}function Le(){return R}function Re(e,t=!1){R&&R.cleanups.push(e)}var ze,Be=new WeakSet,Ve=class{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,R&&(R.active?R.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Be.has(this)&&(Be.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ge(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ot(this),Je(this);let e=ze,t=nt;ze=this,nt=!0;try{return this.fn()}finally{Ye(this),ze=e,nt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Qe(e);this.deps=this.depsTail=void 0,ot(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Be.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Xe(this)&&this.run()}get dirty(){return Xe(this)}},He=0,Ue,We;function Ge(e,t=!1){if(e.flags|=8,t){e.next=We,We=e;return}e.next=Ue,Ue=e}function Ke(){He++}function qe(){if(--He>0)return;if(We){let e=We;for(We=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ue;){let t=Ue;for(Ue=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Je(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ye(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Qe(r),$e(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Xe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ze(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ze(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===st)||(e.globalVersion=st,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Xe(e))))return;e.flags|=2;let t=e.dep,n=ze,r=nt;ze=e,nt=!0;try{Je(e);let n=e.fn(e._value);(t.version===0||se(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{ze=n,nt=r,Ye(e),e.flags&=-3}}function Qe(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Qe(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function $e(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function et(e,t){e.effect instanceof Ve&&(e=e.effect.fn);let n=new Ve(e);t&&_(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function tt(e){e.effect.stop()}var nt=!0,rt=[];function it(){rt.push(nt),nt=!1}function at(){let e=rt.pop();nt=e===void 0||e}function ot(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=ze;ze=void 0;try{t()}finally{ze=e}}}var st=0,ct=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},lt=class{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(!ze||!nt||ze===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==ze)t=this.activeLink=new ct(ze,this),ze.deps?(t.prevDep=ze.depsTail,ze.depsTail.nextDep=t,ze.depsTail=t):ze.deps=ze.depsTail=t,ut(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=ze.depsTail,t.nextDep=void 0,ze.depsTail.nextDep=t,ze.depsTail=t,ze.deps===t&&(ze.deps=e)}return t}trigger(e){this.version++,st++,this.notify(e)}notify(e){Ke();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{qe()}}};function ut(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ut(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var dt=new WeakMap,ft=Symbol(``),pt=Symbol(``),mt=Symbol(``);function ht(e,t,n){if(nt&&ze){let t=dt.get(e);t||dt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new lt),r.map=t,r.key=n),r.track()}}function z(e,t,n,r,i,a){let o=dt.get(e);if(!o){st++;return}let s=e=>{e&&e.trigger()};if(Ke(),t===`clear`)o.forEach(s);else{let i=x(e),a=i&&N(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===mt||!O(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(mt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(ft)),S(e)&&s(o.get(pt)));break;case`delete`:i||(s(o.get(ft)),S(e)&&s(o.get(pt)));break;case`set`:S(e)&&s(o.get(ft))}}qe()}function gt(e,t){let n=dt.get(e);return n&&n.get(t)}function _t(e){let t=sn(e);return t===e||(ht(t,`iterate`,mt),an(e))?t:rn(e)?nn(e)?t.map(e=>un(ln(e))):t.map(un):t.map(ln)}function vt(e){return ht(e=sn(e),`iterate`,mt),e}function yt(e,t){return rn(e)?un(nn(e)?ln(t):t):ln(t)}var bt={__proto__:null,[Symbol.iterator](){return xt(this,Symbol.iterator,e=>yt(this,e))},concat(...e){return _t(this).concat(...e.map(e=>x(e)?_t(e):e))},entries(){return xt(this,`entries`,e=>(e[1]=yt(this,e[1]),e))},every(e,t){return B(this,`every`,e,t,void 0,arguments)},filter(e,t){return B(this,`filter`,e,t,e=>e.map(e=>yt(this,e)),arguments)},find(e,t){return B(this,`find`,e,t,e=>yt(this,e),arguments)},findIndex(e,t){return B(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return B(this,`findLast`,e,t,e=>yt(this,e),arguments)},findLastIndex(e,t){return B(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return B(this,`forEach`,e,t,void 0,arguments)},includes(...e){return wt(this,`includes`,e)},indexOf(...e){return wt(this,`indexOf`,e)},join(e){return _t(this).join(e)},lastIndexOf(...e){return wt(this,`lastIndexOf`,e)},map(e,t){return B(this,`map`,e,t,void 0,arguments)},pop(){return Tt(this,`pop`)},push(...e){return Tt(this,`push`,e)},reduce(e,...t){return Ct(this,`reduce`,e,t)},reduceRight(e,...t){return Ct(this,`reduceRight`,e,t)},shift(){return Tt(this,`shift`)},some(e,t){return B(this,`some`,e,t,void 0,arguments)},splice(...e){return Tt(this,`splice`,e)},toReversed(){return _t(this).toReversed()},toSorted(e){return _t(this).toSorted(e)},toSpliced(...e){return _t(this).toSpliced(...e)},unshift(...e){return Tt(this,`unshift`,e)},values(){return xt(this,`values`,e=>yt(this,e))}};function xt(e,t,n){let r=vt(e),i=r[t]();return r!==e&&!an(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var St=Array.prototype;function B(e,t,n,r,i,a){let o=vt(e),s=o!==e&&!an(e),c=o[t];if(c!==St[t]){let t=c.apply(e,a);return s?ln(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,yt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Ct(e,t,n,r){let i=vt(e),a=i!==e&&!an(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=yt(e,t)),n.call(this,t,yt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?yt(e,c):c}function wt(e,t,n){let r=sn(e);ht(r,`iterate`,mt);let i=r[t](...n);return(i===-1||i===!1)&&on(n[0])?(n[0]=sn(n[0]),r[t](...n)):i}function Tt(e,t,n=[]){it(),Ke();let r=sn(e)[t].apply(e,n);return qe(),at(),r}var Et=u(`__proto__,__v_isRef,__isVue`),Dt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(O));function Ot(e){O(e)||(e=String(e));let t=sn(this);return ht(t,`has`,e),t.hasOwnProperty(e)}var kt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Yt:Jt:i?qt:Kt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=x(e);if(!r){let e;if(a&&(e=bt[t]))return e;if(t===`hasOwnProperty`)return Ot}let o=Reflect.get(e,t,dn(e)?e:n);if((O(t)?Dt.has(t):Et(t))||(r||ht(e,`get`,t),i))return o;if(dn(o)){let e=a&&N(t)?o:o.value;return r&&k(e)?$t(e):e}return k(o)?r?$t(o):Zt(o):o}},At=class extends kt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=x(e)&&N(t);if(!this._isShallow){let e=rn(i);if(!an(n)&&!rn(n)&&(i=sn(i),n=sn(n)),!a&&dn(i)&&!dn(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:b(e,t),s=Reflect.set(e,t,n,dn(e)?e:r);return e===sn(r)&&s&&(o?se(n,i)&&z(e,`set`,t,n,i):z(e,`add`,t,n)),s}deleteProperty(e,t){let n=b(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&z(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!O(t)||!Dt.has(t))&&ht(e,`has`,t),n}ownKeys(e){return ht(e,`iterate`,x(e)?`length`:ft),Reflect.ownKeys(e)}},jt=class extends kt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Mt=new At,Nt=new jt,Pt=new At(!0),Ft=new jt(!0),It=e=>e,Lt=e=>Reflect.getPrototypeOf(e);function Rt(e,t,n){return function(...r){let i=this.__v_raw,a=sn(i),o=S(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?It:t?un:ln;return!t&&ht(a,`iterate`,c?pt:ft),_(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function zt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Bt(e,t){let n={get(n){let r=this.__v_raw,i=sn(r),a=sn(n);e||(se(n,a)&&ht(i,`get`,n),ht(i,`get`,a));let{has:o}=Lt(i),s=t?It:e?un:ln;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&ht(sn(t),`iterate`,ft),t.size},has(t){let n=this.__v_raw,r=sn(n),i=sn(t);return e||(se(t,i)&&ht(r,`has`,t),ht(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=sn(a),s=t?It:e?un:ln;return!e&&ht(o,`iterate`,ft),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return _(n,e?{add:zt(`add`),set:zt(`set`),delete:zt(`delete`),clear:zt(`clear`)}:{add(e){let n=sn(this),r=Lt(n),i=sn(e),a=!t&&!an(e)&&!rn(e)?i:e;return r.has.call(n,a)||se(e,a)&&r.has.call(n,e)||se(i,a)&&r.has.call(n,i)||(n.add(a),z(n,`add`,a,a)),this},set(e,n){!t&&!an(n)&&!rn(n)&&(n=sn(n));let r=sn(this),{has:i,get:a}=Lt(r),o=i.call(r,e);o||=(e=sn(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?se(n,s)&&z(r,`set`,e,n,s):z(r,`add`,e,n),this},delete(e){let t=sn(this),{has:n,get:r}=Lt(t),i=n.call(t,e);i||=(e=sn(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&z(t,`delete`,e,void 0,a),o},clear(){let e=sn(this),t=e.size!==0,n=e.clear();return t&&z(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Rt(r,e,t)}),n}function Vt(e,t){let n=Bt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(b(n,r)&&r in t?n:t,r,i)}var Ht={get:Vt(!1,!1)},Ut={get:Vt(!1,!0)},Wt={get:Vt(!0,!1)},Gt={get:Vt(!0,!0)},Kt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Yt=new WeakMap;function Xt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Zt(e){return rn(e)?e:tn(e,!1,Mt,Ht,Kt)}function Qt(e){return tn(e,!1,Pt,Ut,qt)}function $t(e){return tn(e,!0,Nt,Wt,Jt)}function en(e){return tn(e,!0,Ft,Gt,Yt)}function tn(e,t,n,r,i){if(!k(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Xt(ee(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function nn(e){return rn(e)?nn(e.__v_raw):!!(e&&e.__v_isReactive)}function rn(e){return!!(e&&e.__v_isReadonly)}function an(e){return!!(e&&e.__v_isShallow)}function on(e){return e?!!e.__v_raw:!1}function sn(e){let t=e&&e.__v_raw;return t?sn(t):e}function cn(e){return!b(e,`__v_skip`)&&Object.isExtensible(e)&&ce(e,`__v_skip`,!0),e}var ln=e=>k(e)?Zt(e):e,un=e=>k(e)?$t(e):e;function dn(e){return e?e.__v_isRef===!0:!1}function V(e){return pn(e,!1)}function fn(e){return pn(e,!0)}function pn(e,t){return dn(e)?e:new mn(e,t)}var mn=class{constructor(e,t){this.dep=new lt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:sn(e),this._value=t?e:ln(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||an(e)||rn(e);e=n?e:sn(e),se(e,t)&&(this._rawValue=e,this._value=n?e:ln(e),this.dep.trigger())}};function hn(e){e.dep&&e.dep.trigger()}function H(e){return dn(e)?e.value:e}function gn(e){return E(e)?e():H(e)}var _n={get:(e,t,n)=>t===`__v_raw`?e:H(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return dn(i)&&!dn(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function vn(e){return nn(e)?e:new Proxy(e,_n)}var yn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new lt,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function bn(e){return new yn(e)}function xn(e){let t=x(e)?Array(e.length):{};for(let n in e)t[n]=Tn(e,n);return t}var Sn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=O(t)?t:String(t),this._raw=sn(e);let r=!0,i=e;if(!x(e)||O(this._key)||!N(this._key))do r=!on(i)||an(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=H(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&dn(this._raw[this._key])){let t=this._object[this._key];if(dn(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return gt(this._raw,this._key)}},Cn=class{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 wn(e,t,n){return dn(e)?e:E(e)?new Cn(e):k(e)&&arguments.length>1?Tn(e,t,n):V(e)}function Tn(e,t,n){return new Sn(e,t,n)}var En=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new lt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=st-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return Ge(this,!0),!0}get value(){let e=this.dep.track();return Ze(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Dn(e,t,n=!1){let r,i;return E(e)?r=e:(r=e.get,i=e.set),new En(r,i,n)}var On={GET:`get`,HAS:`has`,ITERATE:`iterate`},kn={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},An={},jn=new WeakMap,Mn=void 0;function Nn(){return Mn}function Pn(e,t=!1,n=Mn){if(n){let t=jn.get(n);t||jn.set(n,t=[]),t.push(e)}}function Fn(e,t,n=d){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:an(e)||i===!1||i===0?In(e,1):In(e),u,f,m,h,g=!1,_=!1;if(dn(e)?(f=()=>e.value,g=an(e)):nn(e)?(f=()=>l(e),g=!0):x(e)?(_=!0,g=e.some(e=>nn(e)||an(e)),f=()=>e.map(e=>{if(dn(e))return e.value;if(nn(e))return l(e);if(E(e))return c?c(e,2):e()})):f=E(e)?t?c?()=>c(e,2):e:()=>{if(m){it();try{m()}finally{at()}}let t=Mn;Mn=u;try{return c?c(e,3,[h]):e(h)}finally{Mn=t}}:p,t&&i){let e=f,t=i===!0?1/0:i;f=()=>In(e(),t)}let y=Le(),b=()=>{u.stop(),y&&y.active&&v(y.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return b(),n}}let S=_?Array(e.length).fill(An):An,C=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||g||(_?n.some((e,t)=>se(e,S[t])):se(n,S))){m&&m();let e=Mn;Mn=u;try{let e=[n,S===An?void 0:_&&S[0]===An?[]:S,h];S=n,c?c(t,3,e):t(...e)}finally{Mn=e}}}else u.run()}};return s&&s(C),u=new Ve(f),u.scheduler=o?()=>o(C,!1):C,h=e=>Pn(e,!1,u),m=u.onStop=()=>{let e=jn.get(u);if(e){if(c)c(e,4);else for(let t of e)t();jn.delete(u)}},t?r?C(!0):S=u.run():o?o(C.bind(null,!0),!0):u.run(),b.pause=u.pause.bind(u),b.resume=u.resume.bind(u),b.stop=b,b}function In(e,t=1/0,n){if(t<=0||!k(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,dn(e))In(e.value,t,n);else if(x(e))for(let r=0;r<e.length;r++)In(e[r],t,n);else if(C(e)||S(e))e.forEach(e=>{In(e,t,n)});else if(te(e)){for(let r in e)In(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&In(e[r],t,n)}return e}var Ln=[];function Rn(e){Ln.push(e)}function zn(){Ln.pop()}function Bn(e,t){}var Vn={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},Hn={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function Un(e,t,n,r){try{return r?e(...r):e()}catch(e){Gn(e,t,n)}}function Wn(e,t,n,r){if(E(e)){let i=Un(e,t,n,r);return i&&A(i)&&i.catch(e=>{Gn(e,t,n)}),i}if(x(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Wn(e[a],t,n,r));return i}}function Gn(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||d;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){it(),Un(a,null,10,[e,i,o]),at();return}}Kn(e,n,i,r,o)}function Kn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var qn=[],Jn=-1,Yn=[],Xn=null,Zn=0,Qn=Promise.resolve(),$n=null;function er(e){let t=$n||Qn;return e?t.then(this?e.bind(this):e):t}function tr(e){let t=Jn+1,n=qn.length;for(;t<n;){let r=t+n>>>1,i=qn[r],a=sr(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function nr(e){if(!(e.flags&1)){let t=sr(e),n=qn[qn.length-1];!n||!(e.flags&2)&&t>=sr(n)?qn.push(e):qn.splice(tr(t),0,e),e.flags|=1,rr()}}function rr(){$n||=Qn.then(cr)}function ir(e){if(!x(e))Xn&&e.id===-1?Xn.splice(Zn+1,0,e):e.flags&1||(Yn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Yn.push(e[t]);rr()}function ar(e,t,n=Jn+1){for(;n<qn.length;n++){let t=qn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;qn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function or(e){if(Yn.length){let e=[...new Set(Yn)].sort((e,t)=>sr(e)-sr(t));if(Yn.length=0,Xn){for(let t=0;t<e.length;t++)Xn.push(e[t]);return}for(Xn=e,Zn=0;Zn<Xn.length;Zn++){let e=Xn[Zn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Xn=null,Zn=0}}var sr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function cr(e){try{for(Jn=0;Jn<qn.length;Jn++){let e=qn[Jn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Un(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Jn<qn.length;Jn++){let e=qn[Jn];e&&(e.flags&=-2)}Jn=-1,qn.length=0,or(e),$n=null,(qn.length||Yn.length)&&cr(e)}}var lr,ur=[];function dr(e,t){lr=e,lr?(lr.enabled=!0,ur.forEach(({event:e,args:t})=>lr.emit(e,...t)),ur=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{dr(e,t)}),setTimeout(()=>{lr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,ur=[])},3e3)):ur=[]}var fr=null,pr=null;function mr(e){let t=fr;return fr=e,pr=e&&e.type.__scopeId||null,t}function hr(e){pr=e}function gr(){pr=null}var _r=e=>U;function U(e,t=fr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&gs(-1);let i=mr(t),a=fs.length,o;try{o=e(...n)}finally{for(let e=fs.length;e>a;e--)ms();mr(i),r._d&&gs(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function vr(e,t){if(fr===null)return e;let n=tc(fr),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=d]=t[e];i&&(E(i)&&(i={mounted:i,updated:i}),i.deep&&In(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function yr(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(it(),Wn(c,n,8,[e.el,s,e,t]),at())}}function br(e,t){if(Ls){let n=Ls.provides,r=Ls.parent&&Ls.parent.provides;r===n&&(n=Ls.provides=Object.create(r)),n[e]=t}}function xr(e,t,n=!1){let r=Rs();if(r||ro){let i=ro?ro._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&E(t)?t.call(r&&r.proxy):t}}function Sr(){return!!(Rs()||ro)}var Cr=Symbol.for(`v-scx`),wr=()=>xr(Cr);function Tr(e,t){return Or(e,null,t)}function Er(e,t){return Or(e,null,{flush:`post`})}function Dr(e,t){return Or(e,null,{flush:`sync`})}function W(e,t,n){return Or(e,t,n)}function Or(e,t,n=d){let{immediate:r,deep:i,flush:a,once:o}=n,s=_({},n),c=t&&r||!t&&a!==`post`,l;if(Ws){if(a===`sync`){let e=wr();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=p,e.resume=p,e.pause=p,e}}let u=Ls;s.call=(e,t,n)=>Wn(e,u,t,n);let f=!1;a===`post`?s.scheduler=e=>{Lo(e,u&&u.suspense)}:a!==`sync`&&(f=!0,s.scheduler=(e,t)=>{t?e():nr(e)}),s.augmentJob=e=>{t&&(e.flags|=4),f&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let m=Fn(e,t,s);return Ws&&(l?l.push(m):c&&m()),m}function kr(e,t,n){let r=this.proxy,i=D(e)?e.includes(`.`)?Ar(r,e):()=>r[e]:e.bind(r,r),a;E(t)?a=t:(a=t.handler,n=t);let o=Vs(this),s=Or(i,a.bind(r),n);return o(),s}function Ar(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var jr=new WeakMap,Mr=Symbol(`_vte`),Nr=e=>e.__isTeleport,Pr=e=>e&&(e.disabled||e.disabled===``),Fr=e=>e&&(e.defer||e.defer===``),Ir=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Lr=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Rr=(e,t)=>{let n=e&&e.to;return D(n)?t?t(n):null:n},zr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Pr(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Pr(e.props),r=e.target=Rr(e.props,m),a=Wr(r,e,h,p);r&&(o!==`svg`&&Ir(r)?o=`svg`:o!==`mathml`&&Lr(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Ur(e,!1)))},S=e=>{let t=()=>{if(jr.get(e)===t){if(jr.delete(e),Pr(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),Ur(e,!0)}x(e)}};jr.set(e,t),Lo(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Fr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Ur(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=jr.get(e);if(u){u.flags|=8,jr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Pr(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Ir(p)?o=`svg`:(o===`mathml`||Lr(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Wo(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Br(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Rr(t.props,m);e&&(t.target=e,Br(t,e,null,l,0))}else g&&Br(t,p,h,l,1);Ur(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Pr(f),m=a||!p,h=jr.get(e);if(h&&(h.flags|=8,jr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:Br,hydrate:Vr};function Br(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!jr.has(e)&&(!d||Pr(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function Vr(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=Rr(t.props,c),h=Pr(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||Wr(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||Wr(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),Ur(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var Hr=zr;function Ur(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function Wr(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Mr]=o,e&&(r(a,e,i),r(o,e,i)),o}var Gr=Symbol(`_leaveCb`),Kr=Symbol(`_enterCb`);function qr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Qi(()=>{e.isMounted=!0}),ta(()=>{e.isUnmounting=!0}),e}var Jr=[Function,Array],Yr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jr,onEnter:Jr,onAfterEnter:Jr,onEnterCancelled:Jr,onBeforeLeave:Jr,onLeave:Jr,onAfterLeave:Jr,onLeaveCancelled:Jr,onBeforeAppear:Jr,onAppear:Jr,onAfterAppear:Jr,onAppearCancelled:Jr},Xr=e=>{let t=e.subTree;return t.component?Xr(t.component):t},Zr={name:`BaseTransition`,props:Yr,setup(e,{slots:t}){let n=Rs(),r=qr();return()=>{let i=t.default&&ai(t.default(),!0),a=i&&i.length?Qr(i):n.subTree?Os():void 0;if(!a)return;let o=sn(e),{mode:s}=o;if(r.isLeaving)return ni(a);let c=ri(a);if(!c)return ni(a);let l=ti(c,o,r,n,e=>l=e);c.type!==us&&ii(c,l);let u=n.subTree&&ri(n.subTree);if(u&&u.type!==us&&!ys(u,c)&&Xr(n).type!==us){let e=ti(u,o,r,n);if(ii(u,e),s===`out-in`&&c.type!==us)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},ni(a);s===`in-out`&&c.type!==us?e.delayLeave=(e,t,n)=>{let i=ei(r,u);i[String(u.key)]=u,e[Gr]=()=>{t(),e[Gr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function Qr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==us){t=n;break}}return t}var $r=Zr;function ei(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function ti(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:f,onLeave:p,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),S=ei(n,e),C=(e,t)=>{e&&Wn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),x(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=g||c;else return}t[Gr]&&t[Gr](!0);let i=S[b];i&&ys(e,i)&&i.el[Gr]&&i.el[Gr](),C(r,[t])},enter(t){if(S[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=_||l,i=v||u,o=y||d;else return}let s=!1;t[Kr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[Kr]=void 0)};let c=t[Kr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[Kr]&&t[Kr](!0),n.isUnmounting)return r();C(f,[t]);let a=!1;t[Gr]=n=>{a||(a=!0,r(),C(n?h:m,[t]),t[Gr]=void 0,S[i]===e&&delete S[i])};let o=t[Gr].bind(null,!1);S[i]=e,p?w(p,[t,o]):o()},clone(e){let a=ti(e,t,n,r,i);return i&&i(a),a}};return T}function ni(e){if(Bi(e))return e=Ts(e),e.children=null,e}function ri(e){if(!Bi(e))return Nr(e.type)&&e.children?Qr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&E(n.default))return n.default()}}function ii(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;ii(Nr(n.type)&&ri(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ai(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===cs?(o.patchFlag&128&&i++,r=r.concat(ai(o.children,t,s))):(t||o.type!==us)&&r.push(s==null?o:Ts(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function G(e,t){return E(e)?_({name:e.name},t,{setup:e}):e}function oi(){let e=Rs();return e?(e.appContext.config.idPrefix||`v`)+`-`+e.ids[0]+e.ids[1]++:``}function si(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function ci(e){let t=Rs(),n=fn(null);if(t){let r=t.refs===d?t.refs={}:t.refs;Object.defineProperty(r,e,{enumerable:!0,get:()=>n.value,set:e=>n.value=e})}return n}function li(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var ui=new WeakMap;function di(e,t,n,r,i=!1){if(x(e)){e.forEach((e,a)=>di(e,t&&(x(t)?t[a]:t),n,r,i));return}if(Li(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&di(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?tc(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===d?s.refs={}:s.refs,f=s.setupState,p=sn(f),h=f===d?m:e=>!li(u,e)&&b(p,e),g=(e,t)=>!(t&&li(u,t));if(l!=null&&l!==c){if(fi(t),D(l))u[l]=null,h(l)&&(f[l]=null);else if(dn(l)){let e=t;g(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(E(c))Un(c,s,12,[o,u]);else{let t=D(c),r=dn(c);if(t||r){let s=()=>{if(e.f){let n=t?h(c)?f[c]:u[c]:g(c)||!e.k?c.value:u[e.k];if(i)x(n)&&v(n,a);else if(x(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],h(c)&&(f[c]=u[c]);else{let t=[a];g(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,h(c)&&(f[c]=o)):r&&(g(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),ui.delete(e)};t.id=-1,ui.set(e,t),Lo(t,n)}else fi(e),s()}}}function fi(e){let t=ui.get(e);t&&(t.flags|=8,ui.delete(e))}var pi=!1,mi=()=>{pi||=(console.error(`Hydration completed but contains mismatches.`),!0)},hi=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,gi=e=>e.namespaceURI.includes(`MathML`),_i=e=>{if(e.nodeType===1){if(hi(e))return`svg`;if(gi(e))return`mathml`}},vi=e=>e.nodeType===8;function yi(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:s,insert:c,createComment:l}}=e,u=(e,t)=>{if(!t.hasChildNodes()){n(null,e,t),or(),t._vnode=e;return}d(t.firstChild,e,null,null,null),or(),t._vnode=e},d=(n,r,s,l,u,h=!1)=>{h||=!!r.dynamicChildren;let b=vi(n)&&n.data===`[`,x=()=>g(n,r,s,l,u,b),{type:S,ref:C,shapeFlag:w,patchFlag:T}=r,E=n.nodeType;r.el=n,T===-2&&(h=!1,r.dynamicChildren=null);let D=null;switch(S){case ls:E===3?(n.data!==r.children&&(mi(),n.data=r.children),D=a(n)):r.children===``?(c(r.el=i(``),o(n),n),D=n):D=x();break;case us:y(n)?(D=a(n),v(r.el=n.content.firstChild,n,s)):D=E!==8||b?x():a(n);break;case ds:if(b&&(n=a(n),E=n.nodeType),E===1||E===3){D=n;let e=!r.children.length;for(let t=0;t<r.staticCount;t++)e&&(r.children+=D.nodeType===1?D.outerHTML:D.data),t===r.staticCount-1&&(r.anchor=D),D=a(D);return b?a(D):D}x();break;case cs:D=b?m(n,r,s,l,u,h):x();break;default:if(w&1)D=(E!==1||r.type.toLowerCase()!==n.tagName.toLowerCase())&&!y(n)?x():f(n,r,s,l,u,h);else if(w&6){r.slotScopeIds=u;let e=o(n);if(D=b?_(n):vi(n)&&n.data===`teleport start`?_(n,n.data,`teleport end`):a(n),t(r,e,null,s,l,_i(e),h),(Li(r)||r.component.asyncDep)&&!r.component.subTree){let t;b?(t=Z(ds),t.anchor=D?D.previousSibling:e.lastChild):t=n.nodeType===3?Es(``):Z(n.nodeType===8?us:`div`),t.el=n,r.component.subTree=t}}else w&64?D=E===8?r.type.hydrate(n,r,s,l,u,h,e,p):x():w&128&&(D=r.type.hydrate(n,r,s,l,_i(o(n)),u,h,e,d))}return C!=null&&di(C,null,l,r),D},f=(e,t,n,i,a,o)=>{o||=!!t.dynamicChildren;let{type:c,dynamicProps:l,props:u,patchFlag:d,shapeFlag:f,dirs:m,transition:g}=t,_=c===`input`||c===`option`,b=!!l;if(_||b||d!==-1){m&&yr(t,null,n,`created`);let c=!1;if(y(e)){c=Uo(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(c){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(f&16&&!(u&&(u.innerHTML||u.textContent))){let r=p(e.firstChild,t,e,n,i,a,o);for(r&&!wi(e,1)&&mi();r;){let e=r;r=r.nextSibling,s(e)}}else if(f&8){let n=t.children;n[0]===`
|
|
2
|
+
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
|
3
|
+
`)&&(wi(e,0)||mi(),e.textContent=t.children)}if(u){if(_||b||!o||d&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in u)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||h(a)&&!ne(a)||a[0]===`.`||t&&!ne(a)||l&&l.includes(a)){if(xi(e,a,u[a]))continue;r(e,a,null,u[a],i,n)}}else if(u.onClick)r(e,`onClick`,null,u.onClick,void 0,n);else if(d&4&&nn(u.style))for(let e in u.style)u.style[e]}let x;(x=u&&u.onVnodeBeforeMount)&&Ns(x,n,t),m&&yr(t,null,n,`beforeMount`),((x=u&&u.onVnodeMounted)||m||c)&&as(()=>{x&&Ns(x,n,t),c&&g.enter(e),m&&yr(t,null,n,`mounted`)},i)}return e.nextSibling},p=(e,t,r,o,s,l,u)=>{u||=!!t.dynamicChildren;let f=t.children,p=f.length,m=!1;for(let t=0;t<p;t++){let h=u?f[t]:f[t]=ks(f[t]),g=h.type===ls;e?(g&&!u&&t+1<p&&ks(f[t+1]).type===ls&&(c(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=d(e,h,o,s,l,u)):g&&!h.children?c(h.el=i(``),r):(m||(m=!0,wi(r,1)||mi()),n(null,h,r,null,o,s,_i(r),l))}return e},m=(e,t,n,r,i,s)=>{let{slotScopeIds:u}=t;u&&(i=i?i.concat(u):u);let d=o(e),f=p(a(e),t,d,n,r,i,s);return f&&vi(f)&&f.data===`]`?a(t.anchor=f):(mi(),c(t.anchor=l(`]`),d,f),f)},g=(e,t,r,i,c,l)=>{if(Ei(e,t)||mi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)s(n);else break}}let u=a(e),d=o(e);return s(e),n(null,t,d,u,r,i,_i(d),c),r&&(r.vnode.el=t.el,vo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&vi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[u,d]}var bi=new Set([`src`,`srcset`,`href`,`poster`]);function xi(e,t,n){return bi.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Si=`data-allow-mismatch`,Ci={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function wi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Si);)e=e.parentElement;return Ti(e&&e.getAttribute(Si),t)}function Ti(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(Ci[t])}}function Ei(e,t){return wi(e.parentElement,1)||Di(e)||Oi(t)}function Di(e){return e.nodeType===1&&Ti(e.getAttribute(Si),1)}function Oi({props:e}){let t=e&&e[Si];return typeof t==`string`&&Ti(t,1)}var ki=fe().requestIdleCallback||(e=>setTimeout(e,1)),Ai=fe().cancelIdleCallback||(e=>clearTimeout(e)),ji=(e=1e4)=>t=>{let n=ki(t,{timeout:e});return()=>Ai(n)};function Mi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ni=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Mi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Pi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Fi=(e=[])=>(t,n)=>{D(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ii(e,t){if(vi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(vi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Li=e=>!!e.type.__asyncLoader;function Ri(e){E(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return G({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ii(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Ls;if(si(e),u)return()=>zi(u,e);let t=t=>{l=null,Gn(t,e,13,!r)};if(s&&e.suspense||Ws)return p().then(t=>()=>zi(t,e)).catch(e=>(t(e),()=>r?Z(r,{error:e}):null));let a=V(!1),c=V(),d=V(!!i),f,m;return na(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Bi(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return zi(u,e);if(c.value&&r)return Z(r,{error:c.value});if(n&&!d.value)return zi(n,e)}}})}function zi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=Z(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var Bi=e=>e.type.__isKeepAlive,Vi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Rs(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),Lo(()=>{a.isDeactivated=!1,a.a&&L(a.a);let t=e.props&&e.props.onVnodeMounted;t&&Ns(t,a.parent,e)},s)},r.deactivate=e=>{let t=e.component;qo(t.m),qo(t.a),l(e,f,null,1,s),Lo(()=>{t.da&&L(t.da);let n=e.props&&e.props.onVnodeUnmounted;n&&Ns(n,t.parent,e),t.isDeactivated=!0},s)};function p(e){qi(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=nc(Li(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!ys(t,o))?p(t):o&&qi(o),i.delete(e),a.delete(e)}W(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Hi(e,t)),t&&m(e=>!Hi(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{g!=null&&(Yo(n.subTree.type)?Lo(()=>{let e=Ji(n.subTree);e.component&&i.set(g,e)},n.subTree.suspense):i.set(g,Ji(n.subTree)))};return Qi(_),ea(_),ta(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=Ji(t);if(e.type===i.type&&e.key===i.key){qi(i);let e=i.component.da;e&&Lo(e,r);return}p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!vs(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=Ji(r);if(s.type===us)return o=null,s;let c=s.type,l=nc(Li(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Hi(u,l))||d&&l&&Hi(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Ts(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&ii(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,Yo(r.type)?r:s}}};function Hi(e,t){return x(e)?e.some(e=>Hi(e,t)):D(e)?e.split(`,`).includes(t):T(e)?(e.lastIndex=0,e.test(t)):!1}function Ui(e,t){Gi(e,`a`,t)}function Wi(e,t){Gi(e,`da`,t)}function Gi(e,t,n=Ls){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Yi(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Bi(e.parent.vnode)&&Ki(r,t,n,e),e=e.parent}}function Ki(e,t,n,r){let i=Yi(t,e,r,!0);na(()=>{v(r[t],i)},n)}function qi(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function Ji(e){return e.shapeFlag&128?e.ssContent:e}function Yi(e,t,n=Ls,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{it();let i=Vs(n),a=Wn(t,n,e,r);return i(),at(),a};return r?i.unshift(a):i.push(a),a}}var Xi=e=>(t,n=Ls)=>{(!Ws||e===`sp`)&&Yi(e,(...e)=>t(...e),n)},Zi=Xi(`bm`),Qi=Xi(`m`),$i=Xi(`bu`),ea=Xi(`u`),ta=Xi(`bum`),na=Xi(`um`),ra=Xi(`sp`),ia=Xi(`rtg`),aa=Xi(`rtc`);function oa(e,t=Ls){Yi(`ec`,e,t)}var sa=`components`,ca=`directives`;function la(e,t){return pa(sa,e,!0,t)||e}var ua=Symbol.for(`v-ndc`);function da(e){return D(e)?pa(sa,e,!1)||e:e||ua}function fa(e){return pa(ca,e)}function pa(e,t,n=!0,r=!1){let i=fr||Ls;if(i){let n=i.type;if(e===sa){let e=nc(n,!1);if(e&&(e===t||e===ae(t)||e===I(ae(t))))return n}let a=ma(i[e]||n[e],t)||ma(i.appContext[e],t);return!a&&r?n:a}}function ma(e,t){return e&&(e[t]||e[ae(t)]||e[I(ae(t))])}function ha(e,t,n,r){let i,a=n&&n[r],o=x(e);if(o||D(e)){let n=o&&nn(e),r=!1,s=!1;n&&(r=!an(e),s=rn(e),e=vt(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?un(ln(e[n])):ln(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(k(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function ga(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(x(r))for(let t=0;t<r.length;t++)e[r[t].name]=r[t].fn;else r&&(e[r.name]=r.key?(...e)=>{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function K(e,t,n,r,i,a){if(n??={},fr.ce||fr.parent&&Li(fr.parent)&&fr.parent.ce){let e=a!=null&&n.key==null?_({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),q(),Y(cs,null,[Z(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=fs.length;q();let c;try{let i=o&&_a(o(n)),s=n.key||a||i&&i.key;c=Y(cs,{key:(s&&!O(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=fs.length;e>s;e--)ms();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function _a(e){return e.some(e=>!vs(e)||!(e.type===us||e.type===cs&&!_a(e.children)))?e:null}function va(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:oe(r)]=e[r];return n}var ya=e=>e?Us(e)?tc(e):ya(e.parent):null,ba=_(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ya(e.parent),$root:e=>ya(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Wa(e),$forceUpdate:e=>e.f||=()=>{nr(e.update)},$nextTick:e=>e.n||=er.bind(e.proxy),$watch:e=>kr.bind(e)}),xa=(e,t)=>e!==d&&!e.__isScriptSetup&&b(e,t),Sa={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if(xa(r,t))return o[t]=1,r[t];else if(i!==d&&b(i,t))return o[t]=2,i[t];else if(b(a,t))return o[t]=3,a[t];else if(n!==d&&b(n,t))return o[t]=4,n[t];else za&&(o[t]=0)}let l=ba[t],u,f;if(l)return t===`$attrs`&&ht(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==d&&b(n,t))return o[t]=4,n[t];if(f=c.config.globalProperties,b(f,t))return f[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return xa(i,t)?(i[t]=n,!0):r!==d&&b(r,t)?(r[t]=n,!0):b(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==d&&s[0]!==`$`&&b(e,s)||xa(t,s)||b(a,s)||b(r,s)||b(ba,s)||b(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?b(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},Ca=_({},Sa,{get(e,t){if(t!==Symbol.unscopables)return Sa.get(e,t,e)},has(e,t){return t[0]!==`_`&&!pe(t)}});function wa(){return null}function Ta(){return null}function Ea(e){}function Da(e){}function Oa(){return null}function ka(){}function Aa(e,t){return null}function ja(){return Na(`useSlots`).slots}function Ma(){return Na(`useAttrs`).attrs}function Na(e){let t=Rs();return t.setupContext||=ec(t)}function Pa(e){return x(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Fa(e,t){let n=Pa(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?x(r)||E(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Ia(e,t){return!e||!t?e||t:x(e)&&x(t)?e.concat(t):_({},Pa(e),Pa(t))}function La(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Ra(e){let t=Rs(),n=Ws,r=e();Hs(),n&&Bs(!1);let i=()=>{Vs(t),n&&Bs(!0)},a=()=>{Rs()!==t&&t.scope.off(),Hs(),n&&Bs(!1)};return A(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var za=!0;function Ba(e){let t=Wa(e),n=e.proxy,r=e.ctx;za=!1,t.beforeCreate&&Ha(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:m,updated:h,activated:g,deactivated:_,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:S,render:C,renderTracked:w,renderTriggered:T,errorCaptured:D,serverPrefetch:O,expose:A,inheritAttrs:j,components:M,directives:ee,filters:te}=t;if(l&&Va(l,r,null),o)for(let e in o){let t=o[e];E(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);k(t)&&(e.data=Zt(t))}if(za=!0,a)for(let e in a){let t=a[e],i=Q({get:E(t)?t.bind(n,n):E(t.get)?t.get.bind(n,n):p,set:!E(t)&&E(t.set)?t.set.bind(n):p});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)Ua(s[e],r,n,e);if(c){let e=E(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{br(t,e[t])})}u&&Ha(u,e,`c`);function N(e,t){x(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(N(Zi,d),N(Qi,f),N($i,m),N(ea,h),N(Ui,g),N(Wi,_),N(oa,D),N(aa,w),N(ia,T),N(ta,y),N(na,S),N(ra,O),x(A)){if(A.length){let t=e.exposed||={};A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===p&&(e.render=C),j!=null&&(e.inheritAttrs=j),M&&(e.components=M),ee&&(e.directives=ee),O&&si(e)}function Va(e,t,n=p){x(e)&&(e=Ya(e));for(let n in e){let r=e[n],i;i=k(r)?`default`in r?xr(r.from||n,r.default,!0):xr(r.from||n):xr(r),dn(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ha(e,t,n){Wn(x(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ua(e,t,n,r){let i=r.includes(`.`)?Ar(n,r):()=>n[r];if(D(e)){let n=t[e];E(n)&&W(i,n)}else if(E(e))W(i,e.bind(n));else if(k(e)){if(x(e))e.forEach(e=>Ua(e,t,n,r));else{let r=E(e.handler)?e.handler.bind(n):t[e.handler];E(r)&&W(i,r,e)}}}function Wa(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Ga(c,e,o,!0)),Ga(c,t,o)),k(t)&&a.set(t,c),c}function Ga(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Ga(e,a,n,!0),i&&i.forEach(t=>Ga(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Ka[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ka={data:qa,props:Qa,emits:Qa,methods:Za,computed:Za,beforeCreate:Xa,created:Xa,beforeMount:Xa,mounted:Xa,beforeUpdate:Xa,updated:Xa,beforeDestroy:Xa,beforeUnmount:Xa,destroyed:Xa,unmounted:Xa,activated:Xa,deactivated:Xa,errorCaptured:Xa,serverPrefetch:Xa,components:Za,directives:Za,watch:$a,provide:qa,inject:Ja};function qa(e,t){return t?e?function(){return _(E(e)?e.call(this,this):e,E(t)?t.call(this,this):t)}:t:e}function Ja(e,t){return Za(Ya(e),Ya(t))}function Ya(e){if(x(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Xa(e,t){return e?[...new Set([].concat(e,t))]:t}function Za(e,t){return e?_(Object.create(null),e,t):t}function Qa(e,t){return e?x(e)&&x(t)?[...new Set([...e,...t])]:_(Object.create(null),Pa(e),Pa(t??{})):t}function $a(e,t){if(!e)return t;if(!t)return e;let n=_(Object.create(null),e);for(let r in t)n[r]=Xa(e[r],t[r]);return n}function eo(){return{app:null,config:{isNativeTag:m,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}}var to=0;function no(e,t){return function(n,r=null){E(n)||(n=_({},n)),r!=null&&!k(r)&&(r=null);let i=eo(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:to++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:cc,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&E(e.install)?(a.add(e),e.install(c,...t)):E(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||Z(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,tc(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Wn(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=ro;ro=c;try{return e()}finally{ro=t}}};return c}}var ro=null;function io(e,t,n=d){let r=Rs(),i=ae(t),a=F(t),o=ao(e,i),s=bn((o,s)=>{let c,l=d,u;return Dr(()=>{let t=e[i];se(c,t)&&(c=t,s())}),{get(){return o(),n.get?n.get(c):c},set(e){let o=n.set?n.set(e):e;if(!se(o,c)&&!(l!==d&&se(e,l)))return;let f=r.vnode.props,p=!!(f&&(t in f||i in f||a in f)&&(`onUpdate:${t}`in f||`onUpdate:${i}`in f||`onUpdate:${a}`in f));p||(c=e,s()),r.emit(`update:${t}`,o),se(e,l)&&(se(e,o)&&!se(o,u)||p&&l!==d&&!se(o,c))&&s(),l=e,u=o}}});return s[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?o||d:s,done:!1}:{done:!0}}}},s}var ao=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${ae(t)}Modifiers`]||e[`${F(t)}Modifiers`];function oo(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||d,i=n,a=t.startsWith(`update:`),o=a&&ao(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>D(e)?e.trim():e)),o.number&&(i=i.map(le)));let s,c=r[s=oe(t)]||r[s=oe(ae(t))];!c&&a&&(c=r[s=oe(F(t))]),c&&Wn(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Wn(l,e,6,i)}}var so=new WeakMap;function co(e,t,n=!1){let r=n?so:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!E(e)){let r=e=>{let n=co(e,t,!0);n&&(s=!0,_(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(k(e)&&r.set(e,null),null):(x(a)?a.forEach(e=>o[e]=null):_(o,a),k(e)&&r.set(e,o),o)}function lo(e,t){return!e||!h(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),b(e,t[0].toLowerCase()+t.slice(1))||b(e,F(t))||b(e,t))}function uo(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,_=mr(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=ks(l.call(t,e,u,d,p,f,m)),y=s}else{let e=t;v=ks(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),y=t.props?s:po(s)}}catch(t){fs.length=0,Gn(t,e,1),v=Z(us)}let b=v;if(y&&h!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(g)&&(y=mo(y,a)),b=Ts(b,y,!1,!0))}return n.dirs&&(b=Ts(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&ii(Nr(b.type)&&ri(b)||b,n.transition),v=b,mr(_),v}function fo(e,t=!0){let n;for(let t=0;t<e.length;t++){let r=e[t];if(vs(r)){if(r.type!==us||r.children===`v-if`){if(n)return;n=r}}else return}return n}var po=e=>{let t;for(let n in e)(n===`class`||n===`style`||h(n))&&((t||={})[n]=e[n]);return t},mo=(e,t)=>{let n={};for(let r in e)(!g(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function ho(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?go(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(_o(o,r,n)&&!lo(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||go(r,o,l):!!o;return!1}function go(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(_o(t,e,a)&&!lo(n,a))return!0}return!1}function _o(e,t,n){let r=e[n],i=t[n];return n===`style`&&k(r)&&k(i)?!Oe(r,i):r!==i}function vo({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var yo={},bo=()=>Object.create(yo),xo=e=>Object.getPrototypeOf(e)===yo;function So(e,t,n,r=!1){let i={},a=bo();e.propsDefaults=Object.create(null),wo(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Qt(i):e.type.props?i:a,e.attrs=a}function Co(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=sn(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(lo(e.emitsOptions,o))continue;let u=t[o];if(c){if(b(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=ae(o);i[t]=To(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{wo(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!b(t,a)&&((r=F(a))===a||!b(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=To(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!b(t,e))&&(delete a[e],l=!0)}l&&z(e.attrs,`set`,``)}function wo(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(ne(c))continue;let l=t[c],u;i&&b(i,u=ae(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:lo(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=sn(n),r=s||d;for(let o=0;o<a.length;o++){let s=a[o];n[s]=To(i,t,s,r[s],e,!b(r,s))}}return o}function To(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=b(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&E(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Vs(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===F(n))&&(r=!0))}return r}var Eo=new WeakMap;function Do(e,t,n=!1){let r=n?Eo:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!E(e)){let r=e=>{c=!0;let[n,r]=Do(e,t,!0);_(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return k(e)&&r.set(e,f),f;if(x(a))for(let e=0;e<a.length;e++){let t=ae(a[e]);Oo(t)&&(o[t]=d)}else if(a)for(let e in a){let t=ae(e);if(Oo(t)){let n=a[e],r=o[t]=x(n)||E(n)?{type:n}:_({},n),i=r.type,c=!1,l=!0;if(x(i))for(let e=0;e<i.length;++e){let t=i[e],n=E(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=E(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||b(r,`default`))&&s.push(t)}}let l=[o,s];return k(e)&&r.set(e,l),l}function Oo(e){return e[0]!==`$`&&!ne(e)}var ko=e=>e===`_`||e===`_ctx`||e===`$stable`,Ao=e=>x(e)?e.map(ks):[ks(e)],jo=(e,t,n)=>{if(t._n)return t;let r=U((...e)=>Ao(t(...e)),n);return r._c=!1,r},Mo=(e,t,n)=>{let r=e._ctx;for(let n in e){if(ko(n))continue;let i=e[n];if(E(i))t[n]=jo(n,i,r);else if(i!=null){let e=Ao(i);t[n]=()=>e}}},No=(e,t)=>{let n=Ao(t);e.slots.default=()=>n},Po=(e,t,n)=>{for(let r in t)(n||!ko(r))&&(e[r]=t[r])},Fo=(e,t,n)=>{let r=e.slots=bo();if(e.vnode.shapeFlag&32){let e=t._;e?(Po(r,t,n),n&&ce(r,`_`,e,!0)):Mo(t,r)}else t&&No(e,t)},Io=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=d;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Po(i,t,n):(a=!t.$stable,Mo(t,i)),o=t}else t&&(No(e,t),o={default:1});if(a)for(let e in i)!ko(e)&&o[e]==null&&delete i[e]},Lo=as;function Ro(e){return Bo(e)}function zo(e){return Bo(e,yi)}function Bo(e,t){let n=fe();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:m,nextSibling:h,setScopeId:g=p,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!ys(e,t)&&(r=ue(e),I(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===f&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case ls:y(e,t,n,r);break;case us:b(e,t,n,r);break;case ds:e??x(t,n,r,o);break;case cs:j(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?M(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,me)}u!=null&&i?di(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&di(e.ref,null,a,e,!0)},y=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},b=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=h(e),r(e,n,i),e=a;r(t,n,i)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),i(e),e=n;i(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)T(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),O(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},T=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&D(e.children,f,null,i,s,Vo(e,c),l,d),_&&yr(e,null,i,`created`),E(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!ne(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&Ns(p,i,e)}_&&yr(e,null,i,`beforeMount`);let v=Uo(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&Lo(()=>{try{p&&Ns(p,i,e),v&&g.enter(f),_&&yr(e,null,i,`mounted`)}finally{}},s)},E=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||Yo(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;E(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},D=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?As(e[l]):ks(e[l]);v(null,c,t,n,r,i,a,o,s)}},O=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:f,dirs:p}=t;l|=e.patchFlag&16;let m=e.props||d,h=t.props||d,g;if(n&&Ho(n,!1),(g=h.onVnodeBeforeUpdate)&&Ns(g,n,t,e),p&&yr(t,e,n,`beforeUpdate`),n&&Ho(n,!0),f&&(!e.dynamicChildren||e.dynamicChildren.length!==f.length)&&(l=0,s=!1,f=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&u(c,``),f?k(e.dynamicChildren,f,c,n,r,Vo(t,i),o):s||ie(e,t,c,null,n,r,Vo(t,i),o,!1),l>0){if(l&16)A(c,m,h,n,i);else if(l&2&&m.class!==h.class&&a(c,`class`,null,h.class,i),l&4&&a(c,`style`,m.style,h.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=m[r],s=h[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&f==null&&A(c,m,h,n,i);((g=h.onVnodeUpdated)||p)&&Lo(()=>{g&&Ns(g,n,t,e),p&&yr(t,e,n,`updated`)},r)},k=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===cs||!ys(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},A=(e,t,n,r,i)=>{if(t!==n){if(t!==d)for(let o in t)!ne(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(ne(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},j=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),D(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(k(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&Wo(e,t,!0)):ie(e,t,n,f,a,o,c,l,u)},M=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ee(t,n,r,i,a,o,c):te(e,t,c)},ee=(e,t,n,r,i,a,o)=>{let s=e.component=Is(e,r,i);if(Bi(e)&&(s.ctx.renderer=me),Gs(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,N,o),!e.el){let r=s.subTree=Z(us);b(null,r,t,n),e.placeholder=r.el}}else N(s,e,t,n,i,a,o)},te=(e,t,n)=>{let r=t.component=e.component;if(ho(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,re(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},N=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Ko(e);if(n){t&&(t.el=c.el,re(e,t,o)),n.asyncDep.then(()=>{Lo(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;Ho(e,!1),t?(t.el=c.el,re(e,t,o)):t=c,n&&L(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Ns(d,s,t,c),Ho(e,!0);let f=uo(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ue(p),e,i,a),t.el=f.el,u===null&&vo(e,f.el),r&&Lo(r,i),(d=t.props&&t.props.onVnodeUpdated)&&Lo(()=>Ns(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Li(t);if(Ho(e,!1),l&&L(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Ns(o,d,t),Ho(e,!0),s&&ge){let t=()=>{e.subTree=uo(e),ge(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=uo(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&Lo(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;Lo(()=>Ns(o,d,e),i)}(t.shapeFlag&256||d&&Li(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&Lo(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ve(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>nr(u),Ho(e,!0),l()},re=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Co(e,t.props,r,n),Io(e,t.children,n),it(),ar(e),at()},ie=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){P(l,f,n,r,i,a,o,s,c);return}if(p&256){ae(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&le(l,i,a),f!==l&&u(n,f)):d&16?m&16?P(l,f,n,r,i,a,o,s,c):le(l,i,a,!0):(d&8&&u(n,``),m&16&&D(f,n,r,i,a,o,s,c))},ae=(e,t,n,r,i,a,o,s,c)=>{e||=f,t||=f;let l=e.length,u=t.length,d=Math.min(l,u),p=0;for(;p<d;p++){let r=t[p]=c?As(t[p]):ks(t[p]);v(e[p],r,n,null,i,a,o,s,c)}l>u?le(e,i,a,!0,!1,d):D(t,n,r,i,a,o,s,c,d)},P=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,p=u-1;for(;l<=d&&l<=p;){let r=e[l],u=t[l]=c?As(t[l]):ks(t[l]);if(ys(r,u))v(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=p;){let r=e[d],l=t[p]=c?As(t[p]):ks(t[p]);if(ys(r,l))v(r,l,n,null,i,a,o,s,c);else break;d--,p--}if(l>d){if(l<=p){let e=p+1,d=e<u?t[e].el:r;for(;l<=p;)v(null,t[l]=c?As(t[l]):ks(t[l]),n,d,i,a,o,s,c),l++}}else if(l>p)for(;l<=d;)I(e[l],i,a,!0),l++;else{let m=l,h=l,g=new Map;for(l=h;l<=p;l++){let e=t[l]=c?As(t[l]):ks(t[l]);e.key!=null&&g.set(e.key,l)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(l=0;l<b;l++)C[l]=0;for(l=m;l<=d;l++){let r=e[l];if(y>=b){I(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&ys(r,t[_])){u=_;break}u===void 0?I(r,i,a,!0):(C[u-h]=l+1,u>=S?S=u:x=!0,v(r,t[u],n,null,i,a,o,s,c),y++)}let w=x?Go(C):f;for(_=w.length-1,l=b-1;l>=0;l--){let e=h+l,d=t[e],f=t[e+1],p=e+1<u?f.el||Jo(f):r;C[l]===0?v(null,d,n,p,i,a,o,s,c):x&&(_<0||l!==w[_]?F(d,n,p,2):_--)}}},F=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){F(e.component.subTree,t,n,a);return}if(d&128){e.suspense.move(t,n,a);return}if(d&64){c.move(e,t,n,me);return}if(c===cs){r(s,t,n);for(let e=0;e<u.length;e++)F(u[e],t,n,a);r(e.anchor,t,n);return}if(c===ds){S(e,t,n);return}if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[Gr]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),Lo(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[Gr];s._isLeaving&&s[Gr](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},I=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(it(),di(s,null,n,e,!0),at()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Li(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Ns(_,t,e),u&6)ce(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&yr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,me,r):l&&!l.hasOnce&&(a!==cs||d>0&&d&64)?le(l,t,n,!1,!0):(a===cs&&d&384||!i&&u&16)&&le(c,t,n),r&&oe(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&Lo(()=>{_&&Ns(_,t,e),h&&yr(e,null,t,`unmounted`),v&&(e.el=null)},n)},oe=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===cs){se(n,r);return}if(t===ds){C(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},se=(e,t)=>{let n;for(;e!==t;)n=h(e),i(e),e=n;i(t)},ce=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;qo(c),qo(l),r&&L(r),i.stop(),a?(a.flags|=8,I(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,I(o,e,t,n)),s&&Lo(s,t),Lo(()=>{e.isUnmounted=!0},t)},le=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)I(e[o],t,n,r,i)},ue=e=>{if(e.shapeFlag&6)return ue(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Mr];return n?h(n):t},de=!1,pe=(e,t,n)=>{let r;e==null?t._vnode&&(I(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,de||=(de=!0,ar(r),or(),!1)},me={p:v,um:I,m:F,r:oe,mt:ee,mc:D,pc:ie,pbc:k,n:ue,o:e},he,ge;return t&&([he,ge]=t(me)),{render:pe,hydrate:he,createApp:no(pe,he)}}function Vo({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function Ho({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Uo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Wo(e,t,n=!1){let r=e.children,i=t.children;if(x(r)&&x(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=As(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&Wo(t,a)),a.type===ls&&(a.patchFlag===-1&&(a=i[e]=As(a)),a.el=t.el),a.type===us&&!a.el&&(a.el=t.el)}}function Go(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Ko(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ko(t)}function qo(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Jo(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?Jo(t.subTree):null}var Yo=e=>e.__isSuspense,Xo=0,Zo={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)$o(t,n,r,i,a,o,s,c,l);else{if(a&&a.deps>0&&!e.suspense.isInFallback&&!a.isHydrating){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}es(e,t,n,r,i,o,s,c,l)}},hydrate:ns,normalize:rs};function Qo(e,t){let n=e.props&&e.props[t];E(n)&&n()}function $o(e,t,n,r,i,a,o,s,c){let{p:l,o:{createElement:u}}=c,d=u(`div`),f=e.suspense=ts(e,i,r,t,d,n,a,o,s,c);l(null,f.pendingBranch=e.ssContent,d,null,r,f,a,o),f.deps>0?(Qo(e,`onPending`),Qo(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),os(f,e.ssFallback)):f.resolve(!1,!0)}function es(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,ys(h,f)?(d.deps++,c(h,f,_?n:d.hiddenContainer,null,i,d,a,o,s),d.deps--,d.deps<=0?d.resolve():g&&!_&&!d.isFallbackMountPending&&(c(m,p,n,r,i,null,a,o,s),os(d,p))):(d.pendingId=Xo++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,d.effects.length=0,d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():d.isFallbackMountPending||(c(m,p,n,r,i,null,a,o,s),os(d,p))):m&&ys(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0)):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&ys(m,f))c(m,f,n,r,i,d,a,o,s),os(d,f);else if(Qo(t,`onPending`),d.pendingBranch=f,d.pendingId=f.shapeFlag&512?f.component.suspenseId:Xo++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e,pendingId:t}=d;e>0?setTimeout(()=>{d.pendingId===t&&d.fallback(p)},e):e===0&&d.fallback(p)}}function ts(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=ss(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?ue(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:Xo++,timeout:typeof y==`number`?y:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){g=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;g&&(i.transition.afterLeave=()=>{s===x.pendingId&&(f(o,u,a===b&&!e?m(i):a,0),ir(c),d&&r.ssFallback&&(r.ssFallback.el=null))}),i&&!x.isFallbackMountPending&&(h(i.el)===u&&(a=m(i),e=!0),p(i,l,x,!0),!g&&d&&r.ssFallback&&Lo(()=>r.ssFallback.el=null,x)),g||f(o,u,a,0)}x.isFallbackMountPending=!1,os(x,o),x.pendingBranch=null,x.isInFallback=!1;let y=x.parent,S=!1;for(;y;){if(y.pendingBranch){for(let e=0;e<c.length;e++)y.effects.push(c[e]);S=!0;break}y=y.parent}!S&&!g&&ir(c),x.effects=[],v&&t&&t.pendingBranch&&_===t.pendingId&&(_=void 0,t.deps--,t.deps===0&&!n&&t.resolve()),Qo(r,`onResolve`)},fallback(e){if(!x.pendingBranch)return;let{vnode:t,activeBranch:n,parentComponent:r,container:i,namespace:a}=x;Qo(t,`onFallback`);let o=m(n),l=()=>{if(x.isFallbackMountPending=!1,!x.isInFallback)return;let e=x.vnode.ssFallback;d(null,e,i,o,r,null,a,s,c),os(x,e)},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n){let r=!!x.pendingBranch;r&&x.deps++;let i=e.vnode.el;e.asyncDep.catch(t=>{Gn(t,e,0)}).then(a=>{if(e.isUnmounted||x.isUnmounted||x.pendingId!==e.suspenseId)return;if(Hs(),i&&!e.scope.active){r&&--x.deps===0&&x.resolve();return}e.asyncResolved=!0;let{vnode:s}=e;qs(e,a,!1),i&&(s.el=i);let c=!i&&e.subTree.el;t(e,s,h(i||e.subTree.el),i?null:m(e.subTree),x,o,n),c&&(s.placeholder=null,g(c)),vo(e,s.el),r&&--x.deps===0&&x.resolve()})},unmount(e,t){x.isUnmounted=!0,x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&p(x.pendingBranch,n,e,t)}};return x}function ns(e,t,n,r,i,a,o,s,c){let l=t.suspense=ts(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function rs(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=is(r?n.default:n),e.ssFallback=r?is(n.fallback):Z(us)}function is(e){let t;if(E(e)){let n=hs&&e._c;n&&(e._d=!1,q()),e=e(),n&&(e._d=!0,t=ps,ms())}return x(e)&&(e=fo(e)),e=ks(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function as(e,t){t&&t.pendingBranch?x(e)?t.effects.push(...e):t.effects.push(e):ir(e)}function os(e,t){e.activeBranch=t;let{vnode:n,parentComponent:r}=e,i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,vo(r,i))}function ss(e){let t=e.props&&e.props.suspensible;return t!=null&&t!==!1}var cs=Symbol.for(`v-fgt`),ls=Symbol.for(`v-txt`),us=Symbol.for(`v-cmt`),ds=Symbol.for(`v-stc`),fs=[],ps=null;function q(e=!1){fs.push(ps=e?null:[])}function ms(){fs.pop(),ps=fs[fs.length-1]||null}var hs=1;function gs(e,t=!1){hs+=e,e<0&&ps&&t&&(ps.hasOnce=!0)}function _s(e){return e.dynamicChildren=hs>0?ps||f:null,ms(),hs>0&&ps&&ps.push(e),e}function J(e,t,n,r,i,a){return _s(X(e,t,n,r,i,a,!0))}function Y(e,t,n,r,i){return _s(Z(e,t,n,r,i,!0))}function vs(e){return e?e.__v_isVNode===!0:!1}function ys(e,t){return e.type===t.type&&e.key===t.key}function bs(e){}var xs=({key:e})=>e??null,Ss=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:D(e)||dn(e)||E(e)?{i:fr,r:e,k:t,f:!!n}:e);function X(e,t=null,n=null,r=0,i=null,a=e===cs?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&xs(t),ref:t&&Ss(t),scopeId:pr,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:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:fr};return s?(js(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=D(n)?8:16),hs>0&&!o&&ps&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&ps.push(c),c}var Z=Cs;function Cs(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===ua)&&(e=us),vs(e)){let r=Ts(e,t,!0);return n&&js(r,n),hs>0&&!a&&ps&&(r.shapeFlag&6?ps[ps.indexOf(e)]=r:ps.push(r)),r.patchFlag=-2,r}if(rc(e)&&(e=e.__vccOpts),t){t=ws(t);let{class:e,style:n}=t;e&&!D(e)&&(t.class=ye(e)),k(n)&&(on(n)&&!x(n)&&(n=_({},n)),t.style=me(n))}let o=D(e)?1:Yo(e)?128:Nr(e)?64:k(e)?4:E(e)?2:0;return X(e,t,n,r,i,o,a,!0)}function ws(e){return e?on(e)||xo(e)?_({},e):e:null}function Ts(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Ms(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&xs(l),ref:t&&t.ref?n&&a?x(a)?a.concat(Ss(t)):[a,Ss(t)]:Ss(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==cs?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ts(e.ssContent),ssFallback:e.ssFallback&&Ts(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&ii(u,c.clone(u)),u}function Es(e=` `,t=0){return Z(ls,null,e,t)}function Ds(e,t){let n=Z(ds,null,e);return n.staticCount=t,n}function Os(e=``,t=!1){return t?(q(),Y(us,null,e)):Z(us,null,e)}function ks(e){return e==null||typeof e==`boolean`?Z(us):x(e)?Z(cs,null,e.slice()):vs(e)?As(e):Z(ls,null,String(e))}function As(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ts(e)}function js(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(x(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),js(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!xo(t)?t._ctx=fr:r===3&&fr&&(fr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(E(t)){if(r&65){js(e,{default:t});return}t={default:t,_ctx:fr},n=32}else t=String(t),r&64?(n=16,t=[Es(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ms(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=ye([t.class,r.class]));else if(e===`style`)t.style=me([t.style,r.style]);else if(h(e)){let n=t[e],i=r[e];i&&n!==i&&!(x(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!g(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Ns(e,t,n,r=null){Wn(e,t,7,[n,r])}var Ps=eo(),Fs=0;function Is(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||Ps,a={uid:Fs++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Fe(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Do(r,i),emitsOptions:co(r,i),emit:null,emitted:null,propsDefaults:d,inheritAttrs:r.inheritAttrs,ctx:d,data:d,props:d,attrs:d,slots:d,refs:d,setupState:d,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 a.ctx={_:a},a.root=t?t.root:a,a.emit=oo.bind(null,a),e.ce&&e.ce(a),a}var Ls=null,Rs=()=>Ls||fr,zs,Bs;{let e=fe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};zs=t(`__VUE_INSTANCE_SETTERS__`,e=>Ls=e),Bs=t(`__VUE_SSR_SETTERS__`,e=>Ws=e)}var Vs=e=>{let t=Ls;return zs(e),e.scope.on(),()=>{e.scope.off(),zs(t)}},Hs=()=>{Ls&&Ls.scope.off(),zs(null)};function Us(e){return e.vnode.shapeFlag&4}var Ws=!1;function Gs(e,t=!1,n=!1){t&&Bs(t);let{props:r,children:i}=e.vnode,a=Us(e);So(e,r,a,t),Fo(e,i,n||t);let o=a?Ks(e,t):void 0;return t&&Bs(!1),o}function Ks(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Sa);let{setup:r}=n;if(r){it();let n=e.setupContext=r.length>1?ec(e):null,i=Vs(e),a=Un(r,e,0,[e.props,n]),o=A(a);if(at(),i(),(o||e.sp)&&!Li(e)&&si(e),o){if(a.then(Hs,Hs),t)return a.then(n=>{Bs(!0);try{qs(e,n,t)}finally{Bs(!1)}}).catch(t=>{Gn(t,e,0)});e.asyncDep=a}else qs(e,a,t)}else Qs(e,t)}function qs(e,t,n){E(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:k(t)&&(e.setupState=vn(t)),Qs(e,n)}var Js,Ys;function Xs(e){Js=e,Ys=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,Ca))}}var Zs=()=>!Js;function Qs(e,t,n){let r=e.type;if(!e.render){if(!t&&Js&&!r.render){let t=r.template||Wa(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=_(_({isCustomElement:n,delimiters:a},i),o);r.render=Js(t,s)}}e.render=r.render||p,Ys&&Ys(e)}{let t=Vs(e);it();try{Ba(e)}finally{at(),t()}}}var $s={get(e,t){return ht(e,`get`,``),e[t]}};function ec(e){return{attrs:new Proxy(e.attrs,$s),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function tc(e){return e.exposed?e.exposeProxy||=new Proxy(vn(cn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ba)return ba[n](e)},has(e,t){return t in e||t in ba}}):e.proxy}function nc(e,t=!0){return E(e)?e.displayName||e.name:e.name||t&&e.__name}function rc(e){return E(e)&&`__vccOpts`in e}var Q=(e,t)=>Dn(e,t,Ws);function ic(e,t,n){try{gs(-1);let r=arguments.length;return r===2?k(t)&&!x(t)?vs(t)?Z(e,null,[t]):Z(e,t):Z(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&vs(n)&&(n=[n]),Z(e,t,n))}finally{gs(1)}}function ac(){}function oc(e,t,n,r){let i=n[r];if(i&&sc(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function sc(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(se(n[e],t[e]))return!1;return hs>0&&ps&&ps.push(e),!0}var cc=`3.5.43`,lc=p,uc=Hn,dc=lr,fc=dr,pc={createComponentInstance:Is,setupComponent:Gs,renderComponentRoot:uo,setCurrentRenderingInstance:mr,isVNode:vs,normalizeVNode:ks,getComponentPublicInstance:tc,ensureValidVNode:_a,pushWarningContext:Rn,popWarningContext:zn},mc=void 0,hc=typeof window<`u`&&window.trustedTypes;if(hc)try{mc=hc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var gc=mc?e=>mc.createHTML(e):e=>e,_c=`http://www.w3.org/2000/svg`,vc=`http://www.w3.org/1998/Math/MathML`,yc=typeof document<`u`?document:null,bc=yc&&yc.createElement(`template`),xc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?yc.createElementNS(_c,e):t===`mathml`?yc.createElementNS(vc,e):n?yc.createElement(e,{is:n}):yc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>yc.createTextNode(e),createComment:e=>yc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yc.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{bc.innerHTML=gc(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=bc.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Sc=`transition`,Cc=`animation`,wc=Symbol(`_vtc`),Tc={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},Ec=_({},Yr,Tc),Dc=(e=>(e.displayName=`Transition`,e.props=Ec,e))((e,{slots:t})=>ic($r,Ac(e),t)),Oc=(e,t=[])=>{x(e)?e.forEach(e=>e(...t)):e&&e(...t)},kc=e=>e?x(e)?e.some(e=>e.length>1):e.length>1:!1;function Ac(e){let t={};for(let n in e)n in Tc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=jc(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,Pc(e,t?u:s),Pc(e,t?l:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,Pc(e,d),Pc(e,p),Pc(e,f),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);Oc(i,[t,o]),Fc(()=>{Pc(t,e?c:a),Nc(t,e?u:s),kc(i)||Lc(t,r,h,o)})};return _(t,{onBeforeEnter(e){Oc(v,[e]),Nc(e,a),Nc(e,o)},onBeforeAppear(e){Oc(C,[e]),Nc(e,c),Nc(e,l)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);Nc(e,d),e._enterCancelled?(Nc(e,f),Vc(e)):(Vc(e),Nc(e,f)),Fc(()=>{e._isLeaving&&(Pc(e,d),Nc(e,p),kc(x)||Lc(e,r,g,n))}),Oc(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),Oc(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),Oc(T,[e])},onLeaveCancelled(e){D(e),Oc(S,[e])}})}function jc(e){if(e==null)return null;if(k(e))return[Mc(e.enter),Mc(e.leave)];{let t=Mc(e);return[t,t]}}function Mc(e){return ue(e)}function Nc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[wc]||(e[wc]=new Set)).add(t)}function Pc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[wc];n&&(n.delete(t),n.size||(e[wc]=void 0))}function Fc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ic=0;function Lc(e,t,n,r){let i=e._endId=++Ic,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Rc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Rc(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${Sc}Delay`),a=r(`${Sc}Duration`),o=zc(i,a),s=r(`${Cc}Delay`),c=r(`${Cc}Duration`),l=zc(s,c),u=null,d=0,f=0;t===Sc?o>0&&(u=Sc,d=o,f=a.length):t===Cc?l>0&&(u=Cc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Sc:Cc:null,f=u?u===Sc?a.length:c.length:0);let p=u===Sc&&/\b(?:transform|all)(?:,|$)/.test(r(`${Sc}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function zc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Bc(t)+Bc(e[n])))}function Bc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Vc(e){return(e?e.ownerDocument:document).body.offsetHeight}function Hc(e,t,n){let r=e[wc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Uc=Symbol(`_vod`),Wc=Symbol(`_vsh`),Gc={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Uc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Kc(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Kc(e,!0),r.enter(e)):r.leave(e,()=>{Kc(e,!1)}):Kc(e,t))},beforeUnmount(e,{value:t}){Kc(e,t)}};function Kc(e,t){e.style.display=t?e[Uc]:`none`,e[Wc]=!t}function qc(){Gc.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var Jc=Symbol(``);function Yc(e){let t=Rs();if(!t)return;let n=t.ut=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>Zc(e,n))},r=()=>{let r=e(t.proxy);t.ce?Zc(t.ce,r):Xc(t.subTree,r),n(r)};$i(()=>{ir(r)}),Qi(()=>{W(r,p,{flush:`post`});let e=new MutationObserver(r);e.observe(t.subTree.el.parentNode,{childList:!0}),na(()=>e.disconnect())})}function Xc(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{Xc(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)Zc(e.el,t);else if(e.type===cs)e.children.forEach(e=>Xc(e,t));else if(e.type===ds){let{el:n,anchor:r}=e;for(;n&&(Zc(n,t),n!==r);)n=n.nextSibling}}function Zc(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Pe(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[Jc]=r}}var Qc=/(?:^|;)\s*display\s*:/;function $c(e,t,n){let r=e.style,i=D(n),a=!1;if(n&&!i){if(t){if(D(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??tl(r,t,``)}else for(let e in t)n[e]??tl(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?tl(r,i,``):al(e,i,!D(t)&&t?t[i]:void 0,o)||tl(r,i,o)}}else if(i){if(t!==n){let e=r[Jc];e&&(n+=`;`+e),r.cssText=n,a=Qc.test(n)}}else t&&e.removeAttribute(`style`);Uc in e&&(e[Uc]=a?r.display:``,e[Wc]&&(r.display=`none`))}var el=/\s*!important$/;function tl(e,t,n){if(x(n))n.forEach(n=>tl(e,t,n));else if(n??=``,t.startsWith(`--`))el.test(n)?e.setProperty(t,n.replace(el,``),`important`):e.setProperty(t,n);else{let r=il(e,t);el.test(n)?e.setProperty(F(r),n.replace(el,``),`important`):e[r]=n}}var nl=[`Webkit`,`Moz`,`ms`],rl={};function il(e,t){let n=rl[t];if(n)return n;let r=ae(t);if(r!==`filter`&&r in e)return rl[t]=r;r=I(r);for(let n=0;n<nl.length;n++){let i=nl[n]+r;if(i in e)return rl[t]=i}return t}function al(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&D(r)&&n===r}var ol=`http://www.w3.org/1999/xlink`;function sl(e,t,n,r,i,a=Se(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(ol,t.slice(6,t.length)):e.setAttributeNS(ol,t,n):n==null||a&&!Ce(n)?e.removeAttribute(t):e.setAttribute(t,a?``:O(n)?String(n):n)}function cl(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?gc(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Ce(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function ll(e,t,n,r){e.addEventListener(t,n,r)}function ul(e,t,n,r){e.removeEventListener(t,n,r)}var dl=Symbol(`_vei`);function fl(e,t,n,r,i=null){let a=e[dl]||(e[dl]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=hl(t);r?ll(e,n,a[t]=yl(r,i),s):o&&(ul(e,n,o,s),a[t]=void 0)}}var pl=/(Once|Passive|Capture)$/,ml=/^on:?(?:Once|Passive|Capture)$/;function hl(e){let t,n;for(;(n=e.match(pl))&&!ml.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):F(e.slice(2)),t]}var gl=0,_l=Promise.resolve(),vl=()=>gl||=(_l.then(()=>gl=0),Date.now());function yl(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(x(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Wn(e,t,5,a)}}else Wn(r,t,5,[e])};return n.value=e,n.attached=vl(),n}var bl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,xl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Hc(e,r,o):t===`style`?$c(e,n,r):h(t)?g(t)||fl(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Sl(e,t,r,o))?(cl(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&sl(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Cl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!D(r)))?cl(e,ae(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),sl(e,t,r,o))};function Sl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&bl(t)&&E(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return bl(t)&&D(n)?!1:t in e}function Cl(e,t){let n=e._def.props;if(!n)return!1;let r=ae(t);return Array.isArray(n)?n.some(e=>ae(e)===r):Object.keys(n).some(e=>ae(e)===r)}var wl={};function Tl(e,t,n){let r=G(e,t);te(r)&&(r=_({},r,t));class i extends Ol{constructor(e){super(r,e,n)}}return i.def=r,i}var El=((e,t)=>Tl(e,t,bu)),Dl=typeof HTMLElement<`u`?HTMLElement:class{},Ol=class e extends Dl{constructor(e,t={},n=yu){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==yu?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(_({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,er(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e<this.attributes.length;e++)this._setAttr(this.attributes[e].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});let e=(e,t=!1)=>{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!x(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=ue(this._props[e])),(i||=Object.create(null))[ae(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)b(this,e)||Object.defineProperty(this,e,{get:()=>H(t[e])})}_resolveProps(e){let{props:t}=e,n=x(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(ae))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):wl,r=ae(e);t&&this._numberProps&&this._numberProps[r]&&(n=ue(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===wl?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(F(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(F(e),t+``):t||this.removeAttribute(F(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),_u(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=Z(this._def,_(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,te(t[0])?_({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),F(e)!==e&&t(F(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(!(n instanceof HTMLStyleElement))return n}return null}_parseSlots(){let e=this._slots={},t;for(;t=this.firstChild;){let n=t.nodeType===1&&t.getAttribute(`slot`)||`default`;(e[n]||(e[n]=[])).push(t),this.removeChild(t)}}_renderSlots(){let e=this._getSlots(),t=this._instance.type.__scopeId;for(let n=0;n<e.length;n++){let r=e[n],i=r.getAttribute(`name`)||`default`,a=this._slots[i],o=r.parentNode;if(a)for(let e of a){if(t&&e.nodeType===1){let n=t+`-s`,r=document.createTreeWalker(e,1);e.setAttribute(n,``);let i;for(;i=r.nextNode();)i.setAttribute(n,``)}o.insertBefore(e,r)}else for(;r.firstChild;)o.insertBefore(r.firstChild,r);o.removeChild(r)}}_getSlots(){let e=[this];this._teleportTargets&&e.push(...this._teleportTargets);let t=new Set;for(let n of e){let e=n.querySelectorAll(`slot`);for(let n=0;n<e.length;n++)t.add(e[n])}return Array.from(t)}_injectChildStyle(e,t){this._applyStyles(e.styles,e,t)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(e){}};function kl(e){let t=Rs();return t&&t.ce||null}function Al(){let e=kl();return e&&e.shadowRoot}function jl(e=`$style`){{let t=Rs();if(!t)return d;let n=t.type.__cssModules;return n&&n[e]||d}}var Ml=new WeakMap,Nl=new WeakMap,Pl=Symbol(`_moveCb`),Fl=Symbol(`_enterCb`),Il=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:_({},Ec,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Rs(),r=qr(),i,a;return ea(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!Vl(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(Ll),i.forEach(Rl);let r=i.filter(zl);Vc(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;Nc(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[Pl]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[Pl]=null,Pc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=sn(e),s=Ac(o),c=o.tag||cs;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[Wc]&&(i.push(t),ii(t,ti(t,s,r,n)),Ml.set(t,Bl(t.el)))}a=t.default?ai(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&ii(t,ti(t,s,r,n))}return Z(c,null,a)}}});function Ll(e){let t=e.el;t[Pl]&&t[Pl](),t[Fl]&&t[Fl]()}function Rl(e){Nl.set(e,Bl(e.el))}function zl(e){let t=Ml.get(e),n=Nl.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el,n=t.style,a=t.getBoundingClientRect(),o=1,s=1;return t.offsetWidth&&(o=a.width/t.offsetWidth),t.offsetHeight&&(s=a.height/t.offsetHeight),(!Number.isFinite(o)||o===0)&&(o=1),(!Number.isFinite(s)||s===0)&&(s=1),Math.abs(o-1)<.01&&(o=1),Math.abs(s-1)<.01&&(s=1),n.transform=n.webkitTransform=`translate(${r/o}px,${i/s}px)`,n.transitionDuration=`0s`,e}}function Bl(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function Vl(e,t,n){let r=e.cloneNode(),i=e[wc];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Rc(r);return a.removeChild(r),o}var Hl=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return x(t)?e=>L(t,e):t};function Ul(e){e.target.composing=!0}function Wl(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Gl=Symbol(`_assign`),Kl=Symbol(`_initialValue`);function ql(e,t,n){return t&&(e=e.trim()),n&&(e=le(e)),e}var Jl={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[Kl]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[Kl]=e.defaultValue.replace(/\r\n?/g,`
|
|
4
|
+
`))),e[Gl]=Hl(i);let a=r||i.props&&i.props.type===`number`;ll(e,t?`change`:`input`,t=>{t.target.composing||e[Gl](ql(e.value,n,a))}),(n||a)&&ll(e,`change`,()=>{e.value=ql(e.value,n,a)}),t||(ll(e,`compositionstart`,Ul),ll(e,`compositionend`,Wl),ll(e,`change`,Wl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Kl];delete e[Kl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Gl](ql(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Gl]=Hl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?le(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Yl={deep:!0,created(e,t,n){e[Gl]=Hl(n),ll(e,`change`,()=>{let t=e._modelValue,n=tu(e),r=e.checked,i=e[Gl];if(x(t)){let e=ke(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(C(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(nu(e,r))})},mounted:Xl,beforeUpdate(e,t,n){e[Gl]=Hl(n),Xl(e,t,n)}};function Xl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(x(t))i=ke(t,r.props.value)>-1;else if(C(t))i=t.has(r.props.value);else{if(t===n)return;i=Oe(t,nu(e,!0))}e.checked!==i&&(e.checked=i)}var Zl={created(e,{value:t},n){e.checked=Oe(t,n.props.value),e[Gl]=Hl(n),ll(e,`change`,()=>{e[Gl](tu(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Gl]=Hl(r),t!==n&&(e.checked=Oe(t,r.props.value))}},Ql={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ll(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?le(tu(e)):tu(e)),r=e.multiple,i=r?C(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?x(i)?t.slice():t:i];try{e[Gl](i)}finally{er(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Gl]=Hl(r)},mounted(e,{value:t}){eu(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Gl]=Hl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!$l(t,n[1],n[0]))&&eu(e,t)}};function $l(e,t,n){if(!n||x(e))return Oe(e,t);if(C(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function eu(e,t){let n=e.multiple,r=x(t);if(!n||r||C(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=tu(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):ke(t,o)>-1}else a.selected=t.has(o)}else if(Oe(tu(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function tu(e){return`_value`in e?e._value:e.value}function nu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ru={created(e,t,n){au(e,t,n,null,`created`)},mounted(e,t,n){au(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){au(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){au(e,t,n,r,`updated`)}};function iu(e,t){switch(e){case`SELECT`:return Ql;case`TEXTAREA`:return Jl;default:switch(t){case`checkbox`:return Yl;case`radio`:return Zl;default:return Jl}}}function au(e,t,n,r,i){let a=iu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function ou(){Jl.getSSRProps=({value:e})=>({value:e}),Zl.getSSRProps=({value:e},t)=>{if(t.props&&Oe(t.props.value,e))return{checked:!0}},Yl.getSSRProps=({value:e},t)=>{if(x(e)){if(t.props&&ke(e,t.props.value)>-1)return{checked:!0}}else if(C(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},ru.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=iu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var su=[`ctrl`,`shift`,`alt`,`meta`],cu={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>su.some(n=>e[`${n}Key`]&&!t.includes(n))},lu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=cu[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},uu={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},du=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=F(n.key);if(t.some(e=>e===r||uu[e]===r))return e(n)}))},fu=_({patchProp:xl},xc),pu,mu=!1;function hu(){return pu||=Ro(fu)}function gu(){return pu=mu?pu:zo(fu),mu=!0,pu}var _u=((...e)=>{hu().render(...e)}),vu=((...e)=>{gu().hydrate(...e)}),yu=((...e)=>{let t=hu().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Su(e);if(!r)return;let i=t._component;!E(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,xu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),bu=((...e)=>{let t=gu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=Su(e);if(t)return n(t,!0,xu(t))},t});function xu(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Su(e){return D(e)?document.querySelector(e):e}var Cu=!1,wu=()=>{Cu||(Cu=!0,ou(),qc())},Tu=s({BaseTransition:()=>$r,BaseTransitionPropsValidators:()=>Yr,Comment:()=>us,DeprecationTypes:()=>null,EffectScope:()=>Fe,ErrorCodes:()=>Vn,ErrorTypeStrings:()=>uc,Fragment:()=>cs,KeepAlive:()=>Vi,ReactiveEffect:()=>Ve,Static:()=>ds,Suspense:()=>Zo,Teleport:()=>Hr,Text:()=>ls,TrackOpTypes:()=>On,Transition:()=>Dc,TransitionGroup:()=>Il,TriggerOpTypes:()=>kn,VueElement:()=>Ol,assertNumber:()=>Bn,callWithAsyncErrorHandling:()=>Wn,callWithErrorHandling:()=>Un,camelize:()=>ae,capitalize:()=>I,cloneVNode:()=>Ts,compatUtils:()=>null,compile:()=>Eu,computed:()=>Q,createApp:()=>yu,createBlock:()=>Y,createCommentVNode:()=>Os,createElementBlock:()=>J,createElementVNode:()=>X,createHydrationRenderer:()=>zo,createPropsRestProxy:()=>La,createRenderer:()=>Ro,createSSRApp:()=>bu,createSlots:()=>ga,createStaticVNode:()=>Ds,createTextVNode:()=>Es,createVNode:()=>Z,customRef:()=>bn,defineAsyncComponent:()=>Ri,defineComponent:()=>G,defineCustomElement:()=>Tl,defineEmits:()=>Ta,defineExpose:()=>Ea,defineModel:()=>ka,defineOptions:()=>Da,defineProps:()=>wa,defineSSRCustomElement:()=>El,defineSlots:()=>Oa,devtools:()=>dc,effect:()=>et,effectScope:()=>Ie,getCurrentInstance:()=>Rs,getCurrentScope:()=>Le,getCurrentWatcher:()=>Nn,getTransitionRawChildren:()=>ai,guardReactiveProps:()=>ws,h:()=>ic,handleError:()=>Gn,hasInjectionContext:()=>Sr,hydrate:()=>vu,hydrateOnIdle:()=>ji,hydrateOnInteraction:()=>Fi,hydrateOnMediaQuery:()=>Pi,hydrateOnVisible:()=>Ni,initCustomFormatter:()=>ac,initDirectivesForSSR:()=>wu,inject:()=>xr,isMemoSame:()=>sc,isProxy:()=>on,isReactive:()=>nn,isReadonly:()=>rn,isRef:()=>dn,isRuntimeOnly:()=>Zs,isShallow:()=>an,isVNode:()=>vs,markRaw:()=>cn,mergeDefaults:()=>Fa,mergeModels:()=>Ia,mergeProps:()=>Ms,nextTick:()=>er,nodeOps:()=>xc,normalizeClass:()=>ye,normalizeProps:()=>be,normalizeStyle:()=>me,onActivated:()=>Ui,onBeforeMount:()=>Zi,onBeforeUnmount:()=>ta,onBeforeUpdate:()=>$i,onDeactivated:()=>Wi,onErrorCaptured:()=>oa,onMounted:()=>Qi,onRenderTracked:()=>aa,onRenderTriggered:()=>ia,onScopeDispose:()=>Re,onServerPrefetch:()=>ra,onUnmounted:()=>na,onUpdated:()=>ea,onWatcherCleanup:()=>Pn,openBlock:()=>q,patchProp:()=>xl,popScopeId:()=>gr,provide:()=>br,proxyRefs:()=>vn,pushScopeId:()=>hr,queuePostFlushCb:()=>ir,reactive:()=>Zt,readonly:()=>$t,ref:()=>V,registerRuntimeCompiler:()=>Xs,render:()=>_u,renderList:()=>ha,renderSlot:()=>K,resolveComponent:()=>la,resolveDirective:()=>fa,resolveDynamicComponent:()=>da,resolveFilter:()=>null,resolveTransitionHooks:()=>ti,setBlockTracking:()=>gs,setDevtoolsHook:()=>fc,setTransitionHooks:()=>ii,shallowReactive:()=>Qt,shallowReadonly:()=>en,shallowRef:()=>fn,ssrContextKey:()=>Cr,ssrUtils:()=>pc,stop:()=>tt,toDisplayString:()=>je,toHandlerKey:()=>oe,toHandlers:()=>va,toRaw:()=>sn,toRef:()=>wn,toRefs:()=>xn,toValue:()=>gn,transformVNodeArgs:()=>bs,triggerRef:()=>hn,unref:()=>H,useAttrs:()=>Ma,useCssModule:()=>jl,useCssVars:()=>Yc,useHost:()=>kl,useId:()=>oi,useModel:()=>io,useSSRContext:()=>wr,useShadowRoot:()=>Al,useSlots:()=>ja,useTemplateRef:()=>ci,useTransitionState:()=>qr,vModelCheckbox:()=>Yl,vModelDynamic:()=>ru,vModelRadio:()=>Zl,vModelSelect:()=>Ql,vModelText:()=>Jl,vShow:()=>Gc,version:()=>cc,warn:()=>lc,watch:()=>W,watchEffect:()=>Tr,watchPostEffect:()=>Er,watchSyncEffect:()=>Dr,withAsyncContext:()=>Ra,withCtx:()=>U,withDefaults:()=>Aa,withDirectives:()=>vr,withKeys:()=>du,withMemo:()=>oc,withModifiers:()=>lu,withScopeId:()=>_r}),Eu=()=>{},Du={bus:{agentManifestChanged:`agent:manifest:changed`,agentToolRegistered:`agent:tool:registered`,agentToolUnregistered:`agent:tool:unregistered`,agentResourceRegistered:`agent:resource:registered`,agentResourceUnregistered:`agent:resource:unregistered`},client:{isTrustedUpdated:`rpc:is-trusted:updated`,error:`rpc:error`,connectionStatus:`connection:status`,connectionError:`connection:error`},broadcast:{authRevoked:`devframe:auth:revoked`,clientStateUpdated:`devframe:rpc:client-state:updated`,clientStatePatch:`devframe:rpc:client-state:patch`,streamingChunk:`devframe:streaming:chunk`,streamingEnd:`devframe:streaming:end`,streamingUploadCancel:`devframe:streaming:upload-cancel`},inPageChannel:{panelStateUpdated:`devframe:in-page:panel-state:updated`,panelStatePatch:`devframe:in-page:panel-state:patch`},postMessage:{remoteAssetsError:`devframe:remote-assets-error`,inPageChannel:`devframe:in-page-channel`}},Ou=`__connection.json`,ku=`__DEVFRAME_CONNECTION__`,Au=`x-birpc-session`,ju=`__rpc-dump/index.json`,Mu=`devframe:services`,Nu=`devframe_otp`,Pu=`devframe_auth_token`;Du.postMessage.remoteAssetsError;function Fu(e){return typeof e==`string`?`'${e}'`:new zu().serialize(e)}var Iu=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Lu=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Iu.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Ru(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Lu[n]?Lu[n]:n+128,s=a<128&&Lu[a]?Lu[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var zu=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Ru(e,t):n===`number`&&r===`number`?e-t:Ru(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Ru),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})();function Bu(e,t){return e===t||Fu(e)===Fu(t)}var Vu=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],Hu=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Uu=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,Wu=[],Gu=class{_data=new Ku;_hash=new Ku([...Vu]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)Wu[n]=e[t+n]|0;else{let e=Wu[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=Wu[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;Wu[n]=t+Wu[n-7]+i+Wu[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+Hu[n]+Wu[n],g=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=Ku.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new Ku(t,i)}},Ku=class e{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=t===void 0?e.length*4:t}static fromUtf8(t){let n=unescape(encodeURIComponent(t)),r=n.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=this.words[t>>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6<this.sigBytes*8;n++)e.push(Uu.charAt(a>>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function qu(e){return new Gu().finalize(e).toBase64()}function Ju(e){return qu(Fu(e))}function Yu(e){return Ju(e)}var Xu=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>Yu(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}};function Zu(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e<i.length;e++)a+=i[e],e<t.length&&(a+=String(t[e]));return`${n}${a}${r}`}return`${n}${String(e)}${r}`})}var Qu={blue:Zu(34,39),cyan:Zu(36,39),gray:Zu(90,39),green:Zu(32,39),red:Zu(31,39),yellow:Zu(33,39),bold:Zu(1,22),dim:Zu(2,22),reset:Zu(0,0),underline:Zu(4,24)};function $u(e,...t){return typeof e==`function`?e(...t):e}var ed=Error.captureStackTrace,td=class e extends Error{name;code;docs;fix;sources;data;get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.code=this.name=t.code,this.fix=t.fix,this.docs=t.docs,this.sources=t.sources,this.data=t.data,ed?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,data:this.data,stack:this.stack}}};function nd(e,t){return typeof e==`string`?`${e}/${t.toLowerCase()}`:e?.(t)}function rd(e){let t=e.reporters??[],n={},{docsBase:r}=e;for(let i of Object.keys(e.codes)){let a=e.codes[i],o=a.docs===!1?void 0:a.docs||nd(r,i),s=(e={},n={})=>{let r=new td({code:i,why:$u(a.why,e),fix:$u(a.fix,e),docs:o,cause:e.cause,sources:e.sources,data:$u(a.data,e)},s);for(let e of t)e(r,n);return r};n[i]=s}return n}function id(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n<r.length-1?`├▶`:`╰▶`)} ${t}`)].join(`
|
|
5
|
+
`)}}var ad=id(Qu);function od(e,{method:t=`warn`}={}){console[t](ad(e))}function sd(e){return rd({...e,reporters:[od,...e.reporters??[]]})}var cd=sd({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function ld(e){if(e.agent&&e.jsonSerializable===!1)throw cd.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function ud(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function dd(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function fd(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=await ud(i,n[r]);if(a.issues)throw cd.DF0043({name:e,index:r,issues:dd(a.issues)})}return r}async function pd(e,t,n){if(!t)return n;let r=await ud(t,n);if(r.issues)throw cd.DF0044({name:e,issues:dd(r.issues)});return n}async function md(e,t){if(!e.setup)return{};if(typeof t==`object`&&t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||(r=Promise.resolve(e.setup(t)),r.catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function hd(e,t){let n=e.handler;if(!n){let r=await md(e,t);if(!r.handler)throw cd.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await fd(e.name,r,t),o=await a(...n);return await pd(e.name,i,o)}}var gd=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return hd(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw cd.DF0021({name:e.name});ld(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw cd.DF0022({name:e.name});ld(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await hd(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw cd.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function _d(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw yd(t,`undefined`,r,e);return n}return i!==null&&vd(i,r,e,t),n})}function vd(e,t,n,r){if(typeof e==`bigint`)throw yd(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw yd(r,`Map`,t,n);if(e instanceof Set)throw yd(r,`Set`,t,n);if(e instanceof Date)throw yd(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw yd(r,e.constructor?.name??`class instance`,t,n)}function yd(e,t,n,r){let i=bd(n,r);return cd.DF0020({name:e||`<anonymous>`,type:t,path:i})}function bd(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}function xd(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e<t;e++){let t=r[e];t&&t(...n)}}function n(n,...r){t(n,...r),delete e[n]}function r(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var Sd=/^[\w+.-]{2,}:\/\//;function Cd(e){return e.endsWith(`/`)?e:`${e}/`}function wd(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function Td(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?Cd(n)+e.replace(/^\.?\//,``):e);return n}function Ed(e,t){if(!t||t===`/`||Sd.test(e))return e;let n=wd(t);return e.startsWith(n)?e:Td(n,e)}function Dd(e,t){let n=e.match(Sd);return t+(n?e.slice(n[0].length):e)}var Od=`__DEVFRAME_CONNECTION_META__`,kd=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function Ad(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function jd(){return Ad(ku)}function Md(){return Ad(Od)}function Nd(e){if(e)return e;try{let e=localStorage.getItem(kd);if(e)return e}catch{}return Ad(kd)}function Pd(e){globalThis[ku]=e,globalThis[Od]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&Fd(e.authToken)}function Fd(e){try{localStorage.setItem(kd,e)}catch{}globalThis[kd]=e;let t=jd();t&&(globalThis[ku]={...t,authToken:e})}function Id(e){let t=Ed(Ou,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function Ld(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function Rd(){let e=jd();if(e)return Ld(e,Nd()??e.authToken??e.connectionMeta.authToken);let t=Md();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??Id(`./`),authToken:Nd(t.authToken)}}async function zd(e={}){if(e.connection){let t=Ld(e.connection,Nd(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return Pd(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:Id(t[0]??`./`),authToken:Nd(e.authToken??e.connectionMeta.authToken)};return Pd(n),n}let n=Rd();if(n){let t=Ld(n,Nd(e.authToken??n.authToken??n.connectionMeta.authToken));return Pd(t),t}let r=[];for(let n of t){let t=Ed(Ou,n),i=Id(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a=n.url||i,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,a).href:a,authToken:Nd(e.authToken??r.authToken)};return Pd(o),o}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var Bd=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function Vd(e=Nu){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function Hd(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function Ud(e=Nu){let t=Vd(e);return t&&Hd(e),t}async function Wd(e,t={}){let n=Ud(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function Gd(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(Mu,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}var Kd=Symbol.for(`immer-nothing`),qd=Symbol.for(`immer-draftable`),Jd=Symbol.for(`immer-state`);function Yd(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Xd=Object,Zd=Xd.getPrototypeOf,Qd=`constructor`,$d=`prototype`,ef=`configurable`,tf=`enumerable`,nf=`writable`,rf=`value`,af=e=>!!e&&!!e[Jd];function of(e){return e?lf(e)||gf(e)||!!e[qd]||!!e[Qd]?.[qd]||_f(e)||vf(e):!1}var sf=Xd[$d][Qd].toString(),cf=new WeakMap;function lf(e){if(!e||!yf(e))return!1;let t=Zd(e);if(t===null||t===Xd[$d])return!0;let n=Xd.hasOwnProperty.call(t,Qd)&&t[Qd];if(n===Object)return!0;if(!bf(n))return!1;let r=cf.get(n);return r===void 0&&(r=Function.toString.call(n),cf.set(n,r)),r===sf}function uf(e,t,n=!0){df(e)===0?(n?Reflect.ownKeys(e):Xd.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function df(e){let t=e[Jd];return t?t.type_:gf(e)?1:_f(e)?2:vf(e)?3:0}var ff=(e,t,n=df(e))=>n===2?e.has(t):Xd[$d].hasOwnProperty.call(e,t),pf=(e,t,n=df(e))=>n===2?e.get(t):e[t],mf=(e,t,n,r=df(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function hf(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var gf=Array.isArray,_f=e=>e instanceof Map,vf=e=>e instanceof Set,yf=e=>typeof e==`object`,bf=e=>typeof e==`function`,xf=e=>typeof e==`boolean`;function Sf(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Cf=e=>yf(e)?e?.[Jd]:null,wf=e=>e.copy_||e.base_,Tf=e=>e.modified_?e.copy_:e.base_;function Ef(e,t){if(_f(e))return new Map(e);if(vf(e))return new Set(e);if(gf(e))return Array[$d].slice.call(e);let n=lf(e);if(t===!0||t===`class_only`&&!n){let t=Xd.getOwnPropertyDescriptors(e);delete t[Jd];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[nf]===!1&&(a[nf]=!0,a[ef]=!0),(a.get||a.set)&&(t[i]={[ef]:!0,[nf]:!0,[tf]:a[tf],[rf]:e[i]})}return Xd.create(Zd(e),t)}{let t=Zd(e);if(t!==null&&n)return{...e};let r=Xd.create(t);return Xd.assign(r,e)}}function Df(e,t=!1){return Af(e)||af(e)||!of(e)?e:(df(e)>1&&Xd.defineProperties(e,{set:kf,add:kf,clear:kf,delete:kf}),Xd.freeze(e),t&&uf(e,(e,t)=>{Df(t,!0)},!1),e)}function Of(){Yd(2)}var kf={[rf]:Of};function Af(e){return e===null||!yf(e)||Xd.isFrozen(e)}var jf=`MapSet`,Mf=`Patches`,Nf=`ArrayMethods`,Pf={};function Ff(e){let t=Pf[e];return t||Yd(0,e),t}var If=e=>!!Pf[e];function Lf(e,t){Pf[e]||(Pf[e]=t)}var Rf,zf=()=>Rf,Bf=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:If(jf)?Ff(jf):void 0,arrayMethodsPlugin_:If(Nf)?Ff(Nf):void 0});function Vf(e,t){t&&(e.patchPlugin_=Ff(Mf),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hf(e){Uf(e),e.drafts_.forEach(Gf),e.drafts_=null}function Uf(e){e===Rf&&(Rf=e.parent_)}var Wf=e=>Rf=Bf(Rf,e);function Gf(e){let t=e[Jd];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Kf(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Jd].modified_&&(Hf(t),Yd(4)),of(e)&&(e=qf(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[Jd].base_,e,t)}else e=qf(t,n);return Jf(t,e,!0),Hf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===Kd?void 0:e}function qf(e,t){if(Af(t))return t;let n=t[Jd];if(!n)return np(t,e.handledSet_,e);if(!Xf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);ep(n,e)}return n.copy_}function Jf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Df(t,n)}function Yf(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Xf=(e,t)=>e.scope_===t,Zf=[];function Qf(e,t,n,r){let i=wf(e),a=e.type_;if(r!==void 0&&pf(i,r,a)===t){mf(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;uf(i,(e,n)=>{if(af(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??Zf;for(let e of o)mf(i,e,n,a)}function $f(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!Xf(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Tf(i);Qf(e,i.draft_??i,a,n),ep(i,r)})}function ep(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}Yf(e)}}function tp(e,t,n){let{scope_:r}=e;if(af(n)){let i=n[Jd];Xf(i,r)&&i.callbacks_.push(function(){dp(e),Qf(e,n,Tf(i),t)})}else of(n)&&e.callbacks_.push(function(){let i=wf(e);e.type_===3?i.has(n)&&np(n,r.handledSet_,r):pf(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&np(pf(e.copy_,t,e.type_),r.handledSet_,r)})}function np(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||af(e)||t.has(e)||!of(e)||Af(e)?e:(t.add(e),uf(e,(r,i)=>{if(af(i)){let t=i[Jd];Xf(t,n)&&(mf(e,r,Tf(t),e.type_),Yf(t))}else of(i)&&np(i,t,n)}),e)}function rp(e,t){let n=gf(e),r={type_:+!!n,scope_:t?t.scope_:zf(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=ip;n&&(i=[r],a=ap);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var ip={get(e,t){if(t===Jd)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=wf(e);if(!ff(i,t,e.type_))return cp(e,i,t);let a=i[t];if(e.finalized_||!of(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Sf(t))return a;if(a===op(e.base_,t)||sp(e,t,a)){dp(e);let n=e.type_===1?+t:t,r=pp(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in wf(e)},ownKeys(e){return Reflect.ownKeys(wf(e))},set(e,t,n){let r=lp(wf(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=op(wf(e),t),i=r?.[Jd];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(hf(n,r)&&(n!==void 0||ff(e.base_,t,e.type_)))return!0;dp(e),up(e)}return e.copy_[t]===n&&(n!==void 0||ff(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])?!0:(e.copy_[t]=n,e.assigned_.set(t,!0),tp(e,t,n),!0)},deleteProperty(e,t){return dp(e),op(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),up(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=wf(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[nf]:!0,[ef]:e.type_!==1||t!==`length`,[tf]:r[tf],[rf]:n[t]}},defineProperty(){Yd(11)},getPrototypeOf(e){return Zd(e.base_)},setPrototypeOf(){Yd(12)}},ap={};for(let e in ip){let t=ip[e];ap[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}ap.deleteProperty=function(e,t){return ap.set.call(this,e,t,void 0)},ap.set=function(e,t,n){return ip.set.call(this,e[0],t,n,e[0])};function op(e,t){let n=e[Jd];return(n?wf(n):e)[t]}function sp(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!of(n)||n[Jd]?!1:e.baseRefs_.has(n)}function cp(e,t,n){let r=lp(t,n);return r?rf in r?r[rf]:r.get?.call(e.draft_):void 0}function lp(e,t){if(!(t in e))return;let n=Zd(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Zd(n)}}function up(e){e.modified_||(e.modified_=!0,e.parent_&&up(e.parent_))}function dp(e){e.copy_||=(e.assigned_=new Map,Ef(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var fp=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(bf(e)&&!bf(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}bf(t)||Yd(6),n!==void 0&&!bf(n)&&Yd(7);let r;if(of(e)){let i=Wf(this),a=pp(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Hf(i):Uf(i)}return Vf(i,n),Kf(r,i)}if(!e||!yf(e)){if(r=t(e),r===void 0&&(r=e),r===Kd&&(r=void 0),this.autoFreeze_&&Df(r,!0),n){let t=[],i=[];Ff(Mf).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}Yd(1,e)},this.produceWithPatches=(e,t)=>{if(bf(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},xf(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),xf(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),xf(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){of(e)||Yd(8),af(e)&&(e=mp(e));let t=Wf(this),n=pp(t,e,void 0);return n[Jd].isManual_=!0,Uf(t),n}finishDraft(e,t){let n=e&&e[Jd];(!n||!n.isManual_)&&Yd(9);let{scope_:r}=n;return Vf(r,t),Kf(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=Ff(Mf).applyPatches_;return af(e)?r(e,t):this.produce(e,e=>r(e,t))}};function pp(e,t,n,r){let[i,a]=_f(t)?Ff(jf).proxyMap_(t,n):vf(t)?Ff(jf).proxySet_(t,n):rp(t,n);return(n?.scope_??zf()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?$f(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function mp(e){return af(e)||Yd(10,e),hp(e)}function hp(e){if(!of(e)||Af(e))return e;let t=e[Jd],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ef(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ef(e,!0);return uf(n,(e,t)=>{mf(n,e,hp(t))},r),t&&(t.finalized_=!1),n}function gp(){function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=Cf(pf(e,n.key_)),i=pf(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||ff(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=pf(n,r),!yf(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[Jd];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;uf(e.assigned_,(e,l)=>{let u=pf(o,e,c),f=pf(s,e,c),p=l?ff(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===Kd?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=df(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===Qd)&&Yd(19),bf(o)&&n===$d&&Yd(19),o=pf(o,n),(o===null||!yf(o))&&Yd(18,i.join(`/`))}let s=df(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:Yd(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:Yd(17,a)}}),e}function u(e){if(!of(e))return e;if(gf(e))return e.map(u);if(_f(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(vf(e))return new Set(Array.from(e).map(u));let t=Object.create(Zd(e));for(let n in e)t[n]=u(e[n]);return ff(e,qd)&&(t[qd]=e[qd]),t}function d(e){return af(e)?u(e):e}Lf(Mf,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var _p=new fp,vp=_p.produce,yp=_p.produceWithPatches.bind(_p),bp=_p.applyPatches.bind(_p),xp=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function Sp(e=21){let t=``,n=e;for(;n--;)t+=xp[Math.random()*64|0];return t}var Cp=1e3;function wp(e,t){if(e.add(t),e.size>Cp){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function Tp(e){let{enablePatches:t=!1}=e;t&&gp();let n=xd(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=Sp())=>{i.has(t)||(gp(),r=bp(r,e),wp(i,t),n.emit(`updated`,r,void 0,t))},mutate:(e,a=Sp())=>{if(!i.has(a)){if(wp(i,a),t){let[t,i]=yp(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,a)}else{let t=vp(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,a)}}},syncIds:i}}function Ep(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:Du.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>o(e,n),r)}}),e.client.register({name:Du.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function s(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(c,l)=>{if(l?.initialValue!==void 0&&r.set(c,l.initialValue),t.has(c))return t.get(c);let u=Tp({initialValue:l?.initialValue,enablePatches:!1});async function d(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,c),l?.initialValue!==void 0){t.set(c,u);for(let e of i)e(c);return e.call(`devframe:rpc:server-state:get`,c).then(e=>{e!==void 0&&u.mutate(()=>o(c,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(c,s(c,u)),u}{let r=await e.call(`devframe:rpc:server-state:get`,c);u.mutate(()=>o(c,r)),t.set(c,u);for(let e of i)e(c);return n.set(c,s(c,u)),u}}return new Promise(t=>{if(e.isTrusted)d().then(t);else{t(u);let n=!1;e.events.on(Du.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,d())})}})}}}var Dp=typeof self==`object`?self:globalThis,Op=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),kp=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function Ap(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=Op.has(e)?Dp[e]:void 0;return n(new(r??Dp.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&kp.has(a))return n(new Dp[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function jp(e){return Ap(new Map,e)(0)}var Mp=``,{toString:Np}={},{keys:Pp}=Object;function Fp(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Np.call(e).slice(8,-1);switch(n){case`Array`:return[1,Mp];case`Object`:return[2,Mp];case`Date`:return[3,Mp];case`RegExp`:return[4,Mp];case`Map`:return[5,Mp];case`Set`:return[6,Mp];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function Ip([e,t]){return e===0&&(t===`function`||t===`symbol`)}function Lp(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Fp(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Pp(r))(e||!Ip(Fp(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Ip(Fp(n))||Ip(Fp(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Ip(Fp(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function Rp(e,t={}){let n=[];return Lp(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:zp,stringify:Bp}=JSON,Vp={json:!0,lossy:!0};function Hp(e){return jp(zp(e))}function Up(e){return Bp(Rp(e,Vp))}function Wp(e){return jp(e)}function Gp(e){return Up(e)}function Kp(e){return Hp(e)}var qp=new Map;function Jp(e=qp){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?_d(n,r??``):`s:${Gp(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?Kp(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function Yp(){}function Xp(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function Zp(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function Qp(e){let{onConnected:t=Yp,onError:n=Yp,onDisconnected:r=Yp,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${Pu}=${encodeURIComponent(e.authToken)}`);let s=Jp(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function h(e){l||(l=!0,p(e),n(e),r())}function g(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function _(e,n){if(e===`session`){f(n),t();return}u?.(n)}async function v(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=Xp(r);if(!e)break;r=e.rest;let{event:t,data:n}=Zp(e.frame);n.length>0&&_(t,n.join(`
|
|
6
|
+
`))}}g()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await v(e.body)}catch(e){if(c.signal.aborted){g();return}h(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l){n(Error(`Devframe SSE channel is closed; message dropped`));return}try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[Au]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function $p(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var em=Math.random.bind(Math),tm=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function nm(e=21){let t=``,n=e;for(;n--;)t+=tm[em()*64|0];return t}var rm=6e4,im=e=>e,am=im,{clearTimeout:om,setTimeout:sm}=globalThis;function cm(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=im,deserialize:s=am,resolver:c,bind:l=`rpc`,timeout:u=rm,proxify:d=!0}=t,f=!1,p=new Map,m,h;async function g(e,r,i,a){if(f)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(m)try{await m}finally{m=void 0}let{promise:l,resolve:d,reject:g}=$p(),_=nm();s.i=_;let v;async function y(n=s){return u>=0&&(v=sm(()=>{try{if(t.onTimeoutError?.call(h,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){g(e)}p.delete(_)},u),typeof v==`object`&&(v=v.unref?.())),p.set(_,{resolve:d,reject:g,timeoutId:v,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(h,s,y,d):await y()}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}finally{om(v),p.delete(_)}return l}let _={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:y,get $closed(){return f},get $meta(){return t.meta},$close:v,$functions:e};h=d?new Proxy({},{get(t,n){if(Object.hasOwn(_,n))return _[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>g(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):_;function v(e){f=!0,p.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),p.clear(),i(b)}function y(e){let t=Array.from(p.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return p.clear(),t}async function b(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(h,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(h,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?h:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(h,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(h,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(h,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=p.get(e);r&&(om(r.timeoutId),n?r.reject(n):r.resolve(t)),p.delete(e)}}return m=r(b),h}function lm(e,t){let{channel:n,rpcOptions:r={}}=t;return cm(e,{...n,timeout:-1,...r,proxify:!1})}function um(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:s=0}=e,c=!1,l=`connecting`,u=null,d=Promise.withResolvers();function f(e,t=null){if(t?u=t:e===`connected`&&(u=null),e===l)return;let n=l;l=e,i.emit(Du.client.connectionStatus,e,n)}let p=new Set;function m(e){for(let t of[...p])t.reject(e)}function h(){return l===`disconnected`||l===`error`?new Bd(`connection`,`[devframe] Not connected to the devframe server`,{cause:u??void 0}):l===`unauthorized`?new Bd(`auth`,`[devframe] Not authorized by the devframe server`,{cause:u??void 0}):null}function g(e,t){return new Promise((n,r)=>{let a=!1,o,c={reject(e){a||(l(),i.emit(Du.client.error,e,t),r(e))}};function l(){a=!0,p.delete(c),o&&clearTimeout(o)}p.add(c),s>0&&(o=setTimeout(()=>{c.reject(new Bd(`timeout`,`[devframe] RPC call "${t}" timed out after ${s}ms`))},s)),e.then(e=>{a||(l(),n(e))},e=>{if(a)return;l();let n=e instanceof Error?e:Error(String(e));i.emit(Du.client.error,n,t),r(n)})})}let _=new Map;for(let e of r.jsonSerializableMethods??[])_.set(e,{jsonSerializable:!0});let v=e.createChannel({definitions:_,onError(e){f(`error`,e),i.emit(Du.client.connectionError,e),m(new Bd(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){l!==`error`&&f(`disconnected`),m(new Bd(`connection`,`[devframe] Disconnected from the devframe server`,{cause:u??void 0}))}}),y=lm(a.functions,{channel:v,rpcOptions:o});a.register({name:Du.broadcast.authRevoked,type:`event`,handler:()=>{c=!1;let e=new Bd(`auth`,`[devframe] The devframe server revoked this client's trust`);f(`unauthorized`,e),i.emit(Du.client.connectionError,e),m(e),i.emit(Du.client.isTrustedUpdated,!1)}});let b=n;async function x(e){b=e;let t=await y.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(c=t.isTrusted,c)d.resolve(!0),f(`connected`);else{let e=new Bd(`auth`,`[devframe] The devframe server refused this client's credentials`);f(`unauthorized`,e),i.emit(Du.client.connectionError,e)}return i.emit(Du.client.isTrustedUpdated,c),t.isTrusted}async function S(e){let t=(await y.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(b=t,c=!0,d.resolve(!0),f(`connected`),i.emit(Du.client.isTrustedUpdated,!0)),t}async function C(e={}){await y.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function w(){return c?!0:x(b??``)}async function T(e=6e4){if(c&&d.resolve(!0),e<=0)return d.promise;let t;try{return await Promise.race([d.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),c}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return c},get status(){return l},get connectionError(){return u},requestTrust:w,requestTrustWithToken:x,requestTrustWithCode:S,requestAuthCode:C,ensureTrusted:T,call:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(Du.client.error,n,t),Promise.reject(n)):g(y.$call(...e),t)},callEvent:(...e)=>{let t=h();if(t){i.emit(Du.client.error,t,String(e[0]));return}return y.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=h();return n?(i.emit(Du.client.error,n,t),Promise.reject(n)):g(y.$callOptional(...e),t)},close:()=>{v.close()}}}function dm(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function fm(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=dm(n.sse,r??`./`,location);return um({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Qp({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function pm(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:mm(r)?pm(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function mm(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function hm(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function gm(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function _m(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function vm(e){if(e.error)throw pm(e.error);return e.output}function ym(e){return e.some(e=>e!=null)}function bm(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function xm(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?Wp(e):e}function a(e,t){return i(bm(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return _m(r)?vm(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if(hm(r)){if(ym(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(gm(r)){let e=Yu(n),i=r.records[e];if(i)return vm(await s(i,r.serialization));if(r.fallback)return vm(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!ym(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function Sm(e){let t=xm(await e.fetchJsonFromBases(ju),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var Cm=256,wm=class extends Error{name=`StreamClosedError`};function Tm(e={}){let t=e.id??Sp(),n=Math.max(0,e.replayWindow??0),r=xd(),i=new AbortController,a=[],o=!1,s=0;function c(e){if(o)throw new wm(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(a.push({seq:s,chunk:e}),a.length>n&&(a.length-n===1?a.shift():a.splice(0,a.length-n))),r.emit(`chunk`,s,e)}function l(e){if(o)return;o=!0;let t=Dm(e);i.abort(e),r.emit(`end`,t)}function u(){o||(o=!0,i.signal.aborted||i.abort(`stream closed`),r.emit(`end`,void 0))}function d(e){o||i.signal.aborted||i.abort(e??`aborted`)}let f=new WritableStream({write(e){c(e)},close(){u()},abort(e){l(e)}});return{id:t,signal:i.signal,get closed(){return o},get lastSeq(){return s},write:c,error:l,close:u,abort:d,writable:f,events:r,buffer:a}}function Em(e={}){let t=e.id??Sp(),n=Math.max(1,e.highWaterMark??Cm),r=[],i=0,a=!1,o=!1,s,c,l,u;function d(){if(c){if(r.length>0){let e=r.shift(),t=c;c=void 0,t.resolve({value:e,done:!1});return}if(a){let e=c;if(c=void 0,s){let t=Error(s.message);t.name=s.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function f(){if(l){for(;r.length>0;){let e=r.shift();try{l.enqueue(e)}catch{break}}if(a&&l){try{if(s){let e=Error(s.message);e.name=s.name,l.error(e)}else l.close()}catch{}l=void 0}}}function p(t,s){if(!(a||o)&&!(t<=i)){if(i=t,r.push(s),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}d(),u&&f()}}function m(e){a||(a=!0,s=e,d(),u&&f())}function h(){o||a||(o=!0,e.onCancel?.(),m(void 0))}function g(){return u||(u=new ReadableStream({start(e){l=e,f()},cancel(){h()}}),u)}return{id:t,get cancelled(){return o},get done(){return a},get lastSeenSeq(){return i},get readable(){return g()},cancel:h,_push:p,_end:m,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(a){if(s){let e=Error(s.message);return e.name=s.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{c={resolve:e,reject:t}})},return(){return h(),Promise.resolve({value:void 0,done:!0})}}}}}function Dm(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var Om=``;function km(e,t){return`${e}${Om}${t}`}function Am(e){let t=new Map,n=new Map;e.client.register({name:Du.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(km(e,n))?._push(r,i)}}),e.client.register({name:Du.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=km(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:Du.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=km(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(Du.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(Om);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=km(n,r),o=t.get(a);if(o)return o;let s=Em({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,s),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(Du.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!s.cancelled&&!s.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:s.lastSeenSeq}))})}return s}function i(t,r){let i=km(t,r),a=n.get(i);if(a)return a;let o=Tm({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function jm(){}var Mm=new Map;function Nm(e){let t=e.url;e.authToken&&(t=`${t}?${Pu}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=jm,onError:i=jm,onDisconnected:a=jm,definitions:o=Mm}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=Jp(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN){n.send(e);return}if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r);return}i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function Pm(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return Dd(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function Fm(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=Pm(n.websocket,r??`./`,location);return um({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Nm({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function Im(e){return e.includes(`:`)}function Lm(e,t){return Im(t)?t:`${e}:${t}`}function Rm(e){return{async get(t){return(await e()).value()[t]},async set(t,n){(await e()).mutate(e=>{e[t]=n})},async delete(t){(await e()).mutate(e=>{delete e[t]})},async all(){return(await e()).value()},async onChange(t){return(await e()).on(`updated`,e=>t(e))}}}function zm(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=e.sharedState.get(r,{initialValue:{}}),i}return Rm(a)}function Bm(e,t){return{global:zm(e,t,`global`),project:zm(e,t,`project`)}}function Vm(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(Im(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call(Lm(t,n),...r)),callEvent:((n,...r)=>e.callEvent(Lm(t,n),...r)),callOptional:((n,...r)=>e.callOptional(Lm(t,n),...r)),sharedState:((n,r)=>e.sharedState.get(Lm(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe(Lm(t,n),r,i),upload:(n,r)=>e.streaming.upload(Lm(t,n),r)}},settings:Bm(e,t),scope:e.scope}}var Hm=128;function Um(e){return e.replace(/[^\w-]+/g,`_`).slice(0,Hm)}function Wm(e,t){return t.safety?t.safety:e===`static`||e===`query`||e==null?`read`:`action`}var Gm=Object.freeze({type:`object`,additionalProperties:!0});function Km(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return Gm}return Gm}function qm(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;r<e.length;r++){let i=`arg${r}`;t[i]=Km(e[r]),n.push(i)}return{type:`object`,properties:t,required:n,additionalProperties:!1}}function Jm(e,t){if(Array.isArray(e))return e;if(e==null)return[];if(typeof e!=`object`)return;let n=e;if(t!=null)return Array.from({length:t},(e,t)=>n[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function Ym(e,t){return Jm(e,t)??[e]}function Xm(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function Zm(e,t={}){let n=t.modelContext??Xm();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=Um(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=Wm(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:qm(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>Qm(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function Qm(e,t,n){try{let r=Ym(n,e.args?.length);return{content:[{type:`text`,text:$m(await(await hd(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:eh(e)}]}}}function $m(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function eh(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}var th=`modulepreload`,nh=function(e,t){return new URL(e,t).href},rh={},ih=function(e){return e.pathname.endsWith(`.css`)},ah=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=nh(t,n);let r=s(t);if(r.href in rh)return;rh[r.href]=!0;let i=ih(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:th,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function oh(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function sh(e={}){let{baseURL:t=`./`,rpcOptions:n={},cacheOptions:r=!1}=e,i=xd(),a=Array.isArray(t)?t:[t],o=await zd(e),{connectionMeta:s,metaBaseUrl:c,authToken:l}=o,u=a[0]??`./`;try{u=new URL(`.`,c).href}catch{}let d=new Xu({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),f={rpc:void 0},p=new gd(f),m=e.webmcp===!1?void 0:Zm(p),h,g=!1;async function _(e){let t=[u,...a.filter(e=>e!==u)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(Ed(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let v={authToken:l,connectionMeta:s,metaBaseUrl:c,events:i,clientRpc:p,callTimeout:e.callTimeout,rpcOptions:{...n,async onRequest(e,t,i){if(await n.onRequest?.call(this,e,t,i),r&&d?.validate(e.m)){if(d.has(e.m,e.a))return i(d.cached(e.m,e.a));let n=await t(e);d.apply(e,n)}else await t(e)}}},y=oh(e.transport??`auto`,s),b=y===`static`?await Sm({fetchJsonFromBases:_}):y===`sse`?fm({...v,sseOptions:e.sseOptions}):Fm({...v,wsOptions:e.wsOptions}),x;try{x=new BroadcastChannel(`devframe-auth`)}catch{}let S,C=!1;function w(e){return((...t)=>C||!S?e(...t):S.then(()=>e(...t)))}function T(){g=!0;try{h?.(),m?.()}finally{try{x?.close()}finally{b.close?.()}}}let E={events:i,get isTrusted(){return b.isTrusted},get status(){return b.status},get connectionError(){return b.connectionError},get transport(){return b.transport??y},get connection(){return o},connectionMeta:s,ensureTrusted:b.ensureTrusted,requestTrust:b.requestTrust,requestTrustWithToken:async e=>(Fd(e),o={...o,authToken:e},b.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await b.requestTrustWithCode(e);if(!t)return!1;Fd(t),o={...o,authToken:t};try{x?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>b.requestAuthCode(e),call:w(b.call),callEvent:w(b.callEvent),callOptional:w(b.callOptional),client:p,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:d,scope:void 0,close:T};E.sharedState=Ep(E),E.streaming=Am(E),E.services=Gd(E);let D=new Map;E.scope=(e=>{if(!e)return E;let t=D.get(e);return t||(t=Vm(E,e),D.set(e,t)),t}),f.rpc=E;function O(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function k(){if(e.simpleAuth!==!1&&O()&&typeof globalThis.prompt==`function`)for(await E.requestAuthCode().catch(()=>{});!E.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await E.requestTrustWithCode(t))return}}async function A(){let t=await b.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await Wd(E,{param:n}):!1;t||r||E.isTrusted||await k()}return S=A().then(()=>{C=!0},()=>{C=!0}),s.mcp&&ah(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./browser-agent-rpc-BOWBkYow.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{g||(h=e(E))}).catch(()=>{}),x&&(x.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&E.requestTrustWithToken(e.data.authToken)}),E}var ch=sh;function lh(){if(window.parent===window)return()=>{};let e=document.documentElement,t=e.style.getPropertyValue(`--devframe-primary`),n=e.style.getPropertyPriority(`--devframe-primary`),r=!1,i=!1;return zd().then(({connectionMeta:t})=>{let n=t.configs?.ui?.branding?.primaryColor;!r&&n&&CSS.supports(`color`,n)&&(e.style.setProperty(`--devframe-primary`,n),i=!0)}).catch(()=>{}),()=>{r=!0,i&&(t?e.style.setProperty(`--devframe-primary`,t,n):e.style.removeProperty(`--devframe-primary`))}}function uh(e,t){return Le()?(Re(e,t),!0):!1}var dh=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var fh=Object.prototype.toString,ph=e=>fh.call(e)===`[object Object]`,mh=()=>{};function hh(...e){if(e.length!==1)return wn(...e);let t=e[0];return typeof t==`function`?$t(bn(()=>({get:t,set:mh}))):V(t)}function gh(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var _h=e=>e();function vh(e=_h,t={}){let{initialState:n=`active`}=t,r=hh(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:en(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function yh(e){return Array.isArray(e)?e:[e]}function bh(e){return e||Rs()}function xh(e,t,n={}){let{eventFilter:r=_h,...i}=n;return W(e,gh(r,t),i)}function Sh(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=vh(r,{initialState:i});return{stop:xh(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function Ch(e,t=!0,n){bh(n)?Qi(e,n):t?e():er(e)}function wh(e,t=1e3,n={}){let{immediate:r=!0,immediateCallback:i=!1}=n,a=null,o=fn(!1);function s(){a&&=(clearInterval(a),null)}function c(){o.value=!1,s()}function l(){let n=gn(t);n<=0||(o.value=!0,i&&e(),s(),o.value&&(a=setInterval(e,n)))}return r&&dh&&l(),(dn(t)||typeof t==`function`)&&uh(W(t,()=>{o.value&&dh&&l()})),uh(c),{isActive:en(o),pause:c,resume:l}}function Th(e,t,n){return W(e,t,{...n,immediate:!0})}var Eh=dh?window:void 0;dh&&window.document,dh&&window.navigator,dh&&window.location;function Dh(e){let t=gn(e);return t?.$el??t}function Oh(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Q(()=>{let t=yh(gn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return Th(()=>[n.value?.map(e=>Dh(e))??[Eh].filter(e=>e!=null),yh(gn(n.value?e[1]:e[0])),yh(H(n.value?e[2]:e[1])),gn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=ph(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var kh=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},Ah=`__vueuse_ssr_handlers__`,jh=Mh();function Mh(){return Ah in kh||(kh[Ah]=kh[Ah]||{}),kh[Ah]}function Nh(e,t){return jh[e]||t}function Ph(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var Fh={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},Ih=`vueuse-storage`;function Lh(e,t,n,r={}){let{flush:i=`pre`,deep:a=!0,listenToStorageChanges:o=!0,writeDefaults:s=!0,mergeDefaults:c=!1,shallow:l,window:u=Eh,eventFilter:d,onError:f=e=>{console.error(e)},initOnMounted:p}=r,m=(l?fn:V)(typeof t==`function`?t():t),h=Q(()=>gn(e));if(!n)try{n=Nh(`getDefaultStorage`,()=>Eh?.localStorage)()}catch(e){f(e)}if(!n)return m;let g=gn(t),_=Ph(g),v=r.serializer??Fh[_],{pause:y,resume:b}=Sh(m,e=>C(e),{flush:i,deep:a,eventFilter:d});W(h,()=>T(),{flush:i});let x=!1;u&&o&&(n instanceof Storage?Oh(u,`storage`,e=>{(!p||x)&&T(e)},{passive:!0}):Oh(u,Ih,e=>{(!p||x)&&E(e)})),p?Ch(()=>{x=!0,T()}):T();function S(e,t){if(u){let r={key:h.value,oldValue:e,newValue:t,storageArea:n};u.dispatchEvent(n instanceof Storage?new StorageEvent(`storage`,r):new CustomEvent(Ih,{detail:r}))}}function C(e){try{let t=n.getItem(h.value);if(e==null)S(t,null),n.removeItem(h.value);else{let r=v.write(e);t!==r&&(n.setItem(h.value,r),S(t,r))}}catch(e){f(e)}}function w(e){let t=e?e.newValue:n.getItem(h.value);if(t==null)return s&&g!=null&&n.setItem(h.value,v.write(g)),g;if(!e&&c){let e=v.read(t);return typeof c==`function`?c(e,g):_===`object`&&!Array.isArray(e)?{...g,...e}:e}return typeof t==`string`?v.read(t):t}function T(e){if(!(e&&e.storageArea!==n)){if(e&&e.key==null){m.value=g;return}if(!(e&&e.key!==h.value)){y();try{let t=v.write(m.value);(e===void 0||e?.newValue!==t)&&(m.value=w(e))}catch(e){f(e)}finally{e?er(b):b()}}}}function E(e){T(e.detail)}return m}function Rh(e,t,n={}){let{window:r=Eh}=n;return Lh(e,t,r?.localStorage,n)}var zh=Object.assign({inheritAttrs:!1},{__name:`splitpanes`,props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1},keyboardStep:{type:Number,default:5}},emits:[`ready`,`resize`,`resized`,`pane-click`,`pane-maximize`,`pane-add`,`pane-remove`,`splitter-click`,`splitter-dblclick`,`direction-changed`],setup(e,{emit:t}){let n=t,r=e,i=Ma(),a=ja(),o=V([]),s=Q(()=>o.value.reduce((e,t)=>(e[~~t.id]=t)&&e,{})),c=Q(()=>o.value.length),l=V(null),u=V(!1),d=V({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),f=V({splitter:null,timeoutId:null}),p=Q(()=>({[`splitpanes splitpanes--${r.horizontal?`horizontal`:`vertical`}`]:!0,"splitpanes--dragging":d.value.dragging,"splitpanes--ready":u.value})),m=()=>{document.addEventListener(`mousemove`,_,{passive:!1}),document.addEventListener(`mouseup`,v),`ontouchstart`in window&&(document.addEventListener(`touchmove`,_,{passive:!1}),document.addEventListener(`touchend`,v))},h=()=>{document.removeEventListener(`mousemove`,_,{passive:!1}),document.removeEventListener(`mouseup`,v),`ontouchstart`in window&&(document.removeEventListener(`touchmove`,_,{passive:!1}),document.removeEventListener(`touchend`,v))},g=(e,t)=>{let n=e.target.closest(`.splitpanes__splitter`);if(n){let{left:t,top:i}=n.getBoundingClientRect(),{clientX:a,clientY:o}=`ontouchstart`in window&&e.touches?e.touches[0]:e;d.value.cursorOffset=r.horizontal?o-i:a-t}m(),d.value.mouseDown=!0,d.value.activeSplitter=t,document.documentElement.style.cursor=r.horizontal?`row-resize`:`col-resize`},_=e=>{d.value.mouseDown&&(e.preventDefault(),d.value.dragging||(window.getSelection()?.removeAllRanges(),d.value.dragging=!0),requestAnimationFrame(()=>{T(C(e)),L(`resize`,{event:e},!0)}))},v=e=>{d.value.dragging&&(window.getSelection()?.removeAllRanges(),L(`resized`,{event:e},!0)),d.value.mouseDown=!1,d.value.activeSplitter=null,setTimeout(()=>{d.value.dragging=!1,h(),document.documentElement.style.cursor=``},100)},y=(e,t)=>{`ontouchstart`in window&&(e.preventDefault(),f.value.splitter===t?(clearTimeout(f.value.timeoutId),f.value.timeoutId=null,b(e,t),f.value.splitter=null):(f.value.splitter=t,f.value.timeoutId=setTimeout(()=>f.value.splitter=null,500))),d.value.dragging||L(`splitter-click`,{event:e,index:t},!0)},b=(e,t)=>{if(L(`splitter-dblclick`,{event:e,index:t},!0),r.maximizePanes){let n=0;o.value=o.value.map((e,r)=>(e.size=r===t?e.max:e.min,r!==t&&(n+=e.min),e)),o.value[t].size-=n,L(`pane-maximize`,{event:e,index:t,pane:o.value[t]}),L(`resized`,{event:e,index:t},!0)}},x=(e,t)=>{if(!r.keyboardStep)return;let n=r.horizontal?e.key===`ArrowDown`:e.key===`ArrowRight`,i=r.horizontal?e.key===`ArrowUp`:e.key===`ArrowLeft`;if(!n&&!i)return;e.preventDefault(),d.value.activeSplitter=t;let a=(n?1:-1)*(r.rtl&&!r.horizontal?-1:1),s=O(t)+o.value[t].size;E(Math.min(Math.max(s+a*r.keyboardStep,0),100)),L(`resize`,{event:e},!0),L(`resized`,{event:e},!0),d.value.activeSplitter=null},S=(e,t)=>{let n=s.value[t];n&&L(`pane-click`,{event:e,index:n.index,pane:n})},C=e=>{let t=l.value.getBoundingClientRect(),{clientX:n,clientY:i}=`ontouchstart`in window&&e.touches?e.touches[0]:e;return{x:n-(r.horizontal?0:d.value.cursorOffset)-t.left,y:i-(r.horizontal?d.value.cursorOffset:0)-t.top}},w=e=>{e=e[r.horizontal?`y`:`x`];let t=l.value[r.horizontal?`clientHeight`:`clientWidth`];return r.rtl&&!r.horizontal&&(e=t-e),e*100/t},T=e=>{E(w(e))},E=e=>{let t=d.value.activeSplitter;if(t===null||t>=o.value.length-1)return;let n={prevPanesSize:O(t),nextPanesSize:k(t),prevReachedMinPanes:0,nextReachedMinPanes:0},i=0+(r.pushOtherPanes?0:n.prevPanesSize),a=100-(r.pushOtherPanes?0:n.nextPanesSize);e=Math.max(Math.min(e,a),i);let s=[t,t+1],c=o.value[s[0]]||null,l=o.value[s[1]]||null,u=c!==null&&c.max<100&&e>=c.max+n.prevPanesSize,f=l!==null&&l.max<100&&e<=100-(l.max+k(t+1));if(u||f){u?(c.size=c.max,l.size=Math.min(Math.max(100-c.max-n.prevPanesSize-n.nextPanesSize,l.min),l.max)):(c.size=Math.min(Math.max(100-l.max-n.prevPanesSize-k(t+1),c.min),c.max),l.size=l.max);return}if(r.pushOtherPanes){let t=D(n,e);if(!t)return;({sums:n,panesToResize:s}=t),c=o.value[s[0]]||null,l=o.value[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(e-n.prevPanesSize-n.prevReachedMinPanes,c.min),c.max)),l!==null&&(l.size=Math.min(Math.max(100-e-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))},D=(e,t)=>{let n=d.value.activeSplitter,r=[n,n+1];if(t<e.prevPanesSize+o.value[r[0]].min){if(r[0]=A(n).index,e.prevReachedMinPanes=0,r[0]<n&&o.value.forEach((t,i)=>{i>r[0]&&i<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),r[0]===void 0)return e.prevReachedMinPanes=0,o.value[0].size=o.value[0].min,o.value.forEach((t,r)=>{r>0&&r<=n&&(t.size=t.min,e.prevReachedMinPanes+=t.min)}),o.value[r[1]].size=100-e.prevReachedMinPanes-o.value[0].min-e.prevPanesSize-e.nextPanesSize,null;e.prevPanesSize=O(r[0])}return t>100-e.nextPanesSize-o.value[r[1]].min&&(r[1]=j(n).index,e.nextReachedMinPanes=0,r[1]>n+1&&o.value.forEach((t,i)=>{i>n&&i<r[1]&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),e.nextPanesSize=r[1]===void 0?0:k(r[1]-1),r[1]===void 0)?(e.nextReachedMinPanes=0,o.value.forEach((t,r)=>{r>=n+1&&(t.size=t.min,e.nextReachedMinPanes+=t.min)}),r[0]!==void 0&&(o.value[r[0]].size=100-e.prevPanesSize-k(r[0]-1)),null):{sums:e,panesToResize:r}},O=e=>o.value.reduce((t,n,r)=>t+(r<e?n.size:0),0),k=e=>o.value.reduce((t,n,r)=>t+(r>e+1?n.size:0),0),A=e=>[...o.value].reverse().find(t=>t.index<e&&t.size>t.min)||{},j=e=>o.value.find(t=>t.index>e+1&&t.size>t.min)||{},M=()=>{let e=Array.from(l.value?.children||[]);for(let t of e){let e=t.classList.contains(`splitpanes__pane`),n=t.classList.contains(`splitpanes__splitter`);!e&&!n&&(t.remove(),console.warn(`Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.`))}},ee=(e,t,n=!1)=>{let i=e-1,a=document.createElement(`div`);a.classList.add(`splitpanes__splitter`),n||(a.onmousedown=e=>g(e,i),typeof window<`u`&&`ontouchstart`in window&&(a.ontouchstart=e=>g(e,i)),a.onclick=e=>y(e,i+1),r.keyboardStep&&(a.setAttribute(`tabindex`,`0`),a.setAttribute(`role`,`separator`),a.setAttribute(`aria-orientation`,r.horizontal?`horizontal`:`vertical`),a.onkeydown=e=>x(e,i))),a.ondblclick=e=>b(e,i+1),t.parentNode.insertBefore(a,t)},te=e=>{e.onmousedown=null,e.onclick=null,e.ondblclick=null,e.onkeydown=null,e.remove()},N=()=>{let e=Array.from(l.value?.children||[]);for(let t of e)t.className.includes(`splitpanes__splitter`)&&te(t);let t=0;for(let n of e)n.className.includes(`splitpanes__pane`)&&(!t&&r.firstSplitter?ee(t,n,!0):t&&ee(t,n),t++)},ne=({uid:e,...t})=>{let n=s.value[e];for(let[e,r]of Object.entries(t))n[e]=r},re=!1,ie=e=>{let t=-1;Array.from(l.value?.children||[]).some(n=>(n.className.includes(`splitpanes__pane`)&&t++,n.isSameNode(e.el))),o.value.splice(t,0,{...e,index:t}),o.value.forEach((e,t)=>e.index=t),u.value&&!re&&(re=!0,er(()=>{N(),P({addedPane:o.value[t]}),L(`pane-add`,{pane:o.value[t]}),re=!1}))},ae=e=>{let t=o.value.findIndex(t=>t.id===e);o.value[t].el=null;let n=o.value.splice(t,1)[0];o.value.forEach((e,t)=>e.index=t),er(()=>{N(),L(`pane-remove`,{pane:n}),P({removedPane:{...n,index:t}})})},P=(e={})=>{!e.addedPane&&!e.removedPane?I():o.value.some(e=>e.givenSize!==null||e.min||e.max<100)?oe(e):F(),u.value&&L(`resized`)},F=()=>{let e=100/c.value,t=100,n=[],r=[];for(let i of o.value)i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&r.push(i.id);Math.abs(t)>.1&&se(t,n,r)},I=()=>{let e=100,t=[],n=[],r=0;for(let i of o.value)e-=i.size,i.givenSize!==null&&r++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id);let i=100;if(e>.1){for(let t of o.value)t.givenSize===null&&(t.size=Math.max(Math.min(e/(c.value-r),t.max),t.min)),i-=t.size;i>.1&&se(i,t,n)}},oe=({addedPane:e,removedPane:t}={})=>{let n=o.value.reduce((e,t)=>e+(t.givenSize===null?0:t.givenSize),0),r=o.value.filter(e=>e.givenSize===null).length,i=r>0?(100-n)/r:0,a=0,s=[],c=[];for(let e of o.value)a-=e.size,e.size>=e.max&&s.push(e.id),e.size<=e.min&&c.push(e.id);if(!(Math.abs(a)<.1)){a=100;for(let e of o.value)e.givenSize===null&&(e.size=Math.max(Math.min(i,e.max),e.min)),a-=e.size,e.size>=e.max&&s.push(e.id),e.size<=e.min&&c.push(e.id);Math.abs(a)>.1&&se(a,s,c)}},se=(e,t,n)=>{let r;r=e>0?e/(c.value-t.length):e/(c.value-n.length),o.value.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}else if(!n.includes(i.id)){let t=Math.max(Math.min(i.size+r,i.max),i.min),n=t-i.size;e-=n,i.size=t}}),Math.abs(e)>.1&&u.value&&console.warn(`Splitpanes: Could not resize panes correctly due to their constraints.`)},L=(e,t=void 0,i=!1)=>{let a=t?.index??d.value.activeSplitter??null;n(e,{...t,...a!==null&&{index:a},...i&&a!==null&&{prevPane:o.value[a-+!!r.firstSplitter],nextPane:o.value[a+ +!r.firstSplitter]},panes:o.value.map(e=>({min:e.min,max:e.max,size:e.size}))})};W(()=>r.firstSplitter,()=>N()),W(()=>r.horizontal,e=>er(()=>{n(`direction-changed`,{horizontal:e,panes:o.value.map(e=>({min:e.min,max:e.max,size:e.size}))})})),Qi(()=>{M(),N(),P(),L(`ready`),u.value=!0}),ta(()=>u.value=!1);let ce=()=>{let{class:e,...t}=i;return ic(`div`,{ref:l,class:[p.value,e],...t},a.default?.())};return br(`panes`,o),br(`indexedPanes`,s),br(`horizontal`,Q(()=>r.horizontal)),br(`requestUpdate`,ne),br(`onPaneAdd`,ie),br(`onPaneRemove`,ae),br(`onPaneClick`,S),(e,t)=>(q(),Y(da(ce)))}}),Bh={__name:`pane`,props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(e){let t=e,n=xr(`requestUpdate`),r=xr(`onPaneAdd`),i=xr(`horizontal`),a=xr(`onPaneRemove`),o=xr(`onPaneClick`),s=Rs()?.uid,c=xr(`indexedPanes`),l=Q(()=>c.value[s]),u=V(null),d=Q(()=>{let e=isNaN(t.size)||t.size===void 0?0:parseFloat(t.size);return Math.max(Math.min(e,p.value),f.value)}),f=Q(()=>{let e=parseFloat(t.minSize);return isNaN(e)?0:e}),p=Q(()=>{let e=parseFloat(t.maxSize);return isNaN(e)?100:e}),m=Q(()=>{let e=l.value?.size??(t.size===void 0?void 0:d.value);return e===void 0?``:`${i.value?`height`:`width`}: ${e}%`});return W(()=>d.value,e=>n({uid:s,size:e})),W(()=>f.value,e=>n({uid:s,min:e})),W(()=>p.value,e=>n({uid:s,max:e})),Qi(()=>{r({id:s,el:u.value,min:f.value,max:p.value,givenSize:t.size===void 0?null:d.value,size:d.value})}),ta(()=>a(s)),(e,t)=>(q(),J(`div`,{ref_key:`paneEl`,ref:u,class:`splitpanes__pane`,onClick:t[0]||=t=>H(o)(t,e._.uid),style:me(m.value)},[K(e.$slots,`default`)],4))}},Vh=G({__name:`LayoutSplitPane`,props:{horizontal:{type:Boolean},storageKey:{}},setup(e){let t=e,n=t.storageKey?Rh(t.storageKey,[]):V([]);function r(e){n.value=e.panes.map(e=>e.size)}return(t,i)=>(q(),Y(H(zh),{horizontal:e.horizontal,onResized:r},{default:U(()=>[K(t.$slots,`default`,{sizes:H(n)})]),_:3},8,[`horizontal`]))}}),Hh=Symbol(`antfu-design-color-scheme`);function Uh(e){let t=wn(e);return br(Hh,t),t}function Wh(e){let t=xr(Hh,void 0);return Q(()=>e?.()??t?.value??`light`)}var Gh=[`top`,`right`,`bottom`,`left`],Kh=[`start`,`end`],qh=Gh.reduce((e,t)=>e.concat(t,t+`-`+Kh[0],t+`-`+Kh[1]),[]),Jh=Math.min,Yh=Math.max,Xh=Math.round,Zh=Math.floor,Qh=e=>({x:e,y:e}),$h={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function eg(e,t,n){return Yh(e,Jh(t,n))}function tg(e,t){return typeof e==`function`?e(t):e}function ng(e){return e.split(`-`)[0]}function rg(e){return e.split(`-`)[1]}function ig(e){return e===`x`?`y`:`x`}function ag(e){return e===`y`?`height`:`width`}function og(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function sg(e){return ig(og(e))}function cg(e,t,n){n===void 0&&(n=!1);let r=rg(e),i=sg(e),a=ag(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_g(o)),[o,_g(o)]}function lg(e){let t=_g(e);return[ug(e),t,ug(t)]}function ug(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var dg=[`left`,`right`],fg=[`right`,`left`],pg=[`top`,`bottom`],mg=[`bottom`,`top`];function hg(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fg:dg:t?dg:fg;case`left`:case`right`:return t?pg:mg;default:return[]}}function gg(e,t,n,r){let i=rg(e),a=hg(ng(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ug)))),a}function _g(e){let t=ng(e);return $h[t]+e.slice(t.length)}function vg(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function yg(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vg(e)}function bg(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xg(e,t,n){let{reference:r,floating:i}=e,a=og(t),o=sg(t),s=ag(o),c=ng(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=rg(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Sg(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=tg(t,e),p=yg(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bg(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=bg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Cg=50,wg=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Sg},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xg(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Cg&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xg(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Tg=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=tg(e,t)||{};if(l==null)return{};let d=yg(u),f={x:n,y:r},p=sg(i),m=ag(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Jh(d[_],T),D=Jh(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=eg(E,k,O),j=!c.arrow&&rg(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}});function Eg(e,t,n){return(e?[...n.filter(t=>rg(t)===e),...n.filter(t=>rg(t)!==e)]:n.filter(e=>ng(e)===e)).filter(n=>!e||rg(n)===e||(t?ug(n)!==n:!1))}var Dg=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=qh,autoAlignment:u=!0,...d}=tg(e,t),f=c!==void 0||l===qh?Eg(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=cg(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[ng(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=rg(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,rg(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},Og=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=tg(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ng(r),_=og(o),v=ng(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_g(o)]:lg(o)),x=p!==`none`;!d&&x&&b.push(...gg(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=cg(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===og(t)||T.every(e=>og(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=og(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function kg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ag(e){return Gh.some(t=>e[t]>=0)}var jg=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=tg(e,t);switch(i){case`referenceHidden`:{let e=kg(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ag(e)}}}case`escaped`:{let e=kg(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ag(e)}}}default:return{}}}}},Mg=new Set([`left`,`top`]);async function Ng(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ng(n),s=rg(n),c=og(n)===`y`,l=Mg.has(o)?-1:1,u=a&&c?-1:1,d=tg(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Pg=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ng(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Fg=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=tg(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=og(i),p=ig(f),m=u[p],h=u[f],g=(e,t)=>eg(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ig=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=tg(e,t),u={x:n,y:r},d=og(i),f=ig(d),p=u[f],m=u[d],h=tg(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Mg.has(ng(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Lg=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=tg(e,t),c=await i.detectOverflow(t,s),l=ng(n),u=rg(n),d=og(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Jh(p-c[m],g),y=Jh(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Yh(c.left,c.right):S=p-2*Yh(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Rg(){return typeof window<`u`}function zg(e){return Hg(e)?(e.nodeName||``).toLowerCase():`#document`}function Bg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vg(e){return((Hg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Hg(e){return Rg()?e instanceof Node||e instanceof Bg(e).Node:!1}function Ug(e){return Rg()?e instanceof Element||e instanceof Bg(e).Element:!1}function Wg(e){return Rg()?e instanceof HTMLElement||e instanceof Bg(e).HTMLElement:!1}function Gg(e){return!Rg()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Bg(e).ShadowRoot}function Kg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=r_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qg(e){return/^(table|td|th)$/.test(zg(e))}function Jg(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Yg=/transform|translate|scale|rotate|perspective|filter/,Xg=/paint|layout|strict|content/,Zg=e=>!!e&&e!==`none`,Qg;function $g(e){let t=Ug(e)?r_(e):e;return Zg(t.transform)||Zg(t.translate)||Zg(t.scale)||Zg(t.rotate)||Zg(t.perspective)||!t_()&&(Zg(t.backdropFilter)||Zg(t.filter))||Yg.test(t.willChange||``)||Xg.test(t.contain||``)}function e_(e){let t=a_(e);for(;Wg(t)&&!n_(t);){if($g(t))return t;if(Jg(t))return null;t=a_(t)}return null}function t_(){return Qg??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Qg}function n_(e){return/^(html|body|#document)$/.test(zg(e))}function r_(e){return Bg(e).getComputedStyle(e)}function i_(e){return Ug(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function a_(e){if(zg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Gg(e)&&e.host||Vg(e);return Gg(t)?t.host:t}function o_(e){let t=a_(e);return n_(t)?(e.ownerDocument||e).body:Wg(t)&&Kg(t)?t:o_(t)}function s_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=o_(e),i=r===e.ownerDocument?.body,a=Bg(r);if(i){let e=c_(a);return t.concat(a,a.visualViewport||[],Kg(r)?r:[],e&&n?s_(e):[])}return t.concat(r,s_(r,[],n))}function c_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function l_(e){let t=r_(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wg(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Xh(n)!==a||Xh(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function u_(e){return Ug(e)?e:e.contextElement}function d_(e){let t=u_(e);if(!Wg(t))return Qh(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=l_(t),o=(a?Xh(n.width):n.width)/r,s=(a?Xh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var f_=Qh(0);function p_(e){let t=Bg(e);return!t_()||!t.visualViewport?f_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function m_(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bg(e)}function h_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=u_(e),o=Qh(1);t&&(r?Ug(r)&&(o=d_(r)):o=d_(e));let s=m_(a,n,r)?p_(a):Qh(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Bg(a),t=Ug(r)?Bg(r):r,n=e,i=c_(n);for(;i&&t!==n;){let e=d_(i),t=i.getBoundingClientRect(),r=r_(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Bg(i),i=c_(n)}}return bg({width:u,height:d,x:c,y:l})}function g_(e,t){let n=i_(e).scrollLeft;return t?t.left+n:h_(Vg(e)).left+n}function __(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-g_(e,n),y:n.top+t.scrollTop}}function v_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Vg(r),s=t?Jg(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Qh(1),u=Qh(0),d=Wg(r);if((d||!a)&&((zg(r)!==`body`||Kg(o))&&(c=i_(r)),d)){let e=h_(r);l=d_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?__(o,c):Qh(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function y_(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function b_(e){let t=i_(e),n=e.ownerDocument.body,r=Yh(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Yh(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+g_(e),o=-t.scrollTop;return r_(n).direction===`rtl`&&(a+=Yh(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var x_=25;function S_(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Bg(e),a=Vg(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!t_()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(g_(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=x_&&(s-=o)}return{width:s,height:c,x:l,y:u}}function C_(e,t){let n=h_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=d_(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function w_(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=S_(e,n,t);else if(t===`document`)r=b_(Vg(e));else if(Ug(t))r=C_(t,n);else{let n=p_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bg(r)}function T_(e,t){let n=t.get(e);if(n)return n;let r=s_(e,[],!1).filter(e=>Ug(e)&&zg(e)!==`body`),i=null,a=r_(e).position===`fixed`,o=a?a_(e):e;for(;Ug(o)&&!n_(o);){let e=r_(o),t=$g(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=a_(o)}return t.set(e,r),r}function E_(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Jg(t)?[]:T_(t,this._c):[].concat(n),r],o=w_(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=w_(t,a[e],i);s=Yh(n.top,s),c=Jh(n.right,c),l=Jh(n.bottom,l),u=Yh(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function D_(e){let{width:t,height:n}=l_(e);return{width:t,height:n}}function O_(e,t,n){let r=Wg(t),i=Vg(t),a=n===`fixed`,o=h_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Qh(0);if((r||!a)&&((zg(t)!==`body`||Kg(i))&&(s=i_(t)),r)){let e=h_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=g_(i));let l=i&&!r&&!a?__(i,s):Qh(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function k_(e){return r_(e).position===`static`}function A_(e,t){if(!Wg(e)||r_(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Vg(e)===n&&(n=n.ownerDocument.body),n}function j_(e,t){let n=Bg(e);if(Jg(e))return n;if(!Wg(e)){let t=a_(e);for(;t&&!n_(t);){if(Ug(t)&&!k_(t))return t;t=a_(t)}return n}let r=A_(e,t);for(;r&&qg(r)&&k_(r);)r=A_(r,t);return r&&n_(r)&&k_(r)&&!$g(r)?n:r||e_(e)||n}var M_=async function(e){let t=this.getOffsetParent||j_,n=this.getDimensions,r=await n(e.floating);return{reference:O_(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function N_(e){return r_(e).direction===`rtl`}var P_={convertOffsetParentRelativeRectToViewportRelativeRect:v_,getDocumentElement:Vg,getClippingRect:E_,getOffsetParent:j_,getElementRects:M_,getClientRects:y_,getDimensions:D_,getScale:d_,isElement:Ug,isRTL:N_};function F_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function I_(e,t,n){let r=null,i,a=Vg(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Zh(d),h=Zh(a.clientWidth-(u+f)),g=Zh(a.clientHeight-(d+p)),_=Zh(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Yh(0,Jh(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!F_(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Bg(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function L_(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=u_(e),u=i||a?[...l?s_(l):[],...t?s_(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?I_(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?h_(e):null;c&&g();function g(){let t=h_(e);h&&!F_(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var R_=Pg,z_=Dg,B_=Fg,V_=Og,H_=Lg,U_=jg,W_=Tg,G_=Ig,K_=(e,t,n)=>{let r=new Map,i=n??{},a={...P_,...i.platform,_c:r};return wg(e,t,{...i,platform:a})},q_=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),J_={targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},ariaId:{default:null},delay:{type:[String,Number,Object],default:0},triggers:{type:Array,default:()=>[]},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},autoHide:{type:[Boolean,Function],default:!1},handleResize:{type:Boolean,default:!1},eagerMount:{type:Boolean,default:!1},popperClass:{type:[String,Array,Object],default:void 0},noAutoFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},placement:{type:String,validator:e=>q_.includes(e),default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},popperTriggers:{type:Array,default:void 0},container:{type:[String,Object,Boolean],default:void 0},boundary:{type:[String,Object],default:void 0},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:void 0},instantMove:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},noArrow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},Y_={show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},X_=Object.freeze({disabled:!1,placement:`bottom`,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,shiftCrossAxis:!1,overflowPadding:0,arrowPadding:0,noArrow:!1,autoHideOnMousedown:!1});function Z_(){return Rs()?.appContext.provides.$_vueAfloatGlobalOptions??{}}function Q_(e){let t={};if(!e)return t;for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function $_(e,t=Z_()){return Object.assign({},X_,Q_(t),Q_(e))}var ev={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},tv={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function nv(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}var rv=0,iv=0,av=0,ov=0,sv=0;function cv(e){rv=av,iv=ov,av=e.clientX,ov=e.clientY}function lv(){sv++,sv===1&&window.addEventListener(`mousemove`,cv,{passive:!0})}function uv(){sv--,sv===0&&window.removeEventListener(`mousemove`,cv)}function dv(e,t){let n=e.getBoundingClientRect();if(av>=n.left&&av<=n.right&&ov>=n.top&&ov<=n.bottom){let e=t.getBoundingClientRect(),n=av-rv,r=ov-iv,i=e.left+e.width/2-rv+(e.top+e.height/2)-iv+e.width+e.height,a=rv+n*i,o=iv+r*i;return fv(rv,iv,a,o,e.left,e.top,e.left,e.bottom)||fv(rv,iv,a,o,e.left,e.top,e.right,e.top)||fv(rv,iv,a,o,e.right,e.top,e.right,e.bottom)||fv(rv,iv,a,o,e.left,e.bottom,e.right,e.bottom)}return!1}function fv(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}var pv=typeof window<`u`&&typeof navigator<`u`&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,mv=null,hv=0;function gv(){return hv++,mv||=yv(),mv}function _v(){hv--,hv===0&&mv&&(mv.dispose(),mv=null)}function vv(){if(mv)for(let e of mv.shownPoppers)e.computePosition()}function yv(){let e=new Set,t=new Map;function n(){for(let t of e)if(t.options.value.autoHideOnMousedown)return!0;return!1}function r(t,r){if(n())a(t,r);else{let n=t.composedPath();for(let t of e)try{t.mouseDownContains=n.includes(t.popperNode())}catch{}}}function i(e,t){n()||a(e,t)}function a(t,n){let r={},i=t.composedPath(),a=[...e].reverse();for(let e of a)try{let o=Array.from(e.shownChildren).some(e=>{let t=a.find(t=>t.randomId===e);return t&&i.includes(t.popperNode())}),s=e.containsGlobalTarget=e.mouseDownContains||i.includes(e.popperNode())||o;e.pendingHide=!1,requestAnimationFrame(()=>{if(e.pendingHide=!1,!r[e.randomId]&&bv(e,s,t)){if(e.handleGlobalClose(t,n),!t.closeAllPopover&&t.closePopover&&s){let t=e.parentPopper;for(;t;)r[t.randomId]=!0,t=t.parentPopper;return}let i=e.parentPopper;for(;i&&bv(i,i.containsGlobalTarget,t);)i.handleGlobalClose(t,n),i=i.parentPopper}})}catch{}}let o=e=>r(e,!1),s=e=>i(e,!1),c=e=>r(e,!0),l=e=>i(e,!0);if(pv){let e={passive:!0,capture:!0};document.addEventListener(`touchstart`,c,e),document.addEventListener(`touchend`,l,e)}else window.addEventListener(`mousedown`,o,!0),window.addEventListener(`click`,s,!0);window.addEventListener(`resize`,vv);function u(e){let t=e.popperNode().getRootNode();return t instanceof ShadowRoot?t.host:document.body}function d(e){e&&![...t.values()].includes(e)&&e.classList.remove(`vue-afloat--some-open`)}let f={shownPoppers:e,hidingPopper:null,markShown(n){e.add(n);let r=t.get(n),i=u(n);t.set(n,i),d(r),i.classList.add(`vue-afloat--some-open`)},markHidden(n){e.delete(n);let r=t.get(n);t.delete(n),d(r),f.hidingPopper===n&&(f.hidingPopper=null)},dispose(){pv?(document.removeEventListener(`touchstart`,c,{capture:!0}),document.removeEventListener(`touchend`,l,{capture:!0})):(window.removeEventListener(`mousedown`,o,!0),window.removeEventListener(`click`,s,!0)),window.removeEventListener(`resize`,vv)}};return f}function bv(e,t,n){return n.closeAllPopover||n.closePopover&&t||xv(e,n)&&!t}function xv(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function Sv(e,t){let n=[],r={strategy:e.strategy,middleware:n},i=e.boundary;(e.distance||e.skidding)&&n.push(R_({mainAxis:e.distance,crossAxis:e.skidding}));let a=e.placement.startsWith(`auto`);return a?n.push(z_({alignment:e.placement.split(`-`)[1]??``})):r.placement=e.placement,e.preventOverflow&&(e.shift&&n.push(B_({padding:e.overflowPadding,boundary:i,crossAxis:e.shiftCrossAxis})),!a&&e.flip&&n.push(V_({padding:e.overflowPadding,boundary:i}))),n.push(W_({element:t,padding:e.arrowPadding})),r}var Cv=class{entries=[];add(e,t,n){this.entries.push({targetNodes:e,eventType:t,handler:n});for(let r of e)r.addEventListener(t,n,{passive:!0})}addTriggers(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r);for(let n of a){let r=t[n];r&&this.add(e,r,i)}}remove(e){this.entries=this.entries.filter(t=>{if(!e||e===t.eventType){for(let e of t.targetNodes)e.removeEventListener(t.eventType,t.handler);return!1}return!0})}},wv=`__floating-vue__popper`;function Tv(e,t){let n=Rs(),r=Z_(),i=Q(()=>$_(e,r)),a=V(!1),o=V(!1),s=V(!1),c=Zt({showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0}),l=Zt({x:0,y:0,placement:``,strategy:i.value.strategy,arrow:{x:0,y:0,centerOffset:0}}),u=V(!0),d=`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,f=new Set,p=!0,m=!1,h=!1,g=!1,_,v,y,b=[],x,S,C=new Cv,w=null,T=!1,E=xr(wv,null)?.parentPopper??null,D={randomId:d,options:i,get autoHide(){return e.autoHide},parentPopper:E,lockedChild:null,lockedChildTimer:null,shownChildren:f,pendingHide:!1,mouseDownContains:!1,containsGlobalTarget:!1,get lastAutoHide(){return u.value},set lastAutoHide(e){u.value=e},popperNode:()=>e.popperNode(),hide:ee,applyHide:oe,computePosition:()=>{re()},handleGlobalClose:de};br(wv,{parentPopper:D});let O=Q(()=>e.ariaId??d),k=Q(()=>e.eagerMount||o.value),A=Q(()=>i.value.popperTriggers.includes(`hover`)||Array.isArray(e.popperShowTriggers)&&e.popperShowTriggers.includes(`hover`)),j=Q(()=>({popperId:O.value,isShown:a.value,shouldMountContent:k.value,skipTransition:s.value,noArrow:i.value.noArrow,autoHide:typeof e.autoHide==`function`?u.value:e.autoHide,show:M,hide:ee,handleResize:e.handleResize,onResize:ne,classes:{...c,popperClass:e.popperClass},result:l}));function M({skipDelay:e=!1,force:n=!1}={}){E?.lockedChild&&E.lockedChild!==D||(D.pendingHide=!1,(n||!i.value.disabled)&&(E?.lockedChild===D&&(E.lockedChild=null),ie(e),t(`show`),h=!0,requestAnimationFrame(()=>{h=!1})),t(`update:shown`,!0))}function ee({skipDelay:e=!1}={}){if(!g){if(f.size>0){D.pendingHide=!0;return}if(A.value&&dv(y,x)){E&&(E.lockedChild=D,E.lockedChildTimer&&clearTimeout(E.lockedChildTimer),E.lockedChildTimer=setTimeout(()=>{E.lockedChild===D&&(E.lockedChild.hide({skipDelay:e}),E.lockedChild=null)},1e3));return}E?.lockedChild===D&&(E.lockedChild=null),D.pendingHide=!1,ae(e),t(`hide`),t(`update:shown`,!1)}}function te(){p&&(p=!1,o.value=!1,m=!1,y=e.referenceNode?.()??n.proxy.$el,b=e.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),x=e.popperNode(),S=x.querySelector(`.vue-afloat__arrow-container`),pe(`title`,`data-original-title`),fe(),w=gv(),ue(),e.triggers.length&&ce(),e.shown&&M())}function N(){p||(p=!0,C.remove(),ee({skipDelay:!0}),fe(),o.value=!1,a.value=!1,he(!1),pe(`data-original-title`,`title`),ue(),w&&=(_v(),null))}async function ne(){a.value&&(await re(),t(`resize`))}async function re(){if(p)return;let e=Sv(i.value,S),t=await K_(y,x,e);Object.assign(l,{x:t.x,y:t.y,placement:t.placement,strategy:t.strategy,arrow:t.middlewareData.arrow})}function ie(e=!1){he(!0),g=!1,clearTimeout(_);let t=w?.hidingPopper;if(t&&i.value.instantMove&&t.options.value.instantMove&&t!==E){t.applyHide(!0),F(!0);return}e?F():_=setTimeout(F,P(`show`))}function ae(e=!1){if(f.size>0){D.pendingHide=!0;return}he(!1),g=!0,clearTimeout(_),a.value&&w&&(w.hidingPopper=D),e?oe():_=setTimeout(oe,P(`hide`))}function P(t){let n=e.delay;return parseInt(n&&n[t]||n||0)}async function F(e=!1){clearTimeout(v),clearTimeout(_),s.value=e,!a.value&&(L(),await nv(),await re(),await I(),C.add([...s_(y),...s_(x)],`scroll`,()=>{re()}))}async function I(){g||(a.value=!0,me({"aria-describedby":O.value,"data-popper-shown":``}),w?.markShown(D),t(`apply-show`),c.showFrom=!0,c.showTo=!1,c.hideFrom=!1,c.hideTo=!1,await nv(),c.showFrom=!1,c.showTo=!0,e.noAutoFocus||x.focus())}async function oe(e=!1){if(f.size>0){D.pendingHide=!0,g=!1;return}if(clearTimeout(_),!a.value)return;s.value=e,w?.markHidden(D),a.value=!1,me({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(v);let n=i.value.disposeTimeout;n!==null&&(v=setTimeout(()=>{x&&(fe(),o.value=!1)},n)),C.remove(`scroll`),t(`apply-hide`),c.showFrom=!1,c.showTo=!1,c.hideFrom=!0,c.hideTo=!1,await nv(),c.hideFrom=!1,c.hideTo=!0}function se(){e.shown?M():ee()}function L(){if(p)return;let e=i.value.container,t;if(typeof e==`string`){let n=y.getRootNode();t=n instanceof ShadowRoot?e===`body`?n:n.querySelector(e):y.ownerDocument.querySelector(e)}else t=e===!1?b[0].parentNode:e;if(!t)throw Error(`No container for popover: ${e}`);t.appendChild(x),o.value=!0}function ce(){let t=e=>{(!a.value||g)&&(e.usedByTooltip=!0,!m&&M({event:e}))};C.addTriggers(b,ev,e.triggers,e.showTriggers,t),C.addTriggers([x],ev,i.value.popperTriggers,e.popperShowTriggers,t);let n=e=>{e.usedByTooltip||ee({event:e})};C.addTriggers(b,tv,e.triggers,e.hideTriggers,n),C.addTriggers([x],tv,i.value.popperTriggers,e.popperHideTriggers,n)}function le(){p||(C.remove(),ce(),ue())}function ue(){let e=!p&&A.value;e!==T&&(T=e,e?lv():uv())}function de(e,n){h||(ee({event:e}),e.closePopover?t(`close-directive`):t(`auto-hide`),n&&(m=!0,setTimeout(()=>{m=!1},300)))}function fe(){x.parentNode&&x.parentNode.removeChild(x)}function pe(e,t){for(let n of b){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}}function me(e){for(let t of b)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}}function he(e){let t=E;for(;t;)e?t.shownChildren.add(d):(t.shownChildren.delete(d),t.pendingHide&&t.hide()),t=t.parentPopper}return W(()=>e.shown,se),W(()=>i.value.disabled,e=>{e?N():te()}),W(()=>i.value.container,async()=>{a.value&&(L(),w?.markShown(D),await re())}),W(()=>e.triggers,le,{deep:!0}),W(i,()=>re()),Qi(()=>{te(),fe()}),Ui(se),Wi(()=>{ee()}),ta(N),{show:M,hide:ee,dispose:N,onResize:ne,slotData:j}}var Ev=G({name:`VPopperRoot`,props:J_,emits:Y_,setup(e,{emit:t,slots:n,expose:r}){let{show:i,hide:a,dispose:o,onResize:s,slotData:c}=Tv(e,t);return r({show:i,hide:a,dispose:o,onResize:s}),()=>ic(`div`,{ref:`reference`,class:[`vue-afloat`,{"vue-afloat--shown":c.value.isShown}]},n.default?.(c.value))}}),Dv=G({name:`VPopperContent`,props:{popperId:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,noArrow:Boolean,autoHide:Boolean,handleResize:Boolean,classes:{type:Object,required:!0},result:{type:Object,required:!0}},emits:[`hide`,`resize`],setup(e,{emit:t,slots:n}){let r=V(),i;Qi(()=>{e.handleResize&&(i=new ResizeObserver(()=>t(`resize`)),i.observe(r.value))}),ta(()=>{i?.disconnect()});function a(e){return e!=null&&!Number.isNaN(e)?`${e}px`:null}return()=>{let{autoHide:i,classes:o,result:s,shown:c}=e,l=s.placement.split(`-`)[0];return ic(`div`,{id:e.popperId,ref:`popover`,"data-allow-mismatch":``,class:[`vue-afloat`,`vue-afloat--${l}`,o.popperClass,{"vue-afloat--shown":c,"vue-afloat--hidden":!c,"vue-afloat--show-from":o.showFrom,"vue-afloat--show-to":o.showTo,"vue-afloat--hide-from":o.hideFrom,"vue-afloat--hide-to":o.hideTo,"vue-afloat--skip-transition":e.skipTransition,"vue-afloat--no-arrow":e.noArrow}],style:{position:s.strategy,transform:`translate3d(${Math.round(s.x)}px,${Math.round(s.y)}px,0)`},"aria-hidden":c||i?`false`:`true`,tabindex:i?0:void 0,"data-popper-placement":s.placement,onKeyup:e=>{e.key===`Escape`&&i&&t(`hide`)}},[ic(`div`,{class:`vue-afloat__backdrop`,onClick:()=>i&&t(`hide`)}),ic(`div`,{class:`vue-afloat__wrapper`},[ic(`div`,{ref:r,class:`vue-afloat__inner`},e.mounted?[ic(`div`,n.default?.())]:void 0),ic(`div`,{ref:`arrow`,class:`vue-afloat__arrow-container`,style:{left:a(s.arrow.x),top:a(s.arrow.y)}},[ic(`div`,{class:`vue-afloat__arrow-outer`}),ic(`div`,{class:`vue-afloat__arrow-inner`})])])])}}}),Ov=new Set([`targetNodes`,`popperNode`]);function kv(e){let t={};for(let n in J_){if(Ov.has(n))continue;let r=J_[n];t[n]=n in e?{...r,default:e[n]}:r}return t}function Av(e,t,n={}){return G({name:e,props:kv(n),emits:Y_,setup(e,{emit:n,slots:r,expose:i}){let a,o;function s(){return Array.from(a.$el.children).filter(e=>e!==o.$el)}return i({show:(...e)=>a.show(...e),hide:(...e)=>a.hide(...e),dispose:()=>a.dispose(),onResize:()=>a.onResize()}),()=>ic(Ev,{ref:e=>{a=e},...e,targetNodes:s,popperNode:()=>o.$el,class:t,onShow:()=>n(`show`),onHide:()=>n(`hide`),"onUpdate:shown":e=>n(`update:shown`,e),onApplyShow:()=>n(`apply-show`),onApplyHide:()=>n(`apply-hide`),onCloseDirective:()=>n(`close-directive`),onAutoHide:()=>n(`auto-hide`),onResize:()=>n(`resize`)},{default:({popperId:e,isShown:n,shouldMountContent:i,skipTransition:a,noArrow:s,autoHide:c,show:l,hide:u,handleResize:d,onResize:f,classes:p,result:m})=>[r.default?.({shown:n,show:l,hide:u}),ic(Dv,{ref:e=>{o=e},class:t,popperId:e,shown:n,mounted:i,skipTransition:a,noArrow:s,autoHide:c,handleResize:d,classes:p,result:m,onHide:u,onResize:f},{default:()=>r.popper?.({shown:n,hide:u})})]})}})}Av(`VDropdown`,`vue-afloat-dropdown`,{placement:`bottom`,triggers:()=>[`click`],delay:0,handleResize:!0,autoHide:!0}),Av(`VMenu`,`vue-afloat-menu`,{placement:`bottom`,triggers:()=>[`hover`,`focus`],popperTriggers:()=>[`hover`],delay:()=>({show:0,hide:400}),handleResize:!0,autoHide:!0,noArrow:!0}),Av(`VTooltip`,`vue-afloat-tooltip`,{placement:`top`,triggers:()=>[`hover`,`focus`,`touch`],hideTriggers:()=>e=>[...e,`click`],delay:()=>({show:200,hide:0})});function jv(){return G({name:`VPopper`,props:J_,emits:Y_,setup(e,{emit:t,slots:n,expose:r}){let{show:i,hide:a,dispose:o,onResize:s,slotData:c}=Tv(e,t);return r({show:i,hide:a,dispose:o,onResize:s}),()=>n.default?.(c.value)}})}var Mv=jv(),Nv=G({name:`VTooltipDirective`,inheritAttrs:!1,props:{html:{type:Boolean,default:!1},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:`...`},targetNodes:{type:Function,required:!0}},setup(e,{attrs:t,expose:n}){let r=V(null),i=Q(()=>typeof e.content==`function`),a=Q(()=>i.value&&r.value==null),o=Q(()=>i.value?a.value?e.loadingContent:r.value:e.content),s,c,l=!1,u=!1,d=0;function f(t=!1){if(typeof e.content==`function`&&l&&(t||!u&&r.value==null)){r.value=null,u=!0;let t=++d,n=e.content(e);n.then?n.then(e=>p(t,e)):p(t,n)}}function p(e,t){e===d&&(u=!1,r.value=t)}W(()=>e.content,()=>f(!0),{immediate:!0}),W(o,async()=>{await er(),s.onResize()});function m(){l=!0,f()}function h(){l=!1}return n({show:(...e)=>s.show(...e),hide:(...e)=>s.hide(...e),dispose:()=>s.dispose(),onResize:()=>s.onResize()}),()=>ic(Mv,{ref:e=>{s=e},placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},...t,targetNodes:e.targetNodes,popperNode:()=>c.$el,onApplyShow:m,onApplyHide:h},{default:({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,noArrow:s,autoHide:l,hide:u,handleResize:d,onResize:f,classes:p,result:m})=>ic(Dv,{ref:e=>{c=e},class:[`vue-afloat-tooltip`,{"vue-afloat--tooltip-loading":a.value}],popperId:t,shown:n,mounted:r,skipTransition:i,noArrow:s,autoHide:l,handleResize:d,classes:p,result:m,onHide:u,onResize:f},{default:()=>e.html?ic(`div`,{innerHTML:o.value}):ic(`div`,{textContent:o.value})})})}}),Pv=`vue-afloat--has-tooltip`;function Fv(e,t){let n=e.placement;if(!n&&t)for(let e of q_)t[e]&&(n=e);return n||=`top`,n}function Iv(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=Fv(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}var Lv,Rv,zv=0;function Bv(){if(Lv)return;Rv=V([]),Lv=yu({name:`VTooltipDirectiveApp`,setup(){return{directives:Rv}},render(){return this.directives.map(e=>ic(Nv,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);Lv.mount(e)}function Vv(e,t,n){Bv();let r=V(Iv(e,t,n)),i=V(!1),a={id:zv++,options:r,shown:i};return Rv.value.push(a),e.classList&&e.classList.add(Pv),e.$_vueAfloat={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function Hv(e){if(e.$_vueAfloat){let t=Rv.value.indexOf(e.$_vueAfloat.item);t!==-1&&Rv.value.splice(t,1),delete e.$_vueAfloat,delete e.$_vueAfloatOldShown,delete e.$_vueAfloatMountTarget}e.classList&&e.classList.remove(Pv)}function Uv(e,{value:t,modifiers:n}){let r=Iv(e,t,n);if(!r.content||X_.disabled)Hv(e);else{let i;e.$_vueAfloat?(i=e.$_vueAfloat,i.options.value=r):i=Vv(e,t,n);let a=typeof t==`object`?t.shown:void 0;a!==void 0&&a!==e.$_vueAfloatOldShown&&(e.$_vueAfloatOldShown=a,a?i.show():i.hide())}}var Wv={beforeMount:Uv,updated:Uv,beforeUnmount(e){Hv(e)}},Gv=G({__name:`ActionIconButton`,props:{as:{},to:{},href:{},icon:{},tooltip:{},active:{type:Boolean},disabled:{type:Boolean},label:{},compact:{type:Boolean},activeClass:{}},setup(e){let t=e,n=Q(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=Q(()=>n.value===`a`),i=Q(()=>n.value===`button`),a=Q(()=>t.compact?`btn-icon-compact`:`btn-icon`),o=Q(()=>t.compact?`w-auto! h-auto! p-[0.25em]`:`w-auto! h-auto! p-[0.5em]`),s=Q(()=>t.active?t.activeClass||`color-active bg-active op100`:``);return(t,c)=>vr((q(),Y(da(n.value),{type:i.value?`button`:void 0,class:ye([a.value,o.value,s.value,{"pointer-events-none op-mute":e.disabled&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?e.disabled:void 0,"aria-disabled":e.disabled&&!i.value||void 0,"aria-label":e.label??e.tooltip,"aria-pressed":e.active||void 0},{default:U(()=>[e.icon?(q(),J(`span`,{key:0,class:ye(e.icon),"aria-hidden":`true`},null,2)):Os(``,!0),K(t.$slots,`default`),K(t.$slots,`badge`)]),_:3},8,[`type`,`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-label`,`aria-pressed`])),[[H(Wv),e.tooltip??``]])}});function Kv(e,t){let n=e.length,r,i,a=!1,o=!1;Array.isArray(e[0])?r=e:(r=[e],n=r.length,a=!0),Array.isArray(t[0])?i=t:(i=t.length>0?t.map(e=>[e]):[[]],o=!0);let s=i[0].length,c=i[0].map((e,t)=>i.map(e=>e[t])),l=r.map(e=>c.map(t=>{let n=0;if(!Array.isArray(e)){for(let r of t)n+=e*r;return n}for(let r=0;r<e.length;r++)n+=e[r]*(t[r]||0);return n}));return n===1&&a&&(l=l[0]),s===1&&o?n===1&&a?l[0]:l.map(e=>e[0]):l}function qv(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Jv(e,t,n=[0,0,0]){let r=qv(e,t[0]),i=qv(e,t[1]),a=qv(e,t[2]);return n[0]=r,n[1]=i,n[2]=a,n}function Yv(e){return Xv(e)===`string`}function Xv(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||``).toLowerCase()}function Zv(e,{precision:t=16,unit:n}){return Qv(e)?`none`:(e=+ey(e,t),e+(n??``))}function Qv(e){return e===null}function $v(e){return Qv(e)?0:e}function ey(e,t){if(e===0)return 0;let n=~~e,r=0;n&&t&&(r=~~Math.log10(Math.abs(n))+1);let i=10**(t-r);return Math.floor(e*i+.5)/i}function ty(e,t,n){return isNaN(e)?t:isNaN(t)?e:e+(t-e)*n}function ny(e,t,n){return(n-e)/(t-e)}function ry(e,t,n){return!e||!t||e===t||e[0]===t[0]&&e[1]===t[1]||isNaN(n)||n===null?n:ty(t[0],t[1],ny(e[0],e[1],n))}function iy(e,t,n){return Math.max(Math.min(n,t),e)}function ay(e,t){return Math.sign(e)===Math.sign(t)?e:-e}function oy(e,t){return ay(Math.abs(e)**t,e)}function sy(e,t){return t===0?0:e/t}function cy(e,t,n=0,r=e.length){for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n}function ly(e,t){if(e instanceof t)return!0;let n=t.name;for(;e;){let t=Object.getPrototypeOf(e),r=t?.constructor?.name;if(r===n)return!0;if(!r||r===`Object`)return!1;e=t}return!1}var uy=Object.freeze({__proto__:null,bisectLeft:cy,clamp:iy,copySign:ay,interpolate:ty,interpolateInv:ny,isInstance:ly,isNone:Qv,isString:Yv,mapRange:ry,multiplyMatrices:Kv,multiply_v3_m3x3:Jv,serializeNumber:Zv,skipNone:$v,spow:oy,toPrecision:ey,type:Xv,zdiv:sy}),dy=new class{add(e,t,n){if(typeof arguments[0]!=`string`){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?`unshift`:`push`](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},fy={gamut_mapping:`css`,precision:5,deltaE:`76`,verbose:!0,warn:function(e){this.verbose&&globalThis?.console?.warn?.(e)}},py=class{type;coordMeta;coordRange;range;constructor(e,t){if(typeof e==`object`&&(this.coordMeta=e),t&&(this.coordMeta=t,this.coordRange=t.range??t.refRange),typeof e==`string`){let t=e.trim().match(/^(?<type><[a-z]+>)(\[(?<min>-?[.\d]+),\s*(?<max>-?[.\d]+)\])?$/);if(!t)throw TypeError(`Cannot parse ${e} as a type definition.`);this.type=t.groups.type;let{min:n,max:r}=t.groups;(n||r)&&(this.range=[+n,+r])}}get computedRange(){return this.range?this.range:this.type===`<percentage>`?this.percentageRange():this.type===`<angle>`?[0,360]:null}get unit(){return this.type===`<percentage>`?`%`:this.type===`<angle>`?`deg`:``}resolve(e){if(this.type===`<angle>`)return e;let t=this.computedRange,n=this.coordRange;return this.type===`<percentage>`&&(n??=this.percentageRange()),ry(t,n,e)}serialize(e,t){let n=this.type===`<percentage>`?this.percentageRange(100):this.computedRange,r=this.unit;return e=ry(this.coordRange,n,e),Zv(e,{unit:r,precision:t})}toString(){let e=this.type;if(this.range){let[t=``,n=``]=this.range;e+=`[${t},${n}]`}return e}percentageRange(e=1){let t;return t=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1],[t[0]*e,t[1]*e]}static get(e,t){return ly(e,this)?e:new this(e,t)}},my=Symbol(`instance`),hy=class e{type;name;spaceCoords;coords;id;alpha;constructor(e,t=e.space){e[my]=this,this.type=`function`,this.name=`color`,Object.assign(this,e),this.space=t,this.type!==`custom`&&(this.spaceCoords=Object.values(t.coords),this.coords||=this.spaceCoords.map(e=>{let t=[`<number>`,`<percentage>`];return e.type===`angle`&&t.push(`<angle>`),t}),this.coords=this.coords.map((e,t)=>{let n=this.spaceCoords[t];return typeof e==`string`&&(e=e.trim().split(/\s*\|\s*/)),e.map(e=>py.get(e,n))}))}serializeCoords(e,t,n){return n=e.map((e,t)=>py.get(n?.[t]??this.coords[t][0],this.spaceCoords[t])),e.map((e,r)=>n[r].serialize(e,t))}coerceCoords(e,t){return Object.entries(this.space.coords).map(([n,r],i)=>{let a=e[i];if(Qv(a)||isNaN(a))return a;let o=t[i],s=this.coords[i].find(e=>e.type==o);if(!s){let e=r.name||n;throw TypeError(`${o??a?.raw??a} not allowed for ${e} in ${this.name}()`)}return a=s.resolve(a),s.range&&(t[i]=s.toString()),a})}canSerialize(){return this.type===`function`||this.serialize}parse(e){return null}static get(t,...n){return!t||ly(t,this)?t:t[my]?t[my]:new e(t,...n)}},gy={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function _y(e){return Array.isArray(e)?e:gy[e]}function vy(e,t,n,r={}){if(e=_y(e),t=_y(t),!e||!t)throw TypeError(`Missing white point to convert ${e?``:`from`}${!e&&!t?`/`:``}${t?``:`to`}`);if(e===t)return n;let i={W1:e,W2:t,XYZ:n,options:r};if(dy.run(`chromatic-adaptation-start`,i),i.M||(i.W1===gy.D65&&i.W2===gy.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===gy.D50&&i.W2===gy.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),dy.run(`chromatic-adaptation-end`,i),i.M)return Jv(i.XYZ,i.M);throw TypeError(`Only Bradford CAT with white points D50 and D65 supported for now.`)}function yy(e,t){let n={str:String(e)?.trim(),options:t};if(dy.run(`parse-start`,n),n.color)return n.color;n.parsed=Cy(n.str);let r,i=n.options?n.options.parseMeta??n.options.meta:null;if(n.parsed){let t=n.parsed.name,a,o,s=n.parsed.args,c=s.map((e,t)=>n.parsed.argMeta[t]?.type);if(t===`color`){let r=s.shift();c.shift();let i=r.startsWith(`--`)?r.substring(2):`--${r}`,l=[r,i];if(a=Ey.findFormat({name:t,id:l,type:`function`}),!a){let t,a=r in Ey.registry?r:i;if(a in Ey.registry){let n=Ey.registry[a].formats?.color?.id;n&&(t=`Did you mean ${e.replace(`color(`+r,`color(`+n)}?`)}throw TypeError(`Cannot parse ${n.str}. `+(t??`Missing a plugin?`))}o=a.space,a.id.startsWith(`--`)&&!r.startsWith(`--`)&&fy.warn(`${o.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${a.id}) instead of color(${r}).`),r.startsWith(`--`)&&!a.id.startsWith(`--`)&&fy.warn(`${o.name} is a standard space and supported in the CSS spec. Use color(${a.id}) instead of prefixed color(${r}).`)}else a=Ey.findFormat({name:t,type:`function`}),o=a.space;i&&Object.assign(i,{format:a,formatId:a.name,types:c,commas:n.parsed.commas});let l=1;n.parsed.lastAlpha&&(l=n.parsed.args.pop(),i&&(i.alphaType=c.pop()));let u=a.coords.length;if(s.length!==u)throw TypeError(`Expected ${u} coordinates for ${o.id} in ${n.str}), got ${s.length}`);s=a.coerceCoords(s,c),r={spaceId:o.id,coords:s,alpha:l}}else spaceloop:for(let e of Ey.all)for(let t in e.formats){let a=e.formats[t];if(a.type!==`custom`||a.test&&!a.test(n.str))continue;let o=e.getFormat(a),s=o.parse(n.str);if(s){i&&Object.assign(i,{format:o,formatId:t}),r=s;break spaceloop}}if(!r)throw TypeError(`Could not parse ${e} as a color. Missing a plugin?`);return r.alpha=Qv(r.alpha)?r.alpha:r.alpha===void 0?1:iy(0,r.alpha,1),r}var by={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},xy={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp(`(${Object.keys(by).join(`|`)})$`),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function Sy(e){let t={},n=e.match(xy.unitValue)?.[0],r=t.raw=e;return n?(t.type=n===`%`?`<percentage>`:`<angle>`,t.unit=n,t.unitless=Number(r.slice(0,-n.length)),r=t.unitless*by[n]):xy.number.test(r)?(r=Number(r),t.type=`<number>`):r===`none`?r=null:r===`NaN`||r===`calc(NaN)`?(r=NaN,t.type=`<number>`):t.type=`<ident>`,{value:r,meta:t}}function Cy(e){if(!e)return;e=e.trim();let t=e.match(xy.function);if(t){let e=[],n=[],r=!1,i=t[1].toLowerCase(),a=t[2].replace(xy.singleArgument,(t,a)=>{let{value:o,meta:s}=Sy(a);return(t.startsWith(`/`)||i!==`color`&&e.length===3)&&(r=!0),e.push(o),n.push(s),``});return{name:i,args:e,argMeta:n,lastAlpha:r,commas:a.includes(`,`),rawName:t[1],rawArgs:t[2]}}}function wy(e,t){if(Array.isArray(e))return e.map(e=>wy(e,t));if(!e)throw TypeError(`Empty color reference`);Yv(e)&&(e=yy(e,t));let n=e.space||e.spaceId;return typeof n==`string`&&(e.space=Ey.get(n)),e.alpha===void 0&&(e.alpha=1),e}var Ty=75e-6,Ey=class e{constructor(t){this.id=t.id,this.name=t.name,this.base=t.base?e.get(t.base):null,this.aliases=t.aliases,this.base&&(this.fromBase=t.fromBase,this.toBase=t.toBase);let n=t.coords??this.base.coords;for(let e in n)`name`in n[e]||(n[e].name=e);this.coords=n;let r=t.white??this.base.white??`D65`;this.white=_y(r),this.formats=t.formats??{};for(let e in this.formats){let t=this.formats[e];t.type||=`function`,t.name||=e}this.formats.color?.id||(this.formats.color={...this.formats.color??{},id:t.cssId||this.id}),this.gamutSpace=t.gamutSpace?t.gamutSpace===`self`?this:e.get(t.gamutSpace):this.isPolar?this.base:this,this.gamutSpace.isUnbounded&&(this.inGamut=(e,t)=>!0),this.referred=t.referred,Object.defineProperty(this,"path",{value:Dy(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),dy.run(`colorspace-init-end`,this)}inGamut(e,{epsilon:t=Ty}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let n=Object.values(this.coords);return e.every((e,r)=>{let i=n[r];if(i.type!==`angle`&&i.range){if(Qv(e))return!0;let[n,r]=i.range;return(n===void 0||e>=n-t)&&(r===void 0||e<=r+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!(`range`in e))}get cssId(){return this.formats?.color?.id||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type===`angle`)return!0;return!1}getFormat(e){if(!e)return null;e==="default"?e=Object.values(this.formats)[0]:typeof e==`string`&&(e=this.formats[e]);let t=hy.get(e,this);return t!==e&&e.name in this.formats&&(this.formats[e.name]=t),t}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(t,n){if(arguments.length===1){let e=wy(t);[t,n]=[e.space,e.coords]}if(t=e.get(t),this.equals(t))return n;n=n.map(e=>Qv(e)?0:e);let r=this.path,i=t.path,a,o;for(let e=0;e<r.length&&r[e].equals(i[e]);e++)a=r[e],o=e;if(!a)throw Error(`Cannot convert between color spaces ${this} and ${t}: no connection space was found`);for(let e=r.length-1;e>o;e--)n=r[e].toBase(n);for(let e=o+1;e<i.length;e++)n=i[e].fromBase(n);return n}from(t,n){if(arguments.length===1){let e=wy(t);[t,n]=[e.space,e.coords]}return t=e.get(t),t.to(this,n)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let n=this.coords[t],r=n.range||n.refRange;e.push(r?.min??0)}return e}static registry={};static get all(){return[...new Set(Object.values(e.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let e of t.aliases)this.register(e,t);return t}static get(t,...n){if(!t||ly(t,this))return t;if(Xv(t)===`string`){let n=e.registry[t.toLowerCase()];if(!n)throw TypeError(`No color space found with id = "${t}"`);return n}if(n.length)return e.get(...n);throw TypeError(`${t} is not a valid color space`)}static findFormat(t,n=e.all){if(!t)return null;typeof t==`string`&&(t={name:t});for(let e of n)for(let[n,r]of Object.entries(e.formats)){r.name??=n,r.type??=`function`;let i=(!t.name||r.name===t.name)&&(!t.type||r.type===t.type);if(t.id){let e=r.ids||[r.id],n=Array.isArray(t.id)?t.id:[t.id];i&&=n.some(t=>e.includes(t))}if(i){let t=hy.get(r,e);return t!==r&&(e.formats[r.name]=t),t}}return null}static resolveCoord(t,n){let r=Xv(t),i,a;if(r===`string`?t.includes(`.`)?[i,a]=t.split(`.`):[i,a]=[,t]:Array.isArray(t)?[i,a]=t:(i=t.space,a=t.coordId),i=e.get(i),i||=n,!i)throw TypeError(`Cannot resolve coordinate reference ${t}: No color space specified and relative references are not allowed here`);if(r=Xv(a),r===`number`||r===`string`&&a>=0){let e=Object.entries(i.coords)[a];if(e)return{space:i,id:e[0],index:a,...e[1]}}i=e.get(i);let o=a.toLowerCase(),s=0;for(let e in i.coords){let t=i.coords[e];if(e.toLowerCase()===o||t.name?.toLowerCase()===o)return{space:i,id:e,index:s,...t};s++}throw TypeError(`No "${a}" coordinate found in ${i.name}. Its coordinates are: ${Object.keys(i.coords).join(`, `)}`)}static DEFAULT_FORMAT={type:`functions`,name:`color`}};function Dy(e){let t=[e];for(let n=e;n=n.base;)t.push(n);return t}var Oy=new Ey({id:`xyz-d65`,name:`XYZ D65`,coords:{x:{refRange:[0,1],name:`X`},y:{refRange:[0,1],name:`Y`},z:{refRange:[0,1],name:`Z`}},white:`D65`,formats:{color:{ids:[`xyz-d65`,`xyz`]}},aliases:[`xyz`]}),ky=class extends Ey{constructor(e){e.coords||={r:{range:[0,1],name:`Red`},g:{range:[0,1],name:`Green`},b:{range:[0,1],name:`Blue`}},e.base||=Oy,e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??=t=>{let n=Jv(t,e.toXYZ_M);return this.white!==this.base.white&&(n=vy(this.white,this.base.white,n)),n},e.fromBase??=t=>(t=vy(this.base.white,this.white,t),Jv(t,e.fromXYZ_M))),e.referred??=`display`,super(e)}};function Ay(e,t={}){if(Array.isArray(e))return e.map(e=>Ay(e,t));let{cssProperty:n=`background-color`,element:r,...i}=t,a=null;try{return wy(e,i)}catch(e){a=e}let{CSS:o,getComputedStyle:s}=globalThis;if(Yv(e)&&r&&o&&s&&o.supports(n,e)){let t=r.style[n];e!==t&&(r.style[n]=e);let o=s(r).getPropertyValue(n);if(e!==t&&(r.style[n]=t),o!==e)try{return wy(o,i)}catch(e){a=e}else a={message:`Color value is a valid CSS color, but it could not be resolved :(`}}return t.errorMeta&&(t.errorMeta.error=a),null}function jy(e,t){e=wy(e);let n=Ey.get(t,t?.space),r=t?.precision,i;return i=!n||e.space.equals(n)?e.coords.slice():n.from(e),r===void 0?i:i.map(e=>ey(e,r))}function My(e,t){if(e=wy(e),t===`alpha`)return e.alpha??1;let{space:n,index:r}=Ey.resolveCoord(t,e.space);return jy(e,n)[r]}function Ny(e,t,n,r){return e=wy(e),Array.isArray(t)&&([t,n,r]=[e.space,t,n]),t=Ey.get(t),e.coords=t===e.space?n.slice():t.to(e.space,n),r!==void 0&&(e.alpha=r),e}Ny.returns=`color`;function Py(e,t,n){if(e=wy(e),arguments.length===2&&Xv(arguments[1])===`object`){let t=arguments[1];for(let n in t)Py(e,n,t[n])}else if(typeof n==`function`&&(n=n(My(e,t))),t===`alpha`)e.alpha=n;else{let{space:r,index:i}=Ey.resolveCoord(t,e.space),a=jy(e,r);a[i]=n,Ny(e,r,a)}return e}Py.returns=`color`;var Fy=new Ey({id:`xyz-d50`,name:`XYZ D50`,white:`D50`,base:Oy,fromBase:e=>vy(Oy.white,`D50`,e),toBase:e=>vy(`D50`,Oy.white,e)}),Iy=216/24389,Ly=24/116,Ry=24389/27,zy=gy.D50,By=new Ey({id:`lab`,name:`Lab`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:zy,base:Fy,fromBase(e){let t=e.map((e,t)=>e/zy[t]).map(e=>e>Iy?Math.cbrt(e):(Ry*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let[t,n,r]=e,i=[];return i[1]=(t+16)/116,i[0]=n/500+i[1],i[2]=i[1]-r/200,[i[0]>Ly?i[0]**3:(116*i[0]-16)/Ry,e[0]>8?((e[0]+16)/116)**3:e[0]/Ry,i[2]>Ly?i[2]**3:(116*i[2]-16)/Ry].map((e,t)=>e*zy[t])},formats:{lab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function Vy(e){return typeof e==`number`?(e%360+360)%360:e}function Hy(e,t){let[n,r]=t,i=Qv(n),a=Qv(r);if(i&&a)return[n,r];if(i?n=r:a&&(r=n),e===`raw`)return t;n=Vy(n),r=Vy(r);let o=r-n;return e===`increasing`?o<0&&(r+=360):e===`decreasing`?o>0&&(n+=360):e===`longer`?-180<o&&o<180&&(o>0?n+=360:r+=360):e===`shorter`&&(o>180?n+=360:o<-180&&(r+=360)),[n,r]}var Uy=new Ey({id:`lch`,name:`LCH`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,150],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:By,fromBase(e){if(this.ε===void 0){let e=Object.values(this.base.coords)[1].refRange,t=e[1]-e[0];this.ε=t/1e5}let[t,n,r]=e,i=Math.abs(n)<this.ε&&Math.abs(r)<this.ε,a=i?null:Vy(Math.atan2(r,n)*180/Math.PI);return[t,i?0:Math.sqrt(n**2+r**2),a]},toBase(e){let[t,n,r]=e,i=null,a=null;return Qv(r)||(n=n<0?0:n,i=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180)),[t,i,a]},formats:{lch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),Wy=25**7,Gy=Math.PI,Ky=180/Gy,qy=Gy/180;function Jy(e){let t=e*e;return t*t*t*e}function Yy(e,t,{kL:n=1,kC:r=1,kH:i=1}={}){[e,t]=wy([e,t]);let[a,o,s]=By.from(e),c=Uy.from(By,[a,o,s])[1],[l,u,d]=By.from(t),f=Uy.from(By,[l,u,d])[1];c<0&&(c=0),f<0&&(f=0);let p=Jy((c+f)/2),m=.5*(1-Math.sqrt(p/(p+Wy))),h=(1+m)*o,g=(1+m)*u,_=Math.sqrt(h**2+s**2),v=Math.sqrt(g**2+d**2),y=h===0&&s===0?0:Math.atan2(s,h),b=g===0&&d===0?0:Math.atan2(d,g);y<0&&(y+=2*Gy),b<0&&(b+=2*Gy),y*=Ky,b*=Ky;let x=l-a,S=v-_,C=b-y,w=y+b,T=Math.abs(C),E;_*v===0?E=0:T<=180?E=C:C>180?E=C-360:C<-180?E=C+360:fy.warn(`the unthinkable has happened`);let D=2*Math.sqrt(v*_)*Math.sin(E*qy/2),O=(a+l)/2,k=(_+v)/2,A=Jy(k),j;j=_*v===0?w:T<=180?w/2:w<360?(w+360)/2:(w-360)/2;let M=(O-50)**2,ee=1+.015*M/Math.sqrt(20+M),te=1+.045*k,N=1;N-=.17*Math.cos((j-30)*qy),N+=.24*Math.cos(2*j*qy),N+=.32*Math.cos((3*j+6)*qy),N-=.2*Math.cos((4*j-63)*qy);let ne=1+.015*k*N,re=30*Math.exp(-1*((j-275)/25)**2),ie=2*Math.sqrt(A/(A+Wy)),ae=-1*Math.sin(2*re*qy)*ie,P=(x/(n*ee))**2;return P+=(S/(r*te))**2,P+=(D/(i*ne))**2,P+=ae*(S/(r*te))*(D/(i*ne)),Math.sqrt(P)}var Xy=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Zy=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Qy=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],$y=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],eb=new Ey({id:`oklab`,name:`Oklab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:Oy,fromBase(e){let t=Jv(e,Xy);return t[0]=Math.cbrt(t[0]),t[1]=Math.cbrt(t[1]),t[2]=Math.cbrt(t[2]),Jv(t,Qy,t)},toBase(e){let t=Jv(e,$y);return t[0]**=3,t[1]**=3,t[2]**=3,Jv(t,Zy,t)},formats:{oklab:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function tb(e,t){[e,t]=wy([e,t]);let[n,r,i]=eb.from(e),[a,o,s]=eb.from(t),c=n-a,l=r-o,u=i-s;return Math.sqrt(c**2+l**2+u**2)}var nb=75e-6;function rb(e,t,{epsilon:n=nb}={}){e=wy(e),t||=e.space,t=Ey.get(t);let r=e.coords;return t!==e.space&&(r=t.from(e)),t.inGamut(r,{epsilon:n})}function ib(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function ab(e,t,n=`lab`){n=Ey.get(n);let r=n.from(e),i=n.from(t);return Math.sqrt(r.reduce((e,t,n)=>{let r=i[n];return Qv(t)||Qv(r)?e:e+(r-t)**2},0))}function ob(e,t){return ab(e,t,`lab`)}var sb=Math.PI/180;function cb(e,t,{l:n=2,c:r=1}={}){[e,t]=wy([e,t]);let[i,a,o]=By.from(e),[,s,c]=Uy.from(By,[i,a,o]),[l,u,d]=By.from(t),f=Uy.from(By,[l,u,d])[1];s<0&&(s=0),f<0&&(f=0);let p=i-l,m=s-f,h=a-u,g=o-d,_=h**2+g**2-m**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let y=.0638*s/(1+.0131*s)+.638,b;Qv(c)&&(c=0),b=c>=164&&c<=345?.56+Math.abs(.2*Math.cos((c+168)*sb)):.36+Math.abs(.4*Math.cos((c+35)*sb));let x=s**4,S=Math.sqrt(x/(x+1900)),C=y*(S*b+1-S),w=(p/(n*v))**2;return w+=(m/(r*y))**2,w+=_/C**2,Math.sqrt(w)}var lb=203,ub=new Ey({id:`xyz-abs-d65`,cssId:`--xyz-abs-d65`,name:`Absolute XYZ D65`,coords:{x:{refRange:[0,9504.7],name:`Xa`},y:{refRange:[0,1e4],name:`Ya`},z:{refRange:[0,10888.3],name:`Za`}},base:Oy,fromBase(e){return e.map(e=>e*lb)},toBase(e){return e.map(e=>e/lb)}}),db=1.15,fb=.66,pb=2610/2**14,mb=2**14/2610,hb=3424/4096,gb=2413/128,_b=2392/128,vb=1.7*2523/32,yb=32/(1.7*2523),bb=-.56,xb=16295499532821565e-27,Sb=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Cb=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],wb=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Tb=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],Eb=new Ey({id:`jzazbz`,name:`Jzazbz`,coords:{jz:{refRange:[0,1],name:`Jz`},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:ub,fromBase(e){let[t,n,r]=e,[i,a,o]=Jv(Jv([db*t-.1499999999999999*r,fb*n- -.33999999999999997*t,r],Sb).map(function(e){return oy((hb+gb*oy(e/1e4,pb))/(1+_b*oy(e/1e4,pb)),vb)}),wb);return[.43999999999999995*i/(1+bb*i)-xb,a,o]},toBase(e){let[t,n,r]=e,[i,a,o]=Jv(Jv([(t+xb)/(.43999999999999995-bb*(t+xb)),n,r],Tb).map(function(e){return 1e4*oy((hb-oy(e,yb))/(_b*oy(e,yb)-gb),mb)}),Cb),s=(i+.1499999999999999*o)/db;return[s,(a+-.33999999999999997*s)/fb,o]},formats:{jzazbz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),Db=new Ey({id:`jzczhz`,name:`JzCzHz`,coords:{jz:{refRange:[0,1],name:`Jz`},cz:{refRange:[0,.26],name:`Chroma`},hz:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Eb,fromBase:Uy.fromBase,toBase:Uy.toBase,formats:{jzczhz:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}});function Ob(e,t){[e,t]=wy([e,t]);let[n,r,i]=Db.from(e),[a,o,s]=Db.from(t),c=n-a,l=r-o;Qv(i)&&Qv(s)?(i=0,s=0):Qv(i)?i=s:Qv(s)&&(s=i);let u=i-s,d=2*Math.sqrt(r*o)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(c**2+l**2+d**2)}var kb=3424/4096,Ab=2413/128,jb=2392/128,Mb=2610/16384,Nb=2523/32,Pb=16384/2610,Fb=32/2523,Ib=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],Lb=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],Rb=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],zb=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],Bb=new Ey({id:`ictcp`,name:`ICTCP`,coords:{i:{refRange:[0,1],name:`I`},ct:{refRange:[-.5,.5],name:`CT`},cp:{refRange:[-.5,.5],name:`CP`}},base:ub,fromBase(e){return Vb(Jv(e,Ib))},toBase(e){return Jv(Hb(e),zb)},formats:{ictcp:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <percentage>`]}}});function Vb(e){return Jv(e.map(function(e){return((kb+Ab*(e/1e4)**Mb)/(1+jb*(e/1e4)**Mb))**Nb}),Lb)}function Hb(e){return Jv(e,Rb).map(function(e){return 1e4*(Math.max(e**Fb-kb,0)/(Ab-jb*e**Fb))**Pb})}function Ub(e,t){[e,t]=wy([e,t]);let[n,r,i]=Bb.from(e),[a,o,s]=Bb.from(t);return 720*Math.sqrt((n-a)**2+.25*(r-o)**2+(i-s)**2)}function Wb(e,t){[e,t]=wy([e,t]);let[n,r,i]=eb.from(e),[a,o,s]=eb.from(t),c=n-a,l=2*(r-o),u=2*(i-s);return Math.sqrt(c**2+l**2+u**2)}var Gb=gy.D65,Kb=.42,qb=1/Kb,Jb=2*Math.PI,Yb=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],Xb=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],Zb=[[460,451,288],[460,-891,-261],[460,-220,-6300]],Qb={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},$b={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},ex=180/Math.PI,tx=Math.PI/180;function nx(e,t){return e.map(e=>{let n=oy(t*Math.abs(e)*.01,Kb);return 400*ay(n,e)/(n+27.13)})}function rx(e,t){let n=100/t*27.13**qb;return e.map(e=>{let t=Math.abs(e);return ay(n*oy(t/(400-t),qb),e)})}function ix(e){let t=Vy(e);t<=$b.h[0]&&(t+=360);let n=cy($b.h,t)-1,[r,i]=$b.h.slice(n,n+2),[a,o]=$b.e.slice(n,n+2),s=$b.H[n],c=(t-r)/a;return s+100*c/(c+(i-t)/o)}function ax(e){let t=(e%400+400)%400,n=Math.floor(.01*t);t%=100;let[r,i]=$b.h.slice(n,n+2),[a,o]=$b.e.slice(n,n+2);return Vy((t*(o*r-a*i)-100*r*o)/(t*(o-a)-100*o))}function ox(e,t,n,r,i){let a={};a.discounting=i,a.refWhite=e,a.surround=r;let o=e.map(e=>e*100);a.la=t,a.yb=n;let s=o[1],c=Jv(o,Yb),l=Qb[a.surround],u=l[0];a.c=l[1],a.nc=l[2];let d=(1/(5*a.la+1))**4;a.fl=d*a.la+.1*(1-d)*(1-d)*Math.cbrt(5*a.la),a.flRoot=a.fl**.25,a.n=a.yb/s,a.z=1.48+Math.sqrt(a.n),a.nbb=.725*a.n**-.2,a.ncb=a.nbb;let f=Math.max(Math.min(u*(1-1/3.6*Math.exp((-a.la-42)/92)),1),0);a.dRgb=c.map(e=>ty(1,s/e,f)),a.dRgbInv=a.dRgb.map(e=>1/e);let p=nx(c.map((e,t)=>e*a.dRgb[t]),a.fl);return a.aW=a.nbb*(2*p[0]+p[1]+.05*p[2]),a}var sx=ox(Gb,64/Math.PI*.2,20,`average`,!1);function cx(e,t){if(!(e.J!==void 0^e.Q!==void 0))throw Error(`Conversion requires one and only one: 'J' or 'Q'`);if(!(e.C!==void 0^e.M!==void 0^e.s!==void 0))throw Error(`Conversion requires one and only one: 'C', 'M' or 's'`);if(!(e.h!==void 0^e.H!==void 0))throw Error(`Conversion requires one and only one: 'h' or 'H'`);if(e.J===0||e.Q===0)return[0,0,0];let n=0;n=e.h===void 0?ax(e.H)*tx:Vy(e.h)*tx;let r=Math.cos(n),i=Math.sin(n),a=0;e.J===void 0?e.Q!==void 0&&(a=.25*t.c*e.Q/((t.aW+4)*t.flRoot)):a=oy(e.J,1/2)*.1;let o=0;e.C===void 0?e.M===void 0?e.s!==void 0&&(o=4e-4*e.s**2*(t.aW+4)/t.c):o=e.M/t.flRoot/a:o=e.C/a;let s=oy(o*(1.64-.29**t.n)**-.73,10/9),c=.25*(Math.cos(n+2)+3.8),l=t.aW*oy(a,2/t.c/t.z),u=5e4/13*t.nc*t.ncb*c,d=l/t.nbb,f=23*(d+.305)*sy(s,23*u+s*(11*r+108*i));return Jv(rx(Jv([d,f*r,f*i],Zb).map(e=>e*1/1403),t.fl).map((e,n)=>e*t.dRgbInv[n]),Xb).map(e=>e/100)}function lx(e,t){let n=nx(Jv(e.map(e=>e*100),Yb).map((e,n)=>e*t.dRgb[n]),t.fl),r=n[0]+(-12*n[1]+n[2])/11,i=(n[0]+n[1]-2*n[2])/9,a=(Math.atan2(i,r)%Jb+Jb)%Jb,o=.25*(Math.cos(a+2)+3.8),s=oy(5e4/13*t.nc*t.ncb*sy(o*Math.sqrt(r**2+i**2),n[0]+n[1]+1.05*n[2]+.305),.9)*(1.64-.29**t.n)**.73,c=oy(t.nbb*(2*n[0]+n[1]+.05*n[2])/t.aW,.5*t.c*t.z),l=100*oy(c,2),u=4/t.c*c*(t.aW+4)*t.flRoot,d=s*c,f=d*t.flRoot,p=Vy(a*ex),m=ix(p);return{J:l,C:d,h:p,s:50*oy(t.c*s/(t.aW+4),1/2),Q:u,M:f,H:m}}var ux=new Ey({id:`cam16-jmh`,cssId:`--cam16-jmh`,name:`CAM16-JMh`,coords:{j:{refRange:[0,100],name:`J`},m:{refRange:[0,105],name:`Colorfulness`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:Oy,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=lx(e,sx),n=Math.abs(t.M)<this.ε;return[t.J,n?0:t.M,n?null:t.h]},toBase(e){return cx({J:e[0],M:e[1],h:e[2]},sx)}}),dx=gy.D65,fx=216/24389,px=24389/27;function mx(e){return 116*(e>fx?Math.cbrt(e):(px*e+16)/116)-16}function hx(e){return e>8?((e+16)/116)**3:e/px}function gx(e,t){let[n,r,i]=e,a=[],o=0;if(i===0)return[0,0,0];let s=hx(i);o=i>0?.00379058511492914*i**2+.608983189401032*i+.9155088574762233:9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;let c=0,l=1/0;for(;c<=15;){a=cx({J:o,C:r,h:n},t);let e=Math.abs(a[1]-s);if(e<l){if(e<=2e-12)return a;l=e}o-=(a[1]-s)*o/(2*a[1]),c+=1}return cx({J:o,C:r,h:n},t)}function _x(e,t){let n=mx(e[1]);if(n===0)return[0,0,0];let r=lx(e,vx);return[Vy(r.h),r.C,n]}var vx=ox(dx,200/Math.PI*hx(50),hx(50)*100,`average`,!1),yx=new Ey({id:`hct`,name:`HCT`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},c:{refRange:[0,145],name:`Colorfulness`},t:{refRange:[0,100],name:`Tone`}},base:Oy,fromBase(e){this.ε===void 0&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);let t=_x(e);return t[1]<this.ε&&(t[1]=0,t[0]=null),t},toBase(e){return gx(e,vx)},formats:{color:{id:`--hct`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),bx=Math.PI/180,xx=[1,.007,.0228];function Sx(e){e[1]<0&&(e=yx.fromBase(yx.toBase(e)));let t=Math.log(Math.max(1+xx[2]*e[1]*vx.flRoot,1))/xx[2],n=e[0]*bx,r=t*Math.cos(n),i=t*Math.sin(n);return[e[2],r,i]}function Cx(e,t){[e,t]=wy([e,t]);let[n,r,i]=Sx(yx.from(e)),[a,o,s]=Sx(yx.from(t));return Math.sqrt((n-a)**2+(r-o)**2+(i-s)**2)}var wx={deltaE76:ob,deltaECMC:cb,deltaE2000:Yy,deltaEJz:Ob,deltaEITP:Ub,deltaEOK:tb,deltaEOK2:Wb,deltaEHCT:Cx};function Tx(e){return Math.max(parseFloat(`1e${(e?Math.floor(Math.log10(Math.abs(e))):0)-2}`),1e-6)}var Ex={hct:{method:`hct.c`,jnd:2,deltaEMethod:`hct`,blackWhiteClamp:{}},"hct-tonal":{method:`hct.c`,jnd:0,deltaEMethod:`hct`,blackWhiteClamp:{channel:`hct.t`,min:0,max:100}}};function Dx(e,{method:t=fy.gamut_mapping,space:n=void 0,deltaEMethod:r=``,jnd:i=2,blackWhiteClamp:a=void 0}={}){if(e=wy(e),Yv(arguments[1])?n=arguments[1]:n||=e.space,n=Ey.get(n),rb(e,n,{epsilon:0}))return e;let o;if(t===`css`)o=kx(e,{space:n});else{if(t!==`clip`&&!rb(e,n)){Object.prototype.hasOwnProperty.call(Ex,t)&&({method:t,jnd:i,deltaEMethod:r,blackWhiteClamp:a}=Ex[t]);let s=Yy;if(r!==``){for(let e in wx)if(`deltae`+r.toLowerCase()===e.toLowerCase()){s=wx[e];break}}i===0&&(i=1e-16);let c=Dx(Ax(e,n),{method:`clip`,space:n});if(s(e,c)>i){if(a&&Object.keys(a).length===3){let t=Ey.resolveCoord(a.channel),n=My(Ax(e,t.space),t.id);if(Qv(n)&&(n=0),n>=a.max)return Ax({space:`xyz-d65`,coords:gy.D65},e.space);if(n<=a.min)return Ax({space:`xyz-d65`,coords:[0,0,0]},e.space)}let r=Ey.resolveCoord(t),c=r.space,l=r.id,u=Ax(e,c);u.coords.forEach((e,t)=>{Qv(e)&&(u.coords[t]=0)});let d=(r.range||r.refRange)[0],f=Tx(i),p=d,m=My(u,l);for(;m-p>f;){let e=ib(u);e=Dx(e,{space:n,method:`clip`}),s(u,e)-i<f?p=My(u,l):m=My(u,l),Py(u,l,(p+m)/2)}o=Ax(u,n)}else o=c}else o=Ax(e,n);if(t===`clip`||!rb(o,n,{epsilon:0})){let e=Object.values(n.coords).map(e=>e.range||[]);o.coords=o.coords.map((t,n)=>{let[r,i]=e[n];return r!==void 0&&(t=Math.max(r,t)),i!==void 0&&(t=Math.min(t,i)),t})}}return n!==e.space&&(o=Ax(o,e.space)),e.coords=o.coords,e}Dx.returns=`color`;var Ox={WHITE:{space:eb,coords:[1,0,0],alpha:1},BLACK:{space:eb,coords:[0,0,0],alpha:1}};function kx(e,{space:t}={}){let n=.02,r=1e-4;e=wy(e),t||=e.space,t=Ey.get(t);let i=Ey.get(`oklch`);if(t.isUnbounded)return Ax(e,t);let a=Ax(e,i),o=a.coords[0];if(o>=1){let n=Ax(Ox.WHITE,t);return n.alpha=e.alpha,Ax(n,t)}if(o<=0){let n=Ax(Ox.BLACK,t);return n.alpha=e.alpha,Ax(n,t)}if(rb(a,t,{epsilon:0}))return Ax(a,t);function s(e){let n=Ax(e,t),r=Object.values(t.coords);return n.coords=n.coords.map((e,t)=>{if(`range`in r[t]){let[n,i]=r[t].range;return iy(n,e,i)}return e}),n}let c=0,l=a.coords[1],u=!0,d=ib(a),f=s(d),p=tb(f,d);if(p<n)return f;for(;l-c>r;){let e=(c+l)/2;if(d.coords[1]=e,u&&rb(d,t,{epsilon:0}))c=e;else if(f=s(d),p=tb(f,d),p<n){if(n-p<r)break;u=!1,c=e}else l=e}return f}function Ax(e,t,{inGamut:n}={}){e=wy(e),t=Ey.get(t);let r=t.from(e),i={space:t,coords:r,alpha:e.alpha};return n&&(i=Dx(i,n===!0?void 0:n)),i}Ax.returns=`color`;function jx(e,t={}){let{precision:n=fy.precision,format:r,inGamut:i=!0,coords:a,alpha:o,commas:s}=t,c,l=wy(e),u=r,d=l.parseMeta;d&&!r&&(d.format.canSerialize()&&(r=d.format,u=d.formatId),a??=d.types,o??=d.alphaType,s??=d.commas),u&&(r=l.space.getFormat(r)??Ey.findFormat(u)),r||(r=l.space.getFormat(`default`)??Ey.DEFAULT_FORMAT,u=r.name),r&&r.space&&r.space!==l.space&&(l=Ax(l,r.space));let f=l.coords.slice();if(i||=r.toGamut,i&&!rb(l)&&(f=Dx(ib(l),i===!0?void 0:i).coords),r.type===`custom`){if(r.serialize)c=r.serialize(f,l.alpha,t);else throw TypeError(`format ${u} can only be used to parse colors, not for serialization`)}else{let e=r.name||`color`,t=r.serializeCoords(f,n,a);if(e===`color`){let e=r.id||r.ids?.[0]||l.space.cssId||l.space.id;t.unshift(e)}let i=l.alpha;o!==void 0&&typeof o!=`object`&&(o=typeof o==`string`?{type:o}:{include:o});let u=o?.type??`<number>`,d=o?.include===!0||r.alpha===!0||o?.include!==!1&&r.alpha!==!1&&i<1,p=``;if(s??=r.commas,d){if(n!==null){let e;u===`<percentage>`&&(e=`%`,i*=100),i=Zv(i,{precision:n,unit:e})}p=`${s?`,`:` /`} ${i}`}c=`${e}(${t.join(s?`, `:` `)}${p})`}return c}var Mx=new ky({id:`rec2020-linear`,cssId:`--rec2020-linear`,name:`Linear REC.2020`,white:`D65`,toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),Nx=new ky({id:`rec2020`,name:`REC.2020`,base:Mx,toBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**2.4})},fromBase(e){return e.map(function(e){let t=e<0?-1:1;return t*(e*t)**(1/2.4)})}}),Px=new ky({id:`p3-linear`,cssId:`display-p3-linear`,name:`Linear P3`,white:`D65`,toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),Fx=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],Ix=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],Lx=new ky({id:`srgb-linear`,name:`Linear sRGB`,white:`D65`,toXYZ_M:Fx,fromXYZ_M:Ix}),Rx={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},zx=[,,,].fill(`<percentage> | <number>[0, 255]`),Bx=[,,,].fill(`<number>[0, 255]`),Vx=new ky({id:`srgb`,name:`sRGB`,base:Lx,fromBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e}),toBase:e=>e.map(e=>{let t=e<0?-1:1,n=e*t;return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4}),formats:{rgb:{coords:zx},rgb_number:{name:`rgb`,commas:!0,coords:Bx,alpha:!1},color:{},rgba:{coords:zx,commas:!0,alpha:!0},rgba_number:{name:`rgba`,commas:!0,coords:Bx},hex:{type:`custom`,toGamut:!0,test:e=>/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(e),parse(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,`$&$&`));let t=[];return e.replace(/[a-f0-9]{2}/gi,e=>{t.push(parseInt(e,16)/255)}),{spaceId:`srgb`,coords:t.slice(0,3),alpha:t.slice(3)[0]}},serialize:(e,t,{collapse:n=!0,alpha:r}={})=>{(r!==!1&&t<1||r===!0)&&e.push(t),e=e.map(e=>Math.round(e*255));let i=n&&e.every(e=>e%17==0);return`#`+e.map(e=>i?(e/17).toString(16):e.toString(16).padStart(2,`0`)).join(``)}},keyword:{type:`custom`,test:e=>/^[a-z]+$/i.test(e),parse(e){e=e.toLowerCase();let t={spaceId:`srgb`,coords:null,alpha:1};if(e===`transparent`?(t.coords=Rx.black,t.alpha=0):t.coords=Rx[e],t.coords)return t}}}}),Hx=new ky({id:`p3`,cssId:`display-p3`,name:`P3`,base:Px,fromBase:Vx.fromBase,toBase:Vx.toBase});fy.display_space=Vx;var Ux;if(typeof CSS<`u`&&CSS.supports)for(let e of[By,Nx,Hx]){let t=jx({space:e,coords:e.getMinCoords(),alpha:1});if(CSS.supports(`color`,t)){fy.display_space=e;break}}function Wx(e,{space:t=fy.display_space,...n}={}){e=wy(e);let r=jx(e,n);if(typeof CSS>`u`||CSS.supports(`color`,r)||!fy.display_space)r=new String(r),r.color=e;else{let i=e;if((e.coords.some(Qv)||Qv(e.alpha))&&!(Ux??=CSS.supports(`color`,`hsl(none 50% 50%)`))&&(i=ib(e),i.coords=i.coords.map($v),i.alpha=$v(i.alpha),r=jx(i,n),CSS.supports(`color`,r)))return r=new String(r),r.color=i,r;i=Ax(i,t),r=new String(jx(i,n)),r.color=i}return r}function Gx(e,t,{space:n,hue:r=`shorter`}={}){e=wy(e),n||=e.space,n=Ey.get(n);let i=Object.values(n.coords);[e,t]=[e,t].map(e=>Ax(e,n));let[a,o]=[e,t].map(e=>e.coords),s=a.map((e,t)=>{let n=i[t],a=o[t];return n.type===`angle`&&([e,a]=Hy(r,[e,a])),Kx(e,a)}),c=Kx(e.alpha,t.alpha);return{space:n,coords:s,alpha:c}}function Kx(e,t){return Qv(e)||Qv(t)?e===t?null:0:e-t}function qx(e,t){return e=wy(e),t=wy(t),e.space===t.space&&e.alpha===t.alpha&&e.coords.every((e,n)=>e===t.coords[n])}function Jx(e){return My(e,[Oy,`y`])}function Yx(e,t){Py(e,[Oy,`y`],t)}function Xx(e){Object.defineProperty(e.prototype,"luminance",{get(){return Jx(this)},set(e){Yx(this,e)}})}var Zx=Object.freeze({__proto__:null,getLuminance:Jx,register:Xx,setLuminance:Yx});function Qx(e,t){e=wy(e),t=wy(t);let n=Math.max(Jx(e),0),r=Math.max(Jx(t),0);return r>n&&([n,r]=[r,n]),(n+.05)/(r+.05)}var $x=.56,eS=.57,tS=.62,nS=.65,rS=.022,iS=1.414,aS=.1,oS=5e-4,sS=1.14,cS=.027,lS=1.14;function uS(e){return e>=rS?e:e+(rS-e)**iS}function dS(e){return(e<0?-1:1)*Math.abs(e)**2.4}function fS(e,t){t=wy(t),e=wy(e);let n,r,i,a,o,s;t=Ax(t,`srgb`),[a,o,s]=t.coords.map(e=>Qv(e)?0:e);let c=dS(a)*.2126729+dS(o)*.7151522+dS(s)*.072175;e=Ax(e,`srgb`),[a,o,s]=e.coords.map(e=>Qv(e)?0:e);let l=dS(a)*.2126729+dS(o)*.7151522+dS(s)*.072175,u=uS(c),d=uS(l),f=d>u;return Math.abs(d-u)<oS?r=0:f?(n=d**$x-u**eS,r=n*sS):(n=d**nS-u**tS,r=n*lS),i=Math.abs(r)<aS?0:r>0?r-cS:r+cS,i*100}function pS(e,t){e=wy(e),t=wy(t);let n=Math.max(Jx(e),0),r=Math.max(Jx(t),0);r>n&&([n,r]=[r,n]);let i=n+r;return i===0?0:(n-r)/i}var mS=5e4;function hS(e,t){e=wy(e),t=wy(t);let n=Math.max(Jx(e),0),r=Math.max(Jx(t),0);return r>n&&([n,r]=[r,n]),r===0?mS:(n-r)/r}function gS(e,t){e=wy(e),t=wy(t);let n=My(e,[By,`l`]),r=My(t,[By,`l`]);return Math.abs(n-r)}var _S=216/24389,vS=24/116,yS=24389/27,bS=gy.D65,xS=new Ey({id:`lab-d65`,name:`Lab D65`,coords:{l:{refRange:[0,100],name:`Lightness`},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:bS,base:Oy,fromBase(e){let t=e.map((e,t)=>e/bS[t]).map(e=>e>_S?Math.cbrt(e):(yS*e+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(e){let t=[];return t[1]=(e[0]+16)/116,t[0]=e[1]/500+t[1],t[2]=t[1]-e[2]/200,[t[0]>vS?t[0]**3:(116*t[0]-16)/yS,e[0]>8?((e[0]+16)/116)**3:e[0]/yS,t[2]>vS?t[2]**3:(116*t[2]-16)/yS].map((e,t)=>e*bS[t])},formats:{"lab-d65":{coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),SS=5**.5*.5+.5;function CS(e,t){e=wy(e),t=wy(t);let n=My(e,[xS,`l`]),r=My(t,[xS,`l`]),i=Math.abs(n**+SS-r**+SS)**(1/SS)*Math.SQRT2-40;return i<7.5?0:i}var wS=Object.freeze({__proto__:null,contrastAPCA:fS,contrastDeltaPhi:CS,contrastLstar:gS,contrastMichelson:pS,contrastWCAG21:Qx,contrastWeber:hS});function TS(e,t,n){Yv(n)&&(n={algorithm:n});let{algorithm:r,...i}=n||{};if(!r){let e=Object.keys(wS).map(e=>e.replace(/^contrast/,``)).join(`, `);throw TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${e}`)}e=wy(e),t=wy(t);for(let n in wS)if(`contrast`+r.toLowerCase()===n.toLowerCase())return wS[n](e,t,i);throw TypeError(`Unknown contrast algorithm: ${r}`)}function ES(e){let[t,n,r]=jy(e,Oy),i=t+15*n+3*r;return[4*t/i,9*n/i]}function DS(e){let[t,n,r]=jy(e,Oy),i=t+n+r;return[t/i,n/i]}function OS(e){Object.defineProperty(e.prototype,"uv",{get(){return ES(this)}}),Object.defineProperty(e.prototype,"xy",{get(){return DS(this)}})}var kS=Object.freeze({__proto__:null,register:OS,uv:ES,xy:DS});function AS(e,t,n={}){Yv(n)&&(n={method:n});let{method:r=fy.deltaE,...i}=n;for(let n in wx)if(`deltae`+r.toLowerCase()===n.toLowerCase())return wx[n](e,t,i);throw TypeError(`Unknown deltaE method: ${r}`)}function jS(e,t=.25){return Py(e,[Ey.get(`oklch`,`lch`),`l`],e=>e*(1+t))}function MS(e,t=.25){return Py(e,[Ey.get(`oklch`,`lch`),`l`],e=>e*(1-t))}jS.returns=`color`,MS.returns=`color`;var NS=Object.freeze({__proto__:null,darken:MS,lighten:jS});function PS(e,t,n,r={}){return[e,t]=[wy(e),wy(t)],Xv(n)===`object`&&([n,r]=[.5,n]),IS(e,t,r)(n??.5)}function FS(e,t,n={}){let r;LS(e)&&([r,n]=[e,t],[e,t]=r.rangeArgs.colors);let{maxDeltaE:i,deltaEMethod:a,steps:o=2,maxSteps:s=1e3,...c}=n;r||=([e,t]=[wy(e),wy(t)],IS(e,t,c));let l=AS(e,t),u=i>0?Math.max(o,Math.ceil(l/i)+1):o,d=[];if(s!==void 0&&(u=Math.min(u,s)),u===1)d=[{p:.5,color:r(.5)}];else{let e=1/(u-1);d=Array.from({length:u},(t,n)=>{let i=n*e;return{p:i,color:r(i)}})}if(i>0){let e=d.reduce((e,t,n)=>{if(n===0)return 0;let r=AS(t.color,d[n-1].color,a);return Math.max(e,r)},0);for(;e>i;){e=0;for(let t=1;t<d.length&&d.length<s;t++){let n=d[t-1],i=d[t],a=(i.p+n.p)/2,o=r(a);e=Math.max(e,AS(o,n.color),AS(o,i.color)),d.splice(t,0,{p:a,color:r(a)}),t++}}}return d=d.map(e=>e.color),d}function IS(e,t,n={}){if(LS(e)){let[n,r]=[e,t];return IS(...n.rangeArgs.colors,{...n.rangeArgs.options,...r})}let{space:r,outputSpace:i,progression:a,premultiplied:o}=n;e=wy(e),t=wy(t),e=ib(e),t=ib(t);let s={colors:[e,t],options:n};if(r=r?Ey.get(r):Ey.registry[fy.interpolationSpace]||e.space,i=i?Ey.get(i):r,e=Ax(e,r),t=Ax(t,r),e=Dx(e),t=Dx(t),r.coords.h&&r.coords.h.type===`angle`){let i=n.hue=n.hue||`shorter`,a=[r,`h`],[o,s]=[My(e,a),My(t,a)];Qv(o)&&!Qv(s)?o=s:Qv(s)&&!Qv(o)&&(s=o),[o,s]=Hy(i,[o,s]),Py(e,a,o),Py(t,a,s)}return o&&(e.coords=e.coords.map(t=>t*e.alpha),t.coords=t.coords.map(e=>e*t.alpha)),Object.assign(n=>{n=a?a(n):n;let s=e.coords.map((e,r)=>{let i=t.coords[r];return ty(e,i,n)}),c=ty(e.alpha,t.alpha,n),l={space:r,coords:s,alpha:c};return o&&(l.coords=l.coords.map(e=>e/c)),i!==r&&(l=Ax(l,i)),l},{rangeArgs:s})}function LS(e){return Xv(e)===`function`&&!!e.rangeArgs}fy.interpolationSpace=`lab`;function RS(e){e.defineFunction(`mix`,PS,{returns:`color`}),e.defineFunction(`range`,IS,{returns:`function<color>`}),e.defineFunction(`steps`,FS,{returns:`array<color>`})}var zS=Object.freeze({__proto__:null,isRange:LS,mix:PS,range:IS,register:RS,steps:FS}),BS=new Ey({id:`hsl`,name:`HSL`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:Vx,fromBase:e=>{let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,(n+t)/2],l=t-n;if(l!==0){switch(s=c===0||c===1?0:(t-c)/Math.min(c,1-c),t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return s<0&&(o+=180,s=Math.abs(s)),o>=360&&(o-=360),[o,s*100,c*100]},toBase:e=>{let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/30)%12,a=n*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]},hsla:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`],commas:!0,alpha:!0}}}),VS=new Ey({id:`hsv`,name:`HSV`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},v:{range:[0,100],name:`Value`}},base:Vx,fromBase(e){let t=Math.max(...e),n=Math.min(...e),[r,i,a]=e,[o,s,c]=[null,0,t],l=t-n;if(l!==0){switch(t){case r:o=(i-a)/l+(i<a?6:0);break;case i:o=(a-r)/l+2;break;case a:o=(r-i)/l+4}o*=60}return c&&(s=l/c),o>=360&&(o-=360),[o,s*100,c*100]},toBase(e){let[t,n,r]=e;t%=360,t<0&&(t+=360),n/=100,r/=100;function i(e){let i=(e+t/60)%6;return r-r*n*Math.max(0,Math.min(i,4-i,1))}return[i(5),i(3),i(1)]},formats:{color:{id:`--hsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),HS=new Ey({id:`hwb`,name:`HWB`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},w:{range:[0,100],name:`Whiteness`},b:{range:[0,100],name:`Blackness`}},base:VS,fromBase(e){let[t,n,r]=e;return[t,r*(100-n)/100,100-r]},toBase(e){let[t,n,r]=e;n/=100,r/=100;let i=n+r;if(i>=1)return[t,0,n/i*100];let a=1-r;return[t,(a===0?0:1-n/a)*100,a*100]},formats:{hwb:{coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),US=new ky({id:`a98rgb-linear`,cssId:`--a98-rgb-linear`,name:`Linear Adobe® 98 RGB compatible`,white:`D65`,toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),WS=new ky({id:`a98rgb`,cssId:`a98-rgb`,name:`Adobe® 98 RGB compatible`,base:US,toBase:e=>e.map(e=>Math.abs(e)**(563/256)*Math.sign(e)),fromBase:e=>e.map(e=>Math.abs(e)**(256/563)*Math.sign(e))}),GS=new ky({id:`prophoto-linear`,cssId:`--prophoto-rgb-linear`,name:`Linear ProPhoto`,white:`D50`,base:Fy,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),KS=1/512,qS=16/512,JS=new ky({id:`prophoto`,cssId:`prophoto-rgb`,name:`ProPhoto`,base:GS,toBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n<qS?e/16:t*n**1.8})},fromBase(e){return e.map(e=>{let t=e<0?-1:1,n=e*t;return n>=KS?t*n**(1/1.8):16*e})}}),YS=1.09929682680944,XS=.018053968510807,ZS=new ky({id:`--rec2020-oetf`,name:`REC.2020_Scene_Referred`,base:Mx,referred:`scene`,toBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n<XS*4.5?e/4.5:t*((n+YS-1)/YS)**(1/.45)})},fromBase(e){return e.map(function(e){let t=e<0?-1:1,n=e*t;return n>=XS?t*(YS*n**.45-.09929682680944008):4.5*e})}}),QS=new Ey({id:`oklch`,name:`OkLCh`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:eb,fromBase:Uy.fromBase,toBase:Uy.toBase,formats:{oklch:{coords:[`<percentage> | <number>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),$S=2*Math.PI,eC=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],tC=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],nC=Number.MAX_VALUE,rC=.206,iC=.03,aC=1.206/1.03;function oC(e,t){let n=e.length;if(n!==t.length)throw Error(`Vectors of size ${n} and ${t.length} are not aligned`);let r=0;return e.forEach((e,n)=>{r+=e*t[n]}),r}function sC(e){return .5*(aC*e-rC+Math.sqrt((aC*e-rC)*(aC*e-rC)+4*iC*aC*e))}function cC(e){return(e**2+rC*e)/(aC*(e+iC))}function lC(e){let[t,n]=e;return[n/t,n/(1-t)]}function uC(e,t){return[.11516993+1/(7.4477897+4.1590124*t+e*(-2.19557347+1.75198401*t+e*(-2.13704948-10.02301043*t+e*(-4.24894561+5.38770819*t+4.69891013*e)))),.11239642+1/(1.6132032-.68124379*t+e*(.40370612+.90148123*t+e*(-.27087943+.6122399*t+e*(.00299215-.45399568*t-.14661872*e))))]}function dC(e,t){let n=Jv(e,$y);return n[0]**=3,n[1]**=3,n[2]**=3,Jv(n,t,n)}function fC(e,t,n,r){let i=hC(e,t,n,r),a=dC([1,i*e,i*t],n),o=oy(1/Math.max(...a),1/3);return[o,o*i]}function pC(e,t,n,r,i,a,o,s){let c;if(s===void 0&&(s=fC(e,t,a,o)),(n-i)*s[1]-(s[0]-i)*r<=0)c=s[1]*i/(r*s[0]+s[1]*(i-n));else{c=s[1]*(i-1)/(r*(s[0]-1)+s[1]*(i-n));let o=n-i,l=r,u=oC($y[0].slice(1),[e,t]),d=oC($y[1].slice(1),[e,t]),f=oC($y[2].slice(1),[e,t]),p=o+l*u,m=o+l*d,h=o+l*f,g=i*(1-c)+c*n,_=c*r,v=g+_*u,y=g+_*d,b=g+_*f,x=v**3,S=y**3,C=b**3,w=3*p*v**2,T=3*m*y**2,E=3*h*b**2,D=6*p**2*v,O=6*m**2*y,k=6*h**2*b,A=oC(a[0],[x,S,C])-1,j=oC(a[0],[w,T,E]),M=oC(a[0],[D,O,k]),ee=j/(j*j-.5*A*M),te=-A*ee,N=oC(a[1],[x,S,C])-1,ne=oC(a[1],[w,T,E]),re=oC(a[1],[D,O,k]),ie=ne/(ne*ne-.5*N*re),ae=-N*ie,P=oC(a[2],[x,S,C])-1,F=oC(a[2],[w,T,E]),I=oC(a[2],[D,O,k]),oe=F/(F*F-.5*P*I),se=-P*oe;te=ee>=0?te:nC,ae=ie>=0?ae:nC,se=oe>=0?se:nC,c+=Math.min(te,Math.min(ae,se))}return c}function mC(e,t,n){let[r,i,a]=e,o=fC(i,a,t,n),s=pC(i,a,r,1,r,t,n,o),c=lC(o),l=s/Math.min(r*c[0],(1-r)*c[1]),u=uC(i,a),d=r*u[0],f=(1-r)*u[1],p=.9*l*Math.sqrt(Math.sqrt(1/(1/d**4+1/f**4)));return d=r*.4,f=(1-r)*.8,[Math.sqrt(1/(1/d**2+1/f**2)),p,s]}function hC(e,t,n,r){let i,a,o,s,c,l,u,d;oC(r[0][0],[e,t])>1?([i,a,o,s,c]=r[0][1],[l,u,d]=n[0]):oC(r[1][0],[e,t])>1?([i,a,o,s,c]=r[1][1],[l,u,d]=n[1]):([i,a,o,s,c]=r[2][1],[l,u,d]=n[2]);let f=i+a*e+o*t+s*e**2+c*e*t,p=oC($y[0].slice(1),[e,t]),m=oC($y[1].slice(1),[e,t]),h=oC($y[2].slice(1),[e,t]),g=1+f*p,_=1+f*m,v=1+f*h,y=g**3,b=_**3,x=v**3,S=3*p*g**2,C=3*m*_**2,w=3*h*v**2,T=6*p**2*g,E=6*m**2*_,D=6*h**2*v,O=l*y+u*b+d*x,k=l*S+u*C+d*w,A=l*T+u*E+d*D;return f-=O*k/(k**2-.5*O*A),f}function gC(e,t,n){let[r,i,a]=e,o=cC(a),s=null,c=null;if(r=Vy(r)/360,o!==0&&o!==1&&i!==0){let e=Math.cos($S*r),a=Math.sin($S*r),[l,u,d]=mC([o,e,a],t,n),f=.8,p,m,h,g;i<f?(p=1.25*i,m=0,h=f*l,g=1-h/u):(p=5*(i-.8),m=u,h=.2*u**2*1.25**2/l,g=1-h/(d-u));let _=m+p*h/(1-g*p);s=_*e,c=_*a}return[o,s,c]}function _C(e,t,n){let r=e[0],i=0,a=sC(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/$S;if(a!==0&&a!==1&&o!==0){let[a,s,c]=mC([r,e[1]/o,e[2]/o],t,n),l=.8,u,d,f,p;o<s?(d=l*a,f=1-d/s,p=o/(d+f*o),i=p*l):(u=s,d=.2*s**2*1.25**2/a,f=1-d/(c-s),p=(o-u)/(d+f*(o-u)),i=l+.2*p)}let c=Math.abs(i)<1e-4;return c||a===0||Math.abs(1-a)<1e-7?(s=null,c||(i=0)):s=Vy(s*360),[s,i,a]}var vC=new Ey({id:`okhsl`,name:`Okhsl`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},l:{range:[0,1],name:`Lightness`}},base:eb,gamutSpace:`self`,fromBase(e){return _C(e,eC,tC)},toBase(e){return gC(e,eC,tC)},formats:{color:{id:`--okhsl`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),yC=new Ey({id:`oklrab`,name:`Oklrab`,coords:{l:{refRange:[0,1],name:`Lightness`},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:`D65`,base:eb,fromBase(e){return[sC(e[0]),e[1],e[2]]},toBase(e){return[cC(e[0]),e[1],e[2]]},formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[-1,1]`,`<number> | <percentage>[-1,1]`]}}}),bC=new Ey({id:`oklrch`,name:`Oklrch`,coords:{l:{refRange:[0,1],name:`Lightness`},c:{refRange:[0,.4],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},white:`D65`,base:yC,fromBase:Uy.fromBase,toBase:Uy.toBase,formats:{color:{coords:[`<percentage> | <number>`,`<number> | <percentage>[0,1]`,`<number> | <angle>`]}}});function xC(e,t,n){let[r,i,a]=e;r=Vy(r)/360;let o=cC(a),s=null,c=null;if(o!==0&&i!==0){let e=Math.cos($S*r),l=Math.sin($S*r),[u,d]=lC(fC(e,l,t,n)),f=.5,p=1-f/u,m=1-i*f/(f+d-d*p*i),h=i*d*f/(f+d-d*p*i);o=a*m;let g=a*h,_=cC(m),v=h*_/m,y=cC(o);g=g*y/o,o=y;let[b,x,S]=dC([_,e*v,l*v],t),C=oy(1/Math.max(Math.max(b,x),Math.max(S,0)),1/3);o*=C,g*=C,s=g*e,c=g*l}return[o,s,c]}function SC(e,t,n){let r=e[0],i=0,a=sC(r),o=Math.sqrt(e[1]**2+e[2]**2),s=.5+Math.atan2(-e[2],-e[1])/$S;if(r!==0&&r!==1&&o!==0){let s=e[1]/o,c=e[2]/o,[l,u]=lC(fC(s,c,t,n)),d=.5,f=1-d/l,p=u/(o+r*u),m=p*r,h=p*o,g=cC(m),_=h*g/m,[v,y,b]=dC([g,s*_,c*_],t),x=oy(1/Math.max(Math.max(v,y),Math.max(b,0)),1/3);r/=x,o/=x,o=o*sC(r)/r,r=sC(r),a=r/m,i=(d+u)*h/(u*d+u*f*h)}return s=Math.abs(i)<1e-4||a===0?null:Vy(s*360),[s,i,a]}var CC=new Ey({id:`okhsv`,name:`Okhsv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,1],name:`Saturation`},v:{range:[0,1],name:`Value`}},base:eb,gamutSpace:`self`,fromBase(e){return SC(e,eC,tC)},toBase(e){return xC(e,eC,tC)},formats:{color:{id:`--okhsv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),wC=gy.D65,TC=216/24389,EC=24389/27,[DC,OC]=ES({space:Oy,coords:wC}),kC=new Ey({id:`luv`,name:`Luv`,coords:{l:{refRange:[0,100],name:`Lightness`},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:wC,base:Oy,fromBase(e){let t=[$v(e[0]),$v(e[1]),$v(e[2])],n=t[1],[r,i]=ES({space:Oy,coords:t});if(!Number.isFinite(r)||!Number.isFinite(i))return[0,0,0];let a=n<=TC?EC*n:116*Math.cbrt(n)-16;return[a,13*a*(r-DC),13*a*(i-OC)]},toBase(e){let[t,n,r]=e;if(t===0||Qv(t))return[0,0,0];n=$v(n),r=$v(r);let i=n/(13*t)+DC,a=r/(13*t)+OC,o=t<=8?t/EC:((t+16)/116)**3;return[o*(9*i/(4*a)),o,o*((12-3*i-20*a)/(4*a))]},formats:{color:{id:`--luv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <percentage>`]}}}),AC=new Ey({id:`lchuv`,name:`LChuv`,coords:{l:{refRange:[0,100],name:`Lightness`},c:{refRange:[0,220],name:`Chroma`},h:{refRange:[0,360],type:`angle`,name:`Hue`}},base:kC,fromBase:Uy.fromBase,toBase:Uy.toBase,formats:{color:{id:`--lchuv`,coords:[`<number> | <percentage>`,`<number> | <percentage>`,`<number> | <angle>`]}}}),jC=216/24389,MC=24389/27,NC=Ix[0][0],PC=Ix[0][1],FC=Ix[0][2],IC=Ix[1][0],LC=Ix[1][1],RC=Ix[1][2],zC=Ix[2][0],BC=Ix[2][1],VC=Ix[2][2];function HC(e,t,n){let r=t/(Math.sin(n)-e*Math.cos(n));return r<0?1/0:r}function UC(e){let t=(e+16)**3/1560896,n=t>jC?t:e/MC,r=n*(284517*NC-94839*FC),i=n*(838422*FC+769860*PC+731718*NC),a=n*(632260*FC-126452*PC),o=n*(284517*IC-94839*RC),s=n*(838422*RC+769860*LC+731718*IC),c=n*(632260*RC-126452*LC),l=n*(284517*zC-94839*VC),u=n*(838422*VC+769860*BC+731718*zC),d=n*(632260*VC-126452*BC);return{r0s:r/a,r0i:i*e/a,r1s:r/(a+126452),r1i:(i-769860)*e/(a+126452),g0s:o/c,g0i:s*e/c,g1s:o/(c+126452),g1i:(s-769860)*e/(c+126452),b0s:l/d,b0i:u*e/d,b1s:l/(d+126452),b1i:(u-769860)*e/(d+126452)}}function WC(e,t){let n=t/360*Math.PI*2,r=HC(e.r0s,e.r0i,n),i=HC(e.r1s,e.r1i,n),a=HC(e.g0s,e.g0i,n),o=HC(e.g1s,e.g1i,n),s=HC(e.b0s,e.b0i,n),c=HC(e.b1s,e.b1i,n);return Math.min(r,i,a,o,s,c)}var GC=new Ey({id:`hsluv`,name:`HSLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:AC,gamutSpace:Vx,fromBase(e){let[t,n,r]=[$v(e[0]),$v(e[1]),$v(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/WC(UC(t),r)*100,[r,i,t]},toBase(e){let[t,n,r]=[$v(e[0]),$v(e[1]),$v(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=WC(UC(r),t)/100*n,[r,i,t]},formats:{color:{id:`--hsluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}});Ix[0][0],Ix[0][1],Ix[0][2],Ix[1][0],Ix[1][1],Ix[1][2],Ix[2][0],Ix[2][1],Ix[2][2];function KC(e,t){return Math.abs(t)/Math.sqrt(e**2+1)}function qC(e){let t=KC(e.r0s,e.r0i),n=KC(e.r1s,e.r1i),r=KC(e.g0s,e.g0i),i=KC(e.g1s,e.g1i),a=KC(e.b0s,e.b0i),o=KC(e.b1s,e.b1i);return Math.min(t,n,r,i,a,o)}var JC=new Ey({id:`hpluv`,name:`HPLuv`,coords:{h:{refRange:[0,360],type:`angle`,name:`Hue`},s:{range:[0,100],name:`Saturation`},l:{range:[0,100],name:`Lightness`}},base:AC,gamutSpace:`self`,fromBase(e){let[t,n,r]=[$v(e[0]),$v(e[1]),$v(e[2])],i;return t>99.9999999?(i=0,t=100):t<1e-8?(i=0,t=0):i=n/qC(UC(t))*100,[r,i,t]},toBase(e){let[t,n,r]=[$v(e[0]),$v(e[1]),$v(e[2])],i;return r>99.9999999?(r=100,i=0):r<1e-8?(r=0,i=0):i=qC(UC(r))/100*n,[r,i,t]},formats:{color:{id:`--hpluv`,coords:[`<number> | <angle>`,`<percentage> | <number>`,`<percentage> | <number>`]}}}),YC=new ky({id:`rec2100-linear`,name:`Linear REC.2100`,white:`D65`,toBase:Mx.toBase,fromBase:Mx.fromBase}),XC=203,ZC=2610/2**14,QC=2**14/2610,$C=2523/32,ew=32/2523,tw=3424/4096,nw=2413/128,rw=2392/128,iw=new ky({id:`rec2100pq`,cssId:`rec2100-pq`,name:`REC.2100-PQ`,base:YC,toBase(e){return e.map(function(e){return(Math.max(e**ew-tw,0)/(nw-rw*e**ew))**QC*1e4/XC})},fromBase(e){return e.map(function(e){let t=Math.max(e*XC/1e4,0);return((tw+nw*t**ZC)/(1+rw*t**ZC))**$C})}}),aw=.17883277,ow=.28466892,sw=.55991073,cw=3.7743,lw=new ky({id:`rec2100hlg`,cssId:`rec2100-hlg`,name:`REC.2100-HLG`,referred:`scene`,base:YC,toBase(e){return e.map(function(e){return e<=.5?e**2/3*cw:(Math.exp((e-sw)/aw)+ow)/12*cw})},fromBase(e){return e.map(function(e){return e/=cw,e<=1/12?oy(3*e,.5):aw*Math.log(12*e-ow)+sw})}}),uw={};dy.add(`chromatic-adaptation-start`,e=>{e.options.method&&(e.M=fw(e.W1,e.W2,e.options.method))}),dy.add(`chromatic-adaptation-end`,e=>{e.M||=fw(e.W1,e.W2,e.options.method)});function dw({id:e,toCone_M:t,fromCone_M:n}){uw[e]=arguments[0]}function fw(e,t,n=`Bradford`){let r=uw[n],[i,a,o]=Kv(r.toCone_M,e),[s,c,l]=Kv(r.toCone_M,t),u=Kv([[s/i,0,0],[0,c/a,0],[0,0,l/o]],r.toCone_M);return Kv(r.fromCone_M,u)}dw({id:`von Kries`,toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),dw({id:`Bradford`,toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),dw({id:`CAT02`,toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),dw({id:`CAT16`,toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(gy,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),gy.ACES=[.32168/.33767,1,.34065/.33767];var pw=new ky({id:`acescg`,cssId:`--acescg`,name:`ACEScg`,coords:{r:{range:[0,65504],name:`Red`},g:{range:[0,65504],name:`Green`},b:{range:[0,65504],name:`Blue`}},referred:`scene`,white:gy.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),mw=2**-16,hw=-.35828683,gw=(Math.log2(65504)+9.72)/17.52,_w=new ky({id:`acescc`,cssId:`--acescc`,name:`ACEScc`,coords:{r:{range:[hw,gw],name:`Red`},g:{range:[hw,gw],name:`Green`},b:{range:[hw,gw],name:`Blue`}},referred:`scene`,base:pw,toBase(e){return e.map(function(e){return e<=-.3013698630136986?(2**(e*17.52-9.72)-mw)*2:e<gw?2**(e*17.52-9.72):65504})},fromBase(e){return e.map(function(e){return e<=0?(Math.log2(mw)+9.72)/17.52:e<mw?(Math.log2(mw+e*.5)+9.72)/17.52:(Math.log2(e)+9.72)/17.52})}}),vw=Object.freeze({__proto__:null,A98RGB:WS,A98RGB_Linear:US,ACEScc:_w,ACEScg:pw,CAM16_JMh:ux,HCT:yx,HPLuv:JC,HSL:BS,HSLuv:GC,HSV:VS,HWB:HS,ICTCP:Bb,JzCzHz:Db,Jzazbz:Eb,LCH:Uy,LCHuv:AC,Lab:By,Lab_D65:xS,Luv:kC,OKLCH:QS,OKLab:eb,OKLrCH:bC,OKLrab:yC,Okhsl:vC,Okhsv:CC,P3:Hx,P3_Linear:Px,ProPhoto:JS,ProPhoto_Linear:GS,REC_2020:Nx,REC_2020_Linear:Mx,REC_2020_Scene_Referred:ZS,REC_2100_HLG:lw,REC_2100_Linear:YC,REC_2100_PQ:iw,XYZ_ABS_D65:ub,XYZ_D50:Fy,XYZ_D65:Oy,sRGB:Vx,sRGB_Linear:Lx}),yw=class e{constructor(...e){let t;if(e.length===1){let n={};typeof e[0]==`object`&&Object.getPrototypeOf(e[0]).constructor===Object&&(e[0]={...e[0]}),t=wy(e[0],{parseMeta:n}),n.format&&(this.parseMeta=n)}let n,r,i;t?(n=t.space||t.spaceId,r=t.coords,i=t.alpha):[n,r,i]=e,Object.defineProperty(this,"space",{value:Ey.get(n),writable:!1,enumerable:!0,configurable:!0}),this.coords=r?r.slice():[0,0,0],this.alpha=Qv(i)?i:i===void 0?1:iy(0,i,1);for(let e in this.space.coords)Object.defineProperty(this,e,{get:()=>this.get(e),set:t=>this.set(e,t)})}get spaceId(){return this.space.id}clone(){return new e(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...t){let n=Wx(this,...t);return n.color=new e(n.color),n}static get(t,...n){return ly(t,this)?t:new e(t,...n)}static try(t,n){if(ly(t,this))return t;let r=Ay(t,n);return r?new e(r):null}static defineFunction(t,n,r=n){let{instance:i=!0,returns:a}=r,o=function(...t){let r=n(...t);if(a===`color`)r=e.get(r);else if(a===`function<color>`){let t=r;r=function(...n){let r=t(...n);return e.get(r)},Object.assign(r,t)}else a===`array<color>`&&(r=r.map(t=>e.get(t)));return r};t in e||(e[t]=o),i&&(e.prototype[t]=function(...e){return o(this,...e)})}static defineFunctions(t){for(let n in t)e.defineFunction(n,t[n],t[n])}static extend(t){if(t.register)t.register(e);else for(let n in t)e.defineFunction(n,t[n])}};yw.defineFunctions({get:My,getAll:jy,set:Py,setAll:Ny,to:Ax,equals:qx,inGamut:rb,toGamut:Dx,distance:ab,deltas:Gx,toString:jx}),Object.assign(yw,{util:uy,hooks:dy,WHITES:gy,Space:Ey,spaces:Ey.registry,parse:yy,defaults:fy});for(let e of Object.keys(vw))Ey.register(vw[e]);for(let e in Ey.registry)bw(e,Ey.registry[e]);dy.add(`colorspace-init-end`,e=>{bw(e.id,e),e.aliases?.forEach(t=>{bw(t,e)})});function bw(e,t){let n=e.replace(/-/g,`_`);Object.defineProperty(yw.prototype,n,{get(){let n=this.getAll(e);if(typeof Proxy>`u`)return n;let r=new Proxy(n,{has:(e,n)=>{try{return Ey.resolveCoord([t,n]),!0}catch{}return Reflect.has(e,n)},get:(e,n,i)=>{if(n&&typeof n!=`symbol`&&!(n in e)&&n in r){let{index:r}=Ey.resolveCoord([t,n]);if(r>=0)return e[r]}return Reflect.get(e,n,i)},set:(n,r,i,a)=>{if(r&&typeof r!=`symbol`&&!(r in n)||Number(r)>=0){let{index:a}=Ey.resolveCoord([t,r]);if(a>=0)return n[a]=i,this.setAll(e,n),!0}return Reflect.set(n,r,i,a)}});return r},set(t){this.setAll(e,t)},configurable:!0,enumerable:!0})}yw.extend(wx),yw.extend({deltaE:AS}),Object.assign(yw,{deltaEMethods:wx}),yw.extend(NS),yw.extend({contrast:TS}),yw.extend(kS),yw.extend(Zx),yw.extend(zS),yw.extend(wS);function xw(e,t=1,n=!1){return`hsla(${e}, ${n?50:65}%, ${n?60:40}%, ${t})`}function Sw(e,t=1,n=!1){let r=0;for(let t=0;t<e.length;t++)r=e.charCodeAt(t)+((r<<5)-r);return xw((r%360+360)%360,t,n)}var Cw=[`vite-plugin-`,`rollup-plugin-`,`webpack-plugin-`,`unplugin-`,`nuxt-`,`eslint-plugin-`,`postcss-`,`vite:`,`rollup:`,`rolldown:`,`webpack:`,`__`];function ww(e){let t=e.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`);return RegExp(`^(?:@[^/]+\\/)?(?:${t})`)}ww(Cw);function Tw(e,t){let[n,r,i]=new yw(e).to(`srgb`).coords.map(e=>Math.round(Math.max(0,Math.min(1,e??0))*255));return`rgba(${n}, ${r}, ${i}, ${t})`}var Ew=G({__name:`DisplayBadge`,props:{text:{},color:{type:[Boolean,Number,String],default:!0},variant:{default:`subtle`},icon:{},as:{},colorScheme:{},rounded:{default:`md`},paddingX:{default:.5},paddingY:{default:.25}},setup(e){let t=e;function n(e){return/^#|^hsl|^rgb|^var\(/.test(e)}let r=Wh(()=>t.colorScheme),i=Q(()=>r.value===`dark`),a=Q(()=>typeof t.color==`string`&&!n(t.color)),o=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return xw(e,1,i.value);if(typeof e==`string`&&n(e))return e;if(e===!0&&r)return Sw(r,1,i.value)}),s=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return xw(e,t.variant===`solid`?1:.12,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Tw(e,.12);if(e===!0&&r)return Sw(r,t.variant===`solid`?1:.12,i.value)}),c=Q(()=>{let{color:e,text:r}=t;if(typeof e==`number`)return xw(e,.2,i.value);if(typeof e==`string`&&n(e))return t.variant===`solid`?e:Tw(e,.2);if(e===!0&&r)return Sw(r,.2,i.value)}),l=Q(()=>{let e={padding:`${t.paddingY}em ${t.paddingX}em`,...typeof t.rounded==`number`?{borderRadius:`${t.rounded}em`}:{}};return o.value?t.variant===`solid`?{...e,color:`#fff`,background:s.value,border:`1px solid ${s.value}`}:a.value?{...e,color:o.value,background:s.value}:{...e,color:o.value,background:s.value,border:`1px solid ${c.value}`}:e}),u=Q(()=>a.value?`badge-color-${t.color}`:t.color===!1?`bg-#8881 color-muted`:``),d=Q(()=>typeof t.rounded==`number`?``:t.rounded===`full`?`rounded-full`:`rounded-md`);return(t,n)=>(q(),Y(da(e.as||`span`),{class:ye([`leading-none font-medium inline-flex gap-1 items-center`,[d.value,u.value]]),style:me(l.value)},{default:U(()=>[e.icon?(q(),J(`span`,{key:0,class:ye(e.icon),"aria-hidden":`true`},null,2)):Os(``,!0),K(t.$slots,`default`,{},()=>[Es(je(e.text),1)])]),_:3},8,[`class`,`style`]))}}),Dw={key:0,class:`flex-1 min-w-0`},Ow={key:1,class:`flex gap-1 items-center`},kw=G({__name:`LayoutToolbar`,props:{sticky:{type:Boolean,default:!0},glass:{type:Boolean,default:!0}},setup(e){return(t,n)=>(q(),J(`div`,{class:ye([`px-3 py-2 border-b border-base flex gap-3 items-center`,[e.sticky?`sticky top-0 z-nav`:``,e.glass?`bg-glass`:`bg-base`]])},[K(t.$slots,`start`,{},()=>[K(t.$slots,`default`)]),t.$slots.search?(q(),J(`div`,Dw,[K(t.$slots,`search`)])):Os(``,!0),t.$slots.end?(q(),J(`div`,Ow,[K(t.$slots,`end`)])):Os(``,!0)],2))}});function Aw(...e){return e.filter(Boolean).join(` `)}var jw={connecting:{label:`connecting…`,dot:`bg-neutral-400 animate-pulse`},disconnected:{label:`disconnected`,dot:`bg-error`},unauthorized:{label:`unauthorized`,dot:`bg-warning`},error:{label:`error`,dot:`bg-error`}};function Mw(e,t){if(e===`connected`)return null;let n=jw[e];return{label:n.label,dot:Aw(`inline-block size-1.5 rounded-full shrink-0`,n.dot),class:Aw(`flex items-center gap-1.5 shrink-0 text-xs color-muted select-none`,t)}}function Nw(e,t){return!!(t.excludeUnderscoreProps&&e.startsWith(`_`)||t.excludeDollarProps&&e.startsWith(`$`))}var Pw=[];for(let e of[`WeakMap`,`WeakSet`,`WeakRef`,`ArrayBuffer`,`SharedArrayBuffer`]){let t=globalThis[e];typeof t==`function`&&Pw.push([t,e])}function Fw(e,t={}){let n=performance.now(),r={seen:new Map,stats:{nodes:0,refs:0,truncatedDepth:0,truncatedEntries:0,truncatedProps:0,ms:0},opts:{maxDepth:t.maxDepth??8,maxEntries:t.maxEntries??200,maxProps:t.maxProps??150,maxString:t.maxString??4e3,excludeFunctions:t.excludeFunctions??!1,excludeUnderscoreProps:t.excludeUnderscoreProps??!1,excludeDollarProps:t.excludeDollarProps??!1}},i=Lw(e,r,0,`#`,[]);return r.stats.ms=Math.round((performance.now()-n)*100)/100,{data:i,stats:r.stats}}function Iw(e,t,n={}){let r=e;for(let[e,i]of t){if(typeof r!=`object`||!r)return;switch(e){case`k`:r=r instanceof Map?r.get(i):Object.hasOwn(r,i)?r[i]:void 0;break;case`i`:{let e=r;r=(n.excludeFunctions?e.filter(e=>typeof e!=`function`):e)[i];break}case`s`:r=[...r][i];break;case`mk`:r=[...r.entries()][i]?.[0];break;case`mv`:r=[...r.entries()][i]?.[1]}}return r}function Lw(e,t,n,r,i){t.stats.nodes++;let a=Rw(e,t);if(a.handled)return a.value;let o=e,s=t.seen.get(o);return s===void 0?zw(o)||(n>=t.opts.maxDepth?(t.stats.truncatedDepth++,{$truncated:`depth`,$preview:qw(o),$path:i}):(t.seen.set(o,r),Array.isArray(o)?Bw(o,t,n,r,i):ArrayBuffer.isView(o)?Vw(o):o instanceof Map?Hw(o,t,n,r,i):o instanceof Set?Uw(o,t,n,r,i):Ww(o,t,n,r,i))):(t.stats.refs++,{$ref:s})}function Rw(e,t){if(e==null)return{handled:!0,value:e??null};let n=typeof e;if(n===`string`){let n=e;return{handled:!0,value:n.length>t.opts.maxString?`${n.slice(0,t.opts.maxString)}… [$truncated string, ${n.length} chars]`:n}}return n===`number`?{handled:!0,value:Number.isFinite(e)?e:String(e)}:n===`boolean`?{handled:!0,value:e}:n===`bigint`?{handled:!0,value:{$type:`bigint`,value:String(e)}}:n===`symbol`?{handled:!0,value:{$type:`symbol`,value:String(e)}}:n===`function`?{handled:!0,value:{$type:`function`,name:e.name||`(anonymous)`}}:{handled:!1}}function zw(e){if(e instanceof Date)return{$type:`Date`,value:Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString()};if(e instanceof RegExp)return{$type:`RegExp`,value:String(e)};if(e instanceof URL)return{$type:`URL`,value:e.href};if(e instanceof Error)return{$type:`Error`,name:e.name,message:e.message};if(e instanceof Promise)return{$type:`Promise`};for(let[t,n]of Pw)if(e instanceof t)return{$type:n}}function Bw(e,t,n,r,i){let a=t.opts.excludeFunctions?e.filter(e=>typeof e!=`function`):e,o=Math.min(a.length,t.opts.maxEntries),s=Array.from({length:o});for(let e=0;e<o;e++)s[e]=Lw(a[e],t,n+1,`${r}[${e}]`,Kw(i,[`i`,e]));return a.length>o&&(t.stats.truncatedEntries++,s.push({$truncated:`entries`,$total:a.length,$shown:o})),s}function Vw(e){let t=e;return{$type:e.constructor?.name??`TypedArray`,length:t.length??t.byteLength}}function Hw(e,t,n,r,i){let a=[...e.entries()].slice(0,t.opts.maxEntries);if(e.size>a.length&&t.stats.truncatedEntries++,a.every(([e])=>typeof e==`string`)){let o={};for(let[e,s]of a)o[e]=Lw(s,t,n+1,`${r}.${String(e)}`,Kw(i,[`k`,e]));return{$type:`Map`,size:e.size,value:o}}return{$type:`Map`,size:e.size,entries:a.map(([e,a],o)=>({key:Lw(e,t,n+1,`${r}~keys[${o}]`,Kw(i,[`mk`,o])),value:Lw(a,t,n+1,`${r}~values[${o}]`,Kw(i,[`mv`,o]))}))}}function Uw(e,t,n,r,i){let a=[...e].slice(0,t.opts.maxEntries);return e.size>a.length&&t.stats.truncatedEntries++,{$type:`Set`,size:e.size,values:a.map((e,a)=>Lw(e,t,n+1,`${r}~set[${a}]`,Kw(i,[`s`,a])))}}function Ww(e,t,n,r,i){let a=Object.getPrototypeOf(e),o=a&&a!==Object.prototype&&a!==null?a.constructor?.name:void 0,s={};o&&o!==`Object`&&(s.$class=o);let c=Object.keys(e).filter(e=>!Nw(e,t.opts)),l=Math.min(c.length,t.opts.maxProps);for(let a=0;a<l;a++)Gw(e,c[a],t,n,r,i,s);return c.length>l&&(t.stats.truncatedProps++,s.$truncated=`props: showing ${l} of ${c.length}`),s}function Gw(e,t,n,r,i,a,o){let s;try{s=e[t]}catch(e){o[t]={$type:`getter-error`,message:e instanceof Error?e.message:String(e)};return}n.opts.excludeFunctions&&typeof s==`function`||(o[t]=Lw(s,n,r+1,`${i}.${t}`,Kw(a,[`k`,t])))}function Kw(e,t){return[...e,t]}function qw(e){if(Array.isArray(e))return`Array(${e.length})`;if(e instanceof Map)return`Map(${e.size})`;if(e instanceof Set)return`Set(${e.size})`;let t=e.constructor?.name??`Object`,n=Object.keys(e);return`${t} { ${n.slice(0,5).join(`, `)}${n.length>5?`, …`:``} }`}function Jw(e){return!!e&&typeof e==`object`&&e.$type===`Map`}function Yw(e){return!!e&&typeof e==`object`&&e.$type===`Set`}function Xw(e){return!!e&&typeof e==`object`&&typeof e.entries==`function`&&typeof e.get==`function`}function Zw(e){return!!e&&typeof e==`object`&&typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`}var Qw;function $w(){return Qw??=ah(async()=>{let{default:e}=await Promise.resolve().then(()=>eN);return{default:e}},void 0,import.meta.url).then(({default:e})=>e.setup({methods:{fromMap:e=>Xw(e)?Object.fromEntries(e.entries()):Jw(e)?e.value??Object.fromEntries((e.entries??[]).map(e=>[String(e.key),e.value])):e,mapEntries:e=>Xw(e)?[...e.entries()].map(([e,t])=>({key:e,value:t})):Jw(e)?e.entries?e.entries:Object.entries(e.value??{}).map(([e,t])=>({key:e,value:t})):[],fromSet:e=>Zw(e)?[...e]:Yw(e)?e.values??[]:e,typeOf:e=>e===null?`null`:typeof e==`object`?e.constructor?.name??`Object`:typeof e,ownKeys:e=>e&&typeof e==`object`?Reflect.ownKeys(e).map(String):[]}}))}async function eT(e,t,n){try{let r=performance.now(),i=(await $w())(t)(e),a=Math.round((performance.now()-r)*100)/100,{data:o,stats:s}=Fw(i,n);return{ok:!0,result:o,stats:{queryMs:a,normalize:s,payloadBytes:new TextEncoder().encode(JSON.stringify(o)??``).length}}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{message:t.message,name:t.name}}}}async function tT(e,t,n,r){try{let i=performance.now(),a=Iw((await $w())(t)(e),n,r),o=Math.round((performance.now()-i)*100)/100,{data:s,stats:c}=Fw(a,r);return{ok:!0,result:s,stats:{queryMs:o,normalize:c,payloadBytes:new TextEncoder().encode(JSON.stringify(s)??``).length}}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{message:t.message,name:t.name}}}}async function nT(e,t,n,r=30){try{let i=performance.now(),a=(await $w())(t,{tolerant:!0,stat:!0})(e).suggestion(n,{limit:r})??[],o=Math.round((performance.now()-i)*100)/100,s=[];for(let e of a){for(let t of e.suggestions??[])if(s.push({type:String(e.type),from:e.from,to:e.to,current:String(e.text??``),value:String(t).slice(0,200)}),s.length>=r)break;if(s.length>=r)break}return{ok:!0,suggestions:s,statMs:o}}catch(e){return{ok:!1,suggestions:[],statMs:0,error:e instanceof Error?e.message:String(e)}}}function rT(e,t={}){let n=performance.now(),r={seen:new WeakSet,nodes:0,opts:{maxDepth:t.maxDepth??5,maxProps:t.maxProps??80,excludeFunctions:t.excludeFunctions??!1,excludeUnderscoreProps:t.excludeUnderscoreProps??!1,excludeDollarProps:t.excludeDollarProps??!1}};return{skeleton:oT(e,r,0),nodes:r.nodes,ms:Math.round((performance.now()-n)*100)/100}}function iT(e){return typeof e.entries==`function`&&typeof e.get==`function`&&typeof e.size==`number`}function aT(e){return typeof e.has==`function`&&typeof e[Symbol.iterator]==`function`&&typeof e.get!=`function`&&typeof e.size==`number`}function oT(e,t,n){if(t.nodes++,e==null)return String(e);let r=typeof e;if(r!==`object`)return r;let i=e;if(i instanceof Date)return`Date`;if(i instanceof RegExp)return`RegExp`;if(i instanceof URL)return`URL`;if(i instanceof Error)return`Error`;if(i instanceof Promise)return`Promise`;if(t.seen.has(i))return`[circular]`;if(n>=t.opts.maxDepth)return`...`;t.seen.add(i);try{return sT(i,t,n)}finally{t.seen.delete(i)}}function sT(e,t,n){return Array.isArray(e)?cT(e,t,n):ArrayBuffer.isView(e)?e.constructor?.name??`TypedArray`:iT(e)?lT(e,t,n):aT(e)?uT(e,t,n):dT(e,t,n)}function cT(e,t,n){let r=t.opts.excludeFunctions?e.filter(e=>typeof e!=`function`):e;if(r.length===0)return[];let i=oT(r[0],t,n+1);return r.length>1?[i,`+${r.length-1} more`]:[i]}function lT(e,t,n){let r=e.entries().next().value;return r?{[`Map(${e.size})`]:{key:oT(r[0],t,n+1),value:oT(r[1],t,n+1)}}:`Map(0)`}function uT(e,t,n){let r=e[Symbol.iterator]().next().value;return r===void 0?`Set(0)`:{[`Set(${e.size})`]:oT(r,t,n+1)}}function dT(e,t,n){let r=Object.getPrototypeOf(e),i=r&&r!==Object.prototype?r.constructor?.name:void 0,a={};i&&i!==`Object`&&(a.$class=i);let o=Object.keys(e).filter(e=>!Nw(e,t.opts)),s=Math.min(o.length,t.opts.maxProps);for(let r=0;r<s;r++)fT(e,o[r],t,n,a);return o.length>s&&(a[`...`]=`+${o.length-s} more props`),a}function fT(e,t,n,r,i){let a;try{a=e[t]}catch{i[t]=`getter-error`;return}n.opts.excludeFunctions&&typeof a==`function`||(i[t]=oT(a,n,r+1))}var pT=Zt({connected:!1,status:`connecting`,error:null,mode:`rpc`}),mT=fn(null);function hT(){if(!mT.value)throw Error(`not connected`);return mT.value}var gT=`devframe:docks:active`,_T=null;async function vT(e,t){let n=_T;if(!n)return;let r=n=>{let r=n?.activation;if(!r||r.dockId!==e)return;let i=r.params?.sourceId;typeof i==`string`&&t(i)};try{let e=await n.sharedState.get(gT,{initialValue:{activation:null}});r(e.value()),e.on(`updated`,r)}catch{}}function yT(e){let t=(t,...n)=>e.call(t,...n);return{static:!1,sources:()=>t(`devframes:plugin:data-inspector:sources`),query:(e,n,r)=>t(`devframes:plugin:data-inspector:query`,e,n,r),queryPath:(e,n,r,i)=>t(`devframes:plugin:data-inspector:queryPath`,e,n,r,i),suggest:(e,n,r)=>t(`devframes:plugin:data-inspector:suggest`,e,n,r),skeleton:(e,n)=>t(`devframes:plugin:data-inspector:skeleton`,e,n),savedList:()=>t(`devframes:plugin:data-inspector:saved:list`),savedSave:e=>t(`devframes:plugin:data-inspector:saved:save`,e),savedDelete:async(e,n)=>{await t(`devframes:plugin:data-inspector:saved:delete`,e,n)},write:(e,n,r)=>t(`devframes:plugin:data-inspector:write`,e,n,r),onSourcesChanged:t=>{e.client.register({name:`devframes:plugin:data-inspector:sources:changed`,type:`event`,handler:t})},onDataChanged:t=>{e.client.register({name:`devframes:plugin:data-inspector:data:changed`,type:`event`,handler:t})}}}function bT(e){let t=e.sources;function n(e){let n=t.find(t=>t.id===e);if(!n)throw Error(`unknown data source "${e}"`);return n.data}return{static:!0,async sources(){return t.map(({data:e,...t})=>t)},async query(e,t,r){return eT(n(e),t,r)},async queryPath(e,t,r,i){return tT(n(e),t,r,i)},async suggest(e,t,r){return nT(n(e),t,r)},async skeleton(e,t){try{return{ok:!0,...rT(n(e),t)}}catch(e){let t=e instanceof Error?e:Error(String(e));return{ok:!1,error:{name:t.name,message:t.message}}}},async savedList(){return[]},async savedSave(){throw Error(`saved queries are unavailable in static mode`)},async savedDelete(){throw Error(`saved queries are unavailable in static mode`)},async write(){throw Error(`editing is unavailable in static mode`)},onSourcesChanged:()=>{},onDataChanged:()=>{}}}function xT(){let e=new URLSearchParams(location.search),t=e.get(Pu);if(!t)return;e.delete(Pu);let n=e.toString();return history.replaceState(null,``,n?`?${n}`:location.pathname),t}async function ST(){try{let e=await fetch(`./__connection.json`);if(!e.ok||(await e.json())?.backend!==`static`)return null}catch{return null}let e=await fetch(`./data-inspector-static.json`);if(!e.ok)throw Error(`failed to load static dataset (${e.status})`);return await e.json()}function CT(e){pT.status=e.status,pT.connected=e.status===`connected`,pT.error=e.connectionError?.message??null}async function wT(){let e=xT();try{let t=await ST();if(t){mT.value=bT(t),pT.mode=`static`,pT.status=`connected`,pT.connected=!0,pT.error=null;return}let n=await ch({baseURL:`./`,authToken:e});_T=n,mT.value=yT(n),CT(n),n.events.on(`connection:status`,()=>CT(n)),await n.ensureTrusted(1e4).catch(()=>{}),CT(n)}catch(e){pT.status=`error`,pT.error=e instanceof Error?e.message:String(e)}}function TT(e,t){return Le()?(Re(e,t),!0):!1}function ET(e){let t=!1,n,r=Ie(!0);return((...i)=>(t||=(n=r.run(()=>e(...i)),!0),n))}var DT=new WeakMap,OT=(...e)=>{let t=e[0],n=Rs()?.proxy??Le();if(n==null&&!Sr())throw Error(`injectLocal must be called in setup`);return n&&DT.has(n)&&t in DT.get(n)?DT.get(n)[t]:xr(...e)},kT=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var AT=e=>e!==void 0,jT=Object.prototype.toString,MT=e=>jT.call(e)===`[object Object]`,NT=()=>{},PT=FT();function FT(){var e,t;return kT&&!!((e=window)!=null&&(e=e.navigator)!=null&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function IT(...e){if(e.length!==1)return wn(...e);let t=e[0];return typeof t==`function`?$t(bn(()=>({get:t,set:NT}))):V(t)}function LT(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return`cancel`in e&&Object.assign(n,{cancel:e.cancel,flush:e.flush,isPending:e.isPending}),n}var RT=e=>e();function zT(e=RT,t={}){let{initialState:n=`active`}=t,r=IT(n===`active`);function i(){r.value=!1}function a(){r.value=!0}return{isActive:en(r),pause:i,resume:a,eventFilter:(...t)=>{r.value&&e(...t)}}}function BT(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function VT(e){return Array.isArray(e)?e:[e]}function HT(e){return e||Rs()}function UT(e){if(!kT)return e;let t=0,n,r,i=()=>{--t,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return((...a)=>(t+=1,r||(r=Ie(!0),n=r.run(()=>e(...a))),TT(i),n))}function WT(e,t=1e4){return bn((n,r)=>{let i=gn(e),a,o=()=>setTimeout(()=>{i=gn(e),r()},gn(t));return TT(()=>{clearTimeout(a)}),{get(){return n(),i},set(e){i=e,r(),clearTimeout(a),a=o()}}})}function GT(e,t,n={}){let{eventFilter:r=RT,...i}=n;return W(e,LT(r,t),i)}function KT(e,t,n={}){let{eventFilter:r,initialState:i=`active`,...a}=n,{eventFilter:o,pause:s,resume:c,isActive:l}=zT(r,{initialState:i});return{stop:GT(e,t,{...a,eventFilter:o}),pause:s,resume:c,isActive:l}}function qT(e,t){HT(t)&&ta(e,t)}function JT(e,t=!0,n){HT(n)?Qi(e,n):t?e():er(e)}function YT(e,t,n){return W(e,t,{...n,immediate:!0})}var XT=kT?window:void 0;kT&&window.document,kT&&window.navigator,kT&&window.location;function ZT(e){let t=gn(e);return t?.$el??t}function QT(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=Q(()=>{let t=VT(gn(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return YT(()=>[n.value?.map(e=>ZT(e))??[XT].filter(e=>e!=null),VT(gn(n.value?e[1]:e[0])),VT(H(n.value?e[2]:e[1])),gn(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=MT(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function $T(){let e=fn(!1),t=Rs();return t&&Qi(()=>{e.value=!0},t),e}function eE(e){let t=$T();return Q(()=>(t.value,!!e()))}function tE(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function nE(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=XT,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=tE(t);return QT(i,a,e=>{e.repeat&&gn(s)||c(e)&&n(e)},o)}var rE=Symbol(`vueuse-ssr-width`);function iE(){let e=Sr()?OT(rE,null):null;return typeof e==`number`?e:void 0}function aE(e,t={}){let{window:n=XT,ssrWidth:r=iE()}=t,i=eE(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=fn(typeof r==`number`),o=fn(),s=fn(!1);return Tr(()=>{if(a.value){a.value=!i.value;let t=gn(e).split(`,`);s.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=BT(n[1])),i&&a&&(a=r<=BT(i[1])),t?!a:a});return}i.value&&(o.value=n.matchMedia(gn(e)),s.value=o.value.matches)}),QT(o,`change`,e=>{s.value=e.matches},{passive:!0}),Q(()=>s.value)}function oE(e){return JSON.parse(JSON.stringify(e))}var sE=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},cE=`__vueuse_ssr_handlers__`,lE=uE();function uE(){return cE in sE||(sE[cE]=sE[cE]||{}),sE[cE]}function dE(e,t){return lE[e]||t}function fE(e){return aE(`(prefers-color-scheme: dark)`,e)}function pE(e){return e==null?`any`:e instanceof Set?`set`:e instanceof Map?`map`:e instanceof Date?`date`:typeof e==`boolean`?`boolean`:typeof e==`string`?`string`:typeof e==`object`?`object`:Number.isNaN(e)?`any`:`number`}var mE={boolean:{read:e=>e===`true`,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},hE=`vueuse-storage`;function gE(e,t,n,r={}){let{flush:i=`pre`,deep:a=!0,listenToStorageChanges:o=!0,writeDefaults:s=!0,mergeDefaults:c=!1,shallow:l,window:u=XT,eventFilter:d,onError:f=e=>{console.error(e)},initOnMounted:p}=r,m=(l?fn:V)(typeof t==`function`?t():t),h=Q(()=>gn(e));if(!n)try{n=dE(`getDefaultStorage`,()=>XT?.localStorage)()}catch(e){f(e)}if(!n)return m;let g=gn(t),_=pE(g),v=r.serializer??mE[_],{pause:y,resume:b}=KT(m,e=>C(e),{flush:i,deep:a,eventFilter:d});W(h,()=>T(),{flush:i});let x=!1;u&&o&&(n instanceof Storage?QT(u,`storage`,e=>{(!p||x)&&T(e)},{passive:!0}):QT(u,hE,e=>{(!p||x)&&E(e)})),p?JT(()=>{x=!0,T()}):T();function S(e,t){if(u){let r={key:h.value,oldValue:e,newValue:t,storageArea:n};u.dispatchEvent(n instanceof Storage?new StorageEvent(`storage`,r):new CustomEvent(hE,{detail:r}))}}function C(e){try{let t=n.getItem(h.value);if(e==null)S(t,null),n.removeItem(h.value);else{let r=v.write(e);t!==r&&(n.setItem(h.value,r),S(t,r))}}catch(e){f(e)}}function w(e){let t=e?e.newValue:n.getItem(h.value);if(t==null)return s&&g!=null&&n.setItem(h.value,v.write(g)),g;if(!e&&c){let e=v.read(t);return typeof c==`function`?c(e,g):_===`object`&&!Array.isArray(e)?{...g,...e}:e}return typeof t==`string`?v.read(t):t}function T(e){if(!(e&&e.storageArea!==n)){if(e&&e.key==null){m.value=g;return}if(!(e&&e.key!==h.value)){y();try{let t=v.write(m.value);(e===void 0||e?.newValue!==t)&&(m.value=w(e))}catch(e){f(e)}finally{e?er(b):b()}}}}function E(e){T(e.detail)}return m}var _E=`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`;function vE(e={}){let{selector:t=`html`,attribute:n=`class`,initialValue:r=`auto`,window:i=XT,storage:a,storageKey:o=`vueuse-color-scheme`,listenToStorageChanges:s=!0,storageRef:c,emitAuto:l,disableTransition:u=!0}=e,d={auto:``,light:`light`,dark:`dark`,...e.modes||{}},f=fE({window:i}),p=Q(()=>f.value?`dark`:`light`),m=c||(o==null?IT(r):gE(o,r,a,{window:i,listenToStorageChanges:s})),h=Q(()=>m.value===`auto`?p.value:m.value),g=dE(`updateHTMLAttrs`,(e,t,n)=>{let r=typeof e==`string`?i?.document.querySelector(e):ZT(e);if(!r)return;let a=new Set,o=new Set,s=null;if(t===`class`){let e=n.split(/\s/g);Object.values(d).flatMap(e=>(e||``).split(/\s/g)).filter(Boolean).forEach(t=>{e.includes(t)?a.add(t):o.add(t)})}else s={key:t,value:n};if(a.size===0&&o.size===0&&s===null)return;let c;u&&(c=i.document.createElement(`style`),c.appendChild(document.createTextNode(_E)),i.document.head.appendChild(c));for(let e of a)r.classList.add(e);for(let e of o)r.classList.remove(e);s&&r.setAttribute(s.key,s.value),u&&(i.getComputedStyle(c).opacity,document.head.removeChild(c))});function _(e){g(t,n,d[e]??e)}function v(t){e.onChanged?e.onChanged(t,_):_(t)}W(h,v,{flush:`post`,immediate:!0}),JT(()=>v(h.value));let y=Q({get(){return l?m.value:h.value},set(e){m.value=e}});return Object.assign(y,{store:m,system:p,state:h})}function yE(e={}){let{valueDark:t=`dark`,valueLight:n=``}=e,r=vE({...e,onChanged:(t,n)=>{var r;e.onChanged?(r=e.onChanged)==null||r.call(e,t===`dark`,n,t):n(t)},modes:{dark:t,light:n}}),i=Q(()=>r.system.value);return Q({get(){return r.value===`dark`},set(e){let t=e?`dark`:`light`;i.value===t?r.value=`auto`:r.value=t}})}function bE(e,t,n={}){let{window:r=XT,...i}=n,a,o=eE(()=>r&&`ResizeObserver`in r),s=()=>{a&&=(a.disconnect(),void 0)},c=W(Q(()=>{let t=gn(e);return Array.isArray(t)?t.map(e=>ZT(e)):[ZT(t)]}),e=>{if(s(),o.value&&r){a=new ResizeObserver(t);for(let t of e)t&&a.observe(t,i)}},{immediate:!0,flush:`post`}),l=()=>{s(),c()};return TT(l),{isSupported:o,stop:l}}function xE(e,t,n,r={}){var i,a;let{clone:o=!1,passive:s=!1,eventName:c,deep:l=!1,defaultValue:u,shouldEmit:d}=r,f=Rs(),p=n||f?.emit||(f==null||(i=f.$emit)==null?void 0:i.bind(f))||(f==null||(a=f.proxy)==null||(a=a.$emit)==null?void 0:a.bind(f?.proxy)),m=c;t||=`modelValue`,m||=`update:${t.toString()}`;let h=e=>o?typeof o==`function`?o(e):oE(e):e,g=()=>AT(e[t])?h(e[t]):u,_=e=>{d?d(e)&&p(m,e):p(m,e)};if(s){let n=V(g()),r=!1;return W(()=>e[t],e=>{r||(r=!0,n.value=h(e),er(()=>r=!1))}),W(n,n=>{!r&&(n!==e[t]||l)&&_(n)},{deep:l}),n}return Q({get(){return g()},set(e){_(e)}})}var SE=yE(),CE=Q(()=>SE.value?`dark`:`light`),wE={class:`min-w-0 flex items-center gap-1.5`},TE=[`title`],EE=G({__name:`AppHeader`,setup(e){let t=Q(()=>Mw(pT.status));return(e,n)=>(q(),Y(kw,{glass:!1,class:`h-nav`},{search:U(()=>[...n[3]||=[X(`div`,null,null,-1)]]),end:U(()=>[Z(Gv,{icon:`i-ph:book-open-duotone`,as:`a`,href:`https://devfra.me/plugins/data-inspector`,target:`_blank`,title:`Data Inspector docs: using the plugin and providing data sources`}),Z(Gv,{icon:`i-ph:sun-duotone dark:i-ph:moon-duotone`,title:`Toggle dark mode`,onClick:n[0]||=e=>SE.value=!H(SE)})]),default:U(()=>[X(`div`,wE,[n[1]||=X(`span`,{class:`flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none`},[X(`span`,{class:`i-ph-crosshair-duotone text-base color-active`}),X(`span`,null,`Data Inspector`)],-1),n[2]||=X(`span`,{class:`truncate op-fade text-xs select-none`},`Inspect server side data/objects interactively`,-1),H(pT).mode===`static`?(q(),Y(Ew,{key:0,class:`flex items-center gap-1.5 py-1 text-xs select-none`,text:`static`,color:!1})):t.value?(q(),J(`span`,{key:1,class:ye(t.value.class),title:H(pT).error??void 0},[X(`span`,{class:ye(t.value.dot)},null,2),Es(` `+je(t.value.label),1)],10,TE)):Os(``,!0)])]),_:1}))}}),DE=`1.0.0-beta.16`,OE=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),kE=Object.prototype.toString;function AE(e,t){return t!==void 0&&(IE(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function jE(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function ME(e,t){return e&&OE(e,t)?e[t]:void 0}function NE(e){return typeof e==`object`&&!!e&&e.constructor===Object}function PE(e){return kE.call(e)===`[object RegExp]`}function FE(e){return e&&(IE(e)||OE(e,`length`)&&isFinite(e.length))}function IE(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function LE(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function RE(e){if(IE(e))return e.length>0;if(NE(e)){for(let t in e)if(OE(e,t))return!0;return!1}return!!e}function zE(e,t){let n=e.startsWith(`0x`)||e.startsWith(`0X`);if(e.includes(`_`)){let r=e.match(n?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(r){let e=r[0],n=r.index+Number(e[1]===`_`);t(`${e===`__`?`Only one underscore is allowed`:`Wrong underscore`} as numeric separator`,{inside:[n,1]})}e=e.replace(/_/g,``)}return n?parseInt(e,16):parseFloat(e)}var BE={0:`\0`,b:`\b`,n:`
|
|
7
|
+
`,r:`\r`,f:`\f`,t:` `,v:`\v`};function VE(e,t=!1,n=1,r){return e.slice(1,e.length-n).replace(/\\(?:(\r\n?|\n|\u2028|\u2029)|([xu][0-9a-fA-F]*)|$|(.))|[\r\n\u2028\u2029]/g,(e,n,i,a,o)=>{if(n)return``;if(i){let t=i[0]===`u`;if(i.length===(t?5:3))return String.fromCharCode(parseInt(i.slice(1),16));r(`Invalid ${t?`Unicode`:`hexadecimal`} escape sequence`,{inside:[o+1,e.length]})}return e===`\\`&&r(`Invalid backslash`,{inside:[o+1,1]}),a?BE[a]||a:(!t&&/[\r\n\u2028\u2029]/.test(e)&&r(`Invalid line terminator`,{inside:[o+1,1]}),e)})}function HE(e,t){let n=e.match(/[^/]*$/)||{index:e.length};for(let r=n.index;r<e.length;r++){let n=e.indexOf(e[r],r+1);n!==-1&&t(`Duplicate flag in regexp`,{inside:[n,1]})}return new RegExp(e.slice(1,n.index-1),e.slice(n.index))}var UE=/\n|\r\n?|\u2028|\u2029/g;function WE(e,t){let n=Math.max(t-32,0),r=Math.min(t+32,e.length),i=(n===0?``:`...`)+e.slice(n,t).replace(UE,`\\n`);return`${i}${e.slice(t,r).replace(UE,`\\n`)+(r===e.length?``:`...`)}\n${`-`.repeat(i.length)}^`}function GE(e,t){let n=e.slice(0,t).split(UE);return{line:n.length,column:n[n.length-1].length,offset:t}}var KE=59,qE={0:`NUMBER`,1:`STRING`,2:`REGEXP`,3:`LITERAL`,4:`IDENT`,5:`$IDENT`,6:`@`,7:`#`,8:`$`,9:`$$`,10:`AND`,11:`OR`,12:`NOT`,13:`NO`,14:`IS`,15:`IN`,16:`NOTIN`,17:`HAS`,18:`HASNO`,19:`ORDER`,20:`METHOD(`,21:`$METHOD(`,22:`TEMPLATE`,23:`TPL_START`,24:`TPL_CONTINUE`,25:`TPL_END`,26:`.`,27:`..`,28:`...`,29:`.(`,30:`.[`,31:`..(`,32:`|`,33:`=>`,34:`=`,35:`!=`,36:`~=`,37:`<`,38:`<=`,39:`>`,40:`>=`,41:`+`,42:`-`,43:`*`,44:`/`,45:`%`,46:`??`,47:`?`,48:`(`,49:`)`,50:`[`,51:`]`,52:`{`,53:`}`,54:`,`,55:`:`,56:`;`,57:`BAD_TOKEN`,58:`EOF`},JE=tD(48,49,29,49,31,49,20,49,21,49,50,51,30,51,52,53,23,25),YE={"has no":18,"not in":16,and:10,or:11,not:12,has:17,is:14,in:15,no:13,asc:19,ascN:19,ascA:19,ascNA:19,ascAN:19,desc:19,descN:19,descA:19,descNA:19,descAN:19},XE={"...":28,"..(":31,"..":27,".(":29,".[":30,"=>":33,"!=":35,"~=":36,"<=":38,">=":40,"??":46,"@":6,"#":7,".":26,"|":32,"=":34,"<":37,">":39,"+":41,"-":42,"*":43,"/":44,"%":45,"?":47,"(":48,")":49,"[":50,"]":51,"{":52,"}":53,",":54,":":55,";":56},ZE=eD(10,11,12,13,15,16,17,18,14,19),QE=eD(26,27),$E=eD(0,1,22,25,2,3,4,9,5,8,6,7,49,51,53,26);function eD(...e){let t=new Int8Array(KE);for(let n of e)t[n]=1;return t}function tD(...e){let t=new Int8Array(KE).fill(-1);for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}var nD=[10,11,15,16,17,18,14],rD=[41,42,43,44,45,32,34,35,36,40,38,37,39],iD=[54,47,55,56,58,51,49,53,24,25,19,...rD,...nD],aD=eD(...iD),oD=eD(...iD);oD[49]=0;var sD=eD(...iD);sD[51]=0;var cD=eD(54,47,55,24,25,19,...rD,...nD);[32,34,41,42,43,44,45,15,17,16,18].forEach(e=>cD[e]=0);var lD=new Map([[null,aD],[47,aD],[55,aD],[56,aD],[54,aD],[26,aD],[27,aD],[48,aD],[33,aD],[12,aD],[13,aD],[29,oD],[31,oD],[20,oD],[21,oD],[50,sD],[30,sD],[8,cD],...rD.map(e=>[e,aD]),...nD.map(e=>[e,aD])]),uD=/\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$)/y,dD=/\s+/y,fD=new RegExp(Object.keys(XE).map(e=>e.replace(/[\[\]{}()^$|?*+.]/g,`\\$&`)).join(`|`),`y`),pD=/(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)\b/y,mD=/(?:has no|not in|and|or|not|has|is|in|no|(?:asc|desc)(?:NA?|AN?)?)\b/y,hD=/\/(?:\\.|[^/])+\/[gimsu]*/y,gD=/(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b|0[xX][_0-9a-fA-F]+\b/y,_D=/"(?:\\.|[^"])*"|'(?:\\.|[^'])*'/sy,vD=/`(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,yD=/\}(?:\\.|[^`\\$]|\$(?!\{))*(\$\{|`)/sy,bD=()=>{},xD=new Map([[`true`,!0],[`false`,!1],[`null`,null],[`undefined`,void 0],[`Infinity`,1/0],[`NaN`,NaN]]),SD=class{#e;#t;constructor(e,t,n,r,i=null){this.type=e,this.start=t,this.end=n,this.#e=r,this.#t=i}get name(){return qE[this.type]}get value(){return this.#t??=this.#e.slice(this.start,this.end)}};function*CD(e,t=!1){let n=TD(e,t),r;for(;r=n();)yield r}function wD(e,t=!1){let n=TD(e,t),r=[],i;for(;i=n();)r.push(i);return r}function TD(e,t){let{tolerant:n=!1,onComment:r}=typeof t==`boolean`?{tolerant:t}:t||{},i=typeof r==`function`?r:Array.isArray(r)?(e,t)=>r.push([e,t]):bD,a=e.length,o=0,s=!1,c=[],l=!1,u=!1,d=null,f=null,p=0;function m(e=1){o=Math.min(o+e,a)}function h(t){t.lastIndex=o;let n=t.exec(e);if(n){let e=n[0];return m(e.length),e}return null}function g(){return o<a?e[o]:``}function _(){let t=o+1;return t<a?e[t]:``}function v(e){return e>=`A`&&e<=`Z`||e>=`a`&&e<=`z`||e===`_`||e===`\\`&&_()===`u`}function y(e){if(e>=`0`&&e<=`9`)return!0;if(e===`.`){let e=_();return e>=`0`&&e<=`9`||e===`_`}return!1}function b(e){JE[e]===-1?x()===e&&c.pop():c.push(JE[e])}function x(){return c.length>0?c[c.length-1]:-1}function S(t){if(lD.get(f)?.[t.type]){d=t;let n,r;return f===null?(n=0,r=ZE[t.type]?Math.max(0,t.start-1):t.start):ZE[f]?(n=t.start,r=t.start):ZE[t.type]?(n=p,r=Math.max(p,t.start-1)):(n=p,r=t.start),new SD(4,n,r,e,``)}return f=t.type,p=t.end,t}function C(){if(o>=a)return s=!0,58;let t=o,n=e[o];if(y(n)&&h(gD))return 0;if((n===`"`||n===`'`)&&h(_D))return 1;if(n==="`"&&h(vD))return e[o-1]=="`"?22:23;if(n===`}`&&x()===25&&h(yD))return e[o-1]==="`"?25:24;if(n===`/`)return!l&&h(hD)?2:(m(),44);if(v(n)){if(!u&&h(mD))return YE[e.slice(t,o)];if(h(pD))return!u&&xD.has(e.slice(t,o))?3:g()===`(`?(m(),20):4}return n===`$`?(m(),g()===`$`?(m(),9):h(pD)?g()===`(`?(m(),21):5:8):h(fD)?XE[e.slice(t,o)]:(o++,57)}function w(){let t=o;return g()===`/`&&h(uD)?(i(t,o,e),!0):!1}return function(){if(d){let e=d;return d=null,f=e.type,p=e.end,e}if(s)return null;do h(dD)&&(u=!1);while(w());let t=o,r=C(),i=new SD(r,t,o,e);return l=$E[r],u=QE[r],b(r),n?S(i):i}}var ED=Symbol(`RECOVERABLE_ERROR`),DD=-1,OD=!0,kD=!1,AD=eD(47),jD=tD(19,1,32,2,47,3,14,4,11,5,10,6,46,7,12,8,13,8,15,9,16,9,17,9,18,9,34,10,35,10,36,10,37,11,38,11,39,11,40,11,41,12,42,12,43,12,44,12,45,12);function MD(e,t){let n=wD(e,t),r=0,i=n[r],a=!1,o=null;try{return o=E()}finally{o&&f(58)}function s(t,n){if(a)throw ED;let r=i.start,o=i.end;n??={},Array.isArray(n?.inside)&&(r+=n.inside[0],o=r+n.inside[1]),i.type===57&&(t=`Bad input on line ${GE(e,r).line} column ${GE(e,r).column}`);let s=GE(e,r),c=i.type===57||n?.inside?[t,``,WE(e,r)]:[`Parse error on line ${s.line}:`,``,WE(e,r),...t?[``,t]:[]],l=i.type===57||!Array.isArray(n?.expected)?null:[...new Set([].concat(...n.expected).map(e=>`'${qE[e]}'`))];throw l&&c.push(``,`Expecting `+l.join(`, `)+` got `+qE[i.type]),Object.assign(SyntaxError(c.join(`
|
|
8
|
+
`)),{details:{rawMessage:t,text:i.value,token:i.name,expected:l,loc:{range:[r,o],start:s,end:GE(e,o)}}})}function c(...e){s(null,{expected:e})}function l(e=DD){e!==DD&&i.type!==e&&c(e)}function u(e){let t=a;a=!1;let n=e();return a=t,n}function d(e,...t){let o=a,s=r;try{return a=!0,e(...t)}catch(e){if(e!==ED)throw e;return r=s,i=n[r],null}finally{a=o}}function f(e){let t=i;return l(e),r=Math.min(r+1,n.length-1),i=n[r],t}function p(e){return _(e)?f():null}function m(e){let t=i.value;return f(e),t}function h(e){let t=[i.start,i.end];return f(e),t}function g(e,t,n){f(e);let r=t();return f(n),r}function _(e){return i.type===e}function v(e){return(r<n.length-1?n[r+1].type:58)===e}function y(){return i.start}function b(e){let t=r>0?n[r-1].end:0;return e>t?[t,t]:[e,t]}function x(e){return e?.range[0]??y()}function S(){let e=r>0?n[r-1].end:0;return{type:`Placeholder`,range:[e,e]}}function C(e,t,n){return e===null?t:w(e,t,b(n))}function w(e,t,n){return{type:`Block`,definitions:e,body:t,range:n}}function T(e,t,n){return{type:`Method`,reference:e,arguments:t,range:n}}function E(){let e=y();return w(D()||[],N()||S(),b(e))}function D(){let e=null;for(let t;t=O();)e===null?e=[t]:e.push(t);return e}function O(){return _(8)||_(5)?d(k):null}function k(){let e=y(),t=A(),n=p(55)?u(N):null;return f(56),{type:`Definition`,declarator:t,value:n,range:b(e)}}function A(){let e=y();return{type:`Declarator`,name:_(5)?m().slice(1):p(8)?null:c(5,8),range:b(e)}}function j(e=!1){let{start:t,end:n,type:r,value:a}=i,o=m();return e||(r===5||r===21)&&(o=o.slice(1)),(r===20||r===21)&&(o=o.slice(0,-1)),{type:`Identifier`,name:o,range:[t,n-!a.endsWith(o)]}}function M(){let e=j();return{type:`Reference`,name:e,range:e.range.slice()}}function ee(){switch(i.type){case 6:return{type:`Data`,range:h()};case 7:return{type:`Context`,range:h()};case 8:return{type:`Current`,range:h()};case 9:return{type:`Arg1`,range:h()};default:c(6,7,8,9)}}function te(){let e=y(),t;switch(i.type){case 0:t=zE(i.value,s);break;case 1:t=VE(i.value,!1,1,s);break;case 22:case 25:t=VE(i.value,!0,1,s);break;case 23:case 24:t=VE(i.value,!0,2,s);break;case 2:t=HE(i.value,s);break;case 3:t=xD.get(i.value);break;default:c(0,1,2,3,22,23,24,25)}return f(),{type:`Literal`,value:t,range:b(e)}}function N(e=0){let t=ne();for(;jD[i.type]>=e&&!_(58);){let e=jD[i.type]+!AD[i.type];switch(i.type){case 47:t=Ce(t,e);break;case 32:t=Se(t);break;case 19:t=ue(t);break;default:t=we(t,e)}}return t}function ne(){switch(i.type){case 12:case 13:case 41:case 42:case 14:return re();default:return ie()}}function re(){let e=y(),t=jD[i.type],n=m();return{type:`Prefix`,operator:n,argument:n===`is`?F():N(t+1),range:b(e)}}function ie(){let e=ae();for(;!_(58);)switch(i.type){case 14:e=P(e);break;case 26:e=v(4)?I(e,!0):v(20)||v(21)?se(e,!0):c(4,20,21);break;case 29:e=ye(e);break;case 30:e=xe(e);break;case 27:case 31:e=be(e);break;case 50:e=d(me,e)||ve(e);break;default:return e}return e}function ae(){switch(i.type){case 0:case 1:case 2:case 3:return te();case 22:case 23:return L();case 6:case 7:case 8:case 9:return ee();case 5:return ce()||M();case 4:return I();case 20:case 21:return se();case 50:return d(me)||pe();case 52:return he();case 48:return ce()||fe();case 33:return le();default:return null}}function P(e){let t=x(e);return f(14),{type:`Postfix`,operator:F(),argument:e,range:b(t)}}function F(){let e=y(),t=p(12)!==null,n=[];switch(i.type){case 48:f(48);do n.length&&n.push(_(10)||_(11)?m():c(10,11)),n.push(F());while(!p(49));break;case 4:case 3:n=j();break;case 5:n=T(M(),[],b(e));break;default:c(48,4,3,5)}return{type:`Assertion`,negation:t,assertion:n,range:b(e)}}function I(e=null,t=!1){let n=x(e);return t&&f(26),{type:`GetProperty`,value:e,property:j(),range:b(n)}}function oe(){let e=y(),t=_(20)?j():_(21)?M():c(20,21),n=[];if(!_(49))do n.push(N());while(p(54));return f(49),T(t,n,b(e))}function se(e=null,t=!1){let n=x(e);return t&&f(26),{type:`MethodCall`,value:e,method:oe(),range:b(n)}}function L(){let e=y(),t=[];if(_(22))t.push(te());else{for(t.push(te(23));t.push(N()),_(24);)t.push(te(24));t.push(te(25))}return{type:`Template`,values:t,range:b(e)}}function ce(){if(_(48)){if(!v(5)&&!v(33)&&!v(49))return null}else if(!v(33))return null;return d(le)}function le(){let e=y(),t=[];if(p(48)){if(!_(49))do l(5),t.push(j());while(p(54));f(49)}else _(5)&&t.push(j());return f(33),{type:`Function`,arguments:t,body:N()||s(`Expected non-empty expression`),range:b(e)}}function ue(e){let t=x(e),n=[de(e)];for(;p(54);)n.push(de(N(jD[19]+1)));return{type:`CompareFunction`,compares:n,range:b(t)}}function de(e){let t=x(e);return{type:`Compare`,query:e,order:m(19),range:b(t)}}function fe(){let e=y();f(48);let t=D(),n=N()||S();return f(49),{type:`Parentheses`,body:C(t,n,e),range:b(e)}}function pe(){let e=y(),t=[];if(f(50),!p(51)){do _(54)&&s(`Expected expression before comma`),t.push(_(28)?_e(OD):N());while(p(54)&&!_(51));f(51)}return{type:`Array`,elements:t,range:b(e)}}function me(e=null){let t=x(e),n=[g(50,N,55),N()];return p(55)&&n.push(N()),f(51),{type:`SliceNotation`,value:e,arguments:n,range:b(t)}}function he(){let e=y();f(52);let t=D(),n=[];if(!_(53))do n.push(_(28)?_e(kD):ge());while(p(54)&&!_(53));return f(53),C(t,{type:`Object`,properties:n,range:b(e)},e)}function ge(){let e=y(),t,n=null,r=null;switch(i.type){case 20:case 21:{let e=oe();t={type:`Literal`,value:e.reference.type===`Identifier`?e.reference.name:e.reference.name.name,range:void 0},n=e,!_(54)&&!_(53)&&!_(58)&&(r=n,n=Se(r,!0));break}case 4:v(55)||v(54)||v(53)||v(58)?t=j():(r=I(null,!1),t=r.property,n=Se(r,!0));break;case 5:v(55)?t=j(!0):(t=M(),!_(54)&&!_(53)&&!_(58)&&(r=t,t=t.name,n=Se(r,!0)));break;case 3:case 1:case 0:t=te();break;case 8:t=ee();break;case 50:t=g(50,N,51),f(55),n=N();break;default:c(4,3,1,0,8,5,50,20,21)}return!r&&!n&&(n=p(55)?N():null),{type:`ObjectEntry`,key:t,value:n,range:b(e)}}function _e(e){let t=y();return{type:`Spread`,query:f(28)&&N(),array:e,range:b(t)}}function ve(e){let t=x(e);return{type:`Pick`,value:e,getter:g(50,N,51),range:b(t)}}function ye(e){let t=x(e);return{type:`Map`,value:e,query:g(29,E,49),range:b(t)}}function be(e){let t=x(e);return{type:`MapRecursive`,value:e,query:p(27)?_(4)?I():se():g(31,E,49),range:b(t)}}function xe(e){let t=x(e);return{type:`Filter`,value:e,query:g(30,E,51),range:b(t)}}function Se(e,t=!1){let n=x(e);return t?p(32):f(32),{type:`Pipeline`,left:e,right:C(t?null:D(),t?N():N(jD[32]+1)||S(),n),range:b(n)}}function Ce(e,t){let n=x(e);return f(47),{type:`Conditional`,test:e,consequent:N(t)||S(),alternate:p(55)?N(t)||S():null,range:b(n)}}function we(e,t){let n=x(e);return{type:`Binary`,operator:m(),left:e,right:N(t)||s(`Expected expression`),range:b(n)}}}var ND={parse(e,t=!1){let n=[];return{ast:MD(e,{tolerant:t,onComment:n}),commentRanges:n}},createTokenizer:TD,tokenize:CD},PD=s({compile:()=>FD,stringify:()=>LD,walk:()=>ID});function FD(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function ID(){}function LD(e,t){t.put(`$$`)}var RD=s({compile:()=>BD,stringify:()=>HD,suggest:()=>zD,walk:()=>VD});function zD(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function BD(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function VD(e,t){t.list(e.elements)}function HD(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var UD=s({compile:()=>GD,stringify:()=>qD,suggest:()=>WD,walk:()=>KD});function WD(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function GD(e,t){if(Array.isArray(e.assertion)){t.put(e.negation?`!(`:`(`);for(let n=0;n<e.assertion.length;n++)if(n%2==0)t.node(e.assertion[n]);else switch(e.assertion[n]){case`and`:t.put(`&&`);break;case`or`:t.put(`||`);break;default:t.error(`Bad conjuction operator in assertion`,e)}t.put(`)`)}else switch(e.negation&&t.put(`!`),e.assertion.type){case`Identifier`:e.assertion.name?(t.put(`!!`),t.tolerant&&t.put(`(typeof `),t.put(`a[`),t.node(e.assertion),t.put(`]`),t.tolerant&&(t.put(`==="function"?a[`),t.node(e.assertion),t.put(`]`)),t.put(`.call(mctx,`),t.nodeOrCurrent(),t.put(`)`),t.tolerant&&t.put(`:false)`),t.usedAssertions.has(e.assertion.name)?t.usedAssertions.get(e.assertion.name).push(e.assertion.range):t.usedAssertions.set(e.assertion.name,e.assertion.range)):t.put(`false`);break;case`Method`:t.put(`!!`),t.node(e.assertion);break;default:t.error(`Unknown assertion node type "`+e.assertion.type+`"`,e.assertion)}}function KD(e,t){if(Array.isArray(e.assertion))for(let n=0;n<e.assertion.length;n++)n%2==0&&t.node(e.assertion[n]);else t.node(e.assertion)}function qD(e,t){if(e.negation&&t.put(`not `),Array.isArray(e.assertion)){t.put(`(`);for(let n=0;n<e.assertion.length;n++)n%2==0?t.node(e.assertion[n]):(t.put(` `),t.put(e.assertion[n]),t.put(` `));t.put(`)`)}else t.node(e.assertion)}var JD=s({compile:()=>QD,stringify:()=>eO,suggest:()=>ZD,walk:()=>$D}),YD={in:`in`,"not in":`notIn`,has:`has`,"has no":`hasNo`,and:`and`,or:`or`,"??":`nullish`,"+":`add`,"-":`sub`,"*":`mul`,"/":`div`,"%":`mod`,"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`,"~=":`match`};function XD(e,t,n){if(n.type===`Array`){if(n.elements.length===0){e.range([n.range[0]+1,n.range[1]-1],`value-subset`,t,!1);return}let r=[];for(let{type:e,range:t,value:i}of n.elements)t&&(e===`Literal`||e===`Identifier`)&&r.push(i);let i=r.length?e.literalList(r):!1;for(let{type:r,range:a,value:o}of n.elements)a&&(r===`Literal`||r===`Identifier`||r===`GetProperty`&&o===null)&&e.range(a,`value-subset`,t,i)}}function ZD(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),XD(t,e.left,e.right);break;case`not in`:XD(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),XD(t,e.right,e.left);break;case`has no`:XD(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function QD(e,t){if(!(e.operator in YD)){t.error(`Unknown operator "`+e.operator+`"`,e);return}switch(e.operator){case`and`:t.put(`!`);case`or`:{let n=t.allocateVar();t.put(`${t.buildinFn(`bool`)}(${n}=`),t.node(e.left),t.put(`)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`??`:{let n=t.allocateVar();t.put(`(${n}=`),t.node(e.left),t.put(`,${n}!==null&&${n}!==undefined)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`has no`:t.put(`!`);case`has`:t.put(t.buildinFn(`in`)),t.put(`(`),t.node(e.right),t.put(`,`),t.node(e.left),t.put(`)`);break;default:t.put(t.buildinFn(YD[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function $D(e,t){t.node(e.left),t.node(e.right)}function eO(e,t){t.node(e.left),/^[a-z]/i.test(e.operator)?(t.put(` `),t.put(e.operator),t.put(` `)):t.put(e.operator),t.node(e.right)}var tO=s({compile:()=>rO,stringify:()=>aO,suggest:()=>nO,walk:()=>iO});function nO(e,t){e.body===null&&t.queryRoot(e.range[1])}function rO(e,t){e.definitions.length?(t.put(`(()=>{`),t.createScope(()=>{for(let{declarator:n}of e.definitions)n.name&&t.scope.awaitInit.add(t.unescapeName(`$`+n.name,n));t.list(e.definitions),t.put(`return `),t.nodeOrCurrent(e.body)},e=>e+`;`,t.scope.$ref),t.put(`})()`)):e.body&&e.body.type===`Object`?(t.put(`(`),t.nodeOrCurrent(e.body),t.put(`)`)):t.nodeOrCurrent(e.body)}function iO(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function aO(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var oO=s({compile:()=>cO,stringify:()=>uO,walk:()=>lO}),sO={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function cO(e,t){let n=e.order.startsWith(`desc`),r=sO[e.order.slice(n?4:3)]||sO[``];n&&t.put(`-`),t.put(t.buildinFn(r)),t.put(`((_q=$=>(`),t.createScope(()=>t.node(e.query),e=>e+`,`),t.put(`))(_a),_q(_b))`)}function lO(e,t){t.node(e.query)}function uO(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var dO=s({compile:()=>fO,stringify:()=>mO,walk:()=>pO});function fO(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function pO(e,t){t.list(e.compares)}function mO(e,t){t.list(e.compares,`,`)}var hO=s({compile:()=>gO,stringify:()=>vO,walk:()=>_O});function gO(e,t){t.put(t.buildinFn(`bool`)),t.put(`(`),t.nodeOrCurrent(e.test),t.put(`)?`),t.createScope(()=>t.nodeOrCurrent(e.consequent),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref),t.put(`:`),t.createScope(()=>{e.alternate?e.alternate.type===`Placeholder`?(t.put(`(`),t.node(e.alternate),t.put(`,undefined)`)):t.node(e.alternate):t.put(`undefined`)},e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref)}function _O(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function vO(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var yO=s({compile:()=>bO,stringify:()=>SO,walk:()=>xO});function bO(e,t){t.put(`context`)}function xO(){}function SO(e,t){t.put(`#`)}var CO=s({compile:()=>TO,stringify:()=>DO,suggest:()=>wO,walk:()=>EO});function wO(e,t){e.range&&t.range(e.range,`var`)}function TO(e,t){t.put(t.scope.$ref)}function EO(){}function DO(e,t){t.put(`$`)}var OO=s({compile:()=>kO,stringify:()=>jO,walk:()=>AO});function kO(e,t){t.put(`data`)}function AO(){}function jO(e,t){t.put(`@`)}var MO=s({compile:()=>NO,stringify:()=>FO,walk:()=>PO});function NO(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function PO(){}function FO(e,t){t.put(e.name?`$`+e.name:`$`)}var IO=s({compile:()=>VO,stringify:()=>UO,suggest:()=>BO,walk:()=>HO}),LO=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`],RO=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},zO=function(e,t){return{type:`Identifier`,name:e,range:t}};function BO(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function VO(e,t){let n=e.declarator.name,r=n&&t.unescapeName(`$`+n,e);if(r===null){t.node(e.declarator),t.nodeOrCurrent(e.value),t.put(`;`);return}if(t.scope.own.has(r)){t.error(`Identifier "${r}" has already been declared`,e.declarator);return}if(LO.includes(r)){t.error(`Identifier "${r}" is reserved for future use`,e.declarator);return}t.put(`const `),t.node(e.declarator),t.put(`=`),t.node(e.value||RO(null,zO(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function HO(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function UO(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var WO=s({compile:()=>GO,stringify:()=>qO,walk:()=>KO});function GO(e,t){t.put(t.buildinFn(`filter`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function KO(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function qO(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var JO=s({compile:()=>YO,stringify:()=>ZO,walk:()=>XO});function YO(e,t){let n=e.arguments.map(e=>t.unescapeName(`$`+e.name,e)),r=e.arguments.find((e,t)=>t>0&&n.lastIndexOf(`$`+e.name,t-1)!==-1);r&&t.error(`Duplicate parameter name "$`+r.name+`" is not allowed`,r),t.put(`function(`),t.put(String(n)||`$`),t.put(`){return `),t.createScope(()=>{t.scope.arg1=n[1]||`arguments[1]`,t.scope.$ref=n[0]||`$`;for(let e of n)t.scope.add(e);t.node(e.body)},e=>e+`,`),t.put(`}`)}function XO(e,t){t.node(e.body)}function ZO(e,t){t.put(`=>`),t.node(e.body)}var QO=s({compile:()=>ek,stringify:()=>nk,suggest:()=>$O,walk:()=>tk});function $O(e,t){t.range(e.property.range,`path`,e.value||void 0,!e.value),e.value===null&&t.range(e.property.range,`var`),e.range&&e.value===null&&e.property.range[0]!==e.range[0]&&t.queryRoot(e.range[0])}function ek(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function tk(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function nk(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var rk=s({compile:()=>ik,stringify:()=>ok,walk:()=>ak});function ik(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function ak(){}function ok(e,t){t.put(e.name)}var sk=s({compile:()=>ck,stringify:()=>uk,walk:()=>lk});function ck(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function lk(){}function uk(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var dk=s({compile:()=>fk,stringify:()=>mk,walk:()=>pk});function fk(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function pk(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function mk(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var hk=s({compile:()=>gk,stringify:()=>vk,walk:()=>_k});function gk(e,t){t.put(t.buildinFn(`mapRecursive`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function _k(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function vk(e,t){t.nodeOrNothing(e.value),t.put(`..`),t.isSimpleGetPropertyQuery(e.query)||t.isSimpleMethodCallQuery(e.query)?t.node(e.query):(t.put(`(`),t.node(e.query),t.put(`)`))}var yk=s({compile:()=>xk,stringify:()=>Ck,suggest:()=>bk,walk:()=>Sk});function bk(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function xk(e,t,n){let r=e.reference.type===`Identifier`;t.tolerant&&t.put(`(typeof `),r?(t.usedMethods.has(e.reference.name)?t.usedMethods.get(e.reference.name).push(e.reference.range):t.usedMethods.set(e.reference.name,[e.reference.range]),t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference),t.tolerant&&(t.put(`==="function"?`),r?(t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference)),t.put(r?`.call(mctx,`:`(`),t.nodeOrCurrent(n),e.arguments.length&&(t.put(`,`),t.list(e.arguments,`,`)),t.put(`)`),t.tolerant&&t.put(`:undefined)`)}function Sk(e,t){t.node(e.reference),t.list(e.arguments)}function Ck(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var wk=s({compile:()=>Tk,stringify:()=>Dk,walk:()=>Ek});function Tk(e,t){t.node(e.method,e.value)}function Ek(e,t){t.nodeOrNothing(e.value),t.node(e.method)}function Dk(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.method)}var Ok=s({compile:()=>Ak,stringify:()=>Mk,suggest:()=>kk,walk:()=>jk});function kk(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function Ak(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function jk(e,t){t.list(e.properties)}function Mk(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var Nk=s({compile:()=>Rk,stringify:()=>Bk,suggest:()=>Lk,walk:()=>zk}),Pk=function(e,t,n){return{type:`GetProperty`,value:e,property:t,range:n}},Fk=function(e,t){return{type:`Identifier`,name:e,range:t}},Ik=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function Lk(e,t){if(e.value===null)switch(e.key.type){case`Literal`:case`Identifier`:t.range(e.range,`path`),t.range(e.range,`var`);break;case`Current`:case`Reference`:t.range(e.range,`var`)}}function Rk(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=Pk(null,Fk(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=Pk(null,e.key);break;case`Reference`:t.node(e.key.name),n||=e.key;break;default:t.put(`[`),t.node(e.key),t.put(`]`)}t.put(`:`),t.node(n)}function zk(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function Bk(e,t){if(Ik.has(e.key.type)){if(t.node(e.key),e.value===null)return}else t.put(`[`),t.node(e.key),t.put(`]`);t.put(`:`),t.node(e.value)}var Vk=s({compile:()=>Hk,stringify:()=>Wk,walk:()=>Uk});function Hk(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function Uk(e,t){t.node(e.body)}function Wk(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var Gk=s({compile:()=>qk,stringify:()=>Yk,suggest:()=>Kk,walk:()=>Jk});function Kk(e,t){if(e.getter===null){let n=e.range[1]-1;t.range([n,n],`key`,e.value,!1),t.queryRoot(n)}else(e.getter.type===`GetProperty`||e.getter.type===`Reference`||e.getter.type===`Literal`&&typeof e.getter.value==`string`)&&t.range(e.getter.range,`key`,e.value,!1)}function qk(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function Jk(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function Yk(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var Xk=s({compile:()=>Zk,stringify:()=>$k,walk:()=>Qk});function Zk(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function Qk(e,t){t.node(e.left),t.node(e.right)}function $k(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var eA=s({compile:()=>nA,stringify:()=>iA,suggest:()=>tA,walk:()=>rA});function tA(e,t){t.queryRoot(e.range[1])}function nA(e,t){t.put(t.scope.$ref)}function rA(){}function iA(){}var aA=s({compile:()=>oA,stringify:()=>cA,walk:()=>sA});function oA(e,t){if(e.operator&&e.operator.type){t.put(`($=>(`),t.createScope(()=>t.node(e.operator),e=>e+`,`),t.put(`))`),t.put(`(`),t.node(e.argument),t.put(`)`);return}t.error(`Unknown operator "`+e.operator+`"`,e)}function sA(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function cA(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var lA=s({compile:()=>uA,stringify:()=>fA,walk:()=>dA});function uA(e,t){switch(e.operator){case`no`:case`not`:t.put(`!`),t.put(t.buildinFn(`bool`)),t.put(`(`),t.node(e.argument),t.put(`)`);break;case`+`:case`-`:t.put(e.operator),t.node(e.argument);break;case`is`:t.put(`!!(`),t.node(e.argument),t.put(`)`);break;default:t.error(`Unknown operator "`+e.operator+`"`,e)}}function dA(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function fA(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var pA=s({compile:()=>hA,stringify:()=>_A,suggest:()=>mA,walk:()=>gA});function mA(e,t){e.range&&t.range(e.range,`var`)}function hA(e,t){let n=e.name,r=t.unescapeName(`$`+n.name,n),i=t.scope.has(r),a=t.scope.awaitInit.has(r);if(!i||a){a?(t.put(`f.awaitInitRef(()=>`),t.putIdent(r,n),t.tolerant||(t.put(`,`),t.put(JSON.stringify(r)),t.put(`,`),t.put(JSON.stringify(n.range))),t.put(`)`)):t.tolerant?t.put(`undefined`):(t.putIdent(r,e),t.error(`${r} is not defined`,e));return}t.putIdent(r,n)}function gA(e,t){t.node(e.name)}function _A(e,t){t.put(`$`),t.node(e.name)}var vA=s({compile:()=>yA,stringify:()=>xA,walk:()=>bA});function yA(e,t){t.put(t.buildinFn(`slice`)),t.put(`(`),t.nodeOrCurrent(e.value),e.arguments.slice(0,3).forEach(e=>{t.put(`,`),e?t.node(e):t.put(`undefined`)}),t.put(`)`)}function bA(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function xA(e,t){let[n,r,i]=e.arguments;t.nodeOrNothing(e.value),t.put(`[`),n&&t.node(n),t.put(`:`),r&&t.node(r),i&&(t.put(`:`),t.node(i)),t.put(`]`)}var SA=s({compile:()=>wA,stringify:()=>EA,suggest:()=>CA,walk:()=>TA});function CA(e,t){e.query===null&&t.queryRoot(e.range[1])}function wA(e,t){if(e.array){t.put(`...`),t.put(t.buildinFn(`ensureArray`)),t.put(`(`),t.nodeOrCurrent(e.query),t.put(`)`);return}t.put(`...`),t.nodeOrCurrent(e.query)}function TA(e,t){t.nodeOrNothing(e.query)}function EA(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var DA=s({compile:()=>kA,stringify:()=>jA,suggest:()=>OA,walk:()=>AA});function OA(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function kA(e,t){for(let[n,r]of Object.entries(e.values)){let e=Number(n);r!==null&&(e!==0&&t.put(`+`),e%2==0?t.put(`"`+PA(r.value,MA)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function AA(e,t){for(let n of e.values)n!==null&&t.node(n)}function jA(e,t){let n=e.values.length-1;for(let[r,i]of Object.entries(e.values)){let e=Number(r);e%2==0?(t.put(e===0?"`":`}`),t.put(PA(i.value,NA)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var MA=new Map([[`\b`,`\\b`],[`
|
|
9
|
+
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),NA=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function PA(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var FA={Arg1:PD,Array:RD,Assertion:UD,Binary:JD,Block:tO,Compare:oO,Conditional:hO,Context:yO,Current:CO,Data:OO,Declarator:MO,Definition:IO,Filter:WO,Function:JO,GetProperty:QO,Identifier:rk,Literal:sk,Map:dk,MapRecursive:hk,Method:yk,MethodCall:wk,Object:Ok,ObjectEntry:Nk,Parentheses:Vk,Pick:Gk,Pipeline:Xk,Placeholder:eA,Postfix:aA,Prefix:lA,Reference:pA,SliceNotation:vA,CompareFunction:dO,Spread:SA,Template:DA},IA=e=>new Map(Object.entries(FA).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),LA={};IA(`build`).forEach((e,t)=>LA[t]=e);var RA=IA(`compile`),zA=IA(`walk`),BA=IA(`stringify`),VA=IA(`suggest`);function HA(e,t){function n(e){if(zA.has(e.type))i(e),zA.get(e.type)(e,r),a(e);else throw Error(`Unknown node type "`+e.type+`"`)}let r={node:n,nodeOrNothing(e){e!==null&&n(e)},list(e){e.forEach(n)}},i=()=>{},a=()=>{};typeof t==`function`&&(t={enter:t}),t&&(typeof t.enter==`function`&&(i=t.enter),typeof t.leave==`function`&&(a=t.leave)),n(e)}function UA(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function WA(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function GA(e,t,n){for(;t<n;t++)if(!WA(e,t))return!1;return!0}function KA(e,t,n,r,i){let a=[];for(let n=0;n<r.length;n++){let[i,o]=r[n];if(i>=t)break;i<e||(a.push(e,i),e=o)}return(e!==n.length||!i)&&a.push(e,t),a}function qA(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(GA(t,o,s)){for(;o>=0&&WA(t,o-1);)o--;for(;s<t.length&&WA(t,s);)s++;if(UA(t,o-1)){if(o===s)continue;o++}if(UA(t,s)){if(o===s)continue;s--}}let u=KA(o,s,t,n,r);for(let e=0;e<u.length;e+=2)i.push([u[e],u[e+1],c,l])}return i}function JA(e){let t=null,n=[],r=Object.assign(new Map,{literalList:n}),i=(e,t)=>{r.has(e)?r.get(e).push(t):r.set(e,[t])},a={range(e,n,r=t,a=!0){i(r,[...e,n,a])},literalList(e){let t=`l`+n.length;return n.push([t,e]),t},queryRoot(e,n=e){i(t,[e,n,`var`,!0]),i(t,[e,n,`path`,!0])}};return HA(e,e=>{if(VA.has(e.type)){let n=t;t=e,VA.get(e.type)(e,a),t=n}}),r}function YA(e,{ast:t,commentRanges:n}){let r=JA(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,qA(a,e,n,i));return r}function XA(e){return e.type===`GetProperty`}function ZA(e){return e.type===`MethodCall`}function QA(e){function t(e){if(BA.has(e.type))BA.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:XA,isSimpleMethodCallQuery:ZA,put(e){n.push(e)},node:t,nodeOrNothing(e){if(e!==null)return t(e),!0},list(e,n){if(!n){e.forEach(t);return}e.forEach((e,i)=>{i>0&&r.put(n),t(e)})}};return t(e),n.join(``)}function $A(e,t,n){let r=Object.assign(Object.create(SyntaxError.prototype),n),i=Error();return r.name=e,r.message=t,Object.defineProperty(r,"stack",{get:function(){return(i.stack||``).replace(/^(.+\n){1,3}/,e+`: `+t+`
|
|
10
|
+
`)}}),r}var ej=/^[\p{ID_Start}$_]$/u,tj=/^[\p{ID_Continue}$]$/u;function nj(e,t,n){return aj(e,`query`,t,n)}function rj(e,t,n){return aj(e,`method`,t,n)}var ij=class e extends Set{constructor(e,t=[],n=!1,r=`$`){super(e),this.own=new Set,this.awaitInit=new Set(t),this.firstCurrent=null,this.captureCurrent=[],this.arg1=n,this.$ref=r}spawn(t,n){return new e(this,this.awaitInit,t,n)}};function aj(e,t,n=!1,r=null){function i(e){let t=`s`+l.length;return l.push(e?[t,e]:[t]),t}function a(e){let t=u.get(e);return t||u.set(e,t=i()),t}function o(e,t,n,r,o){let s=[e,t,JSON.stringify(n)];if(n===`var`){if(!g.scope.size)return;s.push(JSON.stringify([...g.scope]))}else r||=i(),s.push(r),o&&s.push(typeof o==`string`?o:a(o));return f.push(s),r}function s(e,n,r=`$`){let i=g.scope,a=p.length-1,s=i.arg1||t===`method`&&`arguments[1]`;if(g.scope=i.spawn(s,r),e(),g.scope.captureCurrent.length){let e=`stat(`+g.scope.captureCurrent.reduce((e,t)=>o(...t,e),void 0)+`,`+g.scope.$ref+`)`;g.scope.firstCurrent?p[g.scope.firstCurrent]=e:p[a]+=n(e)}g.scope=i}function c(e,t){let n=!1;if(r!==null){if(r.has(e))for(let[t,i,s,c]of r.get(e))s===`var`?o(t,i,s):c===!0?g.scope.captureCurrent.push([t,i,s]):(n||(n=a(e),p.push(`stat(`+n+`,`)),s&&o(t,i,s,n,c));e.type===`Current`&&g.scope.firstCurrent===null&&(g.scope.firstCurrent=p.length)}if(RA.has(e.type))RA.get(e.type)(e,g,t);else throw Error(`Unknown node type "`+e.type+`"`);n&&p.push(`)`)}let l=[],u=new WeakMap,d=[],f=[],p=[{toString(){if(t===`query`)return[`((data,context)=>{`,...g.usedMethods.size||g.usedAssertions.size?[`const method = (name,...args)=>m[name].apply(mctx,args);`,`const assertion = (name,...args)=>a[name].apply(mctx,args);`,`const mctx = Object.freeze({context,method,assertion});`]:[]].join(`
|
|
11
|
+
`)+`
|
|
12
|
+
`;if(t===`method`)return[`(function(data){`,`const mctx = this;`,`const context = mctx.context;`].join(`
|
|
13
|
+
`)+`
|
|
14
|
+
`;throw Error(`Unknown kind: `+t)}},{toString(){return d.length>0?`let `+d+`;
|
|
15
|
+
`:``}},{toString(){return l.length>0?[`const stat=(s,v)=>(s.add(v),v);
|
|
16
|
+
`,`const `+l.map(([e,t])=>e+`=new Set(`+(t?JSON.stringify(t):``)+`)`)+`;
|
|
17
|
+
`].join(``):``}},{toString(){let e=r&&Array.isArray(r.literalList)&&r.literalList.map(([e,t])=>e+`=`+JSON.stringify(t));return e&&e.length?`const `+e+`;
|
|
18
|
+
`:``}},r===null?`return `:`return{
|
|
19
|
+
value: `],m={},h=new Set,g={tolerant:n,usedAssertions:new Map,usedMethods:new Map,suggestions:r!==null,buildinFn(e){return h.add(e),`f.`+e},scope:new ij,createScope:s,error(e,t){let r=SyntaxError(e);if(t&&t.range&&(r.details={loc:{range:t.range}}),!n)throw r;return r},allocateVar(){let e=`tmp`+d.length;return d.push(e),e},unescapeName(e,t,n=!0){return e.replace(/\\u[0-9a-fA-F]{4}/g,(e,r)=>{let i=String.fromCharCode(parseInt(e.slice(2),16)),a=r===0?ej:tj;return n&&!a.test(i)&&this.error(`Bad escape sequence in indentifier name (expected ${a})`,t&&{range:[t.range[0]+r,t.range[0]+r+6]}),i})},put:e=>p.push(e),putIdent(e,t){if(!/^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(e))throw this.error(`Bad identifier name `+JSON.stringify(e),t);this.put(e)},node:c,nodeOrCurrent(e,t){c(e||{type:`Current`},t)},list(e,t,n){e.forEach((e,r)=>{r>0&&p.push(t),c(e,n)})}};if(s(()=>c(e),e=>(p.push(`)`),`(`+e+`,`),`data`),!n){let{usedMethods:e,usedAssertions:t}=g;t.size&&(p.unshift(` this.assertAssertions(a)||`),m.assertAssertions=function(e){for(let[n,r]of t.entries())if(!OE(e,n))return()=>{throw Object.assign(Error(`Assertion "${n}" is not defined`),{details:{loc:{range:r}}})}}),e.size&&(p.unshift(` this.assertMethods(m)||`),m.assertMethods=function(t){for(let[n,r]of e.entries())if(!OE(t,n))return()=>{throw Object.assign(Error(`Method "${n}" is not defined. If that's a custom method make sure you added it with "methods" section in options`),{details:{loc:{range:r[0]}}})}})}return r!==null&&p.push(`,
|
|
20
|
+
stats: [`+f.map(e=>`[`+e+`]`)+`],
|
|
21
|
+
methods: m,
|
|
22
|
+
assertions: a
|
|
23
|
+
}`),oj(m,`return`+p.join(``)+`})`)}function oj(e,t){try{let n=Function(`f,m,a`,t);return Object.assign(n.bind(e),{toString(){return n.toString().replace(/^(\S+\s+)anonymous([^)\s]+)\s*\)/,`$1query$2)`)}})}catch(e){throw $A(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var sj=0,cj=1,lj=2,uj=4,dj=8,fj=3,pj=12,mj=e=>typeof e==`number`||typeof e==`string`,hj=(e,t)=>t<e.length?e.charCodeAt(t):0,gj=e=>e===43||e===45,_j=e=>e>=48&&e<=57,vj=e=>e===9||e===10||e===12||e===13||e===32,yj=e=>e>32&&e<256&&(e<65||e>90)&&(e<97||e>122)&&!_j(e)&&!gj(e)||e===8470,bj=e=>e&&!vj(e)&&!yj(e)&&!_j(e),xj=(e,t,n)=>gj(e)?_j(t)?2:t===46&&_j(n)?3:0:+!!_j(e),Sj=(e,t,n)=>{for(;n(hj(e,++t)););return t},Cj=(e,t,n)=>{let r=hj(e,t);if(gj(r)&&(r=hj(e,t+=1)),_j(r)&&(t=Sj(e,t,_j),r=hj(e,t)),r===46&&_j(hj(e,t+1))){if(n)return t;let i=Sj(e,t+1,_j);if(r=hj(e,i),r===46)return t;t=i}if(r===69||r===101){let n=1;r=hj(e,t+1),gj(r)&&(n=2,r=hj(e,t+2)),_j(r)&&(t=Sj(e,t+n,_j))}return t},wj=(e,t,n,r)=>{if(t>=e.length)return sj;let i=hj(e,t);return vj(i)?cj|Sj(e,t,vj)-t<<4:yj(i)||r&&gj(i)?lj|Sj(e,t,yj)-t<<4:xj(i,hj(e,t+1),hj(e,t+2))?uj|Cj(e,t,n)-t<<4:dj|Sj(e,t,bj)-t<<4},Tj=(e,t,n)=>{let r=0,i=0,a=!1,o=!1,s=0,c=0,l=!0;for(;;){let u=wj(e,r,a,o),d=wj(t,i,a,o),f=u&15,p=u>>4,m=d&15,h=d>>4;if(f!==m){if(l&&f&fj&&m&pj){s=1,c=f,r+=p;continue}if(l&&m&fj&&f&pj){s=-1,c=m,i+=h;continue}return f-m}if(f===sj)return s;l=!1,a=!1,o=!1;let g=p<h?p:h,_=p-h,v=``,y=``;for(let n=0;n<g;n++)if(v=e[r+n],y=t[i+n],v!==y){_=v<y?-1:1;break}if(f&fj)a=e[r+p-1]===`.`,_!==0&&f>c&&(c=f,s=_);else if(f&uj){if(o=!0,_!==0){let a=e.substr(r,p)-t.substr(i,h);if(a!==0)return n?-a:a;if(f>c){let a=hj(e,r),o=hj(t,i),l=a===45?-1:1;c=f,s=a!==o&&(a===45||o===43)?-1:a!==o&&(a===43||o===45)?1:(p-h||_)<0?-l:l,n&&(s=-s)}}}else if(_!==0){if(v!==y){let n=e.substr(r,p),a=t.substr(i,h),o=n.toLowerCase(),s=a.toLowerCase();return o===s?n<a?-1:1:o<s?-1:1}return _}r+=p,i+=h}},Ej=e=>(t,n)=>mj(t)&&mj(n)?Math.sign(Tj(String(t),String(n),e)):0,Dj=Ej(!1),Oj=Ej(!0),kj=1,Aj=2,jj=3,Mj=4,Nj=5,Pj=6,Fj=7,Ij=8;function Lj(e){switch(typeof e){case`boolean`:return kj;case`number`:return e===e?jj:Aj;case`string`:return Mj;case`object`:return e===null?Nj:Pj;case`undefined`:return Ij;default:return Fj}}function Rj(e,t){let n=Lj(e),r=Lj(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function zj(e,t){let n=Lj(e),r=Lj(t);return n===r?n===jj?t-e:e<t?-1:+(e>t):n<r?-1:1}function Bj(e,t){let n=Lj(e),r=Lj(t);return(n===jj||n===Mj)&&(r===jj||r===Mj)?Dj(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function Vj(e,t){let n=Lj(e),r=Lj(t);return(n===jj||n===Mj)&&(r===jj||r===Mj)?Oj(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function Hj(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var Uj=Object.freeze({awaitInitRef:Wj,ensureArray:Gj,bool:RE,and:(e,t)=>RE(e)?t:e,or:(e,t)=>RE(e)?e:t,add:Kj,sub:qj,mul:Jj,div:Yj,mod:Xj,eq:Zj,ne:Qj,lt:$j,lte:eM,gt:tM,gte:nM,in:rM,notIn:(e,t)=>!rM(e,t),has:(e,t)=>rM(t,e),hasNo:(e,t)=>!rM(t,e),cmp:Rj,cmpAnalytical:zj,cmpNatural:Bj,cmpNaturalAnalytical:Vj,match:iM,pick:aM,indexOf:oM,lastIndexOf:cM,map:uM,mapRecursive:dM,some:fM,filter:pM,slice:mM});function Wj(e,t,n){try{return e()}catch{if(t)throw Object.assign(ReferenceError(`Cannot access ${t} before initialization`),{details:{name:t,loc:{range:n}}})}}function Gj(e){return IE(e)?e:[e]}function Kj(e,t){return IE(e)||IE(t)?[...new Set([...IE(e)?e:[e],...IE(t)?t:[t]])]:e+t}function qj(e,t){if(IE(e)){let n=new Set(e);return IE(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function Jj(e,t){return e*t}function Yj(e,t){return e/t}function Xj(e,t){return e%t}function Zj(e,t){return Object.is(e,t)}function Qj(e,t){return!Object.is(e,t)}function $j(e,t){return e<t}function eM(e,t){return e<=t}function tM(e,t){return e>t}function nM(e,t){return e>=t}function rM(e,t){return NE(t)?OE(t,e):t?sM(t,e)!==-1:!1}function iM(e,t){return typeof t==`function`?fM(e,t):PE(t)?fM(e,t.test.bind(t)):t==null}function aM(e,t=()=>!0){if(e){if(typeof t==`function`){if(IE(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(RE(t(e[n],n)))return e[n]}for(let n in e)if(OE(e,n)&&RE(t(e[n],n)))return e[n];return}return IE(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:OE(e,t)?e[t]:void 0}}function oM(e,t,n){return e?sM(e,t,n):-1}function sM(e,t,n=0){if(Number.isNaN(t)&&FE(e)){for(let t=LE(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function cM(e,t,n){return e?lM(e,t,n):-1}function lM(e,t,n){if(Number.isNaN(t)&&FE(e)){for(let t=LE(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,LE(n,e.length-1)):-1}function uM(e,t){let n=typeof t==`function`?t:e=>ME(e,t);return IE(e)?[...e.reduce((e,t)=>AE(e,n(t)),new Set)]:e===void 0?e:n(e)}function dM(e,t){let n=new Set;return AE(n,uM(e,t)),n.forEach(e=>AE(n,uM(e,t))),[...n]}function fM(e,t){return IE(e)?e.some(e=>RE(t(e))):RE(t(e))}function pM(e,t){return IE(e)?e.filter(e=>RE(t(e))):RE(t(e))?e:void 0}function mM(e,t,n,r=1){if(!FE(e))return[];if(t=LE(t,0),n=LE(n,e.length),r=LE(r,1)||1,t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),n=n<0?Math.max(0,e.length+n):Math.min(e.length,n),t>=0&&n>=0&&t<=n&&r===1)return typeof e==`string`?e.slice(t,n):Array.prototype.slice.call(e,t,n);t>n&&([t,n]=[n,t],r=-r);let i=[];if(r>0)for(let a=t;a<n;a+=r)i.push(e[a]);else for(let a=n-1;a>=t;a+=r)i.push(e[a]);return typeof e==`string`?i.join(``):i}var hM=gM(20)?1/0:gM(10)?10:0;function gM(e){return Array.from({length:e},(e,t)=>({idx:t})).sort((e,t)=>e.idx%2-t.idx%2).every((t,n)=>n<e/2?t.idx>>1===n:Math.ceil(e/2)+(t.idx>>1)===n)}function _M(e,t){return e.length<=hM?e.slice().sort(t):e.map((e,t)=>({value:e,idx:t})).sort((e,n)=>(e.value===void 0?n.value!==void 0:n.value===void 0?-1:t(e.value,n.value))||e.idx-n.idx).map(e=>e.value)}var vM=(e,t)=>e-t,yM=(e,t)=>t-e,bM=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||yM,this.accept=n||null,this.values=[],this.valuesSet=r?new Set:null}add(e){(this.accept===null||this.accept(e))&&(this.valuesSet!==null&&this.valuesSet.has(e)||(this.values.length<this.maxSize?(this.valuesSet!==null&&this.valuesSet.add(e),this.values.push(e),this.heapifyUp(this.values.length-1)):this.compare(this.values[0],e)>0&&(this.valuesSet!==null&&(this.valuesSet.delete(this.values[0]),this.valuesSet.add(e)),this.values[0]=e,this.heapifyDown())))}addArray(e){for(let t=0;t<e.length;t++)this.add(e[t])}extract(){let e=this.values[0],t=this.values.pop();return this.values.length>0&&(this.values[0]=t,this.heapifyDown()),this.valuesSet!==null&&this.valuesSet.delete(e),e}heapifyUp(e){let t=this.values,n=t[e];for(;e>0;){let r=e-1>>1,i=t[r];if(this.compare(i,n)>0)break;t[r]=n,t[e]=i,e=r}}heapifyDown(){let e=this.values,t=e.length,n=t>>1,r=0,i=e[r],a=r,o=i;for(;r<n;){let n=2*r+1,s=e[n],c=n+1;if(this.compare(s,i)>0&&(a=n,o=s),c<t){let t=e[c];this.compare(t,o)>0&&(a=c,o=t)}if(a===r)break;e[r]=o,e[a]=i,r=a,o=i}}[Symbol.iterator](){return this.values.slice().sort(this.compare)[Symbol.iterator]()}},xM=class extends bM{},SM=class extends bM{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):vM,n,r)}},CM=e=>e;function wM(e){return typeof e==`object`&&e?NaN:Number(e)}function TM(e,t,n){if(FE(e)){typeof t!=`function`&&(t=CM);for(let r of e){let e=t(r);e!==void 0&&n(wM(e))}}}function EM(e,t,n,r){if(e.length===0||!isFinite(t)||t<0||t>100)return;let i=0,a=t*(e.length-1)/100,o=Math.floor(a),s=Math.ceil(a),c=!1,l=t<50?new SM(s+1,r):new xM(e.length-o,r);if(TM(e,n,e=>{Number.isNaN(e)&&(c=!0),l.add(e),i++}),c)return NaN;if(e.length!==i){if(i===0)return;a=t*(i-1)/100,o=Math.floor(a),s=Math.ceil(a);let e=t<50?s+1:i-o;for(let t=l.values.length;t>e;t--)l.extract()}if(o!==s){let e=l.extract(),t=l.values[0];return e<=t?e+(t-e)*(a-o):t+(e-t)*(a-o)}return l.values[0]}var DM=e=>e;function OM(e,t){let n,r=0,i=0;return TM(e,t,e=>{if(i++,n===void 0)n=e;else{let t=n,i=Math.abs(t),a=Math.abs(e);n+=e,i!==1/0&&a!==1/0&&(r+=i>=a?t-n+e:e-n+t)}}),n!==void 0&&(n+=r),{sum:n,count:i}}function kM(e,t){let n=[];return TM(e,t,n.push.bind(n)),n}function AM(e,t){let n=0;if(FE(e)){typeof t!=`function`&&(t=DM);for(let r of e)t(r)!==void 0&&n++}return n}function jM(e,t){return OM(e,t).sum}function MM(e,t){let{sum:n,count:r}=OM(e,t);if(r>0)return n/r}function NM(e,t){let n=0,r=0,i=0;if(TM(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function PM(e,t){let n=NM(e,t);if(n!==void 0)return Math.sqrt(n)}function FM(e,t=Bj){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=Hj(t,Bj);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)<0)&&t(i,void 0)!==0&&(n=i)}}return n}function IM(e,t=Bj){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=Hj(t,Bj);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)>=0)&&t(i,void 0)!==0&&(n=i)}}return n}function LM(e,t,n){if(FE(e))return EM(e,t,n)}function RM(e,t){return LM(e,50,t)}function zM(){}function BM(e){return e}function VM(e){return e===null?null:{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}function HM(e){let t=e.pop(),n=typeof t==`string`?null:t,r=n===null?t:e.pop(),i=e.pop();return{matched:e,start:i,end:i+e[0].length,input:r,groups:n}}var UM=String.prototype.replaceAll||function(e,t){return PE(e)?this.replace(e,t):this.split(e).join(String(t))},WM=Object.freeze({bool:Uj.bool,filter:Uj.filter,map:Uj.map,pick:Uj.pick,indexOf:Uj.indexOf,lastIndexOf:Uj.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)OE(e,n)&&AE(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)OE(e,n)&&t.push({key:n,value:e[n]});return t},fromEntries(e){let t=Object.create(null);if(Array.isArray(e))for(let n of e)n&&(t[n.key]=n.value);return t},size(e){return NE(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=Rj){if(!IE(e))return e;if(typeof t==`function`&&t.length!==2){let e=t;t=(t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){let r=Rj(t[e],n[e]);if(r!==0)return r}return 0}return Rj(t,n)}}return _M(e,t)},reverse(e){return IE(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||IE(e)?e.slice(t,n):Array.prototype.slice.call(e,t,n)},group(e,t,n){let r=new Map,i=[];typeof t!=`function`&&(t=zM),typeof n!=`function`&&(n=BM),IE(e)||(e=[e]);for(let i of e){let e=t(i);if(IE(e)){if(e.length>0){let t=n(i);for(let n of e)jE(r,n,t)}else jE(r,void 0,n(i))}else jE(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return IE(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=PE(t)?t.flags:``;if(n||i.includes(`g`)){let e=[],n=new RegExp(t,(i||``).replace(/g|$/,`g`)),a;for(;a=n.exec(r);)e.push(VM(a));return e}return VM(r.match(t))},reduce(e,t,n=void 0){return IE(e)?n===void 0?e.reduce((e,n)=>t(n,e)):e.reduce((e,n)=>t(n,e),n):t(e,n)},split(e,t){if(IE(e)){let n=typeof t==`function`?t:Object.is.bind(null,t),r=[],i=0,a=0;for(;a<e.length;a++)n(e[a])&&(r.push(e.slice(i,a)),i=a+1);return r.push(e.slice(i,a)),r}return String(e).split(t)},replace(e,t,n){if(IE(e)){let r=typeof t==`function`?t:Object.is.bind(null,t),i=[...e];for(let e=0;e<i.length;e++){let t=i[e];r(t)&&(i[e]=typeof n==`function`?n(t):n)}return i}return PE(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),UM.call(String(e),t,typeof n==`function`?(...e)=>n(HM(e)):n)},toLowerCase(e,t){return String(e).toLocaleLowerCase(t)},toUpperCase(e,t){return String(e).toLocaleUpperCase(t)},trim(e){return String(e).trim()},...`abs.acos.acosh.asin.asinh.atan.atan2.atanh.cbrt.ceil.clz32.cos.cosh.exp.expm1.floor.fround.hypot.imul.log10.log2.pow.round.sign.sin.sinh.sqrt.tan.tanh.trunc`.split(`.`).reduce((e,t)=>(e[t]=Math[t],e),{}),ln:Math.log,ln1p:Math.log1p,numbers:kM,count:AM,sum:jM,avg:MM,variance:NM,stdev:PM,min:FM,max:IM,percentile:LM,p:LM,median:RM}),GM=Object.freeze({function:e=>typeof e==`function`,symbol:e=>typeof e==`symbol`,primitive:e=>e===null||typeof e!=`object`&&typeof e!=`function`,string:e=>typeof e==`string`,number:e=>typeof e==`number`,int:Number.isInteger,finite:e=>Number.isFinite(e),nan:e=>Number.isNaN(e),infinity:e=>e===1/0||e===-1/0,boolean:e=>e===!0||e===!1,null:e=>e===null,undefined:e=>e===void 0,nullish:e=>e==null,object:NE,array:IE,regexp:PE,truthy:RE,falsy:e=>!RE(e)}),KM={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function qM(e,t){typeof e==`object`&&e&&!IE(e)&&Reflect.ownKeys(e).forEach(t.add,t)}function JM(e,t,n,r=new Set){let i=e=>{switch(typeof e){case`string`:case`number`:r.add(e)}};switch(e){case`path`:{let e=new Set;for(let n of t)if(Array.isArray(n))for(let t of n)qM(t,e);else qM(n,e);e.forEach(r.add,r);break}case`key`:{let e=new Set;for(let n of t)qM(n,e);e.forEach(r.add,r);break}case`value`:for(let e of t)i(e);break;case`in-value`:{let e=new Set;for(let n of t)IE(n)?n.forEach(i):qM(n,e);e.forEach(r.add,r);break}case`var`:for(let e of t)r.add(e);break;case`value-subset`:{let e=new Set(n);for(let n of t)e.has(n)||i(n);break}}return r}function YM(e,t,n,r=!1){let i=[];for(let[a,o,s,c,l=null]of n)if(t>=a&&t<=o&&(r||c.size||c.length)){let n=e.substring(a,o);/\S/.test(n)||(a=o=t,n=``),i.push({context:s,from:a,to:o,text:n,values:c,related:l})}return i}function XM(e,t){return typeof e==`function`?e:e===!0&&t}function ZM(e){if(/^(["']).*\1$/.test(e))try{return e[0]===`'`&&(e=`"${e.slice(1,-1).replace(/\\.|"/g,e=>e===`\\'`?`'`:e===`"`?`\\"`:e)}"`),JSON.parse(e)}catch{}return e}function QM(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var $M=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return YM(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=XM(o,Uj.cmp),s=XM(s,QM);let c=o&&isFinite(a)?xM:Set,l=YM(e,t,n,!0),u=new Map,d=[];for(let e of l){let{context:t,text:n,from:i,to:l,values:d,related:f}=e,p=KM[t];if(!u.has(p)){let e;switch(c){case xM:e=new xM(a,o,s&&s(ZM(n)),!0);break;case Set:e=new Set}u.set(p,{type:p,from:i,to:l,text:n,suggestions:e})}let{suggestions:m}=u.get(p);switch(t){case`assertion`:if(m.size===0||m.values&&m.values.length===0)for(let e of Object.keys(r))m.add(e);break;default:JM(t,d,f,m)}}if(c===Set)for(let e of u.values()){let{suggestions:t}=e;if(o&&(t=[...t].sort(o)),s||isFinite(a)){let n=[],r=s?s(ZM(e.text)):()=>!0;for(let e of t)if(r(e)&&n.push(e)>=a)break;t=n}e.suggestions=t}for(let e of u.values())e.suggestions=Array.isArray(e.suggestions)?e.suggestions:[...e.suggestions],e.suggestions.length&&d.push(e);return d.length?d:null}}),eN=s({default:()=>dN}),tN=new Map,nN=new Map,rN=new Map,iN=new Map;function aN(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=cN(n,`method`)(Uj,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function oN(e,t){if(!e&&!t)return{queryMethods:WM,queryAssertions:GM};let n={...WM},r={...GM};for(let[t,i]of Object.entries(e||{})){if(OE(WM,t))throw Error(`Builtin method "${t}" can\'t be overridden`);aN(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(OE(GM,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);aN(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function sN(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function cN(e,t,n,r,i){i=typeof i==`function`?i:i?sN:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=ND.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,QA(a.ast)));let o=n?YA(e,a):null;if(i&&o){let t=e=>JSON.stringify(e).slice(1,-1),n=[].concat(...[...o.entries()].map(([e,t])=>t.map(t=>[e,...t]))),r=[],a=null;i(`Stat/suggestion ranges`,n.sort((e,t)=>e[1]-t[1]).map(([n,...i])=>{let[o,s,c,l]=i,u;if(o===r[0]&&s===r[1])u=` `.repeat(a.length);else{let n=t(e.slice(0,o)).length,c=t(e.substring(o,s)).length;r=i,a=` `.repeat(n)+(c?`~`.repeat(c):`\\`)+` `+o+`:`+s,u=t(e)+`
|
|
24
|
+
`+a}return u+` [`+c+`] on `+n.type+(l===!0?` (current)`:l&&l.type?` & `+l.type:``)}).join(`
|
|
25
|
+
`))}let s=t===`method`?rj(a.ast,r,o):nj(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function lN(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?iN:nN:r?rN:tN,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=oN(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=cN(e,`query`,n,r,t.debug),i.set(e,l)),l=l(Uj,s,c),n?Object.assign((t,n)=>$M(e,l(t,n)),{query:l}):l}function uN(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=oN(a,o);return function(e,a){a||={};let o=!!a.stat,l=!!a.tolerant,u=o?l?i:n:l?r:t,d;if(e=String(e),u.has(e)&&!a.debug)d=u.get(e);else{let t=cN(e,`query`,o,l,a.debug)(Uj,s,c);d=o?Object.assign((n,r)=>$M(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var dN=Object.assign(lN,{version:DE,buildin:Uj,methods:WM,assertions:GM,setup:uN,syntax:{tokenize:ND.tokenize,parse:ND.parse,suggest:YA,walk:HA,stringify:QA,compile:nj,compileMethod:rj}}),fN=400,pN=150,mN=300,hN=`data-inspector:drafts`,gN=5,_N=1,vN=3600,yN=[`excludeFunctions`,`excludeUnderscoreProps`,`excludeDollarProps`];function bN(){try{let e=JSON.parse(localStorage.getItem(hN)??`{}`);return e&&typeof e==`object`?e:{}}catch{return{}}}function xN(e){try{return dN.syntax.parse(e),{kind:`ok`}}catch(t){let n=t,r=n.details?.loc?.range;return!r||r[1]>=e.trimEnd().length?{kind:`pending`}:{kind:`error`,message:n.message}}}function SN(e){return Number.isFinite(e)?Math.min(vN,Math.max(_N,Math.round(e))):gN}function CN(){let e=new URLSearchParams(location.hash.replace(/^#/,``)),t={};for(let n of yN)e.get(n)===`1`&&(t[n]=!0);let n=Number(e.get(`autorunSecs`));return{sourceId:e.get(`source`)??``,query:e.get(`query`)??``,filters:t,autoRun:e.get(`autorun`)===`1`,autoRunSeconds:n?SN(n):gN}}function wN(){let e=CN(),t=V([]),n=V(e.sourceId),r=V(e.query),i=bN(),a=!1;function o(){n.value&&(r.value?i[n.value]=r.value:delete i[n.value],localStorage.setItem(hN,JSON.stringify(i)))}function s(){a=!0,r.value=i[n.value]??``}let c=Zt({excludeFunctions:!1,excludeUnderscoreProps:!1,excludeDollarProps:!1,...e.filters}),l=V(e.autoRun),u=V(e.autoRunSeconds),d;function f(){clearTimeout(d),d=setTimeout(()=>{let e=new URLSearchParams;n.value&&e.set(`source`,n.value),r.value&&e.set(`query`,r.value);for(let t of yN)c[t]&&e.set(t,`1`);l.value&&(e.set(`autorun`,`1`),e.set(`autorunSecs`,String(u.value)));let t=e.toString();location.hash.replace(/^#/,``)!==t&&history.replaceState(history.state,``,t?`#${t}`:location.pathname+location.search)},mN)}function p(){let e=CN();e.sourceId&&e.sourceId!==n.value&&t.value.some(t=>t.id===e.sourceId)&&(n.value=e.sourceId),r.value=e.query;for(let t of yN)c[t]=e.filters[t]??!1;l.value=e.autoRun,u.value=e.autoRunSeconds}let m=V({kind:`ok`}),h=V(!1),g=V(null),_=V(null),v=V(!1),y=fn(),b=V(!1),x=V(null),S=V([]),C=fn(),w=V(null),T=V(!1),E=Q(()=>t.value.find(e=>e.id===n.value)),D=Q(()=>{let e=r.value.trim();return!e||e===`$`}),O=Q(()=>pT.mode===`rpc`&&!!E.value?.writable&&D.value),k=Q(()=>pT.mode!==`rpc`||!E.value?null:E.value.writable?D.value?null:`derived-view`:`readonly-source`),A=null;async function j(){t.value=await hT().sources(),A&&t.value.some(e=>e.id===A)&&(n.value=A,A=null),(!n.value||!t.value.some(e=>e.id===n.value))&&(n.value=t.value[0]?.id??``),e.query&&o()}function M(e){t.value.some(t=>t.id===e)?(n.value=e,A=null):A=e}let ee=0,te;async function N(){if(clearTimeout(te),!n.value)return;let e=r.value.trim()||`$`;if(e!==`$`){let t=xN(e);if(m.value=t,t.kind!==`ok`)return}else m.value={kind:`ok`};let t=++ee;h.value=!0;let i=performance.now(),a;try{a=await hT().query(n.value,e,{...c})}catch(e){t===ee&&(h.value=!1,g.value=`rpc: ${e instanceof Error?e.message:String(e)}`,v.value=!0);return}if(t===ee){if(h.value=!1,!a.ok){g.value=`${a.error.name}: ${a.error.message}`,v.value=!0;return}g.value=null,v.value=!1,_.value={...a.stats,rpcMs:Math.round(performance.now()-i)},y.value=a.result,b.value=!0,x.value=Date.now()}}function ne(){clearTimeout(te),te=setTimeout(()=>void N(),fN)}let re;function ie(){return typeof document<`u`&&document.hidden}function ae(){clearInterval(re),re=void 0,l.value&&!ie()&&(re=setInterval(()=>{h.value||m.value.kind===`error`||N()},SN(u.value)*1e3))}typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{l.value&&(ae(),!ie()&&!h.value&&m.value.kind!==`error`&&N())});async function P(e){if(!n.value)throw Error(`no source selected`);let t=r.value.trim()||`$`,i=await hT().queryPath(n.value,t,e,{...c});if(!i.ok)throw Error(`${i.error.name}: ${i.error.message}`);return i.result}async function F(e){if(!n.value)return{ok:!1,error:{name:`NoSource`,message:`no source selected`}};let t;try{t=await hT().write(n.value,e,{excludeFunctions:c.excludeFunctions})}catch(e){return{ok:!1,error:{name:`RpcError`,message:e instanceof Error?e.message:String(e)}}}return t.ok&&(N(),L()),t}let I;function oe(e){e!==n.value||I||(I=setTimeout(()=>{I=void 0,!(h.value||m.value.kind===`error`)&&(N(),L())},300))}let se=0;async function L(){if(!n.value)return;let e=++se;T.value=!0;let t;try{t=await hT().skeleton(n.value,{...c})}catch(t){e===se&&(T.value=!1,w.value=`rpc: ${t instanceof Error?t.message:String(t)}`);return}if(e===se){if(T.value=!1,!t.ok){w.value=`${t.error.name}: ${t.error.message}`;return}w.value=null,C.value=t.skeleton}}let ce=0,le;async function ue(e){let t=++ce,i;try{i=await hT().suggest(n.value,r.value,e)}catch{return}t===ce&&(S.value=(i.ok?i.suggestions:[]).filter(e=>!e.current||e.value.toLowerCase().startsWith(e.current.toLowerCase())))}function de(e){clearTimeout(le),le=setTimeout(()=>void ue(e),pN)}function fe(e){let t=r.value;return r.value=t.slice(0,e.from)+e.value+t.slice(e.to),S.value=[],N(),r.value}function pe(e){for(let t of yN)c[t]=e[t]??!1;r.value=e.query,N()}W(r,()=>{if(o(),f(),a){a=!1;return}ne()}),W(n,()=>{S.value=[],s(),f(),N(),L()}),W(c,()=>{f(),N(),L()}),W([l,u],()=>{u.value=SN(u.value),f(),ae()}),l.value&&ae(),typeof window<`u`&&window.addEventListener(`hashchange`,p);function me(e){r.value=/^[a-z_$][\w$]*$/i.test(e)?e:`$["${e.replaceAll(`"`,`\\"`)}"]`,N()}function he(e){let t=r.value.trim();r.value=t&&t!==`$`?`${t}\n| ${e}`:e,N()}function ge(e){let t=r.value.trim();r.value=t?`${t}${e.startsWith(`[`)?``:`.`}${e}`:e,N()}return{sources:t,sourceId:n,activeSource:E,query:r,settings:c,autoRun:l,autoRunSeconds:u,syntax:m,running:h,serverError:g,stats:_,statsStale:v,result:y,hasResult:b,lastRunAt:x,suggestions:S,skeleton:C,skeletonError:w,skeletonLoading:T,isIdentityQuery:D,canEdit:O,editHint:k,applyEdit:F,handleDataChanged:oe,loadSources:j,loadSkeleton:L,focusSource:M,expandNode:P,runNow:N,requestSuggestions:ue,scheduleSuggestions:de,acceptSuggestion:fe,applyRecipe:pe,queryProp:me,applySubquery:he,appendPath:ge}}var TN=Symbol(`data-inspector:workbench`);function EN(){let e=xr(TN);if(!e)throw Error(`workbench not provided`);return e}var DN={class:`flex flex-col h-full min-h-0`},ON={class:`flex gap-2`},kN={key:0,class:`text-sm op-fade`},AN={key:0,class:`mx-1 mb-1 px-2.5 py-1.5 font-mono text-11px rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},jN={class:`flex-1 min-h-0 overflow-auto font-mono max-h50 text-xs border border-base rounded-lg px-3 py-2`},MN=[`title`,`onClick`],NN={class:`op50`},PN={key:1,class:`op50`},FN={key:2,class:`op50`},IN=G({__name:`DataShapePanel`,props:{source:{},skeleton:{},error:{},loading:{type:Boolean}},emits:[`refresh`,`select`],setup(e,{emit:t}){let n=e,r=t;function i(e){if(typeof e==`string`)return e===`...`||e===`[circular]`?`object`:e;if(Array.isArray(e))return`array`;if(e&&typeof e==`object`){let t=e;return typeof t.$class==`string`?`class ${t.$class}`:Object.keys(t).find(e=>/^(?:Map|Set)\(\d+\)$/.test(e))||`object`}return String(e)}let a=Q(()=>{let{skeleton:e}=n;return!e||typeof e!=`object`||Array.isArray(e)?[]:Object.entries(e).filter(([e])=>e!==`$class`&&e!==`...`).map(([e,t])=>({key:e,label:i(t)}))}),o=Q(()=>{let{skeleton:e}=n;return e===void 0||a.value.length?null:i(e)});return(t,n)=>(q(),J(`div`,DN,[X(`div`,ON,[e.source?.description?(q(),J(`div`,kN,je(e.source.description),1)):Os(``,!0),n[1]||=X(`div`,{class:`flex-auto`},null,-1),Z(Gv,{class:`text-sm`,icon:e.loading?`i-ph:arrows-clockwise animate-spin`:`i-ph:arrows-clockwise`,label:`Refresh data shape`,tooltip:`Refresh`,disabled:e.loading,onClick:n[0]||=e=>r(`refresh`)},null,8,[`icon`,`disabled`])]),e.error?(q(),J(`div`,AN,je(e.error),1)):Os(``,!0),X(`div`,jN,[a.value.length?(q(),J(cs,{key:0},[n[2]||=X(`div`,{class:`op50 select-none`},` { `,-1),(q(!0),J(cs,null,ha(a.value,e=>(q(),J(`div`,{key:e.key,class:`pl-4 whitespace-nowrap`},[X(`button`,{type:`button`,class:`color-active hover:underline cursor-pointer`,title:`Query ${e.key}`,onClick:t=>r(`select`,e.key)},je(e.key),9,MN),X(`span`,NN,`: `+je(e.label)+`,`,1)]))),128)),n[3]||=X(`div`,{class:`op50 select-none`},` } `,-1)],64)):o.value?(q(),J(`span`,PN,je(o.value),1)):(q(),J(`span`,FN,`loading shape...`))])]))}});function LN(e,t){this.v=e,this.k=t}function RN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zN(e){if(Array.isArray(e))return e}function BN(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function VN(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HN(e,t){return zN(e)||BN(e,t)||UN(e,t)||VN()}function UN(e,t){if(e){if(typeof e==`string`)return RN(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?RN(e,t):void 0}}function WN(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof LN;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}WN.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},WN.prototype.next=function(e){return this._invoke(`next`,e)},WN.prototype.throw=function(e){return this._invoke(`throw`,e)},WN.prototype.return=function(e){return this._invoke(`return`,e)};var GN=Object.entries,KN=Object.setPrototypeOf,qN=Object.isFrozen,JN=Object.getPrototypeOf,YN=Object.getOwnPropertyDescriptor,XN=Object.freeze,ZN=Object.seal,QN=Object.create,$N=typeof Reflect<`u`&&Reflect,eP=$N.apply,tP=$N.construct;XN||=function(e){return e},ZN||=function(e){return e},eP||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},tP||=function(e){return new e(...[...arguments].slice(1))};var nP=SP(Array.prototype.forEach);Array.prototype.indexOf;var rP=SP(Array.prototype.lastIndexOf),iP=SP(Array.prototype.pop),aP=SP(Array.prototype.push);Array.prototype.slice;var oP=SP(Array.prototype.splice),sP=Array.isArray,cP=SP(String.prototype.toLowerCase),lP=SP(String.prototype.toString),uP=SP(String.prototype.match),dP=SP(String.prototype.replace),fP=SP(String.prototype.indexOf),pP=SP(String.prototype.trim),mP=SP(Number.prototype.toString),hP=SP(Boolean.prototype.toString),gP=typeof BigInt>`u`?null:SP(BigInt.prototype.toString),_P=typeof Symbol>`u`?null:SP(Symbol.prototype.toString),vP=SP(Object.prototype.hasOwnProperty),yP=SP(Object.prototype.toString),bP=SP(RegExp.prototype.test),xP=CP(TypeError);function SP(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return eP(e,t,n)}}function CP(e){return function(){return tP(e,[...arguments])}}function wP(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:cP;if(KN&&KN(e,null),!sP(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(qN(t)||(t[r]=e),i=e)}e[i]=!0}return e}function TP(e){for(let t=0;t<e.length;t++)vP(e,t)||(e[t]=null);return e}function EP(e){let t=QN(null);for(let r of GN(e)){var n=HN(r,2);let i=n[0],a=n[1];vP(e,i)&&(t[i]=sP(a)?TP(a):a&&typeof a==`object`&&a.constructor===Object?EP(a):a)}return t}function DP(e){switch(typeof e){case`string`:return e;case`number`:return mP(e);case`boolean`:return hP(e);case`bigint`:return gP?gP(e):`0`;case`symbol`:return _P?_P(e):`Symbol()`;case`undefined`:return yP(e);case`function`:case`object`:{if(e===null)return yP(e);let t=e,n=OP(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:yP(e)}return yP(e)}default:return yP(e)}}function OP(e,t){for(;e!==null;){let n=YN(e,t);if(n){if(n.get)return SP(n.get);if(typeof n.value==`function`)return SP(n.value)}e=JN(e)}function n(){return null}return n}function kP(e){try{return bP(e,``),!0}catch{return!1}}var AP=XN(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),jP=XN(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),MP=XN([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),NP=XN([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),PP=XN(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),FP=XN([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),IP=XN([`#text`]),LP=XN(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),RP=XN(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),zP=XN(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),BP=XN([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),VP=ZN(/{{[\w\W]*|^[\w\W]*}}/g),HP=ZN(/<%[\w\W]*|^[\w\W]*%>/g),UP=ZN(/\${[\w\W]*/g),WP=ZN(/^data-[\-\w.\u00B7-\uFFFF]+$/),GP=ZN(/^aria-[\-\w]+$/),KP=ZN(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qP=ZN(/^(?:\w+script|data):/i),JP=ZN(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),YP=ZN(/^html$/i),XP=ZN(/^[a-z][.\w]*(-[.\w]+)+$/i),ZP=ZN(/<[/\w!]/g),QP=ZN(/<[/\w]/g),$P=ZN(/<\/no(script|embed|frames)/i),eF=ZN(/\/>/i),tF={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nF=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],rF=XN(wP({},nF)),iF=function(){let e={};return nP(nF,t=>{e[t]=ZN(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),XN(e)}(),aF=function(){return typeof window>`u`?null:window},oF=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},sF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},cF=function(e,t,n,r){return vP(e,t)&&sP(e[t])?wP(r.base?EP(r.base):{},e[t],r.transform):n},lF=function(e,t,n){let r=vP(e,t)?e[t]:void 0;return r&&typeof r==`object`?EP(r):n()};function uF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aF(),t=e=>uF(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==tF.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=OP(d,`cloneNode`),p=OP(d,`remove`),m=OP(d,`removeAttributeNode`),h=OP(d,`nextSibling`),g=OP(d,`childNodes`),_=OP(d,`parentNode`),v=OP(d,`shadowRoot`),y=OP(d,`attributes`),b=o&&o.prototype?OP(o.prototype,`nodeType`):null,x=o&&o.prototype?OP(o.prototype,`nodeName`):null,S=o&&o.prototype?OP(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,O=!1,k=0,A=function(){if(k>0)throw xP(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},j=function(e){A(),k++;try{return T.createHTML(e)}finally{k--}},M=function(e){A(),k++;try{return T.createScriptURL(e)}finally{k--}},ee=function(){return O||=(D=oF(u,i),!0),D},te=n,N=te.implementation,ne=te.createNodeIterator,re=te.createDocumentFragment,ie=te.getElementsByTagName,ae=r.importNode,P=sF();t.isSupported=typeof GN==`function`&&typeof _==`function`&&N&&N.createHTMLDocument!==void 0;let F=VP,I=HP,oe=UP,se=WP,L=GP,ce=qP,le=JP,ue=XP,de=KP,fe=null,pe=wP({},[...AP,...jP,...MP,...PP,...IP]),me=null,he=wP({},[...LP,...RP,...zP,...BP]),ge=Object.seal(QN(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,ve=null,ye=Object.seal(QN(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),be=!0,xe=!0,Se=!1,Ce=!0,we=!1,Te=!0,Ee=!1,De=!1,Oe=null,ke=null,Ae=!1,je=!1,Me=!1,Ne=!1,Pe=!0,R=!1,Fe=`user-content-`,Ie=!0,Le=!1,Re={},ze=null,Be=wP({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ve=null,He=wP({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ue=null,We=wP({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ge=`http://www.w3.org/1998/Math/MathML`,Ke=`http://www.w3.org/2000/svg`,qe=`http://www.w3.org/1999/xhtml`,Je=qe,Ye=!1,Xe=null,Ze=wP({},[Ge,Ke,qe],lP),Qe=XN([`mi`,`mo`,`mn`,`ms`,`mtext`]),$e=wP({},Qe),et=XN([`annotation-xml`]),tt=wP({},et),nt=wP({},[`title`,`style`,`font`,`a`,`script`]),rt=null,it=[`application/xhtml+xml`,`text/html`],at=null,ot=null,st=n.createElement(`form`),ct=function(e){return e instanceof RegExp||e instanceof Function},lt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ot&&ot===e)return;(!e||typeof e!=`object`)&&(e={}),e=EP(e),rt=it.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,at=rt===`application/xhtml+xml`?lP:cP,fe=cF(e,`ALLOWED_TAGS`,pe,{transform:at}),me=cF(e,`ALLOWED_ATTR`,he,{transform:at}),Xe=cF(e,`ALLOWED_NAMESPACES`,Ze,{transform:lP}),Ue=cF(e,`ADD_URI_SAFE_ATTR`,We,{transform:at,base:We}),Ve=cF(e,`ADD_DATA_URI_TAGS`,He,{transform:at,base:He}),ze=cF(e,`FORBID_CONTENTS`,Be,{transform:at}),_e=cF(e,`FORBID_TAGS`,EP({}),{transform:at}),ve=cF(e,`FORBID_ATTR`,EP({}),{transform:at}),Re=vP(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?EP(e.USE_PROFILES):e.USE_PROFILES:!1,be=e.ALLOW_ARIA_ATTR!==!1,xe=e.ALLOW_DATA_ATTR!==!1,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ce=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=e.SAFE_FOR_TEMPLATES||!1,Te=e.SAFE_FOR_XML!==!1,Ee=e.WHOLE_DOCUMENT||!1,je=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Ne=e.RETURN_TRUSTED_TYPE||!1,Ae=e.FORCE_BODY||!1,Pe=e.SANITIZE_DOM!==!1,R=e.SANITIZE_NAMED_PROPS||!1,Ie=e.KEEP_CONTENT!==!1,Le=e.IN_PLACE||!1,de=kP(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:KP,Je=typeof e.NAMESPACE==`string`?e.NAMESPACE:qe,$e=lF(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>wP({},Qe)),tt=lF(e,`HTML_INTEGRATION_POINTS`,()=>wP({},et));let t=lF(e,`CUSTOM_ELEMENT_HANDLING`,()=>QN(null));if(ge=QN(null),vP(t,`tagNameCheck`)&&ct(t.tagNameCheck)&&(ge.tagNameCheck=t.tagNameCheck),vP(t,`attributeNameCheck`)&&ct(t.attributeNameCheck)&&(ge.attributeNameCheck=t.attributeNameCheck),vP(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(ge.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ZN(ge),we&&(xe=!1),Me&&(je=!0),Re&&(fe=wP({},IP),me=QN(null),Re.html===!0&&(wP(fe,AP),wP(me,LP)),Re.svg===!0&&(wP(fe,jP),wP(me,RP),wP(me,BP)),Re.svgFilters===!0&&(wP(fe,MP),wP(me,RP),wP(me,BP)),Re.mathMl===!0&&(wP(fe,PP),wP(me,zP),wP(me,BP))),ye.tagCheck=null,ye.attributeCheck=null,vP(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ye.tagCheck=e.ADD_TAGS:sP(e.ADD_TAGS)&&(fe===pe&&(fe=EP(fe)),wP(fe,e.ADD_TAGS,at))),vP(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ye.attributeCheck=e.ADD_ATTR:sP(e.ADD_ATTR)&&(me===he&&(me=EP(me)),wP(me,e.ADD_ATTR,at))),vP(e,`ADD_FORBID_CONTENTS`)&&sP(e.ADD_FORBID_CONTENTS)&&(ze===Be&&(ze=EP(ze)),wP(ze,e.ADD_FORBID_CONTENTS,at)),Ie&&(fe[`#text`]=!0),Ee&&wP(fe,[`html`,`head`,`body`]),fe.table&&(wP(fe,[`tbody`]),delete _e.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw xP(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw xP(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=j(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ee()),T&&typeof E==`string`&&(E=j(``)));XN&&XN(e),ot=e},ut=wP({},[...jP,...MP,...NP]),dt=wP({},[...PP,...FP]),ft=function(e,t,n){return t.namespaceURI===qe?e===`svg`:t.namespaceURI===Ge?e===`svg`&&(n===`annotation-xml`||$e[n]):!!ut[e]},pt=function(e,t,n){return t.namespaceURI===qe?e===`math`:t.namespaceURI===Ke?e===`math`&&tt[n]:!!dt[e]},mt=function(e,t,n){return t.namespaceURI===Ke&&!tt[n]||t.namespaceURI===Ge&&!$e[n]?!1:!dt[e]&&(nt[e]||!ut[e])},ht=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Je,tagName:`template`});let n=cP(e.tagName),r=cP(t.tagName);return Xe[e.namespaceURI]?e.namespaceURI===Ke?ft(n,t,r):e.namespaceURI===Ge?pt(n,t,r):e.namespaceURI===qe?mt(n,t,r):!!(rt===`application/xhtml+xml`&&Xe[e.namespaceURI]):!1},z=function(e){aP(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw xP(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},gt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},_t=function(e){bt(e);let t=g(e);if(t){let e=[];nP(t,t=>{aP(e,t)}),nP(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&>(e,r,i)}},vt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}aP(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(je||Me)try{z(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},yt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||me[at(i)]||gt(e,r,i)}},bt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===tF.element&&yt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e,t){return Te?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},St=function(e){if(!Te)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===tF.processingInstruction||n===tF.comment&&bP(QP,e.data)){try{p(e)}catch{}continue}if(n===tF.element){let t=e,n=at(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&xt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},B=function(e){let t=null,r=null;if(Ae)e=`<remove></remove>`+e;else{let t=uP(e,/^[\r\n\t ]+/);r=t&&t[0]}rt===`application/xhtml+xml`&&Je===qe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?j(e):e;if(Je===qe)try{t=new l().parseFromString(i,rt)}catch{}if(!t||!t.documentElement){t=N.createDocument(Je,`template`,null);try{t.documentElement.innerHTML=Ye?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Je===qe?ie.call(t,Ee?`html`:`body`)[0]:Ee?t.documentElement:a},Ct=function(e){let t=S?S(e):e.ownerDocument;return ne.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wt=function(e){return e=dP(e,F,` `),e=dP(e,I,` `),e=dP(e,oe,` `),e},Tt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ne.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=wt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&nP(i,e=>{Dt(e.content)&&Tt(e.content)})},Et=function(e){let t=x?x(e):null;return typeof t!=`string`||at(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Dt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===tF.documentFragment}catch{return!1}},Ot=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function kt(e,n,r){e.length!==0&&nP(e,e=>{e.call(t,n,r,ot)})}let At=function(e,t){return!!(Te&&e.hasChildNodes()&&!Ot(e.firstElementChild)&&bP(ZP,e.textContent)&&bP(ZP,e.innerHTML)||Te&&e.namespaceURI===qe&&rF[t]&&(Ot(e.firstElementChild)||typeof e.textContent==`string`&&bP(iF[t],e.textContent))||e.nodeType===tF.processingInstruction||Te&&e.nodeType===tF.comment&&bP(QP,e.data))},jt=function(e,t){return e instanceof RegExp?bP(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Mt=function(e,t,n){if(!_e[t]&&Rt(t)&&jt(ge.tagNameCheck,t))return!1;if(Ie&&!ze[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return z(e),!0},Nt=function(e,t,n,r){return e.length===0?t:t===n||t===r?EP(t):t},Pt=function(e,t){return e===t||_(e)!==null?!1:(Le&&bt(e),!0)},Ft=function(e,n){if(kt(P.beforeSanitizeElements,e,null),Pt(e,n))return!0;if(Et(e))return z(e),!0;let r=at(w(e));if(fe=Nt(P.uponSanitizeElement,fe,pe,Oe),kt(P.uponSanitizeElement,e,{tagName:r,allowedTags:fe}),Pt(e,n))return!0;if(At(e,r))return z(e),!0;if(_e[r]||!(ye.tagCheck instanceof Function&&ye.tagCheck(r))&&!fe[r]){let t=Mt(e,r,n);return t===!1&&(kt(P.afterSanitizeElements,e,null),Pt(e,n))?!0:t}if(C(e)===tF.element&&!ht(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&bP($P,e.innerHTML))return z(e),!0;if(we&&e.nodeType===tF.text){let n=wt(e.textContent);e.textContent!==n&&(aP(t.removed,{element:e.cloneNode()}),e.textContent=n)}return kt(P.afterSanitizeElements,e,null),Pt(e,n)},It=function(e,t,r){if(ve[t]||xt(t,e)||Pe&&(t===`id`||t===`name`)&&(r in n||r in st))return!1;let i=me[t]||ye.attributeCheck instanceof Function&&ye.attributeCheck(t,e);return xe&&bP(se,t)||be&&bP(L,t)?!0:i?Ue[t]||bP(de,dP(r,le,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&fP(r,`data:`)===0&&Ve[e]||Se&&!bP(ce,dP(r,le,``))?!0:!r:Rt(e)&&jt(ge.tagNameCheck,e)&&jt(ge.attributeNameCheck,t,e)||t===`is`&&ge.allowCustomizedBuiltInElements&&jt(ge.tagNameCheck,r)},Lt=wP({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Rt=function(e){return!Lt[cP(e)]&&bP(ue,e)},zt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return j(r);case`TrustedScriptURL`:return M(r)}return r},Bt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Et(e)||(z(e),!1)}catch{return vt(t,e),!1}},Vt=function(e,n){if(kt(P.beforeSanitizeAttributes,e,null),Pt(e,n))return;let r=e.attributes;if(!r||Et(e))return;me=Nt(P.uponSanitizeAttribute,me,he,ke);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:me,forceKeepAttr:void 0},a=r.length,o=at(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=at(s),d=l,f=s===`value`?d:pP(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,kt(P.uponSanitizeAttribute,e,i),f=i.attrValue,R&&(u===`id`||u===`name`)&&fP(f,Fe)!==0&&(vt(s,e,n),f=Fe+f,p=!0),Te&&bP(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){vt(s,e,n);continue}if(u===`attributename`&&uP(f,`href`)){vt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){vt(s,e,n);continue}if(!Ce&&bP(eF,f)){vt(s,e,n);continue}if(we&&(f=wt(f)),!It(o,u,f)){vt(s,e,n);continue}f=zt(o,u,c,f),f!==d&&Bt(e,s,c,f)&&p&&iP(t.removed)}}kt(P.afterSanitizeAttributes,e,null),Pt(e,n)},Ht=function(e){let t=null,n=Ct(e);for(kt(P.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(kt(P.uponSanitizeShadowNode,t,null),Ft(t,e),Vt(t,e),Dt(t.content)&&Ht(t.content),C(t)===tF.element){let e=v(t);Dt(e)&&(Ut(e),Ht(e))}kt(P.afterSanitizeShadowDOM,e,null)},Ut=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ht(e.shadow);continue}let n=e.node,r=C(n)===tF.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&at(e)===`template`){let e=n.content;Dt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Dt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ye=!e,Ye&&(e=`<!-->`),typeof e!=`string`&&!Ot(e)&&(e=DP(e),typeof e!=`string`))throw xP(`dirty is not a string, aborting`);if(!t.isSupported)return e;De?(fe=Oe,me=ke):lt(n),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(fe=EP(fe)),P.uponSanitizeAttribute.length>0&&(me=EP(me)),t.removed=[];let c=Le&&typeof e!=`string`&&Ot(e);if(c){St(e);let t=w(e);if(typeof t==`string`){let n=at(t);if(!fe[n]||_e[n])throw _t(e),xP(`root node is forbidden and cannot be sanitized in-place`)}if(Et(e))throw _t(e),xP(`root node is clobbered and cannot be sanitized in-place`);try{Ut(e)}catch(t){throw _t(e),t}}else if(Ot(e))i=B(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===tF.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Ut(i);else{if(!je&&!we&&!Ee&&e.indexOf(`<`)===-1)return T&&Ne?j(e):e;if(i=B(e),!i)return je?null:Ne?E:``}i&&Ae&&z(i.firstChild);let l=c?e:i;try{let e=Ct(l);for(;o=e.nextNode();)Ft(o,l),Vt(o,l),Dt(o.content)&&Ht(o.content)}catch(n){throw c&&(_t(e),nP(t.removed,e=>{e.element&&bt(e.element)})),n}if(c){let n=!1;if(nP(t.removed,t=>{t.element&&(t.element===e&&(n=!0),bt(t.element))}),n)throw xP(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return we&&Tt(e),e}if(je){if(we&&Tt(i),Me)for(s=re.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(me.shadowroot||me.shadowrootmode)&&(s=ae.call(r,s,!0)),s}let u=Ee?i.outerHTML:i.innerHTML;return Ee&&fe[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&bP(YP,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
27
|
+
`+u),we&&(u=wt(u)),T&&Ne?j(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};lt(e),De=!0,Oe=fe,ke=me},t.clearConfig=function(){ot=null,De=!1,Oe=null,ke=null,T=D,E=``},t.isValidAttribute=function(e,t,n){ot||lt({});let r=at(e),i=at(t);return It(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&vP(P,e)&&aP(P[e],t)},t.removeHook=function(e,t){if(vP(P,e)){if(t!==void 0){let n=rP(P[e],t);return n===-1?void 0:oP(P[e],n,1)[0]}return iP(P[e])}},t.removeHooks=function(e){vP(P,e)&&(P[e]=[])},t.removeAllHooks=function(){P=sF()},t}var dF=uF(),fF=new Map,pF=dF();async function mF(e,t){let n=`${e}:${t}`;if(fF.has(n))return fF.get(n);let r=i().then(e=>(fF.set(n,e),e)).catch(e=>{throw fF.delete(n),e});return fF.set(n,r),r;async function i(){let n=`https://api.iconify.design/${e}/${t}.svg?color=currentColor&width=100%`,r=await fetch(n).then(e=>e.text());return pF.sanitize(r)}}var hF=[`innerHTML`],gF=[`src`],_F=G({__name:`DisplayIconifyRemoteIcon`,props:{icon:{},size:{default:`1em`}},setup(e){let t=e,n=Q(()=>t.icon.includes(`/`)||t.icon.startsWith(`data:`)||t.icon.startsWith(`builtin:`)),r=Q(()=>{if(n.value)return;let e=t.icon.match(/^(?:i-)?([\w-]+):([\w-]+)$/);if(e)return{collection:e[1],icon:e[2]}}),i=V(void 0);return Tr(async()=>{if(!r.value){i.value=void 0;return}try{i.value=await mF(r.value.collection,r.value.icon)}catch{i.value=void 0}}),(t,n)=>r.value?(q(),J(`div`,{key:0,class:`shrink-0 inline-block [&>svg]:h-full [&>svg]:w-full`,style:me({width:e.size,height:e.size}),innerHTML:i.value},null,12,hF)):(q(),J(`img`,{key:1,src:e.icon,class:`shrink-0 inline-block object-contain`,style:me({width:e.size,height:e.size}),draggable:`false`},null,12,gF))}});function vF(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function yF(e,t){let n=typeof e==`string`&&!t?`${e}Context`:t,r=Symbol(n);return[t=>{let n=xr(r,t);if(n||n===null)return n;throw Error(`Injection \`${r.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(`, `)}`:`\`${e}\``}`)},e=>(br(r,e),e)]}function bF(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function xF(e,t,n){let r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function SF(e){return e==null}function CF(e,t){return SF(e)?!1:Array.isArray(e)?e.some(e=>Bu(e,t)):Bu(e,t)}function wF(e){return e?e.flatMap(e=>e.type===cs?wF(e.children):[e]):[]}var[TF,EF]=yF(`ConfigProvider`),DF=Zt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});function OF(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function kF(e,t,n=`.`,r){if(!OF(t))return kF(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:OF(a)&&OF(i[t])?kF(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function AF(e){return(...t)=>t.reduce((t,n)=>kF(t,n,``,e),{})}var jF=AF(),MF=UT(()=>{let e=V(new Map),t=V(),n=Q(()=>{for(let t of e.value.values())if(t)return!0;return!1}),r=TF({scrollBody:V(!0)}),i=null,a=()=>{document.body.style.paddingRight=``,document.body.style.marginRight=``,DF.layersWithOutsidePointerEventsDisabled.size===0&&(document.body.style.pointerEvents=``),document.documentElement.style.removeProperty(`--scrollbar-width`),document.body.style.overflow=t.value??``,PT&&i?.(),t.value=void 0};return W(n,(e,o)=>{if(!kT)return;if(!e){o&&a();return}t.value===void 0&&(t.value=document.body.style.overflow);let s=window.innerWidth-document.documentElement.clientWidth,c={padding:s,margin:0},l=r.scrollBody?.value?typeof r.scrollBody.value==`object`?jF({padding:r.scrollBody.value.padding===!0?s:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?s:r.scrollBody.value.margin},c):c:{padding:0,margin:0};s>0&&(document.body.style.paddingRight=typeof l.padding==`number`?`${l.padding}px`:String(l.padding),document.body.style.marginRight=typeof l.margin==`number`?`${l.margin}px`:String(l.margin),document.documentElement.style.setProperty(`--scrollbar-width`,`${s}px`),document.body.style.overflow=`hidden`),PT&&(i=QT(document,`touchmove`,e=>FF(e),{passive:!1})),er(()=>{n.value&&(document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`)})},{immediate:!0,flush:`sync`}),e});function NF(e){let t=Math.random().toString(36).substring(2,7),n=MF();n.value.set(t,e??!1);let r=Q({get:()=>n.value.get(t)??!1,set:e=>n.value.set(t,e)});return qT(()=>{n.value.delete(t)}),r}function PF(e){let t=window.getComputedStyle(e);if(t.overflowX===`scroll`||t.overflowY===`scroll`||t.overflowX===`auto`&&e.clientWidth<e.scrollWidth||t.overflowY===`auto`&&e.clientHeight<e.scrollHeight)return!0;{let t=e.parentNode;return!(t instanceof Element)||t.tagName===`BODY`?!1:PF(t)}}function FF(e){let t=e||window.event,n=t.target;return n instanceof Element&&PF(n)?!1:t.touches.length>1||(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function IF(e){let t=TF({dir:V(`ltr`)});return Q(()=>e?.value||t.dir?.value||`ltr`)}function LF(e){let t=Rs(),n=t?.type.emits,r={};return n?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),n?.forEach(t=>{r[oe(ae(t))]=(...n)=>e(t,...n)}),r}var RF=0;function zF(){Tr(e=>{if(!kT)return;let t=document.querySelectorAll(`[data-reka-focus-guard]`);document.body.insertAdjacentElement(`afterbegin`,t[0]??BF()),document.body.insertAdjacentElement(`beforeend`,t[1]??BF()),RF++,e(()=>{RF===1&&document.querySelectorAll(`[data-reka-focus-guard]`).forEach(e=>e.remove()),RF--})})}function BF(){let e=document.createElement(`span`);return e.setAttribute(`data-reka-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}function VF(e){return Q(()=>!gn(e)||!!ZT(e)?.closest(`form`))}function HF(){let e=Rs(),t=V(),n=Q(()=>r());ea(()=>{n.value!==r()&&hn(t)});function r(){return t.value&&`$el`in t.value&&[`#text`,`#comment`].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:ZT(t)}let i=Object.assign({},e.exposed),a={};for(let t in e.props)Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:()=>e.props[t]});if(Object.keys(i).length>0)for(let e in i)Object.defineProperty(a,e,{enumerable:!0,configurable:!0,get:()=>i[e]});Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=a;function o(n){if(t.value=n,n&&(Object.defineProperty(a,"$el",{enumerable:!0,configurable:!0,get:()=>n instanceof Element?n:n.$el}),!(n instanceof Element)&&!Object.hasOwn(n,`$el`))){let t=n.$.exposed,r=Object.assign({},a);for(let e in t)Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>t[e]});e.exposed=r}}return{forwardRef:o,currentRef:t,currentElement:n}}function UF(e){let t=Rs(),n=Object.keys(t?.type.props??{}).reduce((e,n)=>{let r=(t?.type.props[n]).default;return r!==void 0&&(e[n]=r),e},{}),r=wn(e);return Q(()=>{let e={},i=t?.vnode.props??{};return Object.keys(i).forEach(t=>{e[ae(t)]=i[t]}),Object.keys({...n,...e}).reduce((e,t)=>(r.value[t]!==void 0&&(e[t]=r.value[t]),e),{})})}function WF(e,t){let n=UF(e),r=t?LF(t):{};return Q(()=>({...n.value,...r}))}function GF(){let e=Rs()?.vnode?.scopeId;return e?{[e]:``}:{}}var KF=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},qF=new WeakMap,JF=new WeakMap,YF={},XF=0,ZF=function(e){return e&&(e.host||ZF(e.parentNode))},QF=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ZF(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},$F=function(e,t,n,r){var i=QF(t,Array.isArray(e)?e:[e]);YF[n]||(YF[n]=new WeakMap);var a=YF[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(qF.get(e)||0)+1,l=(a.get(e)||0)+1;qF.set(e,c),a.set(e,l),o.push(e),c===1&&i&&JF.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),XF++,function(){o.forEach(function(e){var t=qF.get(e)-1,i=a.get(e)-1;qF.set(e,t),a.set(e,i),t||(JF.has(e)||e.removeAttribute(r),JF.delete(e)),i||e.removeAttribute(n)}),XF--,XF||(qF=new WeakMap,qF=new WeakMap,JF=new WeakMap,YF={})}},eI=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||KF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),$F(r,i,n,`aria-hidden`)):function(){return null}};function tI(e){let t;W(()=>ZT(e),e=>{let n=!1;try{n=!!e?.closest(`[popover]:not(:popover-open)`)}catch{}e&&!n?t=eI(e):t&&t()}),na(()=>{t&&t()})}var nI=0;function rI(e,t=`reka`){if(e)return e;let n,r=TF({useId:void 0});return n=r.useId?r.useId():`useId`in Tu?oi?.():`${++nI}`,t?`${t}-${n}`:n}function iI(e){let t=V(),n=Q(()=>t.value?.width??0),r=Q(()=>t.value?.height??0),i;return Qi(()=>{let n=ZT(e);n?(t.value={width:n.offsetWidth,height:n.offsetHeight},i=new ResizeObserver(e=>{if(!Array.isArray(e)||!e.length)return;let r=e[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=n.offsetWidth,a=n.offsetHeight;t.value={width:i,height:a}}),i.observe(n,{box:`border-box`})):t.value=void 0}),na(()=>{i?.disconnect(),i=void 0}),{width:n,height:r}}function aI(e,t){let n=V(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function oI(e){let t=WT(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=bF(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=cI(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function sI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function cI(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=sI(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lI(e,t){let n=V({}),r=V(`none`),i=V(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??XT,{state:c,dispatch:l}=aI(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(kT){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};W(e,async(e,i)=>{let a=i!==e;if(await er(),a){let a=r.value,o=uI(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=uI(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=uI(t.value))},p=W(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=W(c,()=>{let e=uI(t.value);r.value=c.value===`mounted`?e:`none`});return na(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:Q(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function uI(e){return e&&getComputedStyle(e).animationName||`none`}var dI=G({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=xn(e),a=V(),{isPresent:o}=lI(r,a);n({present:o});let s=t.default({present:o.value});s=wF(s||[]);let c=Rs();if(s&&s?.length>1){let e=c?.parent?.type.name?`<${c.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(`
|
|
28
|
+
`)].join(`
|
|
29
|
+
`))}return()=>i.value||r.value||o.value?ic(t.default({present:o.value})[0],{ref:e=>{let t=ZT(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),fI=G({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=wF(n.default()),r=e.findIndex(e=>e.type!==us);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?Ms(t,i.props):t,o=Ts({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),pI=[`area`,`img`,`input`],mI=G({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&pI.includes(r)?()=>ic(r,t):r===`template`?()=>ic(fI,t,{default:n.default}):()=>ic(e.as,t,{default:n.default})}});function hI(){let e=V();return{primitiveElement:e,currentElement:Q(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ZT(e))}}function gI({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function _I({type:e,defaultValue:t,modelValue:n}){return e||gI({type:e,defaultValue:t,modelValue:n})}function vI({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function yI(e,t){let n=Q(()=>_I(e)),r=xE(e,`modelValue`,t,{defaultValue:vI(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Bu(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(CF(t,e)){let n=t.findIndex(t=>Bu(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Q(()=>n.value===`single`)}}var[bI,xI]=yF(`DialogRoot`),SI=G({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=xE(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=V(),a=V(),{modal:o,unmountOnHide:s}=xn(n);return xI({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>K(e.$slots,`default`,{open:H(r),close:()=>r.value=!1})}}),CI=G({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;HF();let n=bI();return(e,r)=>(q(),Y(H(mI),Ms(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>H(n).onOpenChange(!1)}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`type`]))}}),wI=`dismissableLayer.pointerDownOutside`,TI=`dismissableLayer.focusOutside`;function EI(e,t){if(!(t instanceof Element))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function DI(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1),a=V(()=>{});return Tr(o=>{if(!kT||!gn(n))return;let s=async n=>{let o=n.target;if(t?.value&&o){if(EI(t.value,o)){r.removeEventListener(`click`,a.value),i.value=!1;return}if(n.target&&!i.value){let t={originalEvent:n};function i(){xF(wI,e,t)}n.pointerType===`touch`?(r.removeEventListener(`click`,a.value),a.value=i,r.addEventListener(`click`,a.value,{once:!0})):i()}else r.removeEventListener(`click`,a.value);i.value=!1}},c=window.setTimeout(()=>{r.addEventListener(`pointerdown`,s)},0);o(()=>{window.clearTimeout(c),r.removeEventListener(`pointerdown`,s),r.removeEventListener(`click`,a.value)})}),{onPointerDownCapture:()=>{gn(n)&&(i.value=!0)}}}function OI(e,t,n=!0){let r=t?.value?.ownerDocument??globalThis?.document,i=V(!1);return Tr(a=>{if(!kT||!gn(n))return;let o=async n=>{if(!t?.value)return;await er(),await er();let r=n.target;t.value&&r&&!EI(t.value,r)&&n.target&&!i.value&&xF(TI,e,{originalEvent:n})};r.addEventListener(`focusin`,o),a(()=>r.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{gn(n)&&(i.value=!0)},onBlurCapture:()=>{gn(n)&&(i.value=!1)}}}var kI=G({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=HF(),o=Q(()=>a.value?.ownerDocument??globalThis.document),s=Q(()=>DF.layersRoot),c=Q(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=Q(()=>DF.layersWithOutsidePointerEventsDisabled.size>0),u=Q(()=>{let e=Array.from(s.value),[t]=[...DF.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=DI(async e=>{let t=[...DF.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await er(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=OI(e=>{let t=[...DF.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return nE(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))}),W([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{e&&n&&t&&(DF.layersWithOutsidePointerEventsDisabled.size===0&&(DF.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents=`none`),DF.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{DF.layersWithOutsidePointerEventsDisabled.delete(e),DF.layersWithOutsidePointerEventsDisabled.size===0&&!SF(DF.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=DF.originalBodyPointerEvents)}))},{immediate:!0}),W([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),Tr(e=>{e(()=>{a.value&&(s.value.delete(a.value),DF.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(e,t)=>(q(),Y(H(mI),{ref:H(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:me({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:H(f).onFocusCapture,onBlurCapture:H(f).onBlurCapture,onPointerdownCapture:H(d).onPointerDownCapture},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),AI=ET(()=>V([]));function jI(){let e=AI();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=MI(e.value,t),e.value.unshift(t)},remove(t){e.value=MI(e.value,t),e.value[0]?.resume()}}}function MI(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var NI=`focusScope.autoFocusOnMount`,PI=`focusScope.autoFocusOnUnmount`,FI={bubbles:!1,cancelable:!0};function II(e,{select:t=!1}={}){let n=bF();for(let r of e)if(HI(r,{select:t}),bF()!==n)return!0}function LI(e){let t=RI(e);return[zI(t,e),zI(t.reverse(),e)]}function RI(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function zI(e,t){for(let n of e)if(!BI(n,{upTo:t}))return n}function BI(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function VI(e){return e instanceof HTMLInputElement&&`select`in e}function HI(e,{select:t=!1}={}){if(e&&e.focus){let n=bF();e.focus({preventScroll:!0}),e!==n&&VI(e)&&t&&e.select()}}var UI=G({__name:`FocusScope`,props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},present:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`mountAutoFocus`,`unmountAutoFocus`],setup(e,{emit:t}){let n=e,r=t,{currentRef:i,currentElement:a}=HF(),o=V(null),s=jI(),c=Zt({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Tr(e=>{if(!kT)return;let t=a.value;if(!n.trapped)return;function r(e){if(c.paused||!t)return;let n=e.target;t.contains(n)?o.value=n:HI(o.value,{select:!0})}function i(e){if(c.paused||!t)return;let n=e.relatedTarget;n!==null&&(t.contains(n)||HI(o.value,{select:!0}))}function s(e){let n=o.value;if(n===null||!e.some(e=>e.removedNodes.length>0))return;let r=bF();r&&t.contains(r)||t.contains(n)||HI(t)}document.addEventListener(`focusin`,r),document.addEventListener(`focusout`,i);let l=new MutationObserver(s);t&&l.observe(t,{childList:!0,subtree:!0}),e(()=>{document.removeEventListener(`focusin`,r),document.removeEventListener(`focusout`,i),l.disconnect()})});function l(e,t){let n=new CustomEvent(NI,FI),i=e=>r(`mountAutoFocus`,e);e.addEventListener(NI,i),e.dispatchEvent(n),e.removeEventListener(NI,i),n.defaultPrevented||(II(RI(e),{select:!0}),bF()===t&&HI(e))}Tr(async e=>{let t=a.value;if(await er(),!t)return;n.present!==!1&&s.add(c);let i=bF();!t.contains(i)&&n.present!==!1&&l(t,i),e(()=>{let e=new CustomEvent(PI,FI),n=e=>{r(`unmountAutoFocus`,e)};t.addEventListener(PI,n),t.dispatchEvent(e),t.setAttribute(`data-focus-scope-unmounting`,``),setTimeout(()=>{e.defaultPrevented||HI(i??document.body,{select:!0}),t.removeEventListener(PI,n),s.remove(c),t.removeAttribute(`data-focus-scope-unmounting`)},0)})}),W(()=>n.present,async(e,t)=>{if(!kT)return;if(e===!1&&t===!0){s.remove(c);return}if(e!==!0||t!==!1)return;s.add(c),await er();let n=a.value;if(!n)return;let r=bF();n.contains(r)||l(n,r)});function u(e){if(!n.loop&&!n.trapped||c.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=bF();if(t&&r){let t=e.currentTarget,[i,a]=LI(t);i&&a?!e.shiftKey&&r===a?(e.preventDefault(),n.loop&&HI(i,{select:!0})):e.shiftKey&&r===i&&(e.preventDefault(),n.loop&&HI(a,{select:!0})):r===t&&e.preventDefault()}}return(e,t)=>(q(),Y(H(mI),{ref_key:`currentRef`,ref:i,tabindex:`-1`,"as-child":e.asChild,as:e.as,onKeydown:u},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),WI=[`Enter`,` `],GI=[`ArrowDown`,`PageUp`,`Home`],KI=[`ArrowUp`,`PageDown`,`End`];[...GI,...KI],[...WI],[...WI];function qI(e){return e?`open`:`closed`}function JI(e){let t=bF();for(let n of e)if(n===t||(n.focus(),bF()!==t))return}var YI=G({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=bI(),{forwardRef:a,currentElement:o}=HF();return i.titleId||=rI(void 0,`reka-dialog-title`),i.descriptionId||=rI(void 0,`reka-dialog-description`),Qi(()=>{i.contentElement=o,bF()!==document.body&&(i.triggerElement.value=bF())}),(e,t)=>(q(),Y(H(UI),{"as-child":``,loop:``,trapped:n.trapFocus,present:n.present,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:U(()=>[Z(H(kI),Ms({id:H(i).contentId,ref:H(a),as:e.as,"as-child":e.asChild,present:n.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":H(i).descriptionId,"aria-labelledby":H(i).titleId,"data-state":H(qI)(H(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>H(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),XI=G({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=bI(),a=LF(r),{forwardRef:o,currentElement:s}=HF();tI(Q(()=>n.present?s.value:void 0));let c=Q(()=>{let{present:e,...t}=n;return t});return W(()=>n.present,(e,t)=>{!e&&t&&i.triggerElement.value?.focus()}),(e,t)=>(q(),Y(YI,Ms({...c.value,...H(a)},{ref:H(o),present:e.present,"trap-focus":H(i).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),H(i).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),ZI=G({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=LF(t);HF();let i=bI(),a=V(!1),o=V(!1),s=Q(()=>{let{present:e,...t}=n;return t});return W(()=>n.present,(e,t)=>{!e&&t&&(a.value||i.triggerElement.value?.focus(),a.value=!1,o.value=!1)}),(e,t)=>(q(),Y(YI,Ms({...s.value,...H(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(a.value||H(i).triggerElement.value?.focus(),e.preventDefault()),a.value=!1,o.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(a.value=!0,e.detail.originalEvent.type===`pointerdown`&&(o.value=!0));let t=e.target;H(i).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o.value&&e.preventDefault()}}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`present`]))}}),QI=G({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=bI(),a=LF(r),{forwardRef:o}=HF(),s=Q(()=>n.forceMount||!i.unmountOnHide.value);return(e,t)=>(q(),Y(H(dI),{present:H(i).open.value,"force-mount":s.value},{default:U(({present:t})=>[H(i).modal.value?vr((q(),Y(XI,Ms({key:0,ref:H(o),present:!s.value||t},{...n,...H(a),...e.$attrs}),{default:U(()=>[K(e.$slots,`default`)]),_:2},1040,[`present`])),[[Gc,e.forceMount||H(i).unmountOnHide.value||t]]):vr((q(),Y(ZI,Ms({key:1,ref:H(o),present:!s.value||t},{...n,...H(a),...e.$attrs}),{default:U(()=>[K(e.$slots,`default`)]),_:2},1040,[`present`])),[[Gc,e.forceMount||H(i).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),$I=G({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;HF();let n=bI();return(e,r)=>(q(),Y(H(mI),Ms(t,{id:H(n).descriptionId}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`id`]))}}),eL=G({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=bI(),r=NF(t.present);return W(()=>t.present,e=>r.value=e),HF(),(e,t)=>(q(),Y(H(mI),{as:e.as,"as-child":e.asChild,"data-state":H(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=lu(()=>{},[`left`,`self`,`prevent`])},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),tL=G({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=bI(),{forwardRef:r}=HF(),i=Q(()=>t.forceMount||!n.unmountOnHide.value);return(e,t)=>H(n)?.modal.value?(q(),Y(H(dI),{key:0,present:H(n).open.value,"force-mount":i.value},{default:U(({present:t})=>[vr(Z(eL,Ms(e.$attrs,{ref:H(r),as:e.as,"as-child":e.asChild,present:!i.value||t}),{default:U(()=>[K(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[Gc,e.forceMount||H(n).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`])):Os(`v-if`,!0)}}),nL=G({__name:`Teleport`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e,n=TF({}),r=Q(()=>t.to??n.teleportTo?.value??`body`),i=$T();return(e,t)=>H(i)||e.forceMount?(q(),Y(Hr,{key:0,to:r.value,disabled:e.disabled,defer:e.defer},[K(e.$slots,`default`)],8,[`to`,`disabled`,`defer`])):Os(`v-if`,!0)}}),rL=G({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(q(),Y(H(nL),be(ws(t)),{default:U(()=>[K(e.$slots,`default`)]),_:3},16))}}),iL=G({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=bI();return HF(),(e,r)=>(q(),Y(H(mI),Ms(t,{id:H(n).titleId}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`id`]))}}),aL=G({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=bI(),{forwardRef:r,currentElement:i}=HF();return n.contentId||=rI(void 0,`reka-dialog-content`),Qi(()=>{n.triggerElement.value=i.value}),(e,i)=>(q(),Y(H(mI),Ms(t,{ref:H(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":H(n).open.value||!1,"aria-controls":H(n).open.value?H(n).contentId:void 0,"data-state":H(n).open.value?`open`:`closed`,onClick:H(n).onOpenToggle}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),oL=`data-reka-collection-item`;function sL(e={}){let{key:t=``,isProvider:n=!1}=e,r=`${t}CollectionProvider`,i;n?(i={collectionRef:V(),itemMap:V(new Map)},br(r,i)):i=xr(r);let a=(e,t=!1)=>{if(!i.collectionRef.value)return;let n=i.itemMap.value.get(e);return n&&(t||n.ref.dataset.disabled!==``)?n:void 0},o=(e=!1)=>{let t=i.collectionRef.value;if(!t)return[];let n=Array.from(t.querySelectorAll(`[${oL}]`)),r=new Map(n.map((e,t)=>[e,t])),a=Array.from(i.itemMap.value.values()).sort((e,t)=>(r.get(e.ref)??-1)-(r.get(t.ref)??-1));return e?a:a.filter(e=>e.ref.dataset.disabled!==``)},s=G({name:`CollectionSlot`,inheritAttrs:!1,setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=hI();return W(a,()=>{i.collectionRef.value=a.value}),()=>ic(fI,{ref:r,...n},t)}}),c=G({name:`CollectionItem`,inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(e,{slots:t,attrs:n}){let{primitiveElement:r,currentElement:a}=hI();return Tr(t=>{if(a.value){let n=cn(a.value);i.itemMap.value.set(n,{ref:a.value,value:e.value}),t(()=>i.itemMap.value.delete(n))}}),()=>ic(fI,{...n,[oL]:``,ref:r},t)}});return{getItems:o,getItem:a,reactiveItems:Q(()=>Array.from(i.itemMap.value.values())),itemMapSize:Q(()=>i.itemMap.value.size),CollectionSlot:s,CollectionItem:c}}var cL=G({__name:`VisuallyHidden`,props:{feature:{type:String,required:!1,default:`focusable`},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(q(),Y(H(mI),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature===`focusable`||e.feature===`fully-hidden`?`true`:void 0,"data-hidden":e.feature===`fully-hidden`?``:void 0,tabindex:e.feature===`fully-hidden`?`-1`:void 0,style:{position:`absolute`,border:0,width:`1px`,height:`1px`,padding:0,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,whiteSpace:`nowrap`,wordWrap:`normal`,top:`-1px`,left:`-1px`}},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`aria-hidden`,`data-hidden`,`tabindex`]))}}),lL=G({inheritAttrs:!1,__name:`VisuallyHiddenInputBubble`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,{primitiveElement:n,currentElement:r}=hI();return W(Q(()=>t.checked??t.value),(e,t)=>{if(!r.value)return;let n=r.value,i=window.HTMLInputElement.prototype,a=Object.getOwnPropertyDescriptor(i,`value`).set;if(a&&e!==t){let t=new Event(`input`,{bubbles:!0}),r=new Event(`change`,{bubbles:!0});a.call(n,e),n.dispatchEvent(t),n.dispatchEvent(r)}}),(e,r)=>(q(),Y(cL,Ms({ref_key:`primitiveElement`,ref:n},{...t,...e.$attrs},{as:`input`}),null,16))}}),uL=G({inheritAttrs:!1,__name:`VisuallyHiddenInput`,props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:`fully-hidden`}},setup(e){let t=e,n=Q(()=>typeof t.value==`object`&&Array.isArray(t.value)&&t.value.length===0&&t.required),r=Q(()=>typeof t.value==`string`||typeof t.value==`number`||typeof t.value==`boolean`||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value==`object`&&Array.isArray(t.value)?t.value.flatMap((e,n)=>typeof e==`object`?Object.entries(e).map(([e,r])=>({name:`${t.name}[${n}][${e}]`,value:r})):{name:`${t.name}[${n}]`,value:e}):t.value!==null&&typeof t.value==`object`&&!Array.isArray(t.value)?Object.entries(t.value).map(([e,n])=>({name:`${t.name}[${e}]`,value:n})):[]);return(e,i)=>(q(),J(cs,null,[Os(` We render single input if it's required `),n.value?(q(),Y(lL,Ms({key:e.name},{...t,...e.$attrs},{name:e.name,value:e.value}),null,16,[`name`,`value`])):(q(!0),J(cs,{key:1},ha(r.value,n=>(q(),Y(lL,Ms({key:n.name},{ref_for:!0},{...t,...e.$attrs},{name:n.name,value:n.value}),null,16,[`name`,`value`]))),128))],2112))}}),dL=`rovingFocusGroup.onEntryFocus`,fL={bubbles:!1,cancelable:!0},pL={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mL(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function hL(e,t,n){let r=mL(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return pL[r]}function gL(e,t=!1){let n=bF();for(let r of e)if(r===n||(r.focus({preventScroll:t}),bF()!==n))return}function _L(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var[vL,yL]=yF(`PopperRoot`),bL=G({inheritAttrs:!1,__name:`PopperRoot`,setup(e){let t=V();return yL({anchor:t,onAnchorChange:e=>t.value=e}),(e,t)=>K(e.$slots,`default`)}}),xL=G({__name:`PopperAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n,currentElement:r}=HF(),i=vL();return Er(()=>{i.onAnchorChange(t.reference??r.value)}),(e,t)=>(q(),Y(H(mI),{ref:H(n),as:e.as,"as-child":e.asChild},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`as`,`as-child`]))}});function SL(e){return e!==null}function CL(e){return{name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wL(n),u={start:e.dir===`rtl`?`100%`:`0%`,center:`50%`,end:e.dir===`rtl`?`0%`:`100%`}[l],d={start:`0%`,center:`50%`,end:`100%`}[l],f=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+s/2,m=``,h=``;return c===`bottom`?(m=a?u:`${f}px`,h=`${-s}px`):c===`top`?(m=a?u:`${f}px`,h=`${r.floating.height+s}px`):c===`right`?(m=`${-s}px`,h=a?d:`${p}px`):c===`left`&&(m=`${r.floating.width+s}px`,h=a?d:`${p}px`),{data:{x:m,y:h}}}}}function wL(e){let[t,n=`center`]=e.split(`-`);return[t,n]}function TL(e){return typeof e==`object`&&!!e&&`$el`in e}function EL(e){if(TL(e)){let t=e.$el;return Hg(t)&&zg(t)===`#comment`?null:t}return e}function DL(e){return typeof e==`function`?e():H(e)}function OL(e){return{name:`arrow`,options:e,fn(t){let n=EL(DL(e.element));return n==null?{}:W_({element:n,padding:e.padding}).fn(t)}}}function kL(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function AL(e,t){let n=kL(e);return Math.round(t*n)/n}function jL(e,t,n){n===void 0&&(n={});let r=n.whileElementsMounted,i=Q(()=>DL(n.open)??!0),a=Q(()=>DL(n.middleware)),o=Q(()=>DL(n.placement)??`bottom`),s=Q(()=>DL(n.strategy)??`absolute`),c=Q(()=>DL(n.transform)??!0),l=Q(()=>EL(e.value)),u=Q(()=>EL(t.value)),d=V(0),f=V(0),p=V(s.value),m=V(o.value),h=fn({}),g=V(!1),_=Q(()=>{let e={position:p.value,left:`0`,top:`0`};if(!u.value)return e;let t=AL(u.value,d.value),n=AL(u.value,f.value);return c.value?{...e,transform:`translate(`+t+`px, `+n+`px)`,...kL(u.value)>=1.5&&{willChange:`transform`}}:{position:p.value,left:t+`px`,top:n+`px`}}),v;function y(){if(l.value==null||u.value==null)return;let e=i.value;K_(l.value,u.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(t=>{d.value=t.x,f.value=t.y,p.value=t.strategy,m.value=t.placement,h.value=t.middlewareData,g.value=e!==!1})}function b(){typeof v==`function`&&(v(),v=void 0)}function x(){if(b(),r===void 0){y();return}if(l.value!=null&&u.value!=null){v=r(l.value,u.value,y);return}}function S(){i.value||(g.value=!1)}return W([a,o,s,i],y,{flush:`sync`}),W([l,u],x,{flush:`sync`}),W(i,S,{flush:`sync`}),Le()&&Re(b),{x:en(d),y:en(f),strategy:en(p),placement:en(m),middlewareData:en(h),isPositioned:en(g),floatingStyles:_,update:y}}var ML=[`dir`],NL={side:`bottom`,sideOffset:0,sideFlip:!0,align:`center`,alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:`partial`,hideWhenDetached:!1,positionStrategy:`fixed`,updatePositionStrategy:`optimized`,prioritizePosition:!1},[PL,FL]=yF(`PopperContent`),IL=G({inheritAttrs:!1,__name:`PopperContent`,props:Fa({memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...NL}),emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,i=vL(),{forwardRef:a,currentElement:o}=HF(),s=IF(Q(()=>n.dir)),c=V(),l=V(),{width:u,height:d}=iI(l),f=Q(()=>n.side+(n.align===`center`?``:`-${n.align}`)),p=Q(()=>typeof n.collisionPadding==`number`?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),m=Q(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),h=Q(()=>({padding:p.value,boundary:m.value.filter(SL),altBoundary:m.value.length>0})),g=Q(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),_=Q(()=>[R_({mainAxis:n.sideOffset+d.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&V_({...h.value,...g.value}),n.avoidCollisions&&B_({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky===`partial`?G_():void 0,...h.value}),!n.prioritizePosition&&n.avoidCollisions&&V_({...h.value,...g.value}),H_({...h.value,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--reka-popper-available-width`,`${n}px`),o.setProperty(`--reka-popper-available-height`,`${r}px`),o.setProperty(`--reka-popper-anchor-width`,`${i}px`),o.setProperty(`--reka-popper-anchor-height`,`${a}px`)}}),l.value&&OL({element:l.value,padding:n.arrowPadding}),CL({arrowWidth:u.value,arrowHeight:d.value,dir:s.value}),n.hideWhenDetached&&U_({strategy:`referenceHidden`,...h.value})]),{floatingStyles:v,placement:y,isPositioned:b,middlewareData:x,update:S}=jL(Q(()=>n.reference??i.anchor.value),c,{strategy:n.positionStrategy,placement:f,whileElementsMounted:(...e)=>L_(...e,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy===`always`}),middleware:_}),C=Q(()=>wL(y.value)[0]),w=Q(()=>wL(y.value)[1]);Er(()=>{b.value&&r(`placed`)});let T=Q(()=>{let e=x.value.arrow?.centerOffset!==0;return n.hideShiftedArrow&&e}),E=V(``);return Tr(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)}),FL({placedSide:C,onArrowChange:e=>l.value=e,arrowX:Q(()=>x.value.arrow?.x??0),arrowY:Q(()=>x.value.arrow?.y??0),shouldHideArrow:T}),(e,t)=>(q(),J(`div`,{ref_key:`floatingRef`,ref:c,"data-reka-popper-content-wrapper":``,dir:H(s),style:me({...H(v),transform:H(b)?H(v).transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:E.value,"--reka-popper-transform-origin":[H(x).transformOrigin?.x,H(x).transformOrigin?.y].join(` `),...H(x).hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}})},[n.memoDependencies?oc([n.asChild,n.as,C.value,w.value,H(b),...Object.values(e.$attrs),...n.memoDependencies],()=>(q(),Y(H(mI),Ms({key:0,ref:H(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,style:{animation:H(b)?void 0:`none`}}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`style`])),t,0):(q(),Y(H(mI),Ms({key:1,ref:H(a)},e.$attrs,{"as-child":n.asChild,as:n.as,"data-side":C.value,"data-align":w.value,dir:H(s),style:{animation:H(b)?void 0:`none`}}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`as-child`,`as`,`data-side`,`data-align`,`dir`,`style`]))],12,ML))}});function LL(e){let t=TF({nonce:V()});return Q(()=>e?.value||t.nonce?.value)}var[RL,zL]=yF(`RovingFocusGroup`),BL=G({__name:`RovingFocusGroup`,props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`entryFocus`,`update:currentTabStopId`],setup(e,{expose:t,emit:n}){let r=e,i=n,{loop:a,orientation:o,dir:s}=xn(r),c=IF(s),l=xE(r,`currentTabStopId`,i,{defaultValue:r.defaultCurrentTabStopId,passive:r.currentTabStopId===void 0}),u=V(!1),d=V(!1),f=V(0),{getItems:p,CollectionSlot:m}=sL({isProvider:!0});function h(e){let t=!d.value;if(e.currentTarget&&e.target===e.currentTarget&&t&&!u.value){let t=new CustomEvent(dL,fL);if(e.currentTarget.dispatchEvent(t),i(`entryFocus`,t),!t.defaultPrevented){let e=p().map(e=>e.ref).filter(e=>e.dataset.disabled!==``);gL([e.find(e=>e.getAttribute(`data-active`)===``),e.find(e=>e.getAttribute(`data-highlighted`)===``),e.find(e=>e.id===l.value),...e].filter(Boolean),r.preventScrollOnEntryFocus)}}d.value=!1}function g(){setTimeout(()=>{d.value=!1},1)}return t({getItems:p}),zL({loop:a,dir:c,orientation:o,currentTabStopId:l,onItemFocus:e=>{l.value=e},onItemShiftTab:()=>{u.value=!0},onFocusableItemAdd:()=>{f.value++},onFocusableItemRemove:()=>{f.value--}}),(e,t)=>(q(),Y(H(m),null,{default:U(()=>[Z(H(mI),{tabindex:u.value||f.value===0?-1:0,"data-orientation":H(o),as:e.as,"as-child":e.asChild,dir:H(c),style:{outline:`none`},onMousedown:t[0]||=e=>d.value=!0,onMouseup:g,onFocus:h,onBlur:t[1]||=e=>u.value=!1},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`as`,`as-child`,`dir`])]),_:3}))}}),VL=G({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=RL(),r=rI(),i=Q(()=>t.tabStopId||r),a=Q(()=>n.currentTabStopId.value===i.value),{getItems:o,CollectionItem:s}=sL();Qi(()=>{t.focusable&&n.onFocusableItemAdd()}),na(()=>{t.focusable&&n.onFocusableItemRemove()}),W(()=>t.focusable,(e,t)=>{e!==t&&(e?n.onFocusableItemAdd():n.onFocusableItemRemove())});function c(e){if(e.key===`Tab`&&e.shiftKey){n.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let r=hL(e,n.orientation.value,n.dir.value);if(r!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!t.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...o().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(r===`last`)i.reverse();else if(r===`prev`||r===`next`){r===`prev`&&i.reverse();let t=i.indexOf(e.currentTarget);i=n.loop.value?_L(i,t+1):i.slice(t+1)}er(()=>gL(i))}}return(e,t)=>(q(),Y(H(s),null,{default:U(()=>[Z(H(mI),{tabindex:a.value?0:-1,"data-orientation":H(n).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?H(n).onItemFocus(i.value):t.preventDefault()},onFocus:t[1]||=e=>H(n).onItemFocus(i.value),onKeydown:c},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[HL,UL]=yF(`CheckboxGroupRoot`);function WL(e){return e===`indeterminate`}function GL(e){return WL(e)?`indeterminate`:e?`checked`:`unchecked`}var[KL,qL]=yF(`CheckboxRoot`),JL=G({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=HF(),o=HL(null),s=xE(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),c=Q(()=>o?.disabled.value||n.disabled),l=Q(()=>Bu(s.value,n.trueValue)),u=Q(()=>SF(o?.modelValue.value)?s.value===`indeterminate`?`indeterminate`:l.value:CF(o.modelValue.value,n.value));function d(){if(SF(o?.modelValue.value))s.value===`indeterminate`?s.value=n.trueValue:s.value=l.value?n.falseValue:n.trueValue;else{let e=[...o.modelValue.value||[]];if(CF(e,n.value)){let t=e.findIndex(e=>Bu(e,n.value));e.splice(t,1)}else e.push(n.value);o.modelValue.value=e}}let f=VF(a),p=GF(),m=Ma(),h=Q(()=>{if(!m[`aria-label`])return n.id&&a.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0});return qL({disabled:c,state:u}),(e,t)=>(q(),J(cs,null,[(q(),Y(da(H(o)?.rovingFocus.value?H(VL):H(mI)),Ms({...e.$attrs,...H(p)},{id:e.id,ref:H(i),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":H(WL)(u.value)?`mixed`:u.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||h.value,"data-state":H(GL)(u.value),"data-disabled":c.value?``:void 0,disabled:c.value,focusable:H(o)?.rovingFocus.value?!c.value:void 0,onKeydown:du(lu(()=>{},[`prevent`]),[`enter`]),onClick:d}),{default:U(()=>[K(e.$slots,`default`,{modelValue:H(s),state:u.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),H(f)&&e.name&&!H(o)?(q(),Y(H(uL),Ms({key:0,type:`checkbox`,checked:!!u.value,name:e.name,value:e.value,disabled:c.value,required:e.required},H(p)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):Os(`v-if`,!0)],64))}}),YL=G({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=HF(),n=KL();return(e,r)=>(q(),Y(H(dI),{present:e.forceMount||H(WL)(H(n).state.value)||H(n).state.value===!0},{default:U(()=>[Z(H(mI),Ms({ref:H(t),"data-state":H(GL)(H(n).state.value),"data-disabled":H(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),XL=[` `,`Enter`,`ArrowUp`,`ArrowDown`],ZL=[` `,`Enter`];function QL(e,t,n){return e===void 0?!1:Array.isArray(e)?e.some(e=>$L(e,t,n)):$L(e,t,n)}function $L(e,t,n){return e===void 0||t===void 0?!1:typeof e==`string`?e===t:typeof n==`function`?n(e,t):typeof n==`string`?e?.[n]===t?.[n]:Bu(e,t)}function eR(e){return e==null||e===``||Array.isArray(e)&&e.length===0}var tR=[`value`],[nR,rR]=yF(`SelectRoot`),iR=G({inheritAttrs:!1,__name:`SelectRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},nullableValue:{type:String,required:!1,default:``},by:{type:[String,Function],required:!1},dir:{type:String,required:!1},multiple:{type:Boolean,required:!1},autocomplete:{type:String,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`,`update:open`],setup(e,{emit:t}){let n=e,r=t,{required:i,disabled:a,multiple:o,dir:s}=xn(n),c=xE(n,`modelValue`,r,{defaultValue:n.defaultValue??(o.value?[]:void 0),passive:n.modelValue===void 0,deep:!0}),l=xE(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),u=V(),d=V(),f=V({x:0,y:0}),p=Q(()=>o.value&&Array.isArray(c.value)?c.value?.length===0:SF(c.value));sL({isProvider:!0});let m=IF(s),h=VF(u),g=V(new Set),_=Q(()=>Array.from(g.value).map(e=>e.value).join(`;`));function v(e){if(o.value){let t=Array.isArray(c.value)?[...c.value]:[],r=t.findIndex(t=>$L(t,e,n.by));r===-1?t.push(e):t.splice(r,1),c.value=[...t]}else c.value=e}function y(e){return Array.from(g.value).find(t=>QL(e,t.value,n.by))}return rR({triggerElement:u,onTriggerChange:e=>{u.value=e},valueElement:d,onValueElementChange:e=>{d.value=e},contentId:``,modelValue:c,onValueChange:v,by:n.by,open:l,multiple:o,required:i,onOpenChange:e=>{l.value=e},dir:m,triggerPointerDownPosRef:f,disabled:a,isEmptyModelValue:p,optionsSet:g,onOptionAdd:e=>{let t=y(e.value);t&&g.value.delete(t),g.value.add(e)},onOptionRemove:e=>{let t=y(e.value);t&&g.value.delete(t)}}),(e,t)=>(q(),Y(H(bL),null,{default:U(()=>[K(e.$slots,`default`,{modelValue:H(c),open:H(l)}),H(h)&&e.name?(q(),Y(aR,{key:_.value,"aria-hidden":`true`,tabindex:`-1`,multiple:H(o),required:H(i),name:e.name,autocomplete:e.autocomplete,disabled:H(a),value:H(c)},{default:U(()=>[H(SF)(H(c))?(q(),J(`option`,{key:0,value:e.nullableValue},null,8,tR)):Os(`v-if`,!0),(q(!0),J(cs,null,ha(Array.from(g.value),e=>(q(),J(`option`,Ms({key:e.value??``},{ref_for:!0},e),null,16))),128))]),_:1},8,[`multiple`,`required`,`name`,`autocomplete`,`disabled`,`value`])):Os(`v-if`,!0)]),_:3}))}}),aR=G({__name:`BubbleSelect`,props:{autocomplete:{type:String,required:!1},autofocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},form:{type:String,required:!1},multiple:{type:Boolean,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},size:{type:Number,required:!1},value:{type:null,required:!1}},setup(e){let t=e,n=V(),r=nR();W(()=>t.value,(e,t)=>{let r=window.HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,`value`).set;if(e!==t&&i&&n.value){let t=new Event(`change`,{bubbles:!0});i.call(n.value,e),n.value.dispatchEvent(t)}});function i(e){r.onValueChange(e.target.value)}return(e,r)=>(q(),Y(H(cL),{"as-child":``},{default:U(()=>[X(`select`,Ms({ref_key:`selectElement`,ref:n},t,{onInput:i}),[K(e.$slots,`default`)],16)]),_:3}))}}),oR=G({__name:`SelectPopperPosition`,props:{memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1,default:10},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=UF(e);return(e,n)=>(q(),Y(H(IL),Ms(H(t),{style:{boxSizing:`border-box`,"--reka-select-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-select-content-available-width":`var(--reka-popper-available-width)`,"--reka-select-content-available-height":`var(--reka-popper-available-height)`,"--reka-select-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-select-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16))}}),sR={onViewportChange:()=>{},itemTextRefCallback:()=>{},itemRefCallback:()=>{}},[cR,lR]=yF(`SelectContent`),uR=G({__name:`SelectContentImpl`,props:{position:{type:String,required:!1,default:`item-aligned`},bodyLock:{type:Boolean,required:!1,default:!0},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1,default:`start`},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=nR();zF(),NF(n.bodyLock);let{CollectionSlot:a,getItems:o}=sL(),s=V();tI(s);let{search:c,handleTypeaheadSearch:l}=oI(),u=V(),d=V(),f=V(),p=V(!1),m=V(!1),h=V(!1);function g(){d.value&&s.value&&JI([d.value,s.value])}W(p,()=>{g()});let{onOpenChange:_,triggerPointerDownPosRef:v}=i;Tr(e=>{if(!s.value)return;let t={x:0,y:0},n=e=>{t={x:Math.abs(Math.round(e.pageX)-(v.value?.x??0)),y:Math.abs(Math.round(e.pageY)-(v.value?.y??0))}},r=e=>{e.pointerType!==`touch`&&(t.x<=10&&t.y<=10?e.preventDefault():s.value?.contains(e.target)||_(!1),document.removeEventListener(`pointermove`,n),v.value=null)};v.value!==null&&(document.addEventListener(`pointermove`,n),document.addEventListener(`pointerup`,r,{capture:!0,once:!0})),e(()=>{document.removeEventListener(`pointermove`,n),document.removeEventListener(`pointerup`,r,{capture:!0})})});function y(e){let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),e.code===`Space`){if(c.value===``)return;e.preventDefault()}if(!t&&e.key.length===1&&l(e.key,o()),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=[...o().map(e=>e.ref)];if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>JI(t)),e.preventDefault()}}let b=UF(Q(()=>n.position===`popper`?n:{}).value);return lR({content:s,viewport:u,onViewportChange:e=>{u.value=e},itemRefCallback:(e,t,n)=>{let r=!m.value&&!n,a=QL(i.modelValue.value,t,i.by);if(i.multiple.value){if(h.value)return;(a||r)&&(d.value=e,a&&(h.value=!0))}else(a||r)&&(d.value=e);r&&(m.value=!0)},selectedItem:d,selectedItemText:f,onItemLeave:()=>{s.value?.focus()},itemTextRefCallback:(e,t,n)=>{let r=!m.value&&!n;(QL(i.modelValue.value,t,i.by)||r)&&(f.value=e)},focusSelectedItem:g,position:n.position,isPositioned:p,searchRef:c}),(e,t)=>(q(),Y(H(a),null,{default:U(()=>[Z(H(UI),{"as-child":``,onMountAutoFocus:t[6]||=lu(()=>{},[`prevent`]),onUnmountAutoFocus:t[7]||=e=>{r(`closeAutoFocus`,e),!e.defaultPrevented&&(H(i).triggerElement.value?.focus({preventScroll:!0}),e.preventDefault())}},{default:U(()=>[Z(H(kI),{"as-child":``,"disable-outside-pointer-events":e.disableOutsidePointerEvents,onFocusOutside:t[2]||=lu(()=>{},[`prevent`]),onDismiss:t[3]||=e=>H(i).onOpenChange(!1),onEscapeKeyDown:t[4]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[5]||=e=>r(`pointerDownOutside`,e)},{default:U(()=>[(q(),Y(da(e.position===`popper`?oR:pR),Ms({...e.$attrs,...H(b)},{id:H(i).contentId,ref:e=>{if(!e)return;let t=H(ZT)(e);t?.hasAttribute(`data-reka-popper-content-wrapper`)?s.value=t.firstElementChild:s.value=t},role:`listbox`,"data-state":H(i).open.value?`open`:`closed`,dir:H(i).dir.value,style:{display:`flex`,flexDirection:`column`,outline:`none`},onContextmenu:t[0]||=lu(()=>{},[`prevent`]),onPlaced:t[1]||=e=>p.value=!0,onKeydown:y}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16,[`id`,`data-state`,`dir`,`onKeydown`]))]),_:3},8,[`disable-outside-pointer-events`])]),_:3})]),_:3}))}}),[dR,fR]=yF(`SelectItemAlignedPosition`),pR=G({inheritAttrs:!1,__name:`SelectItemAlignedPosition`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`placed`],setup(e,{emit:t}){let n=e,r=t,{getItems:i}=sL(),a=nR(),o=cR(),s=V(!1),c=V(!0),l=V(),{forwardRef:u,currentElement:d}=HF(),{viewport:f,selectedItem:p,selectedItemText:m,focusSelectedItem:h}=o;function g(){if(a.triggerElement.value&&a.valueElement.value&&l.value&&d.value&&f?.value&&p?.value&&m?.value){let e=a.triggerElement.value.getBoundingClientRect(),t=d.value.getBoundingClientRect(),n=a.valueElement.value.getBoundingClientRect(),o=m.value.getBoundingClientRect();if(a.dir.value!==`rtl`){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=vF(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.left=`${d}px`}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-10,d=vF(i,10,Math.max(10,u-c));l.value.style.minWidth=`${s}px`,l.value.style.right=`${d}px`}let c=i().map(e=>e.ref),u=window.innerHeight-20,h=f.value.scrollHeight,g=window.getComputedStyle(d.value),_=Number.parseInt(g.borderTopWidth,10),v=Number.parseInt(g.paddingTop,10),y=Number.parseInt(g.borderBottomWidth,10),b=Number.parseInt(g.paddingBottom,10),x=_+v+h+b+y,S=Math.min(p.value.offsetHeight*5,x),C=window.getComputedStyle(f.value),w=Number.parseInt(C.paddingTop,10),T=Number.parseInt(C.paddingBottom,10),E=e.top+e.height/2-10,D=u-E,O=p.value.offsetHeight/2,k=p.value.offsetTop+O,A=_+v+k,j=x-A;if(A<=E){let e=p.value===c.at(-1);l.value.style.bottom=`0px`;let t=d.value.clientHeight-f.value.offsetTop-f.value.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);l.value.style.height=`${n}px`}else{let e=p.value===c[0];l.value.style.top=`0px`;let t=Math.max(E,_+f.value.offsetTop+(e?w:0)+O)+j;l.value.style.height=`${t}px`,f.value.scrollTop=A-E+f.value.offsetTop}l.value.style.margin=`10px 0`,l.value.style.minHeight=`${S}px`,l.value.style.maxHeight=`${u}px`,r(`placed`),requestAnimationFrame(()=>s.value=!0)}}let _=V(``);Qi(async()=>{await er(),g(),d.value&&(_.value=window.getComputedStyle(d.value).zIndex)});function v(e){e&&c.value===!0&&(g(),h?.(),c.value=!1)}return bE(a.triggerElement,()=>{g()}),fR({contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:v}),(e,t)=>(q(),J(`div`,{ref_key:`contentWrapperElement`,ref:l,style:me({display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:_.value})},[Z(H(mI),Ms({ref:H(u),style:{boxSizing:`border-box`,maxHeight:`100%`}},{...e.$attrs,...n}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16)],4))}}),mR=G({inheritAttrs:!1,__name:`SelectProvider`,props:{context:{type:Object,required:!0}},setup(e){return rR(e.context),lR(sR),(e,t)=>K(e.$slots,`default`)}}),hR={key:1},gR=G({inheritAttrs:!1,__name:`SelectContent`,props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:[`closeAutoFocus`,`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=WF(n,t),i=nR(),a=V();Qi(()=>{a.value=new DocumentFragment});let o=V(),s=Q(()=>n.forceMount||i.open.value),c=V(s.value),l;function u(){l&&=(clearTimeout(l),void 0)}return W(s,(e,t,n)=>{u(),l=setTimeout(()=>{c.value=s.value,l=void 0}),n(u)}),na(u),(e,t)=>s.value||c.value||o.value?.present?(q(),Y(H(dI),{key:0,ref_key:`presenceRef`,ref:o,present:s.value},{default:U(()=>[Z(uR,be(ws({...H(r),...e.$attrs})),{default:U(()=>[K(e.$slots,`default`)]),_:3},16)]),_:3},8,[`present`])):a.value?(q(),J(`div`,hR,[(q(),Y(Hr,{to:a.value},[Z(mR,{context:H(i)},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`context`])],8,[`to`]))])):Os(`v-if`,!0)}}),_R=G({__name:`SelectIcon`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return(e,t)=>(q(),Y(H(mI),{"aria-hidden":`true`,as:e.as,"as-child":e.asChild},{default:U(()=>[K(e.$slots,`default`,{},()=>[t[0]||=Es(`▼`)])]),_:3},8,[`as`,`as-child`]))}}),[vR,yR]=yF(`SelectItem`),bR=G({__name:`SelectItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{disabled:i}=xn(n),a=nR(),o=cR(),{forwardRef:s,currentElement:c}=HF(),{CollectionItem:l}=sL(),u=Q(()=>QL(a.modelValue?.value,n.value,a.by)),d=V(!1),f=V(n.textValue??``),p=rI(void 0,`reka-select-item-text`);async function m(e){e.defaultPrevented||xF(`select.select`,h,{originalEvent:e,value:n.value})}async function h(e){await er(),r(`select`,e),!e.defaultPrevented&&(i.value||(a.onValueChange(n.value),a.multiple.value||a.onOpenChange(!1)))}async function g(e){await er(),!e.defaultPrevented&&(i.value?o.onItemLeave?.():e.currentTarget?.focus({preventScroll:!0}))}async function _(e){await er(),!e.defaultPrevented&&e.currentTarget===bF()&&o.onItemLeave?.()}async function v(e){await er(),!e.defaultPrevented&&(o.searchRef?.value===``||e.key!==` `)&&(ZL.includes(e.key)&&m(e),e.key===` `&&e.preventDefault())}if(n.value===``)throw Error(`A <SelectItem /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return Qi(()=>{c.value&&o.itemRefCallback(c.value,n.value,n.disabled)}),yR({value:n.value,disabled:i,textId:p,isSelected:u,onItemTextChange:e=>{f.value=((f.value||e?.textContent)??``).trim()}}),(e,t)=>(q(),Y(H(l),{value:{textValue:f.value}},{default:U(()=>[Z(H(mI),{ref:H(s),role:`option`,"aria-labelledby":H(p),"data-highlighted":d.value?``:void 0,"aria-selected":u.value,"data-state":u.value?`checked`:`unchecked`,"aria-disabled":H(i)||void 0,"data-disabled":H(i)?``:void 0,tabindex:H(i)?void 0:-1,as:e.as,"as-child":e.asChild,onFocus:t[0]||=e=>d.value=!0,onBlur:t[1]||=e=>d.value=!1,onPointerup:m,onPointerdown:t[2]||=e=>{e.currentTarget.focus({preventScroll:!0})},onTouchend:t[3]||=lu(()=>{},[`prevent`,`stop`]),onPointermove:g,onPointerleave:_,onKeydown:v},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`aria-labelledby`,`data-highlighted`,`aria-selected`,`data-state`,`aria-disabled`,`data-disabled`,`tabindex`,`as`,`as-child`])]),_:3},8,[`value`]))}}),xR=G({__name:`SelectItemIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=vR();return(e,r)=>H(n).isSelected.value?(q(),Y(H(mI),Ms({key:0,"aria-hidden":`true`},t),{default:U(()=>[K(e.$slots,`default`)]),_:3},16)):Os(`v-if`,!0)}}),SR=G({__name:`SelectPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(q(),Y(H(nL),be(ws(t)),{default:U(()=>[K(e.$slots,`default`)]),_:3},16))}}),CR=G({__name:`SelectTrigger`,props:{disabled:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=nR(),{forwardRef:r,currentElement:i}=HF(),a=Q(()=>n.disabled?.value||t.disabled);n.contentId||=rI(void 0,`reka-select-content`),Qi(()=>{n.onTriggerChange(i.value)});let{getItems:o}=sL(),{search:s,handleTypeaheadSearch:c,resetTypeahead:l}=oI();function u(){a.value||(n.onOpenChange(!0),l())}function d(e){u(),n.triggerPointerDownPosRef.value={x:Math.round(e.pageX),y:Math.round(e.pageY)}}function f(e){return e.button===0&&e.ctrlKey===!1}let p=!1;function m(e){if(e.pointerType===`touch`)return e.preventDefault();let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),f(e)&&(d(e),p=!0)}function h(e){f(e)&&e.preventDefault()}function g(e){p||e.currentTarget?.focus(),p=!1}return(e,t)=>(q(),Y(H(xL),{"as-child":``,reference:e.reference},{default:U(()=>[Z(H(mI),{ref:H(r),role:`combobox`,type:e.as===`button`?`button`:void 0,"aria-controls":H(n).open.value?H(n).contentId:void 0,"aria-expanded":H(n).open.value||!1,"aria-required":H(n).required?.value,"aria-autocomplete":`none`,disabled:a.value,dir:H(n)?.dir.value,"data-state":H(n)?.open.value?`open`:`closed`,"data-disabled":a.value?``:void 0,"data-placeholder":H(eR)(H(n).modelValue?.value)?``:void 0,"as-child":e.asChild,as:e.as,onClick:g,onPointerdown:m,onMousedown:h,onPointerup:t[0]||=lu(e=>{e.pointerType===`touch`&&d(e)},[`prevent`]),onKeydown:t[1]||=e=>{let t=H(s)!==``;(e.ctrlKey||e.altKey||e.metaKey||e.key.length!==1||!t||e.key!==` `)&&(H(c)(e.key,H(o)()),H(XL).includes(e.key)&&(u(),e.preventDefault()))}},{default:U(()=>[K(e.$slots,`default`)]),_:3},8,[`type`,`aria-controls`,`aria-expanded`,`aria-required`,`disabled`,`dir`,`data-state`,`data-disabled`,`data-placeholder`,`as-child`,`as`])]),_:3},8,[`reference`]))}}),wR=G({__name:`SelectViewport`,props:{nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{nonce:n}=xn(t),r=LL(n),i=cR(),a=i.position===`item-aligned`?dR():void 0,{forwardRef:o,currentElement:s}=HF();Qi(()=>{i?.onViewportChange(s.value)});let c=V(0);function l(e){let t=e.currentTarget,{shouldExpandOnScrollRef:n,contentWrapper:r}=a??{};if(n?.value&&r?.value){let e=Math.abs(c.value-t.scrollTop);if(e>0){let n=window.innerHeight-20,i=Number.parseFloat(r.value.style.minHeight),a=Number.parseFloat(r.value.style.height),o=Math.max(i,a);if(o<n){let i=o+e,a=Math.min(n,i),s=i-a;r.value.style.height=`${a}px`,r.value.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,r.value.style.justifyContent=`flex-end`)}}}c.value=t.scrollTop}return(e,n)=>(q(),J(cs,null,[Z(H(mI),Ms({ref:H(o),"data-reka-select-viewport":``,role:`presentation`},{...e.$attrs,...t},{style:{position:`relative`,flex:1,overflow:`hidden auto`},onScroll:l}),{default:U(()=>[K(e.$slots,`default`)]),_:3},16),Z(H(mI),{as:`style`,nonce:H(r)},{default:U(()=>n[0]||=[Es(` /* Hide scrollbars cross-browser and enable momentum scroll for touch devices */ [data-reka-select-viewport] { scrollbar-width:none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch; } [data-reka-select-viewport]::-webkit-scrollbar { display: none; } `)]),_:1,__:[0]},8,[`nonce`])],64))}}),[TR,ER]=yF(`ToggleGroupRoot`),DR=G({__name:`ToggleGroupRoot`,props:{rovingFocus:{type:Boolean,required:!1,default:!0},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{loop:i,rovingFocus:a,disabled:o,dir:s}=xn(n),c=IF(s),{forwardRef:l,currentElement:u}=HF(),{modelValue:d,changeModelValue:f,isSingle:p}=yI(n,r),m=VF(u);return ER({isSingle:p,modelValue:d,changeModelValue:f,dir:c,orientation:n.orientation,loop:i,rovingFocus:a,disabled:o}),(e,t)=>(q(),Y(da(H(a)?H(BL):H(mI)),{"as-child":``,orientation:H(a)?e.orientation:void 0,dir:H(c),loop:H(a)?H(i):void 0},{default:U(()=>[Z(H(mI),{ref:H(l),role:`group`,"as-child":e.asChild,as:e.as},{default:U(()=>[K(e.$slots,`default`,{modelValue:H(d)}),H(m)&&e.name?(q(),Y(uL,{key:0,name:e.name,required:e.required,value:H(d)},null,8,[`name`,`required`,`value`])):Os(`v-if`,!0)]),_:3},8,[`as-child`,`as`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),OR=G({inheritAttrs:!1,__name:`Toggle`,props:{defaultValue:{type:Boolean,required:!1},modelValue:{type:[Boolean,null],required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=HF(),o=GF(),s=TR(null),c=xE(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function l(){c.value=!c.value}let u=Q(()=>c.value?`on`:`off`),d=VF(a);return(e,t)=>(q(),J(cs,null,[Z(H(mI),Ms({ref:H(i),type:e.as===`button`?`button`:void 0,"as-child":n.asChild,as:e.as,"aria-pressed":H(c),"data-state":u.value,"data-disabled":e.disabled?``:void 0,disabled:e.disabled},{...H(o),...e.$attrs},{onClick:l}),{default:U(()=>[K(e.$slots,`default`,{modelValue:H(c),disabled:e.disabled,pressed:H(c),state:u.value})]),_:3},16,[`type`,`as-child`,`as`,`aria-pressed`,`data-state`,`data-disabled`,`disabled`]),H(d)&&e.name&&!H(s)?(q(),Y(uL,Ms({key:0,type:`checkbox`,name:e.name,value:H(c),required:e.required},H(o)),null,16,[`name`,`value`,`required`])):Os(`v-if`,!0)],64))}}),kR=G({__name:`ToggleGroupItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=TR(),r=Q(()=>n.disabled?.value||t.disabled),i=Q(()=>CF(n.modelValue.value,t.value)),{forwardRef:a}=HF(),o=GF();return(e,s)=>(q(),Y(da(H(n).rovingFocus.value?H(VL):H(mI)),Ms({"as-child":``},H(n).rovingFocus.value?{focusable:!r.value,active:i.value}:{}),{default:U(()=>[Z(H(OR),Ms({...H(o),...t},{ref:H(a),disabled:r.value,"model-value":i.value,"onUpdate:modelValue":s[0]||=t=>H(n).changeModelValue(e.value)}),{default:U(t=>[K(e.$slots,`default`,be(ws(t)))]),_:3},16,[`disabled`,`model-value`])]),_:3},16))}}),AR={class:`inline-flex items-center gap-2 min-w-0`},jR={class:`truncate font-semibold text-primary`},MR={class:`flex flex-col min-w-0 flex-1 of-hidden`},NR={class:`flex items-center gap-1.5`},PR={class:`truncate font-medium`},FR={key:0,class:`shrink-0 text-10px op-fade border border-base rounded px-1`},IR={key:0,class:`text-11px color-faint truncate`},LR=`i-ph:database-duotone`,RR=G({__name:`DataSourceSelect`,props:Ia({sources:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=io(e,`modelValue`),r=Q(()=>t.sources.find(e=>e.id===n.value));function i(e){return e?.icon||LR}return(t,a)=>(q(),Y(H(iR),{modelValue:n.value,"onUpdate:modelValue":a[0]||=e=>n.value=e},{default:U(()=>[Z(H(CR),{class:`text-sm px-2.5 outline-none border border-base rounded bg-base inline-flex gap-2 h-9 min-w-52 max-w-80 transition items-center justify-between data-[disabled]:op50 focus-visible:ring-2 focus-visible:ring-primary-500/40`},{default:U(()=>[X(`span`,AR,[Z(_F,{icon:i(r.value),class:`shrink-0 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full`,"aria-hidden":`true`},null,8,[`icon`]),X(`span`,jR,je(r.value?.title??e.placeholder??`Data source`),1)]),Z(H(_R),{class:`op-fade shrink-0`},{default:U(()=>[...a[1]||=[X(`div`,{class:`i-ph:caret-down`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1}),Z(H(SR),null,{default:U(()=>[Z(H(gR),{position:`popper`,"side-offset":6,class:`border border-base rounded-lg bg-base min-w-[--reka-select-trigger-width] max-w-100 shadow-lg z-dropdown overflow-hidden`},{default:U(()=>[Z(H(wR),{class:`p-1`},{default:U(()=>[(q(!0),J(cs,null,ha(e.sources,e=>(q(),Y(H(bR),{key:e.id,value:e.id,class:`text-sm color-base py-1.5 pl-2 pr-2 outline-none rounded-md flex gap-2 cursor-pointer select-none transition items-start relative data-[highlighted]:bg-active`},{default:U(()=>[Z(_F,{icon:i(e),class:`shrink-0 mt-0.5 w-3.5 h-3.5 color-active [&_svg]:h-full [&_svg]:w-full`,"aria-hidden":`true`},null,8,[`icon`]),X(`span`,MR,[X(`span`,NR,[X(`span`,PR,je(e.title),1),e.static?(q(),J(`span`,FR,`static`)):Os(``,!0)]),e.description?(q(),J(`span`,IR,je(e.description),1)):Os(``,!0)]),Z(H(xR),{class:`color-active inline-flex items-center shrink-0 mt-0.5`},{default:U(()=>[...a[2]||=[X(`span`,{class:`i-ph:check`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,[`modelValue`]))}}),zR={class:`px3 py2 border-b border-base flex flex-col gap-2 shrink-0`},BR={class:`flex items-center gap-2`},VR=[`title`],HR={key:0,class:`text-xs color-muted`},UR=G({__name:`DataSourcePanel`,setup(e){let t=EN(),n=V(!1);return(e,r)=>(q(),J(`div`,zR,[X(`div`,BR,[r[4]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none ws-nowrap`},` Data Source `,-1),Z(RR,{modelValue:H(t).sourceId.value,"onUpdate:modelValue":r[0]||=e=>H(t).sourceId.value=e,sources:H(t).sources.value,placeholder:`Data source`},null,8,[`modelValue`,`sources`]),H(t).activeSource.value?.description&&!n.value?(q(),J(`div`,{key:0,class:`text-xs op-fade ws-nowrap of-hidden shrink`,title:H(t).activeSource.value?.description},je(H(t).activeSource.value?.description),9,VR)):Os(``,!0),r[5]||=X(`div`,{class:`flex-auto`},null,-1),Z(Gv,{icon:`i-ph:caret-down`,class:ye([`transition flex-none text-sm`,{"rotate-180":n.value}]),title:n.value?`Hide details`:`Show details`,onClick:r[1]||=e=>n.value=!n.value},null,8,[`class`,`title`])]),H(pT).connected&&!H(t).sources.value.length?(q(),J(`div`,HR,[...r[6]||=[Es(` No data sources registered yet. Call `,-1),X(`code`,{class:`font-mono bg-secondary border border-base rounded px-1`},`registerDataSource()`,-1),Es(` from your plugin or host; `,-1),X(`a`,{href:`https://devfra.me/plugins/data-inspector#providing-data-sources`,target:`_blank`,class:`color-active hover:underline`},`see the docs`,-1),Es(`. `,-1)]])):Os(``,!0),n.value?(q(),Y(IN,{key:1,source:H(t).activeSource.value,skeleton:H(t).skeleton.value,error:H(t).skeletonError.value,loading:H(t).skeletonLoading.value,onRefresh:r[2]||=e=>H(t).loadSkeleton(),onSelect:r[3]||=e=>H(t).queryProp(e)},null,8,[`source`,`skeleton`,`error`,`loading`])):Os(``,!0)]))}}),WR=G({__name:`FeedbackSpinner`,props:{size:{default:`1em`}},setup(e){let t=e,n=Q(()=>typeof t.size==`number`?`${t.size}px`:t.size);return(e,t)=>(q(),J(`span`,{class:`border-2 border-current border-t-transparent rounded-full inline-block animate-spin`,style:me({width:n.value,height:n.value}),role:`status`,"aria-label":`Loading`},null,4))}}),GR=G({__name:`ActionButton`,props:{as:{},to:{},href:{},icon:{},variant:{default:`action`},size:{default:`md`},loading:{type:Boolean},disabled:{type:Boolean}},setup(e){let t=e,n=Q(()=>t.as?t.as:t.href!=null||t.to!=null?`a`:`button`),r=Q(()=>n.value===`a`),i=Q(()=>n.value===`button`),a=Q(()=>t.size===`sm`),o=Q(()=>t.variant===`primary`?a.value?`btn-primary text-sm`:`btn-primary`:t.variant===`text`?a.value?`btn-text text-sm`:`btn-text`:a.value?`btn-action-sm`:`btn-action`),s=Q(()=>t.disabled||t.loading);return(t,a)=>(q(),Y(da(n.value),{class:ye([o.value,{"pointer-events-none op-mute":s.value&&!i.value}]),href:r.value?e.href??e.to:void 0,to:e.as&&e.to!=null?e.to:void 0,disabled:i.value?s.value:void 0,"aria-disabled":s.value||void 0,"aria-busy":e.loading||void 0},{default:U(()=>[e.loading?(q(),Y(WR,{key:0,size:`1em`})):e.icon?(q(),J(`span`,{key:1,class:ye(e.icon),"aria-hidden":`true`},null,2)):Os(``,!0),K(t.$slots,`default`)]),_:3},8,[`class`,`href`,`to`,`disabled`,`aria-disabled`,`aria-busy`]))}}),{toString:KR,hasOwnProperty:qR}=Object.prototype,JR=e=>KR.call(e),YR=Object.hasOwn||((e,t)=>qR.call(e,t));function $(e,t,n){let r=document.createElement(e);typeof t==`string`&&(t={class:t});for(let e in t)if(YR(t,e)){let n=t[e];if(n===void 0)continue;typeof n==`function`?r.addEventListener(e.slice(2),n):r.setAttribute(e,n)}return Array.isArray(n)?r.append(...n):typeof n==`string`&&(r.innerHTML=n),r}function XR(e){return document.createTextNode(String(e))}function ZR(e){return e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function QR(...e){let t=document.createDocumentFragment();return e.forEach(e=>t.appendChild(e instanceof Node?e:XR(e))),t}var $R=!(()=>{let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test-passive`,n,t),window.removeEventListener(`test-passive`,n)}catch{}return e})()||Object.freeze({passive:!0,capture:!0}),ez=/\.\d+(?:eE[-+]?\d+)?|\B(?=(?:\d{3})+(?:\D|$))/g;function tz(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function nz(e,t=!0){let n=t&&typeof e!=`number`?tz(String(e)):String(e);return n.length>3?n.replace(ez,e=>e||`<span class="num-delim"></span>`):n}var rz=class{subscriber;value;constructor(e,t){this.subscriber=null,this.value=e,this.shouldUpdate=typeof t==`function`?t:this.shouldUpdate}get readonly(){let e=this;return{subscribe:this.subscribe.bind(this),subscribeSync:this.subscribeSync.bind(this),unsubscribe:this.unsubscribe.bind(this),get value(){return e.value}}}subscribe(e){return this.subscriber={callback:e,subscriber:this.subscriber},()=>this.unsubscribe(e)}subscribeSync(e){let t=this.subscribe(e);return e(this.value,t),t}unsubscribe(e){let t=this,n=this.subscriber;for(;n!==null;){if(n.callback===e){n.callback=null,t.subscriber=n.subscriber;break}t=n,n=n.subscriber}}shouldUpdate(e,t){return e!==t}set(e){return this.#e(e)!==!1}asyncSet(e){let t=this.#e(e);return t===!1?Promise.resolve(!1):Promise.all(t).then(()=>!0)}#e(e){if(!this.shouldUpdate(e,this.value))return!1;let t=[],n=this.subscriber;for(this.value=e;n!==null;){let{callback:r}=n;r!==null&&t.push(r(e,()=>this.unsubscribe(r))),n=n.subscriber}return t}},iz=typeof ResizeObserver==`function`,az=class extends rz{static supported=iz;el;observer;constructor(){super(null),this.el=null,this.observer=iz?new ResizeObserver(e=>{for(let t of e)this.set(t.contentRect)}):null}observe(e){if(this.observer===null){this.el=null;return}e||=null,this.el!==e&&(this.el!==null&&this.observer.unobserve(this.el),e!==null&&this.observer.observe(e),this.el=e)}dispose(){this.el=null,this.observer=null}},oz=class{listeners;constructor(){this.listeners=Object.create(null)}on(e,t){return this.listeners[e]={callback:t,next:this.listeners[e]||null},this}once(e,t){return this.on(e,function n(...r){t.apply(this,r),this.off(e,n)})}off(e,t){let n=this.listeners[e]||null,r=null;for(;n!==null;){if(n.callback===t){n.callback=null,r?r.next=n.next:this.listeners[e]=n.next;break}r=n,n=n.next}return this}emit(e,...t){let n=this.listeners[e]||null,r=!1;for(;n!==null;)typeof n.callback==`function`&&n.callback.apply(this,t),r=!0,n=n.next;return r}},sz=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.CodeMirror=r())})(e,(function(){var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),a=/Edge\/(\d+)/.exec(e),o=r||i||a,s=o&&(r?document.documentMode||6:+(a||i)[1]),c=!a&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!a&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],f=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),m=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),h=/PhantomJS/.test(e),g=p&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),_=/Android/.test(e),v=g||_||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),S=f&&e.match(/Version\/(\d*\.\d*)/);S&&=Number(S[1]),S&&S>=15&&(f=!1,c=!0);var C=y&&(l||f&&(S==null||S<12.11)),w=n||o&&s>=9;function T(e){return RegExp(`(^|\\s)`+e+`(?:$|\\s)\\s*`)}var E=function(e,t){var n=e.className,r=T(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:``)}};function D(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return D(e).appendChild(t)}function k(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t==`string`)i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function A(e,t,n,r){var i=k(e,t,n,r);return i.setAttribute(`role`,`presentation`),i}var j=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd(`character`,n),r.moveStart(`character`,t),r};function M(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function ee(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function te(e,t){var n=e.className;T(t).test(n)||(e.className+=(n?` `:``)+t)}function N(e,t){for(var n=e.split(` `),r=0;r<n.length;r++)n[r]&&!T(n[r]).test(t)&&(t+=` `+n[r]);return t}var ne=function(e){e.select()};g?ne=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(ne=function(e){try{e.select()}catch{}});function re(e){return e.display.wrapper.ownerDocument}function ie(e){return ae(e.display.wrapper)}function ae(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function P(e){return re(e).defaultView}function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function I(e,t,n){for(var r in t||={},e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function oe(e,t,n,r,i){t??(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=r||0,o=i||0;;){var s=e.indexOf(` `,a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}}var se=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};se.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},se.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function L(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ce=50,le={toString:function(){return`CodeMirror.Pass`}},ue={scroll:!1},de={origin:`*mouse`},fe={origin:`+move`};function pe(e,t,n){for(var r=0,i=0;;){var a=e.indexOf(` `,r);a==-1&&(a=e.length);var o=a-r;if(a==e.length||i+o>=t)return r+Math.min(o,t-i);if(i+=a-r,i+=n-i%n,r=a+1,i>=t)return r}}var me=[``];function he(e){for(;me.length<=e;)me.push(ge(me)+` `);return me[e]}function ge(e){return e[e.length-1]}function _e(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ve(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function ye(){}function be(e,t){var n;return Object.create?n=Object.create(e):(ye.prototype=e,n=new ye),t&&I(t,n),n}var xe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Se(e){return/\w/.test(e)||e>``&&(e.toUpperCase()!=e.toLowerCase()||xe.test(e))}function Ce(e,t){return t?t.source.indexOf(`\\w`)>-1&&Se(e)?!0:t.test(e):Se(e)}function we(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Te=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Ee(e){return e.charCodeAt(0)>=768&&Te.test(e)}function De(e,t,n){for(;(n<0?t>0:t<e.length)&&Ee(e.charAt(t));)t+=n;return t}function Oe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,a=r<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:n;e(a)?n=a:t=a+r}}function ke(e,t,n,r){if(!e)return r(t,n,`ltr`,0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?`rtl`:`ltr`,a),i=!0)}i||r(t,n,`ltr`)}var Ae=null;function je(e,t,n){var r;Ae=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&n==`before`?r=i:Ae=i),a.from==t&&(a.from!=a.to&&n!=`before`?r=i:Ae=i)}return r??Ae}var Me=(function(){function e(e){return e<=247?`bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN`.charAt(e):1424<=e&&e<=1524?`R`:1536<=e&&e<=1785?`nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111`.charAt(e-1536):1774<=e&&e<=2220?`r`:8192<=e&&e<=8203?`w`:e==8204?`b`:`L`}var t=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,r=/[LRr]/,i=/[Lb1n]/,a=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s,c){var l=c==`ltr`?`L`:`R`;if(s.length==0||c==`ltr`&&!t.test(s))return!1;for(var u=s.length,d=[],f=0;f<u;++f)d.push(e(s.charCodeAt(f)));for(var p=0,m=l;p<u;++p){var h=d[p];h==`m`?d[p]=m:m=h}for(var g=0,_=l;g<u;++g){var v=d[g];v==`1`&&_==`r`?d[g]=`n`:r.test(v)&&(_=v,v==`r`&&(d[g]=`R`))}for(var y=1,b=d[0];y<u-1;++y){var x=d[y];x==`+`&&b==`1`&&d[y+1]==`1`?d[y]=`1`:x==`,`&&b==d[y+1]&&(b==`1`||b==`n`)&&(d[y]=b),b=x}for(var S=0;S<u;++S){var C=d[S];if(C==`,`)d[S]=`N`;else if(C==`%`){var w=void 0;for(w=S+1;w<u&&d[w]==`%`;++w);for(var T=S&&d[S-1]==`!`||w<u&&d[w]==`1`?`1`:`N`,E=S;E<w;++E)d[E]=T;S=w-1}}for(var D=0,O=l;D<u;++D){var k=d[D];O==`L`&&k==`1`?d[D]=`L`:r.test(k)&&(O=k)}for(var A=0;A<u;++A)if(n.test(d[A])){var j=void 0;for(j=A+1;j<u&&n.test(d[j]);++j);for(var M=(A?d[A-1]:l)==`L`,ee=M==((j<u?d[j]:l)==`L`)?M?`L`:`R`:l,te=A;te<j;++te)d[te]=ee;A=j-1}for(var N=[],ne,re=0;re<u;)if(i.test(d[re])){var ie=re;for(++re;re<u&&i.test(d[re]);++re);N.push(new o(0,ie,re))}else{var ae=re,P=N.length,F=+(c==`rtl`);for(++re;re<u&&d[re]!=`L`;++re);for(var I=ae;I<re;)if(a.test(d[I])){ae<I&&(N.splice(P,0,new o(1,ae,I)),P+=F);var oe=I;for(++I;I<re&&a.test(d[I]);++I);N.splice(P,0,new o(2,oe,I)),P+=F,ae=I}else++I;ae<re&&N.splice(P,0,new o(1,ae,re))}return c==`ltr`&&(N[0].level==1&&(ne=s.match(/^\s+/))&&(N[0].from=ne[0].length,N.unshift(new o(0,0,ne[0].length))),ge(N).level==1&&(ne=s.match(/\s+$/))&&(ge(N).to-=ne[0].length,N.push(new o(0,u-ne[0].length,u)))),c==`rtl`?N.reverse():N}})();function Ne(e,t){var n=e.order;return n??=e.order=Me(e.text,t),n}var Pe=[],R=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent(`on`+t,n);else{var r=e._handlers||={};r[t]=(r[t]||Pe).concat(n)}};function Fe(e,t){return e._handlers&&e._handlers[t]||Pe}function Ie(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent(`on`+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var a=L(i,n);a>-1&&(r[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Le(e,t){var n=Fe(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Re(e,t,n){return typeof t==`string`&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Le(e,n||t.type,e,t),We(t)||t.codemirrorIgnore}function ze(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)L(n,t[r])==-1&&n.push(t[r])}function Be(e,t){return Fe(e,t).length>0}function Ve(e){e.prototype.on=function(e,t){R(this,e,t)},e.prototype.off=function(e,t){Ie(this,e,t)}}function He(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ue(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function We(e){return e.defaultPrevented==null?e.returnValue==0:e.defaultPrevented}function Ge(e){He(e),Ue(e)}function Ke(e){return e.target||e.srcElement}function qe(e){var t=e.which;return t??(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),y&&e.ctrlKey&&t==1&&(t=3),t}var Je=function(){if(o&&s<9)return!1;var e=k(`div`);return`draggable`in e||`dragDrop`in e}(),Ye;function Xe(e){if(Ye==null){var t=k(`span`,``);O(e,k(`span`,[t,document.createTextNode(`x`)])),e.firstChild.offsetHeight!=0&&(Ye=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=Ye?k(`span`,``):k(`span`,`\xA0`,null,`display: inline-block; width: 1px; margin-right: -1px`);return n.setAttribute(`cm-text`,``),n}var Ze;function Qe(e){if(Ze!=null)return Ze;var t=O(e,document.createTextNode(`AخA`)),n=j(t,0,1).getBoundingClientRect(),r=j(t,1,2).getBoundingClientRect();return D(e),!n||n.left==n.right?!1:Ze=r.right-n.right<3}var $e=`
|
|
30
|
+
|
|
31
|
+
b`.split(/\n/).length==3?function(e){return e.split(/\r\n?|\n/)}:function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
|
|
32
|
+
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==`\r`?i-1:i),o=a.indexOf(`\r`);o==-1?(n.push(a),t=i+1):(n.push(a.slice(0,o)),t+=o+1)}return n},et=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints(`StartToEnd`,t)!=0},tt=(function(){var e=k(`div`);return`oncopy`in e||(e.setAttribute(`oncopy`,`return;`),typeof e.oncopy==`function`)})(),nt=null;function rt(e){if(nt!=null)return nt;var t=O(e,k(`span`,`x`)),n=t.getBoundingClientRect(),r=j(t,0,1).getBoundingClientRect();return nt=Math.abs(n.left-r.left)>1}var it={},at={};function ot(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),it[e]=t}function st(e,t){at[e]=t}function ct(e){if(typeof e==`string`&&at.hasOwnProperty(e))e=at[e];else if(e&&typeof e.name==`string`&&at.hasOwnProperty(e.name)){var t=at[e.name];typeof t==`string`&&(t={name:t}),e=be(t,e),e.name=t.name}else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ct(`application/xml`);else if(typeof e==`string`&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ct(`application/json`);return typeof e==`string`?{name:e}:e||{name:`null`}}function lt(e,t){t=ct(t);var n=it[t.name];if(!n)return lt(e,`text/plain`);var r=n(e,t);if(ut.hasOwnProperty(t.name)){var i=ut[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r[`_`+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var ut={};function dt(e,t){I(t,ut.hasOwnProperty(e)?ut[e]:ut[e]={})}function ft(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function pt(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),n&&n.mode!=e);)t=n.state,e=n.mode;return n||{mode:e,state:t}}function mt(e,t,n){return!e.startState||e.startState(t,n)}var ht=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};ht.prototype.eol=function(){return this.pos>=this.string.length},ht.prototype.sol=function(){return this.pos==this.lineStart},ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ht.prototype.eat=function(e){var t=this.string.charAt(this.pos);if(typeof e==`string`?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ht.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ht.prototype.skipToEnd=function(){this.pos=this.string.length},ht.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ht.prototype.backUp=function(e){this.pos-=e},ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},ht.prototype.indentation=function(){return oe(this.string,null,this.tabSize)-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},ht.prototype.match=function(e,t,n){if(typeof e==`string`){var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}},ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},ht.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ht.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function z(e,t){if(t-=e.first,t<0||t>=e.size)throw Error(`There is no line `+(t+e.first)+` in the document.`);for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],a=i.chunkSize();if(t<a){n=i;break}t-=a}return n.lines[t]}function gt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var a=e.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function _t(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function vt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function yt(e){if(e.parent==null)return null;for(var t=e.parent,n=L(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function bt(e,t){var n=e.first;outer:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],a=i.height;if(t<a){e=i;continue outer}t-=a,n+=i.chunkSize()}return n}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o].height;if(t<s)break;t-=s}return n+o}function xt(e,t){return t>=e.first&&t<e.first+e.size}function St(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function B(e,t,n){if(n===void 0&&(n=null),!(this instanceof B))return new B(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function wt(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function Tt(e){return B(e.line,e.ch)}function Et(e,t){return Ct(e,t)<0?t:e}function Dt(e,t){return Ct(e,t)<0?e:t}function Ot(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function kt(e,t){if(t.line<e.first)return B(e.first,0);var n=e.first+e.size-1;return t.line>n?B(n,z(e,n).text.length):At(t,z(e,t.line).text.length)}function At(e,t){var n=e.ch;return n==null||n>t?B(e.line,t):n<0?B(e.line,0):e}function jt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=kt(e,t[r]);return n}var Mt=function(e,t){this.state=e,this.lookAhead=t},Nt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Nt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Nt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,``),size:this.baseTokens[this.baseTokenPos]-e}},Nt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Nt.fromSaved=function(e,t,n){return t instanceof Mt?new Nt(e,ft(e.mode,t.state),n,t.lookAhead):new Nt(e,ft(e.mode,t),n)},Nt.prototype.save=function(e){var t=e===!1?this.state:ft(this.doc.mode,this.state);return this.maxLookAhead>0?new Mt(t,this.maxLookAhead):t};function Pt(e,t,n,r){var i=[e.state.modeGen],a={};Ut(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},a,r);for(var o=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,Ut(e,t.text,s.mode,n,function(e,t){for(var n=c;l<e;){var r=i[c];r>e&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t){if(s.opaque)i.splice(n,c-n,e,`overlay `+t),c=n+2;else for(;n<c;n+=2){var a=i[n+1];i[n+1]=(a?a+` `:``)+`overlay `+t}}},a),n.state=o,n.baseTokens=null,n.baseTokenPos=1},c=0;c<e.state.overlays.length;++c)s(c);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Ft(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=It(e,yt(t)),i=t.text.length>e.options.maxHighlightLength&&ft(e.doc.mode,r.state),a=Pt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&=null,n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function It(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Nt(r,!0,t);var a=Wt(e,t,n),o=a>r.first&&z(r,a-1).stateAfter,s=o?Nt.fromSaved(r,o,a):new Nt(r,mt(r.mode),a);return r.iter(a,t,function(n){Lt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()}),n&&(r.modeFrontier=s.line),s}function Lt(e,t,n,r){var i=e.doc.mode,a=new ht(t,e.options.tabSize,n);for(a.start=a.pos=r||0,t==``&&Rt(i,n.state);!a.eol();)zt(i,a,n.state),a.start=a.pos}function Rt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=pt(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function zt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=pt(e,n).mode);var a=e.token(t,n);if(t.pos>t.start)return a}throw Error(`Mode `+e.name+` failed to advance stream.`)}var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Vt(e,t,n,r){var i=e.doc,a=i.mode,o;t=kt(i,t);var s=z(i,t.line),c=It(e,t.line,n),l=new ht(s.text,e.options.tabSize,c),u;for(r&&(u=[]);(r||l.pos<t.ch)&&!l.eol();)l.start=l.pos,o=zt(a,l,c.state),r&&u.push(new Bt(l,o,ft(i.mode,c.state)));return r?u:new Bt(l,o,c.state)}function Ht(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-background-?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?`bgClass`:`textClass`;t[r]==null?t[r]=n[2]:RegExp(`(?:^|\\s)`+n[2]+`(?:$|\\s)`).test(t[r])||(t[r]+=` `+n[2])}return e}function Ut(e,t,n,r,i,a,o){var s=n.flattenSpans;s??=e.options.flattenSpans;var c=0,l=null,u=new ht(t,e.options.tabSize,r),d,f=e.options.addModeClass&&[null];for(t==``&&Ht(Rt(n,r.state),a);!u.eol();){if(u.pos>e.options.maxHighlightLength?(s=!1,o&&Lt(e,t,r,u.pos),u.pos=t.length,d=null):d=Ht(zt(n,u,r.state,f),a),f){var p=f[0].name;p&&(d=`m-`+(d?p+` `+d:p))}if(!s||l!=d){for(;c<u.start;)c=Math.min(u.start,c+5e3),i(c,l);l=d}u.start=u.pos}for(;c<u.pos;){var m=Math.min(u.pos,c+5e3);i(m,l),c=m}}function Wt(e,t,n){for(var r,i,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var c=z(a,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof Mt?l.lookAhead:0)<=a.modeFrontier))return s;var u=oe(c.text,null,e.options.tabSize);(i==null||r>u)&&(i=s-1,r=u)}return i}function Gt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=z(e,r).stateAfter;if(i&&(!(i instanceof Mt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var Kt=!1,qt=!1;function Jt(){Kt=!0}function Yt(){qt=!0}function Xt(e,t,n){this.marker=e,this.from=t,this.to=n}function Zt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Qt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||=[]).push(e[r]);return n}function $t(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||=new WeakSet);r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function en(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&o.type==`bookmark`&&(!n||!a.marker.insertLeft)){var s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(r||=[]).push(new Xt(o,a.from,s?null:a.to))}}return r}function tn(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker;if(a.to==null||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&o.type==`bookmark`&&(!n||a.marker.insertLeft)){var s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(r||=[]).push(new Xt(o,s?null:a.from-t,a.to==null?null:a.to-t))}}return r}function nn(e,t){if(t.full)return null;var n=xt(e,t.from.line)&&z(e,t.from.line).markedSpans,r=xt(e,t.to.line)&&z(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,a=t.to.ch,o=Ct(t.from,t.to)==0,s=en(n,i,o),c=tn(r,a,o),l=t.text.length==1,u=ge(t.text).length+(l?i:0);if(s)for(var d=0;d<s.length;++d){var f=s[d];if(f.to==null){var p=Zt(c,f.marker);p?l&&(f.to=p.to==null?null:p.to+u):f.to=i}}if(c)for(var m=0;m<c.length;++m){var h=c[m];h.to!=null&&(h.to+=u),h.from==null?Zt(s,h.marker)||(h.from=u,l&&(s||=[]).push(h)):(h.from+=u,l&&(s||=[]).push(h))}s&&=rn(s),c&&c!=s&&(c=rn(c));var g=[s];if(!l){var _=t.text.length-2,v;if(_>0&&s)for(var y=0;y<s.length;++y)s[y].to??(v||=[]).push(new Xt(s[y].marker,null,null));for(var b=0;b<_;++b)g.push(v);g.push(c)}return g}function rn(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function an(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||L(r,n)==-1)&&(r||=[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],a=0;a<r.length;++a)for(var o=r[a],s=o.find(0),c=0;c<i.length;++c){var l=i[c];if(!(Ct(l.to,s.from)<0||Ct(l.from,s.to)>0)){var u=[c,1],d=Ct(l.from,s.from),f=Ct(l.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:l.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}function on(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function sn(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function cn(e){return e.inclusiveLeft?-1:0}function ln(e){return+!!e.inclusiveRight}function un(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),a=Ct(r.from,i.from)||cn(e)-cn(t);return a?-a:Ct(r.to,i.to)||ln(e)-ln(t)||t.id-e.id}function dn(e,t){var n=qt&&e.markedSpans,r;if(n)for(var i=void 0,a=0;a<n.length;++a)i=n[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||un(r,i.marker)<0)&&(r=i.marker);return r}function V(e){return dn(e,!0)}function fn(e){return dn(e,!1)}function pn(e,t){var n=qt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var a=n[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!r||un(r,a.marker)<0)&&(r=a.marker)}return r}function mn(e,t,n,r,i){var a=z(e,t),o=qt&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var c=o[s];if(c.marker.collapsed){var l=c.marker.find(0),u=Ct(l.from,n)||cn(c.marker)-cn(i),d=Ct(l.to,r)||ln(c.marker)-ln(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Ct(l.to,n)>=0:Ct(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?Ct(l.from,r)<=0:Ct(l.from,r)<0)))return!0}}}function hn(e){for(var t;t=V(e);)e=t.find(-1,!0).line;return e}function H(e){for(var t;t=fn(e);)e=t.find(1,!0).line;return e}function gn(e){for(var t,n;t=fn(e);)e=t.find(1,!0).line,(n||=[]).push(e);return n}function _n(e,t){var n=z(e,t),r=hn(n);return n==r?t:yt(r)}function vn(e,t){if(t>e.lastLine())return t;var n=z(e,t),r;if(!yn(e,n))return t;for(;r=fn(n);)n=r.find(1,!0).line;return yt(n)+1}function yn(e,t){var n=qt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed&&(r.from==null||!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&bn(e,t,r)))return!0}}function bn(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return bn(e,r.line,Zt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&bn(e,t,i))return!0}function xn(e){e=hn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var a=n.parent;a;n=a,a=n.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==n)break;t+=s.height}return t}function Sn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=V(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=fn(r);){var a=n.find(0,!0);t-=r.text.length-a.from.ch,r=a.to.line,t+=r.text.length-a.to.ch}return t}function Cn(e){var t=e.display,n=e.doc;t.maxLine=z(n,n.first),t.maxLineLength=Sn(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Sn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var wn=function(e,t,n){this.text=e,sn(this,t),this.height=n?n(this):1};wn.prototype.lineNo=function(){return yt(this)},Ve(wn);function Tn(e,t,n,r){e.text=t,e.stateAfter&&=null,e.styles&&=null,e.order!=null&&(e.order=null),on(e),sn(e,n);var i=r?r(e):1;i!=e.height&&vt(e,i)}function En(e){e.parent=null,on(e)}var Dn={},On={};function kn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?On:Dn;return n[e]||(n[e]=e.replace(/\S+/g,`cm-$&`))}function An(e,t){var n=A(`span`,null,null,c?`padding-right: .1px`:null),r={pre:A(`pre`,[n],`CodeMirror-line`),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption(`lineWrapping`)};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;r.pos=0,r.addToken=Mn,Qe(e.display.measure)&&(o=Ne(a,e.doc.direction))&&(r.addToken=Pn(r.addToken,o)),r.map=[],In(a,r,Ft(e,a,t!=e.display.externalMeasured&&yt(a))),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=N(a.styleClasses.bgClass,r.bgClass||``)),a.styleClasses.textClass&&(r.textClass=N(a.styleClasses.textClass,r.textClass||``))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Xe(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(`.cm-tab`))&&(r.content.className=`cm-tab-wrap-hack`)}return Le(e,`renderLine`,e,t.line,r.pre),r.pre.className&&(r.textClass=N(r.pre.className,r.textClass||``)),r}function jn(e){var t=k(`span`,`•`,`cm-invalidchar`);return t.title=`\\u`+e.charCodeAt(0).toString(16),t.setAttribute(`aria-label`,t.title),t}function Mn(e,t,n,r,i,a,c){if(t){var l=e.splitSpaces?Nn(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,f;if(!u.test(t))e.col+=t.length,f=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,f),o&&s<9&&(d=!0),e.pos+=t.length;else{f=document.createDocumentFragment();for(var p=0;;){u.lastIndex=p;var m=u.exec(t),h=m?m.index-p:t.length-p;if(h){var g=document.createTextNode(l.slice(p,p+h));o&&s<9?f.appendChild(k(`span`,[g])):f.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!m)break;p+=h+1;var _=void 0;if(m[0]==` `){var v=e.cm.options.tabSize,y=v-e.col%v;_=f.appendChild(k(`span`,he(y),`cm-tab`)),_.setAttribute(`role`,`presentation`),_.setAttribute(`cm-text`,` `),e.col+=y}else m[0]==`\r`||m[0]==`
|
|
33
|
+
`?(_=f.appendChild(k(`span`,m[0]==`\r`?`␍`:``,`cm-invalidchar`)),_.setAttribute(`cm-text`,m[0]),e.col+=1):(_=e.cm.options.specialCharPlaceholder(m[0]),_.setAttribute(`cm-text`,m[0]),o&&s<9?f.appendChild(k(`span`,[_])):f.appendChild(_),e.col+=1);e.map.push(e.pos,e.pos+1,_),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||d||a||c){var b=n||``;r&&(b+=r),i&&(b+=i);var x=k(`span`,[f],b,a);if(c)for(var S in c)c.hasOwnProperty(S)&&S!=`style`&&S!=`class`&&x.setAttribute(S,c[S]);return e.content.appendChild(x)}e.content.appendChild(f)}}function Nn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r=``,i=0;i<e.length;i++){var a=e.charAt(i);a==` `&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=`\xA0`),r+=a,n=a==` `}return r}function Pn(e,t){return function(n,r,i,a,o,s,c){i=i?i+` cm-force-border`:`cm-force-border`;for(var l=n.pos,u=l+r.length;;){for(var d=void 0,f=0;f<t.length&&(d=t[f],!(d.to>l&&d.from<=l));f++);if(d.to>=u)return e(n,r,i,a,o,s,c);e(n,r.slice(0,d.to-l),i,a,null,s,c),a=null,r=r.slice(d.to-l),l=d.to}}}function Fn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||=e.content.appendChild(document.createElement(`span`)),i.setAttribute(`cm-marker`,n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function In(e,t,n){var r=e.markedSpans,i=e.text,a=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(a,a=n[o]),kn(n[o+1],t.cm.options));return}for(var s=i.length,c=0,l=1,u=``,d,f,p=0,m,h,g,_,v;;){if(p==c){m=h=g=f=``,v=null,_=null,p=1/0;for(var y=[],b=void 0,x=0;x<r.length;++x){var S=r[x],C=S.marker;if(C.type==`bookmark`&&S.from==c&&C.widgetNode)y.push(C);else if(S.from<=c&&(S.to==null||S.to>c||C.collapsed&&S.to==c&&S.from==c)){if(S.to!=null&&S.to!=c&&p>S.to&&(p=S.to,h=``),C.className&&(m+=` `+C.className),C.css&&(f=(f?f+`;`:``)+C.css),C.startStyle&&S.from==c&&(g+=` `+C.startStyle),C.endStyle&&S.to==p&&(b||=[]).push(C.endStyle,S.to),C.title&&((v||={}).title=C.title),C.attributes)for(var w in C.attributes)(v||={})[w]=C.attributes[w];C.collapsed&&(!_||un(_.marker,C)<0)&&(_=S)}else S.from>c&&p>S.from&&(p=S.from)}if(b)for(var T=0;T<b.length;T+=2)b[T+1]==p&&(h+=` `+b[T]);if(!_||_.from==c)for(var E=0;E<y.length;++E)Fn(t,0,y[E]);if(_&&(_.from||0)==c){if(Fn(t,(_.to==null?s+1:_.to)-c,_.marker,_.from==null),_.to==null)return;_.to==c&&(_=!1)}}if(c>=s)break;for(var D=Math.min(s,p);;){if(u){var O=c+u.length;if(!_){var k=O>D?u.slice(0,D-c):u;t.addToken(t,k,d?d+m:m,g,c+k.length==p?h:``,f,v)}if(O>=D){u=u.slice(D-c),c=D;break}c=O,g=``}u=i.slice(a,a=n[l++]),d=kn(n[l++],t.cm.options)}}}function Ln(e,t,n){this.line=t,this.rest=gn(t),this.size=this.rest?yt(ge(this.rest))-n+1:1,this.node=this.text=null,this.hidden=yn(e,t)}function Rn(e,t,n){for(var r=[],i,a=t;a<n;a=i){var o=new Ln(e.doc,z(e.doc,a),a);i=a+o.size,r.push(o)}return r}var zn=null;function Bn(e){zn?zn.ops.push(e):e.ownsGroup=zn={ops:[e],delayedCallbacks:[]}}function Vn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function Hn(e,t){var n=e.ownsGroup;if(n)try{Vn(n)}finally{zn=null,t(n)}}var Un=null;function Wn(e,t){var n=Fe(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;zn?i=zn.delayedCallbacks:Un?i=Un:(i=Un=[],setTimeout(Gn,0));for(var a=function(e){i.push(function(){return n[e].apply(null,r)})},o=0;o<n.length;++o)a(o)}}function Gn(){var e=Un;Un=null;for(var t=0;t<e.length;++t)e[t]()}function Kn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a==`text`?Xn(e,t):a==`gutter`?Qn(e,t,n,r):a==`class`?Zn(e,t):a==`widget`&&$n(e,t,r)}t.changes=null}function qn(e){return e.node==e.text&&(e.node=k(`div`,null,null,`position: relative`),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function Jn(e,t){var n=t.bgClass?t.bgClass+` `+(t.line.bgClass||``):t.line.bgClass;if(n&&(n+=` CodeMirror-linebackground`),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=qn(t);t.background=r.insertBefore(k(`div`,null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Yn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):An(e,t)}function Xn(e,t){var n=t.text.className,r=Yn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Zn(e,t)):n&&(t.text.className=n)}function Zn(e,t){Jn(e,t),t.line.wrapClass?qn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=``);var n=t.textClass?t.textClass+` `+(t.line.textClass||``):t.line.textClass;t.text.className=n||``}function Qn(e,t,n,r){if(t.gutter&&=(t.node.removeChild(t.gutter),null),t.gutterBackground&&=(t.node.removeChild(t.gutterBackground),null),t.line.gutterClass){var i=qn(t);t.gutterBackground=k(`div`,null,`CodeMirror-gutter-background `+t.line.gutterClass,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px; width: `+r.gutterTotalWidth+`px`),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=qn(t),s=t.gutter=k(`div`,null,`CodeMirror-gutter-wrapper`,`left: `+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+`px`);if(s.setAttribute(`aria-hidden`,`true`),e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=` `+t.line.gutterClass),e.options.lineNumbers&&(!a||!a[`CodeMirror-linenumbers`])&&(t.lineNumber=s.appendChild(k(`div`,St(e.options,n),`CodeMirror-linenumber CodeMirror-gutter-elt`,`left: `+r.gutterLeft[`CodeMirror-linenumbers`]+`px; width: `+e.display.lineNumInnerWidth+`px`))),a)for(var c=0;c<e.display.gutterSpecs.length;++c){var l=e.display.gutterSpecs[c].className,u=a.hasOwnProperty(l)&&a[l];u&&s.appendChild(k(`div`,[u],`CodeMirror-gutter-elt`,`left: `+r.gutterLeft[l]+`px; width: `+r.gutterWidth[l]+`px`))}}}function $n(e,t,n){t.alignable&&=null;for(var r=T(`CodeMirror-linewidget`),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);tr(e,t,n)}function er(e,t,n,r){var i=Yn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Zn(e,t),Qn(e,t,n,r),tr(e,t,r),t.node}function tr(e,t,n){if(nr(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)nr(e,t.rest[r],t,n,!1)}function nr(e,t,n,r,i){if(t.widgets)for(var a=qn(n),o=0,s=t.widgets;o<s.length;++o){var c=s[o],l=k(`div`,[c.node],`CodeMirror-linewidget`+(c.className?` `+c.className:``));c.handleMouseEvents||l.setAttribute(`cm-ignore-events`,`true`),rr(c,l,n,r),e.display.input.setUneditable(l),i&&c.above?a.insertBefore(l,n.gutter||n.text):a.appendChild(l),Wn(c,`redraw`)}}function rr(e,t,n,r){if(e.noHScroll){(n.alignable||=[]).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+`px`,e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+`px`),t.style.width=i+`px`}e.coverGutter&&(t.style.zIndex=5,t.style.position=`relative`,e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+`px`))}function ir(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!M(document.body,e.node)){var n=`position: relative;`;e.coverGutter&&(n+=`margin-left: -`+t.display.gutters.offsetWidth+`px;`),e.noHScroll&&(n+=`width: `+t.display.wrapper.clientWidth+`px;`),O(t.display.measure,k(`div`,[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function ar(e,t){for(var n=Ke(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute(`cm-ignore-events`)==`true`||n.parentNode==e.sizer&&n!=e.mover)return!0}function or(e){return e.lineSpace.offsetTop}function sr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function cr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,k(`pre`,`x`,`CodeMirror-line-like`)),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function lr(e){return ce-e.display.nativeBarWidth}function ur(e){return e.display.scroller.clientWidth-lr(e)-e.display.barWidth}function dr(e){return e.display.scroller.clientHeight-lr(e)-e.display.barHeight}function fr(e,t,n){var r=e.options.lineWrapping,i=r&&ur(e);if(!t.measure.heights||r&&t.measure.width!=i){var a=t.measure.heights=[];if(r){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var c=o[s],l=o[s+1];Math.abs(c.bottom-l.bottom)>2&&a.push((c.bottom+l.top)/2-n.top)}}a.push(n.bottom-n.top)}}function pr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(yt(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function mr(e,t){t=hn(t);var n=yt(t),r=e.display.externalMeasured=new Ln(e.doc,t,n);r.lineN=n;var i=r.built=An(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}function hr(e,t,n,r){return U(e,_r(e,t),n,r)}function gr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Yr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function _r(e,t){var n=yt(t),r=gr(e,n);r&&!r.text?r=null:r&&r.changes&&(Kn(e,r,n,Wr(e)),e.curOp.forceUpdate=!0),r||=mr(e,t);var i=pr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function U(e,t,n,r,i){t.before&&(n=-1);var a=n+(r||``),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||=t.view.text.getBoundingClientRect(),t.hasHeights||=(fr(e,t.view,t.rect),!0),o=xr(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var vr={left:0,right:0,top:0,bottom:0};function yr(e,t,n){for(var r,i,a,o,s,c,l=0;l<e.length;l+=3)if(s=e[l],c=e[l+1],t<s?(i=0,a=1,o=`left`):t<c?(i=t-s,a=i+1):(l==e.length-3||t==c&&e[l+3]>t)&&(a=c-s,i=a-1,t>=c&&(o=`right`)),i!=null){if(r=e[l+2],s==c&&n==(r.insertLeft?`left`:`right`)&&(o=n),n==`left`&&i==0)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[(l-=3)+2],o=`left`;if(n==`right`&&i==c-s)for(;l<e.length-3&&e[l+3]==e[l+4]&&!e[l+5].insertLeft;)r=e[(l+=3)+2],o=`right`;break}return{node:r,start:i,end:a,collapse:o,coverStart:s,coverEnd:c}}function br(e,t){var n=vr;if(t==`left`)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function xr(e,t,n,r){var i=yr(t.map,n,r),a=i.node,c=i.start,l=i.end,u=i.collapse,d;if(a.nodeType==3){for(var f=0;f<4;f++){for(;c&&Ee(t.line.text.charAt(i.coverStart+c));)--c;for(;i.coverStart+l<i.coverEnd&&Ee(t.line.text.charAt(i.coverStart+l));)++l;if(d=o&&s<9&&c==0&&l==i.coverEnd-i.coverStart?a.parentNode.getBoundingClientRect():br(j(a,c,l).getClientRects(),r),d.left||d.right||c==0)break;l=c,--c,u=`right`}o&&s<11&&(d=Sr(e.display.measure,d))}else{c>0&&(u=r=`right`);var p;d=e.options.lineWrapping&&(p=a.getClientRects()).length>1?p[r==`right`?p.length-1:0]:a.getBoundingClientRect()}if(o&&s<9&&!c&&(!d||!d.left&&!d.right)){var m=a.parentNode.getClientRects()[0];d=m?{left:m.left,right:m.left+Ur(e.display),top:m.top,bottom:m.bottom}:vr}for(var h=d.top-t.rect.top,g=d.bottom-t.rect.top,_=(h+g)/2,v=t.view.measure.heights,y=0;y<v.length-1&&!(_<v[y]);y++);var b=y?v[y-1]:0,x=v[y],S={left:(u==`right`?d.right:d.left)-t.rect.left,right:(u==`left`?d.left:d.right)-t.rect.left,top:b,bottom:x};return!d.left&&!d.right&&(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=h,S.rbottom=g),S}function Sr(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!rt(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Cr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function wr(e){e.display.externalMeasure=null,D(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Cr(e.display.view[t])}function Tr(e){wr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Er(e){return u&&_?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Dr(e){return u&&_?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function W(e){var t=hn(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=ir(t[r]));return n}function Or(e,t,n,r,i){if(!i){var a=W(t);n.top+=a,n.bottom+=a}if(r==`line`)return n;r||=`local`;var o=xn(t);if(r==`local`?o+=or(e.display):o-=e.display.viewOffset,r==`page`||r==`window`){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(r==`window`?0:Dr(re(e)));var c=s.left+(r==`window`?0:Er(re(e)));n.left+=c,n.right+=c}return n.top+=o,n.bottom+=o,n}function kr(e,t,n){if(n==`div`)return t;var r=t.left,i=t.top;if(n==`page`)r-=Er(re(e)),i-=Dr(re(e));else if(n==`local`||!n){var a=e.display.sizer.getBoundingClientRect();r+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Ar(e,t,n,r,i){return r||=z(e.doc,t.line),Or(e,r,hr(e,r,t.ch,i),n)}function jr(e,t,n,r,i,a){r||=z(e.doc,t.line),i||=_r(e,r);function o(t,o){var s=U(e,i,t,o?`right`:`left`,a);return o?s.left=s.right:s.right=s.left,Or(e,r,s,n)}var s=Ne(r,e.doc.direction),c=t.ch,l=t.sticky;if(c>=r.text.length?(c=r.text.length,l=`before`):c<=0&&(c=0,l=`after`),!s)return o(l==`before`?c-1:c,l==`before`);function u(e,t,n){var r=s[t].level==1;return o(n?e-1:e,r!=n)}var d=je(s,c,l),f=Ae,p=u(c,d,l==`before`);return f!=null&&(p.other=u(c,f,l!=`before`)),p}function Mr(e,t){var n=0;t=kt(e.doc,t),e.options.lineWrapping||(n=Ur(e.display)*t.ch);var r=z(e.doc,t.line),i=xn(r)+or(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Nr(e,t,n,r,i){var a=B(e,t,n);return a.xRel=i,r&&(a.outside=r),a}function Pr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Nr(r.first,0,null,-1,-1);var i=bt(r,n),a=r.first+r.size-1;if(i>a)return Nr(r.first+r.size-1,z(r,a).text.length,null,1,1);t<0&&(t=0);for(var o=z(r,i);;){var s=Rr(e,o,i,t,n),c=pn(o,s.ch+ +(s.xRel>0||s.outside>0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;o=z(r,i=l.line)}}function Fr(e,t,n,r){r-=W(t);var i=t.text.length,a=Oe(function(t){return U(e,n,t-1).bottom<=r},i,0);return i=Oe(function(t){return U(e,n,t).top>r},a,i),{begin:a,end:i}}function Ir(e,t,n,r){n||=_r(e,t);var i=Or(e,t,U(e,n,r),`line`).top;return Fr(e,t,n,i)}function Lr(e,t,n,r){return e.bottom<=n?!1:e.top>n||(r?e.left:e.right)>t}function Rr(e,t,n,r,i){i-=xn(t);var a=_r(e,t),o=W(t),s=0,c=t.text.length,l=!0,u=Ne(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Br:zr)(e,t,n,a,u,r,i);l=d.level!=1,s=l?d.from:d.to-1,c=l?d.to:d.from-1}var f=null,p=null,m=Oe(function(t){var n=U(e,a,t);return n.top+=o,n.bottom+=o,Lr(n,r,i,!1)?(n.top<=i&&n.left<=r&&(f=t,p=n),!0):!1},s,c),h,g,_=!1;if(p){var v=r-p.left<p.right-r,y=v==l;m=f+ +!y,g=y?`after`:`before`,h=v?p.left:p.right}else{!l&&(m==c||m==s)&&m++,g=m==0?`after`:m==t.text.length?`before`:U(e,a,m-+!!l).bottom+o<=i==l?`after`:`before`;var b=jr(e,B(n,m,g),`line`,t,a);h=b.left,_=i<b.top?-1:+(i>=b.bottom)}return m=De(t.text,m,1),Nr(n,m,g,_,r-h)}function zr(e,t,n,r,i,a,o){var s=Oe(function(s){var c=i[s],l=c.level!=1;return Lr(jr(e,B(n,l?c.to:c.from,l?`before`:`after`),`line`,t,r),a,o,!0)},0,i.length-1),c=i[s];if(s>0){var l=c.level!=1,u=jr(e,B(n,l?c.from:c.to,l?`after`:`before`),`line`,t,r);Lr(u,a,o,!0)&&u.top>o&&(c=i[s-1])}return c}function Br(e,t,n,r,i,a,o){var s=Fr(e,t,r,o),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,d=null,f=0;f<i.length;f++){var p=i[f];if(!(p.from>=l||p.to<=c)){var m=U(e,r,p.level==1?Math.max(c,p.from):Math.min(l,p.to)-1).right,h=m<a?a-m+1e9:m-a;(!u||d>h)&&(u=p,d=h)}}return u||=i[i.length-1],u.from<c&&(u={from:c,to:u.to,level:u.level}),u.to>l&&(u={from:u.from,to:l,level:u.level}),u}var Vr;function Hr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Vr==null){Vr=k(`pre`,null,`CodeMirror-line-like`);for(var t=0;t<49;++t)Vr.appendChild(document.createTextNode(`x`)),Vr.appendChild(k(`br`));Vr.appendChild(document.createTextNode(`x`))}O(e.measure,Vr);var n=Vr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),D(e.measure),n||1}function Ur(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k(`span`,`xxxxxxxxxx`),n=k(`pre`,[t],`CodeMirror-line-like`);O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Wr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;n[s]=a.offsetLeft+a.clientLeft+i,r[s]=a.clientWidth}return{fixedPos:Gr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Gr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Kr(e){var t=Hr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ur(e.display)-3);return function(i){if(yn(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return n?a+(Math.ceil(i.text.length/r)||1)*t:a+t}}function qr(e){var t=e.doc,n=Kr(e);t.iter(function(e){var t=n(e);t!=e.height&&vt(e,t)})}function Jr(e,t,n,r){var i=e.display;if(!n&&Ke(t).getAttribute(`cm-not-content`)==`true`)return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch{return null}var c=Pr(e,a,o),l;if(r&&c.xRel>0&&(l=z(e.doc,c.line).text).length==c.ch){var u=oe(l,l.length,e.options.tabSize)-l.length;c=B(c.line,Math.max(0,Math.round((a-cr(e.display).left)/Ur(e.display))-u))}return c}function Yr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Xr(e,t,n,r){t??=e.doc.first,n??=e.doc.first+e.doc.size,r||=0;var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)qt&&_n(e.doc,t)<i.viewTo&&Qr(e);else if(n<=i.viewFrom)qt&&vn(e.doc,n+r)>i.viewFrom?Qr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Qr(e);else if(t<=i.viewFrom){var a=$r(e,n,n+r,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=r):Qr(e)}else if(n>=i.viewTo){var o=$r(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Qr(e)}else{var s=$r(e,t,t,-1),c=$r(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(Rn(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):Qr(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function Zr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var a=r.view[Yr(e,t)];if(a.node!=null){var o=a.changes||=[];L(o,n)==-1&&o.push(n)}}}function Qr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function $r(e,t,n,r){var i=Yr(e,t),a,o=e.display.view;if(!qt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=e.display.viewFrom,c=0;c<i;c++)s+=o[c].size;if(s!=t){if(r>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,n+=a}for(;_n(e.doc,n)!=n;){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-+(r<0)].size,i+=r}return{index:i,lineN:n}}function ei(e,t,n){var r=e.display;r.view.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Rn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Yr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Rn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Yr(e,n)))),r.viewTo=n}function ti(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ni(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ri(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),a=r.selection=document.createDocumentFragment(),o=e.options.$customCursor;o&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var c=n.sel.ranges[s];if(!(c.from().line>=e.display.viewTo||c.to().line<e.display.viewFrom)){var l=c.empty();if(o){var u=o(e,c);u&&ii(e,u,i)}else(l||e.options.showCursorWhenSelecting)&&ii(e,c.head,i);l||G(e,c,a)}}return r}function ii(e,t,n){var r=jr(e,t,`div`,null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor`));if(i.style.left=r.left+`px`,i.style.top=r.top+`px`,i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+`px`,/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Ar(e,t,`div`,null,null),o=a.right-a.left;i.style.width=(o>0?o:e.defaultCharWidth())+`px`}if(r.other){var s=n.appendChild(k(`div`,`\xA0`,`CodeMirror-cursor CodeMirror-secondarycursor`));s.style.display=``,s.style.left=r.other.left+`px`,s.style.top=r.other.top+`px`,s.style.height=(r.other.bottom-r.other.top)*.85+`px`}}function ai(e,t){return e.top-t.top||e.left-t.left}function G(e,t,n){var r=e.display,i=e.doc,a=document.createDocumentFragment(),o=cr(e.display),s=o.left,c=Math.max(r.sizerWidth,ur(e)-r.sizer.offsetLeft)-o.right,l=i.direction==`ltr`;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),a.appendChild(k(`div`,null,`CodeMirror-selected`,`position: absolute; left: `+e+`px;
|
|
34
|
+
top: `+t+`px; width: `+(n??c-e)+`px;
|
|
35
|
+
height: `+(r-t)+`px`))}function d(t,n,r){var a=z(i,t),o=a.text.length,d,f;function p(n,r){return Ar(e,B(t,n),`div`,a,r)}function m(t,n,r){var i=Ir(e,a,null,t),o=n==`ltr`==(r==`after`)?`left`:`right`;return p(r==`after`?i.begin:i.end-(/\s/.test(a.text.charAt(i.end-1))?2:1),o)[o]}var h=Ne(a,i.direction);return ke(h,n||0,r??o,function(e,t,i,a){var g=i==`ltr`,_=p(e,g?`left`:`right`),v=p(t-1,g?`right`:`left`),y=n==null&&e==0,b=r==null&&t==o,x=a==0,S=!h||a==h.length-1;if(v.top-_.top<=3){var C=(l?y:b)&&x,w=(l?b:y)&&S,T=C?s:(g?_:v).left,E=w?c:(g?v:_).right;u(T,_.top,E-T,_.bottom)}else{var D,O,k,A;g?(D=l&&y&&x?s:_.left,O=l?c:m(e,i,`before`),k=l?s:m(t,i,`after`),A=l&&b&&S?c:v.right):(D=l?m(e,i,`before`):s,O=!l&&y&&x?c:_.right,k=!l&&b&&S?s:v.left,A=l?m(t,i,`after`):c),u(D,_.top,O-D,_.bottom),_.bottom<v.top&&u(s,_.bottom,null,v.top),u(k,v.top,A-k,v.bottom)}(!d||ai(_,d)<0)&&(d=_),ai(v,d)<0&&(d=v),(!f||ai(_,f)<0)&&(f=_),ai(v,f)<0&&(f=v)}),{start:d,end:f}}var f=t.from(),p=t.to();if(f.line==p.line)d(f.line,f.ch,p.ch);else{var m=z(i,f.line),h=z(i,p.line),g=hn(m)==hn(h),_=d(f.line,f.ch,g?m.text.length+1:null).end,v=d(p.line,g?0:null,p.ch).start;g&&(_.top<v.top-2?(u(_.right,_.top,null,_.bottom),u(s,v.top,v.left,v.bottom)):u(_.right,_.top,v.left-_.right,_.bottom)),_.bottom<v.top&&u(s,_.bottom,null,v.top)}n.appendChild(a)}function oi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=``,e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||ui(e),t.cursorDiv.style.visibility=(n=!n)?``:`hidden`},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=`hidden`)}}function si(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||li(e))}function ci(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ui(e))},100)}function li(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=`nocursor`&&(e.state.focused||(Le(e,`focus`,e,t),e.state.focused=!0,te(e.display.wrapper,`CodeMirror-focused`),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),c&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),oi(e))}function ui(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Le(e,`blur`,e,t),e.state.focused=!1,E(e.display.wrapper,`CodeMirror-focused`)),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function di(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,c=0;c<t.view.length;c++){var l=t.view[c],u=e.options.lineWrapping,d=void 0,f=0;if(!l.hidden){if(i+=l.line.height,o&&s<8){var p=l.node.offsetTop+l.node.offsetHeight;d=p-n,n=p}else{var m=l.node.getBoundingClientRect();d=m.bottom-m.top,!u&&l.text.firstChild&&(f=l.text.firstChild.getBoundingClientRect().right-m.left-1)}var h=l.line.height-d;if((h>.005||h<-.005)&&(i<r&&(a-=h),vt(l.line,d),fi(l.line),l.rest))for(var g=0;g<l.rest.length;g++)fi(l.rest[g]);if(f>e.display.sizerWidth){var _=Math.ceil(f/Ur(e.display));_>e.display.maxLineLength&&(e.display.maxLineLength=_,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function fi(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function pi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-or(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=bt(t,r),o=bt(t,i);if(n&&n.ensure){var s=n.ensure.from.line,c=n.ensure.to.line;s<a?(a=s,o=bt(t,xn(z(t,s))+e.wrapper.clientHeight)):Math.min(c,t.lastLine())>=o&&(a=bt(t,xn(z(t,c))-e.wrapper.clientHeight),o=c)}return{from:a,to:Math.max(o,a+1)}}function mi(e,t){if(!Re(e,`scrollCursorIntoView`)){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,a=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!h){var o=k(`div`,``,null,`position: absolute;
|
|
36
|
+
top: `+(t.top-n.viewOffset-or(e.display))+`px;
|
|
37
|
+
height: `+(t.bottom-t.top+lr(e)+n.barHeight)+`px;
|
|
38
|
+
left: `+t.left+`px; width: `+Math.max(2,t.right-t.left)+`px;`);e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function hi(e,t,n,r){r??=0;var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==`before`?B(t.line,t.ch+1,`before`):t,t=t.ch?B(t.line,t.sticky==`before`?t.ch-1:t.ch,`after`):t);for(var a=0;a<5;a++){var o=!1,s=jr(e,t),c=!n||n==t?s:jr(e,n);i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r};var l=_i(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(l.scrollTop!=null&&(wi(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),l.scrollLeft!=null&&(Ei(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(o=!0)),!o)break}return i}function gi(e,t){var n=_i(e,t);n.scrollTop!=null&&wi(e,n.scrollTop),n.scrollLeft!=null&&Ei(e,n.scrollLeft)}function _i(e,t){var n=e.display,r=Hr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=dr(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+sr(n),c=t.top<r,l=t.bottom>s-r;if(t.top<i)o.scrollTop=c?0:t.top;else if(t.bottom>i+a){var u=Math.min(t.top,(l?s:t.bottom)-a);u!=i&&(o.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-d,p=ur(e)-n.gutters.offsetWidth,m=t.right-t.left>p;return m&&(t.right=t.left+p),t.left<10?o.scrollLeft=0:t.left<f?o.scrollLeft=Math.max(0,t.left+d-(m?0:10)):t.right>p+f-3&&(o.scrollLeft=t.right+(m?0:10)-p),o}function vi(e,t){t!=null&&(Si(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function yi(e){Si(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){(t!=null||n!=null)&&Si(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function xi(e,t){Si(e),e.curOp.scrollToPos=t}function Si(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Ci(e,Mr(e,t.from),Mr(e,t.to),t.margin))}function Ci(e,t,n,r){var i=_i(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,i.scrollLeft,i.scrollTop)}function wi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ta(e,{top:t}),Ti(e,t,!0),n&&ta(e),qi(e,100))}function Ti(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ei(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Di(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+sr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+lr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Oi=function(e,t,n){this.cm=n;var r=this.vert=k(`div`,[k(`div`,null,null,`min-width: 1px`)],`CodeMirror-vscrollbar`),i=this.horiz=k(`div`,[k(`div`,null,null,`height: 100%; min-height: 1px`)],`CodeMirror-hscrollbar`);r.tabIndex=i.tabIndex=-1,e(r),e(i),R(r,`scroll`,function(){r.clientHeight&&t(r.scrollTop,`vertical`)}),R(i,`scroll`,function(){i.clientWidth&&t(i.scrollLeft,`horizontal`)}),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=`18px`)};Oi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=`block`,this.vert.style.bottom=t?r+`px`:`0`;var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+`px`}else this.vert.scrollTop=0,this.vert.style.display=``,this.vert.firstChild.style.height=`0`;if(t){this.horiz.style.display=`block`,this.horiz.style.right=n?r+`px`:`0`,this.horiz.style.left=e.barLeft+`px`;var a=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+`px`}else this.horiz.style.display=``,this.horiz.firstChild.style.width=`0`;return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Oi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,`horiz`)},Oi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,`vert`)},Oi.prototype.zeroWidthHack=function(){var e=y&&!m?`12px`:`18px`;this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility=`hidden`,this.disableHoriz=new se,this.disableVert=new se},Oi.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility=``;function r(){var i=e.getBoundingClientRect();(n==`vert`?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))==e?t.set(1e3,r):e.style.visibility=`hidden`}t.set(1e3,r)},Oi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ki=function(){};ki.prototype.update=function(){return{bottom:0,right:0}},ki.prototype.setScrollLeft=function(){},ki.prototype.setScrollTop=function(){},ki.prototype.clear=function(){};function Ai(e,t){t||=Di(e);var n=e.display.barWidth,r=e.display.barHeight;ji(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&di(e),ji(e,Di(e)),n=e.display.barWidth,r=e.display.barHeight}function ji(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+`px`,n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+`px`,n.heightForcer.style.borderBottom=r.bottom+`px solid transparent`,r.right&&r.bottom?(n.scrollbarFiller.style.display=`block`,n.scrollbarFiller.style.height=r.bottom+`px`,n.scrollbarFiller.style.width=r.right+`px`):n.scrollbarFiller.style.display=``,r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display=`block`,n.gutterFiller.style.height=r.bottom+`px`,n.gutterFiller.style.width=t.gutterWidth+`px`):n.gutterFiller.style.display=``}var Mi={native:Oi,null:ki};function Ni(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Mi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),R(t,`mousedown`,function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute(`cm-not-content`,`true`)},function(t,n){n==`horizontal`?Ei(e,t):wi(e,t)},e),e.display.scrollbars.addClass&&te(e.display.wrapper,e.display.scrollbars.addClass)}var Pi=0;function Fi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pi,markArrays:null},Bn(e.curOp)}function Ii(e){var t=e.curOp;t&&Hn(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Li(e)})}function Li(e){for(var t=e.ops,n=0;n<t.length;n++)Ri(t[n]);for(var r=0;r<t.length;r++)zi(t[r]);for(var i=0;i<t.length;i++)Bi(t[i]);for(var a=0;a<t.length;a++)Vi(t[a]);for(var o=0;o<t.length;o++)Hi(t[o])}function Ri(e){var t=e.cm,n=t.display;Xi(t),e.updateMaxLine&&Cn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function zi(e){e.updatedDisplay=e.mustUpdate&&$i(e.cm,e.update)}function Bi(e){var t=e.cm,n=t.display;e.updatedDisplay&&di(t),e.barMeasure=Di(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=hr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+lr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-ur(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Vi(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+`px`,e.maxScrollLeft<t.doc.scrollLeft&&Ei(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ee(ie(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ai(t,e.barMeasure),e.updatedDisplay&&ia(t,e.barMeasure),e.selectionChanged&&oi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&si(e.cm)}function Hi(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&ea(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Ti(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Ei(t,e.scrollLeft,!0,!0),e.scrollToPos&&mi(t,hi(t,kt(r,e.scrollToPos.from),kt(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(i)for(var o=0;o<i.length;++o)i[o].lines.length||Le(i[o],`hide`);if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Le(a[s],`unhide`);n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Le(t,`changes`,t,e.changeObjs),e.update&&e.update.finish()}function Ui(e,t){if(e.curOp)return t();Fi(e);try{return t()}finally{Ii(e)}}function Wi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Fi(e);try{return t.apply(e,arguments)}finally{Ii(e)}}}function Gi(e){return function(){if(this.curOp)return e.apply(this,arguments);Fi(this);try{return e.apply(this,arguments)}finally{Ii(this)}}}function Ki(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Fi(t);try{return e.apply(this,arguments)}finally{Ii(t)}}}function qi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(Ji,e))}function Ji(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=It(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?ft(t.mode,r.state):null,c=Pt(e,a,r,!0);s&&(r.state=s),a.styles=c.styles;var l=a.styleClasses,u=c.classes;u?a.styleClasses=u:l&&(a.styleClasses=null);for(var d=!o||o.length!=a.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!d&&f<o.length;++f)d=o[f]!=a.styles[f];d&&i.push(r.line),a.stateAfter=r.save(),r.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Lt(e,a.text,r),a.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return qi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Ui(e,function(){for(var t=0;t<i.length;t++)Zr(e,i[t],`text`)})}}var Yi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=pi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=ur(e),this.force=n,this.dims=Wr(e),this.events=[]};Yi.prototype.signal=function(e,t){Be(e,t)&&this.events.push(arguments)},Yi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Le.apply(null,this.events[e])};function Xi(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=lr(e)+`px`,t.sizer.style.marginBottom=-t.nativeBarWidth+`px`,t.sizer.style.borderRightWidth=lr(e)+`px`,t.scrollbarsClipped=!0)}function Zi(e){if(e.hasFocus())return null;var t=ee(ie(e));if(!t||!M(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=P(e).getSelection();r.anchorNode&&r.extend&&M(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Qi(e){if(e&&e.activeElt&&e.activeElt!=ee(ae(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&M(document.body,e.anchorNode)&&M(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function $i(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Qr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ti(e)==0)return!1;oa(e)&&(Qr(e),t.dims=Wr(e));var i=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),qt&&(a=_n(e.doc,a),o=vn(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;ei(e,a,o),n.viewOffset=xn(z(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+`px`;var c=ti(e);if(!s&&c==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var l=Zi(e);return c>4&&(n.lineDiv.style.display=`none`),na(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=``),n.renderedView=n.view,Qi(l),D(n.cursorDiv),D(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,qi(e,400)),n.updateLineNumbers=null,!0}function ea(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==ur(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+sr(e.display)-dr(e),n.top)}),t.visible=pi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=pi(e.display,e.doc,n));if(!$i(e,t))break;di(e);var i=Di(e);ni(e),Ai(e,i),ia(e,i),t.force=!1}t.signal(e,`update`,e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,`viewportChange`,e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ta(e,t){var n=new Yi(e,t);if($i(e,n)){di(e),ea(e,n);var r=Di(e);ni(e),Ai(e,r),ia(e,r),n.finish()}}function na(e,t,n){var r=e.display,i=e.options.lineNumbers,a=r.lineDiv,o=a.firstChild;function s(t){var n=t.nextSibling;return c&&y&&e.display.currentWheelTarget==t?t.style.display=`none`:t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,d=0;d<l.length;d++){var f=l[d];if(!f.hidden){if(!f.node||f.node.parentNode!=a){var p=er(e,f,u,n);a.insertBefore(p,o)}else{for(;o!=f.node;)o=s(o);var m=i&&t!=null&&t<=u&&f.lineNumber;f.changes&&(L(f.changes,`gutter`)>-1&&(m=!1),Kn(e,f,u,n)),m&&(D(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(St(e.options,u)))),o=f.node.nextSibling}}u+=f.size}for(;o;)o=s(o)}function ra(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+`px`,Wn(e,`gutterChanged`,e)}function ia(e,t){e.display.sizer.style.minHeight=t.docHeight+`px`,e.display.heightForcer.style.top=t.docHeight+`px`,e.display.gutters.style.height=t.docHeight+e.display.barHeight+lr(e)+`px`}function aa(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=Gr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=r+`px`,o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=a),n[o].gutterBackground&&(n[o].gutterBackground.style.left=a));var s=n[o].alignable;if(s)for(var c=0;c<s.length;c++)s[c].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=r+i+`px`)}}function oa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=St(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(k(`div`,[k(`div`,n)],`CodeMirror-linenumber CodeMirror-gutter-elt`)),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return r.lineGutter.style.width=``,r.lineNumInnerWidth=Math.max(a,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+`px`,ra(e.display),!0}return!1}function sa(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!=`string`&&(o=a.style,a=a.className),a==`CodeMirror-linenumbers`){if(t)r=!0;else continue}n.push({className:a,style:o})}return t&&!r&&n.push({className:`CodeMirror-linenumbers`,style:null}),n}function ca(e){var t=e.gutters,n=e.gutterSpecs;D(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],a=i.className,o=i.style,s=t.appendChild(k(`div`,null,`CodeMirror-gutter `+a));o&&(s.style.cssText=o),a==`CodeMirror-linenumbers`&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+`px`)}t.style.display=n.length?``:`none`,ra(e)}function la(e){ca(e.display),Xr(e),aa(e)}function ua(e,t,r,i){var a=this;this.input=r,a.scrollbarFiller=k(`div`,null,`CodeMirror-scrollbar-filler`),a.scrollbarFiller.setAttribute(`cm-not-content`,`true`),a.gutterFiller=k(`div`,null,`CodeMirror-gutter-filler`),a.gutterFiller.setAttribute(`cm-not-content`,`true`),a.lineDiv=A(`div`,null,`CodeMirror-code`),a.selectionDiv=k(`div`,null,null,`position: relative; z-index: 1`),a.cursorDiv=k(`div`,null,`CodeMirror-cursors`),a.measure=k(`div`,null,`CodeMirror-measure`),a.lineMeasure=k(`div`,null,`CodeMirror-measure`),a.lineSpace=A(`div`,[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,`position: relative; outline: none`),a.mover=k(`div`,[A(`div`,[a.lineSpace],`CodeMirror-lines`)],null,`position: relative`),a.sizer=k(`div`,[a.mover],`CodeMirror-sizer`),a.sizerWidth=null,a.heightForcer=k(`div`,null,null,`position: absolute; height: `+ce+`px; width: 1px;`),a.gutters=k(`div`,null,`CodeMirror-gutters`),a.lineGutter=null,a.scroller=k(`div`,[a.sizer,a.heightForcer,a.gutters],`CodeMirror-scroll`),a.scroller.setAttribute(`tabIndex`,`-1`),a.wrapper=k(`div`,[a.scrollbarFiller,a.gutterFiller,a.scroller],`CodeMirror`),u&&d===105&&(a.wrapper.style.clipPath=`inset(0px)`),a.wrapper.setAttribute(`translate`,`no`),o&&s<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!c&&!(n&&v)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=sa(i.gutters,i.lineNumbers),ca(a),r.init(a)}var da=0,fa=null;o?fa=-.53:n?fa=15:u?fa=-.7:p&&(fa=-1/3);function pa(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n??=e.wheelDelta,{x:t,y:n}}function ma(e){var t=pa(e);return t.x*=fa,t.y*=fa,t}function ha(e,t){u&&d==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents=`none`:clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=``},100));var r=pa(t),i=r.x,a=r.y,o=fa;t.deltaMode===0&&(i=t.deltaX,a=t.deltaY,o=1);var s=e.display,l=s.scroller,p=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(i&&p||a&&m){if(a&&y&&c){outer:for(var h=t.target,g=s.view;h!=l;h=h.parentNode)for(var _=0;_<g.length;_++)if(g[_].node==h){e.display.currentWheelTarget=h;break outer}}if(i&&!n&&!f&&o!=null){a&&m&&wi(e,Math.max(0,l.scrollTop+a*o)),Ei(e,Math.max(0,l.scrollLeft+i*o)),(!a||a&&m)&&He(t),s.wheelStartX=null;return}if(a&&o!=null){var v=a*o,b=e.doc.scrollTop,x=b+s.wrapper.clientHeight;v<0?b=Math.max(0,b+v-50):x=Math.min(e.doc.height,x+v+50),ta(e,{top:b,bottom:x})}da<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=a,setTimeout(function(){if(s.wheelStartX!=null){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(fa=(fa*da+n)/(da+1),++da)}},200)):(s.wheelDX+=i,s.wheelDY+=a))}}var ga=function(e,t){this.ranges=e,this.primIndex=t};ga.prototype.primary=function(){return this.ranges[this.primIndex]},ga.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!wt(n.anchor,r.anchor)||!wt(n.head,r.head))return!1}return!0},ga.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new K(Tt(this.ranges[t].anchor),Tt(this.ranges[t].head));return new ga(e,this.primIndex)},ga.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ga.prototype.contains=function(e,t){t||=e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Ct(t,r.from())>=0&&Ct(e,r.to())<=0)return n}return-1};var K=function(e,t){this.anchor=e,this.head=t};K.prototype.from=function(){return Dt(this.anchor,this.head)},K.prototype.to=function(){return Et(this.anchor,this.head)},K.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function _a(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return Ct(e.from(),t.from())}),n=L(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],c=Ct(s.to(),o.from());if(r&&!o.empty()?c>0:c>=0){var l=Dt(s.from(),o.from()),u=Et(s.to(),o.to()),d=s.empty()?o.from()==o.head:s.from()==s.head;a<=n&&--n,t.splice(--a,2,new K(d?u:l,d?l:u))}}return new ga(t,n)}function va(e,t){return new ga([new K(e,t||e)],0)}function ya(e){return e.text?B(e.from.line+e.text.length-1,ge(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ba(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return ya(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ya(t).ch-t.to.ch),B(n,r)}function xa(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new K(ba(i.anchor,t),ba(i.head,t)))}return _a(e.cm,n,e.sel.primIndex)}function Sa(e,t,n){return e.line==t.line?B(n.line,e.ch-t.ch+n.ch):B(n.line+(e.line-t.line),e.ch)}function Ca(e,t,n){for(var r=[],i=B(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],c=Sa(s.from,i,a),l=Sa(ya(s),i,a);if(i=s.to,a=l,n==`around`){var u=e.sel.ranges[o],d=Ct(u.head,u.anchor)<0;r[o]=new K(d?l:c,d?c:l)}else r[o]=new K(c,c)}return new ga(r,e.sel.primIndex)}function wa(e){e.doc.mode=lt(e.options,e.doc.modeOption),Ta(e)}function Ta(e){e.doc.iter(function(e){e.stateAfter&&=null,e.styles&&=null}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,qi(e,100),e.state.modeGen++,e.curOp&&Xr(e)}function Ea(e,t){return t.from.ch==0&&t.to.ch==0&&ge(t.text)==``&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,t,n,r){function i(e){return n?n[e]:null}function a(e,n,i){Tn(e,n,i,r),Wn(e,`change`,e,t)}function o(e,t){for(var n=[],a=e;a<t;++a)n.push(new wn(l[a],i(a),r));return n}var s=t.from,c=t.to,l=t.text,u=z(e,s.line),d=z(e,c.line),f=ge(l),p=i(l.length-1),m=c.line-s.line;if(t.full)e.insert(0,o(0,l.length)),e.remove(l.length,e.size-l.length);else if(Ea(e,t)){var h=o(0,l.length-1);a(d,d.text,p),m&&e.remove(s.line,m),h.length&&e.insert(s.line,h)}else if(u==d){if(l.length==1)a(u,u.text.slice(0,s.ch)+f+u.text.slice(c.ch),p);else{var g=o(1,l.length-1);g.push(new wn(f+u.text.slice(c.ch),p,r)),a(u,u.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,g)}}else if(l.length==1)a(u,u.text.slice(0,s.ch)+l[0]+d.text.slice(c.ch),i(0)),e.remove(s.line+1,m);else{a(u,u.text.slice(0,s.ch)+l[0],i(0)),a(d,f+d.text.slice(c.ch),p);var _=o(1,l.length-1);m>1&&e.remove(s.line+1,m-1),e.insert(s.line+1,_)}Wn(e,`change`,e,t)}function Oa(e,t,n){function r(e,i,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=i){var c=a&&s.sharedHist;(!n||c)&&(t(s.doc,c),r(s.doc,e,c))}}}r(e,null,!0)}function ka(e,t){if(t.cm)throw Error(`This document is already in use.`);e.doc=t,t.cm=e,qr(e),wa(e),Aa(e),e.options.direction=t.direction,e.options.lineWrapping||Cn(e),e.options.mode=t.modeOption,Xr(e)}function Aa(e){(e.doc.direction==`rtl`?te:E)(e.display.lineDiv,`CodeMirror-rtl`)}function ja(e){Ui(e,function(){Aa(e),Xr(e)})}function Ma(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Na(e,t){var n={from:Tt(t.from),to:ya(t),text:gt(e,t.from,t.to)};return Ba(e,n,t.from.line,t.to.line+1),Oa(e,function(e){return Ba(e,n,t.from.line,t.to.line+1)},!0),n}function Pa(e){for(;e.length&&ge(e).ranges;)e.pop()}function Fa(e,t){if(t)return Pa(e.done),ge(e.done);if(e.done.length&&!ge(e.done).ranges)return ge(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ge(e.done)}function Ia(e,t,n,r){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)==`+`&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)==`*`))&&(o=Fa(i,i.lastOp==r)))s=ge(o.changes),Ct(t.from,t.to)==0&&Ct(t.from,s.to)==0?s.to=ya(t):o.changes.push(Na(e,t));else{var c=ge(i.done);for((!c||!c.ranges)&&za(e.sel,i.done),o={changes:[Na(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Le(e,`historyAdded`)}function La(e,t,n,r){var i=t.charAt(0);return i==`*`||i==`+`&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Ra(e,t,n,r){var i=e.history,a=r&&r.origin;n==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||La(e,a,ge(i.done),t))?i.done[i.done.length-1]=t:za(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=n,r&&r.clearRedo!==!1&&Pa(i.undone)}function za(e,t){var n=ge(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ba(e,t,n,r){var i=t[`spans_`+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||=t[`spans_`+e.id]={})[a]=n.markedSpans),++a})}function Va(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||=e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}function Ha(e,t){var n=t[`spans_`+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Va(n[i]));return r}function Ua(e,t){var n=Ha(e,t),r=nn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var a=n[i],o=r[i];if(a&&o)spans:for(var s=0;s<o.length;++s){for(var c=o[s],l=0;l<a.length;++l)if(a[l].marker==c.marker)continue spans;a.push(c)}else o&&(n[i]=o)}return n}function Wa(e,t,n){for(var r=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){r.push(n?ga.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];r.push({changes:s});for(var c=0;c<o.length;++c){var l=o[c],u=void 0;if(s.push({from:l.from,to:l.to,text:l.text}),t)for(var d in l)(u=d.match(/^spans_(\d+)$/))&&L(t,Number(u[1]))>-1&&(ge(s)[d]=l[d],delete l[d])}}return r}function Ga(e,t,n,r){if(r){var i=e.anchor;if(n){var a=Ct(t,i)<0;a==Ct(n,i)<0?a!=Ct(t,n)<0&&(t=n):(i=t,t=n)}return new K(i,t)}return new K(n||t,t)}function Ka(e,t,n,r,i){i??=e.cm&&(e.cm.display.shift||e.extend),Qa(e,new ga([Ga(e.sel.primary(),t,n,i)],0),r)}function qa(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)r[a]=Ga(e.sel.ranges[a],t[a],null,i);Qa(e,_a(e.cm,r,e.sel.primIndex),n)}function Ja(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Qa(e,_a(e.cm,i,e.sel.primIndex),r)}function Ya(e,t,n,r){Qa(e,va(t,n),r)}function Xa(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new K(kt(e,t[n].anchor),kt(e,t[n].head))},origin:n&&n.origin};return Le(e,`beforeSelectionChange`,e,r),e.cm&&Le(e.cm,`beforeSelectionChange`,e.cm,r),r.ranges==t.ranges?t:_a(e.cm,r.ranges,r.ranges.length-1)}function Za(e,t,n){var r=e.history.done,i=ge(r);i&&i.ranges?(r[r.length-1]=t,$a(e,t,n)):Qa(e,t,n)}function Qa(e,t,n){$a(e,t,n),Ra(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function $a(e,t,n){(Be(e,`beforeSelectionChange`)||e.cm&&Be(e.cm,`beforeSelectionChange`))&&(t=Xa(e,t,n));var r=n&&n.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);eo(e,no(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption(`readOnly`)!=`nocursor`&&yi(e.cm)}function eo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ze(e.cm)),Wn(e,`cursorActivity`,e))}function to(e){eo(e,no(e,e.sel,null,!1))}function no(e,t,n,r){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],c=io(e,o.anchor,s&&s.anchor,n,r),l=o.head==o.anchor?c:io(e,o.head,s&&s.head,n,r);(i||c!=o.anchor||l!=o.head)&&(i||=t.ranges.slice(0,a),i[a]=new K(c,l))}return i?_a(e.cm,i,t.primIndex):t}function ro(e,t,n,r,i){var a=z(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],c=s.marker,l=`selectLeft`in c?!c.selectLeft:c.inclusiveLeft,u=`selectRight`in c?!c.selectRight:c.inclusiveRight;if((s.from==null||(l?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Le(c,`beforeCursorEnter`),c.explicitlyCleared)){if(a.markedSpans){--o;continue}break}if(!c.atomic)continue;if(n){var d=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(d=ao(e,d,-r,d&&d.line==t.line?a:null)),d&&d.line==t.line&&(f=Ct(d,n))&&(r<0?f<0:f>0))return ro(e,d,t,r,i)}var p=c.find(r<0?-1:1);return(r<0?l:u)&&(p=ao(e,p,r,p.line==t.line?a:null)),p?ro(e,p,t,r,i):null}}return t}function io(e,t,n,r,i){var a=r||1;return ro(e,t,n,a,i)||!i&&ro(e,t,n,a,!0)||ro(e,t,n,-a,i)||!i&&ro(e,t,n,-a,!0)||(e.cantEdit=!0,B(e.first,0))}function ao(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?kt(e,B(t.line-1)):null:n>0&&t.ch==(r||z(e,t.line)).text.length?t.line<e.first+e.size-1?B(t.line+1,0):null:new B(t.line,t.ch+n)}function oo(e){e.setSelection(B(e.firstLine(),0),B(e.lastLine()),ue)}function so(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,a){t&&(r.from=kt(e,t)),n&&(r.to=kt(e,n)),i&&(r.text=i),a!==void 0&&(r.origin=a)}),Le(e,`beforeChange`,e,r),e.cm&&Le(e.cm,`beforeChange`,e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function co(e,t,n){if(e.cm){if(!e.cm.curOp)return Wi(e.cm,co)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Be(e,`beforeChange`)||e.cm&&Be(e.cm,`beforeChange`))&&(t=so(e,t,!0),!t))){var r=Kt&&!n&&an(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)lo(e,{from:r[i].from,to:r[i].to,text:i?[``]:t.text,origin:t.origin});else lo(e,t)}}function lo(e,t){if(t.text.length!=1||t.text[0]!=``||Ct(t.from,t.to)!=0){var n=xa(e,t);Ia(e,t,n,e.cm?e.cm.curOp.id:NaN),po(e,t,n,nn(e,t));var r=[];Oa(e,function(e,n){!n&&L(r,e.history)==-1&&(vo(e.history,t),r.push(e.history)),po(e,t,null,nn(e,t))})}}function uo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i=e.history,a,o=e.sel,s=t==`undo`?i.done:i.undone,c=t==`undo`?i.undone:i.done,l=0;l<s.length&&(a=s[l],!(n?a.ranges&&!a.equals(e.sel):!a.ranges));l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(za(a,c),n&&!a.equals(e.sel)){Qa(e,a,{clearRedo:!1});return}o=a}else if(r){s.push(a);return}else break;var u=[];za(o,c),c.push({changes:u,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var d=Be(e,`beforeChange`)||e.cm&&Be(e.cm,`beforeChange`),f=function(n){var r=a.changes[n];if(r.origin=t,d&&!so(e,r,!1))return s.length=0,{};u.push(Na(e,r)),po(e,r,n?xa(e,r):ge(s),Ua(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:ya(r)});var i=[];Oa(e,function(e,t){!t&&L(i,e.history)==-1&&(vo(e.history,r),i.push(e.history)),po(e,r,null,Ua(e,r))})},p=a.changes.length-1;p>=0;--p){var m=f(p);if(m)return m.v}}}}function fo(e,t){if(t!=0&&(e.first+=t,e.sel=new ga(_e(e.sel.ranges,function(e){return new K(B(e.anchor.line+t,e.anchor.ch),B(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Xr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Zr(e.cm,r,`gutter`)}}function po(e,t,n,r){if(e.cm&&!e.cm.curOp)return Wi(e.cm,po)(e,t,n,r);if(t.to.line<e.first){fo(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);fo(e,i),t={from:B(e.first,0),to:B(t.to.line+i,t.to.ch),text:[ge(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:B(a,z(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=gt(e,t.from,t.to),n||=xa(e,t),e.cm?mo(e.cm,t,r):Da(e,t,r),$a(e,n,ue),e.cantEdit&&io(e,B(e.firstLine(),0))&&(e.cantEdit=!1)}}function mo(e,t,n){var r=e.doc,i=e.display,a=t.from,o=t.to,s=!1,c=a.line;e.options.lineWrapping||(c=yt(hn(z(r,a.line))),r.iter(c,o.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ze(e),Da(r,t,n,Kr(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=Sn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Gt(r,a.line),qi(e,400);var l=t.text.length-(o.line-a.line)-1;t.full?Xr(e):a.line==o.line&&t.text.length==1&&!Ea(e.doc,t)?Zr(e,a.line,`text`):Xr(e,a.line,o.line+1,l);var u=Be(e,`changes`),d=Be(e,`change`);if(d||u){var f={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};d&&Wn(e,`change`,e,f),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function ho(e,t,n,r,i){var a;r||=n,Ct(r,n)<0&&(a=[r,n],n=a[0],r=a[1]),typeof t==`string`&&(t=e.splitLines(t)),co(e,{from:n,to:r,text:t,origin:i})}function go(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function _o(e,t,n,r){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)go(a.ranges[s].anchor,t,n,r),go(a.ranges[s].head,t,n,r);continue}for(var c=0;c<a.changes.length;++c){var l=a.changes[c];if(n<l.from.line)l.from=B(l.from.line+r,l.from.ch),l.to=B(l.to.line+r,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function vo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;_o(e.done,n,r,i),_o(e.undone,n,r,i)}function yo(e,t,n,r){var i=t,a=t;return typeof t==`number`?a=z(e,Ot(e,t)):i=yt(t),i==null?null:(r(a,i)&&e.cm&&Zr(e.cm,i,n),a)}function bo(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}bo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,En(i),Wn(i,`delete`)}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function xo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}xo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var a=Math.min(t,i-e),o=r.height;if(r.removeInner(e,a),this.height-=o-r.height,i==a&&(this.children.splice(n--,1),r.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof bo))){var s=[];this.collapse(s),this.children=[new bo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var c=new bo(i.lines.slice(s,s+=25));i.height-=c.height,this.children.splice(++r,0,c),c.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new xo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=L(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new xo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var So=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};So.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=yt(n);if(r!=null&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var a=ir(this);vt(n,Math.max(0,n.height-a)),e&&(Ui(e,function(){Co(e,n,-a),Zr(e,r,`widget`)}),Wn(e,`lineWidgetCleared`,e,this,r))}},So.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=ir(this)-t;i&&(yn(this.doc,r)||vt(r,r.height+i),n&&Ui(n,function(){n.curOp.forceUpdate=!0,Co(n,r,i),Wn(n,`lineWidgetChanged`,n,e,yt(r))}))},Ve(So);function Co(e,t,n){xn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&vi(e,n)}function wo(e,t,n,r){var i=new So(e,n,r),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),yo(e,t,`widget`,function(t){var n=t.widgets||=[];if(i.insertAt==null?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,a&&!yn(e,t)){var r=xn(t)<e.scrollTop;vt(t,t.height+ir(i)),r&&vi(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Wn(a,`lineWidgetAdded`,a,i,typeof t==`number`?t:yt(t)),i}var To=0,Eo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++To};Eo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Fi(e),Be(this,`clear`)){var n=this.find();n&&Wn(this,`clear`,n.from,n.to)}for(var r=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Zt(o.markedSpans,this);e&&!this.collapsed?Zr(e,yt(o),`text`):e&&(s.to!=null&&(i=yt(o)),s.from!=null&&(r=yt(o))),o.markedSpans=Qt(o.markedSpans,s),s.from==null&&this.collapsed&&!yn(this.doc,o)&&e&&vt(o,Hr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var l=hn(this.lines[c]),u=Sn(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Xr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&to(e.doc)),e&&Wn(e,`markerCleared`,e,this,r,i),t&&Ii(e),this.parent&&this.parent.clear()}},Eo.prototype.find=function(e,t){e==null&&this.type==`bookmark`&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Zt(a.markedSpans,this);if(o.from!=null&&(n=B(t?a:yt(a),o.from),e==-1))return n;if(o.to!=null&&(r=B(t?a:yt(a),o.to),e==1))return r}return n&&{from:n,to:r}},Eo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Ui(r,function(){var i=t.line,a=gr(r,yt(t.line));if(a&&(Cr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!yn(n.doc,i)&&n.height!=null){var o=n.height;n.height=null;var s=ir(n)-o;s&&vt(i,i.height+s)}Wn(r,`markerChanged`,r,e)})},Eo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||L(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||=[]).push(this)}this.lines.push(e)},Eo.prototype.detachLine=function(e){if(this.lines.splice(L(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||=[]).push(this)}},Ve(Eo);function Do(e,t,n,r,i){if(r&&r.shared)return ko(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Wi(e.cm,Do)(e,t,n,r,i);var a=new Eo(e,i),o=Ct(t,n);if(r&&I(r,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=A(`span`,[a.replacedWith],`CodeMirror-widget`),r.handleMouseEvents||a.widgetNode.setAttribute(`cm-ignore-events`,`true`),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(mn(e,t.line,t,n,a)||t.line!=n.line&&mn(e,n.line,t,n,a))throw Error(`Inserting collapsed marker partially overlapping an existing one`);Yt()}a.addToHistory&&Ia(e,{from:t,to:n,origin:`markText`},e.sel,NaN);var s=t.line,c=e.cm,l;if(e.iter(s,n.line+1,function(r){c&&a.collapsed&&!c.options.lineWrapping&&hn(r)==c.display.maxLine&&(l=!0),a.collapsed&&s!=t.line&&vt(r,0),$t(r,new Xt(a,s==t.line?t.ch:null,s==n.line?n.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,n.line+1,function(t){yn(e,t)&&vt(t,0)}),a.clearOnEnter&&R(a,`beforeCursorEnter`,function(){return a.clear()}),a.readOnly&&(Jt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++To,a.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),a.collapsed)Xr(c,t.line,n.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var u=t.line;u<=n.line;u++)Zr(c,u,`text`);a.atomic&&to(c.doc),Wn(c,`markerAdded`,c,a)}return a}var Oo=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Oo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Wn(this,`clear`)}},Oo.prototype.find=function(e,t){return this.primary.find(e,t)},Ve(Oo);function ko(e,t,n,r,i){r=I(r),r.shared=!1;var a=[Do(e,t,n,r,i)],o=a[0],s=r.widgetNode;return Oa(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),a.push(Do(e,kt(e,t),kt(e,n),r,i));for(var c=0;c<e.linked.length;++c)if(e.linked[c].isParent)return;o=ge(a)}),new Oo(a,o)}function Ao(e){return e.findMarks(B(e.first,0),e.clipPos(B(e.lastLine())),function(e){return e.parent})}function jo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(Ct(a,o)){var s=Do(e,a,o,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Mo(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Oa(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var a=n.markers[i];L(r,a.doc)==-1&&(a.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}var No=0,Po=function(e,t,n,r,i){if(!(this instanceof Po))return new Po(e,t,n,r,i);n??=0,xo.call(this,[new bo([new wn(``,null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=B(n,0);this.sel=va(a),this.history=new Ma(null),this.id=++No,this.modeOption=t,this.lineSep=r,this.direction=i==`rtl`?`rtl`:`ltr`,this.extend=!1,typeof e==`string`&&(e=this.splitLines(e)),Da(this,{from:a,to:a,text:e}),Qa(this,va(a),ue)};Po.prototype=be(xo.prototype,{constructor:Po,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=_t(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Ki(function(e){var t=B(this.first,0),n=this.first+this.size-1;co(this,{from:t,to:B(n,z(this,n).text.length),text:this.splitLines(e),origin:`setValue`,full:!0},!0),this.cm&&bi(this.cm,0,0),Qa(this,va(t),ue)}),replaceRange:function(e,t,n,r){t=kt(this,t),n=n?kt(this,n):t,ho(this,e,t,n,r)},getRange:function(e,t,n){var r=gt(this,kt(this,e),kt(this,t));return n===!1?r:n===``?r.join(``):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(xt(this,e))return z(this,e)},getLineNumber:function(e){return yt(e)},getLineHandleVisualStart:function(e){return typeof e==`number`&&(e=z(this,e)),hn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return kt(this,e)},getCursor:function(e){var t=this.sel.primary();return e==null||e==`head`?t.head:e==`anchor`?t.anchor:e==`end`||e==`to`||e===!1?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ki(function(e,t,n){Ya(this,kt(this,typeof e==`number`?B(e,t||0):e),null,n)}),setSelection:Ki(function(e,t,n){Ya(this,kt(this,e),kt(this,t||e),n)}),extendSelection:Ki(function(e,t,n){Ka(this,kt(this,e),t&&kt(this,t),n)}),extendSelections:Ki(function(e,t){qa(this,jt(this,e),t)}),extendSelectionsBy:Ki(function(e,t){var n=_e(this.sel.ranges,e);qa(this,jt(this,n),t)}),setSelections:Ki(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new K(kt(this,e[i].anchor),kt(this,e[i].head||e[i].anchor));t??=Math.min(e.length-1,this.sel.primIndex),Qa(this,_a(this.cm,r,t),n)}}),addSelection:Ki(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new K(kt(this,e),kt(this,t||e))),Qa(this,_a(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=gt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=gt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||`+input`)},replaceSelections:Ki(function(e,t,n){for(var r=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];r[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:n}}for(var s=t&&t!=`end`&&Ca(this,r,t),c=r.length-1;c>=0;c--)co(this,r[c]);s?Za(this,s):this.cm&&yi(this.cm)}),undo:Ki(function(){uo(this,`undo`)}),redo:Ki(function(){uo(this,`redo`)}),undoSelection:Ki(function(){uo(this,`undo`,!0)}),redoSelection:Ki(function(){uo(this,`redo`,!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ma(this.history),Oa(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wa(this.history.done),undone:Wa(this.history.undone)}},setHistory:function(e){var t=this.history=new Ma(this.history);t.done=Wa(e.done.slice(0),null,!0),t.undone=Wa(e.undone.slice(0),null,!0)},setGutterMarker:Ki(function(e,t,n){return yo(this,e,`gutter`,function(e){var r=e.gutterMarkers||={};return r[t]=n,!n&&we(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ki(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&yo(t,n,`gutter`,function(){return n.gutterMarkers[e]=null,we(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e==`number`){if(!xt(this,e)||(t=e,e=z(this,e),!e))return null}else if(t=yt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Ki(function(e,t,n){return yo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`;if(!e[r])e[r]=n;else if(T(n).test(e[r]))return!1;else e[r]+=` `+n;return!0})}),removeLineClass:Ki(function(e,t,n){return yo(this,e,t==`gutter`?`gutter`:`class`,function(e){var r=t==`text`?`textClass`:t==`background`?`bgClass`:t==`gutter`?`gutterClass`:`wrapClass`,i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var a=i.match(T(n));if(!a)return!1;var o=a.index+a[0].length;e[r]=i.slice(0,a.index)+(!a.index||o==i.length?``:` `)+i.slice(o)||null}return!0})}),addLineWidget:Ki(function(e,t,n){return wo(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Do(this,kt(this,e),kt(this,t),n,n&&n.type||`range`)},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=kt(this,e),Do(this,e,e,n,`bookmark`)},findMarksAt:function(e){e=kt(this,e);var t=[],n=z(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=kt(this,e),t=kt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var c=o[s];!(c.to!=null&&i==e.line&&e.ch>=c.to||c.from==null&&i!=e.line||c.from!=null&&i==t.line&&c.from>=t.ch)&&(!n||n(c.marker))&&r.push(c.marker.parent||c.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+r;if(a>e)return t=e,!0;e-=a,++n}),kt(this,B(n,t))},indexFromPos:function(e){e=kt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new Po(_t(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||={};var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Po(_t(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||=[]).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],jo(r,Ao(this)),r},unlinkDoc:function(e){if(e instanceof Us&&(e=e.doc),this.linked){for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Mo(Ao(this));break}}if(e.history==this.history){var n=[e.id];Oa(e,function(e){return n.push(e.id)},!0),e.history=new Ma(null),e.history.done=Wa(this.history.done,n),e.history.undone=Wa(this.history.undone,n)}},iterLinkedDocs:function(e){Oa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):$e(e)},lineSeparator:function(){return this.lineSep||`
|
|
39
|
+
`},setDirection:Ki(function(e){e!=`rtl`&&(e=`ltr`),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&ja(this.cm))})}),Po.prototype.eachLine=Po.prototype.iter;var Fo=0;function Io(e){var t=this;if(zo(t),!(Re(t,e)||ar(t.display,e))){He(e),o&&(Fo=+new Date);var n=Jr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly()){if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),s=0,c=function(){++s==i&&Wi(t,function(){n=kt(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(a.filter(function(e){return e!=null}).join(t.doc.lineSeparator())),origin:`paste`};co(t.doc,e),Za(t.doc,va(kt(t.doc,n),kt(t.doc,ya(e))))})()},l=function(e,n){if(t.options.allowDropFileTypes&&L(t.options.allowDropFileTypes,e.type)==-1){c();return}var r=new FileReader;r.onerror=function(){return c()},r.onload=function(){var e=r.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)){c();return}a[n]=e,c()},r.readAsText(e)},u=0;u<r.length;u++)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var d=e.dataTransfer.getData(`Text`);if(d){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),$a(t.doc,va(n,n)),f)for(var p=0;p<f.length;++p)ho(t.doc,``,f[p].anchor,f[p].head,`drag`);t.replaceSelection(d,`around`,`paste`),t.display.input.focus()}}catch{}}}}}function Lo(e,t){if(o&&(!e.state.draggingText||+new Date-Fo<100)){Ge(t);return}if(!(Re(e,t)||ar(e.display,t))&&(t.dataTransfer.setData(`Text`,e.getSelection()),t.dataTransfer.effectAllowed=`copyMove`,t.dataTransfer.setDragImage&&!p)){var n=k(`img`,null,null,`position: fixed; left: 0; top: 0;`);n.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`,f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}function Ro(e,t){var n=Jr(e,t);if(n){var r=document.createDocumentFragment();ii(e,n,r),e.display.dragCursor||(e.display.dragCursor=k(`div`,null,`CodeMirror-cursors CodeMirror-dragcursors`),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}function zo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Bo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(`CodeMirror`),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var t=0;t<n.length;t++)e(n[t])})}}var Vo=!1;function Ho(){Vo||=(Uo(),!0)}function Uo(){var e;R(window,`resize`,function(){e??=setTimeout(function(){e=null,Bo(Wo)},100)}),R(window,`blur`,function(){return Bo(ui)})}function Wo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Go={3:`Pause`,8:`Backspace`,9:`Tab`,13:`Enter`,16:`Shift`,17:`Ctrl`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Esc`,32:`Space`,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`Left`,38:`Up`,39:`Right`,40:`Down`,44:`PrintScrn`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Mod`,92:`Mod`,93:`Mod`,106:`*`,107:`=`,109:`-`,110:`.`,111:`/`,145:`ScrollLock`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`,224:`Mod`,63232:`Up`,63233:`Down`,63234:`Left`,63235:`Right`,63272:`Delete`,63273:`Home`,63275:`End`,63276:`PageUp`,63277:`PageDown`,63302:`Insert`},Ko=0;Ko<10;Ko++)Go[Ko+48]=Go[Ko+96]=String(Ko);for(var qo=65;qo<=90;qo++)Go[qo]=String.fromCharCode(qo);for(var Jo=1;Jo<=12;Jo++)Go[Jo+111]=Go[Jo+63235]=`F`+Jo;var Yo={};Yo.basic={Left:`goCharLeft`,Right:`goCharRight`,Up:`goLineUp`,Down:`goLineDown`,End:`goLineEnd`,Home:`goLineStartSmart`,PageUp:`goPageUp`,PageDown:`goPageDown`,Delete:`delCharAfter`,Backspace:`delCharBefore`,"Shift-Backspace":`delCharBefore`,Tab:`defaultTab`,"Shift-Tab":`indentAuto`,Enter:`newlineAndIndent`,Insert:`toggleOverwrite`,Esc:`singleSelection`},Yo.pcDefault={"Ctrl-A":`selectAll`,"Ctrl-D":`deleteLine`,"Ctrl-Z":`undo`,"Shift-Ctrl-Z":`redo`,"Ctrl-Y":`redo`,"Ctrl-Home":`goDocStart`,"Ctrl-End":`goDocEnd`,"Ctrl-Up":`goLineUp`,"Ctrl-Down":`goLineDown`,"Ctrl-Left":`goGroupLeft`,"Ctrl-Right":`goGroupRight`,"Alt-Left":`goLineStart`,"Alt-Right":`goLineEnd`,"Ctrl-Backspace":`delGroupBefore`,"Ctrl-Delete":`delGroupAfter`,"Ctrl-S":`save`,"Ctrl-F":`find`,"Ctrl-G":`findNext`,"Shift-Ctrl-G":`findPrev`,"Shift-Ctrl-F":`replace`,"Shift-Ctrl-R":`replaceAll`,"Ctrl-[":`indentLess`,"Ctrl-]":`indentMore`,"Ctrl-U":`undoSelection`,"Shift-Ctrl-U":`redoSelection`,"Alt-U":`redoSelection`,fallthrough:`basic`},Yo.emacsy={"Ctrl-F":`goCharRight`,"Ctrl-B":`goCharLeft`,"Ctrl-P":`goLineUp`,"Ctrl-N":`goLineDown`,"Ctrl-A":`goLineStart`,"Ctrl-E":`goLineEnd`,"Ctrl-V":`goPageDown`,"Shift-Ctrl-V":`goPageUp`,"Ctrl-D":`delCharAfter`,"Ctrl-H":`delCharBefore`,"Alt-Backspace":`delWordBefore`,"Ctrl-K":`killLine`,"Ctrl-T":`transposeChars`,"Ctrl-O":`openLine`},Yo.macDefault={"Cmd-A":`selectAll`,"Cmd-D":`deleteLine`,"Cmd-Z":`undo`,"Shift-Cmd-Z":`redo`,"Cmd-Y":`redo`,"Cmd-Home":`goDocStart`,"Cmd-Up":`goDocStart`,"Cmd-End":`goDocEnd`,"Cmd-Down":`goDocEnd`,"Alt-Left":`goGroupLeft`,"Alt-Right":`goGroupRight`,"Cmd-Left":`goLineLeft`,"Cmd-Right":`goLineRight`,"Alt-Backspace":`delGroupBefore`,"Ctrl-Alt-Backspace":`delGroupAfter`,"Alt-Delete":`delGroupAfter`,"Cmd-S":`save`,"Cmd-F":`find`,"Cmd-G":`findNext`,"Shift-Cmd-G":`findPrev`,"Cmd-Alt-F":`replace`,"Shift-Cmd-Alt-F":`replaceAll`,"Cmd-[":`indentLess`,"Cmd-]":`indentMore`,"Cmd-Backspace":`delWrappedLineLeft`,"Cmd-Delete":`delWrappedLineRight`,"Cmd-U":`undoSelection`,"Shift-Cmd-U":`redoSelection`,"Ctrl-Up":`goDocStart`,"Ctrl-Down":`goDocEnd`,fallthrough:[`basic`,`emacsy`]},Yo.default=y?Yo.macDefault:Yo.pcDefault;function Xo(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))n=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw Error(`Unrecognized modifier name: `+s)}return n&&(e=`Alt-`+e),r&&(e=`Ctrl-`+e),a&&(e=`Cmd-`+e),i&&(e=`Shift-`+e),e}function Zo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r==`...`){delete e[n];continue}for(var i=_e(n.split(` `),Xo),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(` `),o=r):(s=i.slice(0,a+1).join(` `),o=`...`);var c=t[s];if(!c)t[s]=o;else if(c!=o)throw Error(`Inconsistent bindings for `+s)}delete e[n]}for(var l in t)e[l]=t[l];return e}function Qo(e,t,n,r){t=ns(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return`nothing`;if(i===`...`)return`multi`;if(i!=null&&n(i))return`handled`;if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!=`[object Array]`)return Qo(e,t.fallthrough,n,r);for(var a=0;a<t.fallthrough.length;a++){var o=Qo(e,t.fallthrough[a],n,r);if(o)return o}}}function $o(e){var t=typeof e==`string`?e:Go[e.keyCode];return t==`Ctrl`||t==`Alt`||t==`Shift`||t==`Mod`}function es(e,t,n){var r=e;return t.altKey&&r!=`Alt`&&(e=`Alt-`+e),(C?t.metaKey:t.ctrlKey)&&r!=`Ctrl`&&(e=`Ctrl-`+e),(C?t.ctrlKey:t.metaKey)&&r!=`Mod`&&(e=`Cmd-`+e),!n&&t.shiftKey&&r!=`Shift`&&(e=`Shift-`+e),e}function ts(e,t){if(f&&e.keyCode==34&&e.char)return!1;var n=Go[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),es(n,e,t))}function ns(e){return typeof e==`string`?Yo[e]:e}function rs(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var a=t(n[i]);r.length&&Ct(a.from,ge(r).to)<=0;){var o=r.pop();if(Ct(o.from,a.from)<0){a.from=o.from;break}}r.push(a)}Ui(e,function(){for(var t=r.length-1;t>=0;t--)ho(e.doc,``,r[t].from,r[t].to,`+delete`);yi(e)})}function is(e,t,n){var r=De(e.text,t+n,n);return r<0||r>e.text.length?null:r}function as(e,t,n){var r=is(e,t.ch,n);return r==null?null:new B(t.line,r,n<0?`after`:`before`)}function os(e,t,n,r,i){if(e){t.doc.direction==`rtl`&&(i=-i);var a=Ne(n,t.doc.direction);if(a){var o=i<0?ge(a):a[0],s=i<0==(o.level==1)?`after`:`before`,c;if(o.level>0||t.doc.direction==`rtl`){var l=_r(t,n);c=i<0?n.text.length-1:0;var u=U(t,l,c).top;c=Oe(function(e){return U(t,l,e).top==u},i<0==(o.level==1)?o.from:o.to-1,c),s==`before`&&(c=is(n,c,1))}else c=i<0?o.to:o.from;return new B(r,c,s)}}return new B(r,i<0?n.text.length:0,i<0?`before`:`after`)}function ss(e,t,n,r){var i=Ne(t,e.doc.direction);if(!i)return as(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky=`before`):n.ch<=0&&(n.ch=0,n.sticky=`after`);var a=je(i,n.ch,n.sticky),o=i[a];if(e.doc.direction==`ltr`&&o.level%2==0&&(r>0?o.to>n.ch:o.from<n.ch))return as(t,n,r);var s=function(e,n){return is(t,e instanceof B?e.ch:e,n)},c,l=function(n){return e.options.lineWrapping?(c||=_r(e,t),Ir(e,t,c,n)):{begin:0,end:t.text.length}},u=l(n.sticky==`before`?s(n,-1):n.ch);if(e.doc.direction==`rtl`||o.level==1){var d=o.level==1==r<0,f=s(n,d?1:-1);if(f!=null&&(d?f<=o.to&&f<=u.end:f>=o.from&&f>=u.begin)){var p=d?`before`:`after`;return new B(n.line,f,p)}}var m=function(e,t,r){for(var a=function(e,t){return t?new B(n.line,s(e,1),`before`):new B(n.line,e,`after`)};e>=0&&e<i.length;e+=t){var o=i[e],c=t>0==(o.level!=1),l=c?r.begin:s(r.end,-1);if(o.from<=l&&l<o.to||(l=c?o.from:s(o.to,-1),r.begin<=l&&l<r.end))return a(l,c)}},h=m(a+r,r,u);if(h)return h;var g=r>0?u.end:s(u.begin,-1);return g!=null&&!(r>0&&g==t.text.length)&&(h=m(r>0?0:i.length-1,r,l(g)),h)?h:null}var cs={selectAll:oo,singleSelection:function(e){return e.setSelection(e.getCursor(`anchor`),e.getCursor(`head`),ue)},killLine:function(e){return rs(e,function(t){if(t.empty()){var n=z(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:B(t.head.line+1,0)}:{from:t.head,to:B(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return rs(e,function(t){return{from:B(t.from().line,0),to:kt(e.doc,B(t.to().line+1,0))}})},delLineLeft:function(e){return rs(e,function(e){return{from:B(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return rs(e,function(t){var n=e.charCoords(t.head,`div`).top+5;return{from:e.coordsChar({left:0,top:n},`div`),to:t.from()}})},delWrappedLineRight:function(e){return rs(e,function(t){var n=e.charCoords(t.head,`div`).top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`);return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(B(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(B(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ls(e,t.head.line)},{origin:`+move`,bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head)},{origin:`+move`,bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return us(e,t.head.line)},{origin:`+move`,bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},`div`)},fe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5;return e.coordsChar({left:0,top:n},`div`)},fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,`div`).top+5,r=e.coordsChar({left:0,top:n},`div`);return r.ch<e.getLine(r.line).search(/\S/)?ds(e,t.head):r},fe)},goLineUp:function(e){return e.moveV(-1,`line`)},goLineDown:function(e){return e.moveV(1,`line`)},goPageUp:function(e){return e.moveV(-1,`page`)},goPageDown:function(e){return e.moveV(1,`page`)},goCharLeft:function(e){return e.moveH(-1,`char`)},goCharRight:function(e){return e.moveH(1,`char`)},goColumnLeft:function(e){return e.moveH(-1,`column`)},goColumnRight:function(e){return e.moveH(1,`column`)},goWordLeft:function(e){return e.moveH(-1,`word`)},goGroupRight:function(e){return e.moveH(1,`group`)},goGroupLeft:function(e){return e.moveH(-1,`group`)},goWordRight:function(e){return e.moveH(1,`word`)},delCharBefore:function(e){return e.deleteH(-1,`codepoint`)},delCharAfter:function(e){return e.deleteH(1,`char`)},delWordBefore:function(e){return e.deleteH(-1,`word`)},delWordAfter:function(e){return e.deleteH(1,`word`)},delGroupBefore:function(e){return e.deleteH(-1,`group`)},delGroupAfter:function(e){return e.deleteH(1,`group`)},indentAuto:function(e){return e.indentSelection(`smart`)},indentMore:function(e){return e.indentSelection(`add`)},indentLess:function(e){return e.indentSelection(`subtract`)},insertTab:function(e){return e.replaceSelection(` `)},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var a=n[i].from(),o=oe(e.getLine(a.line),a.ch,r);t.push(he(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection(`add`):e.execCommand(`insertTab`)},transposeChars:function(e){return Ui(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,a=z(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new B(i.line,i.ch-1)),i.ch>0)i=new B(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),B(i.line,i.ch-2),i,`+transpose`);else if(i.line>e.doc.first){var o=z(e.doc,i.line-1).text;o&&(i=new B(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),B(i.line-1,o.length-1),i,`+transpose`))}}n.push(new K(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Ui(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,`+input`);t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);yi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
40
|
+
`,`start`)},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ls(e,t){var n=z(e.doc,t),r=hn(n);return r!=n&&(t=yt(r)),os(!0,e,r,t,1)}function us(e,t){var n=z(e.doc,t),r=H(n);return r!=n&&(t=yt(r)),os(!0,e,n,t,-1)}function ds(e,t){var n=ls(e,t.line),r=z(e.doc,n.line),i=Ne(r,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(n.ch,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return B(n.line,o?0:a,n.sticky)}return n}function fs(e,t,n){if(typeof t==`string`&&(t=cs[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=le}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function ps(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Qo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Qo(t,e.options.extraKeys,n,e)||Qo(t,e.options.keyMap,n,e)}var q=new se;function ms(e,t,n,r){var i=e.state.keySeq;if(i){if($o(t))return`handled`;if(/\'$/.test(t)?e.state.keySeq=null:q.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),hs(e,i+` `+t,n,r))return!0}return hs(e,t,n,r)}function hs(e,t,n,r){var i=ps(e,t,r);return i==`multi`&&(e.state.keySeq=t),i==`handled`&&Wn(e,`keyHandled`,e,t,n),(i==`handled`||i==`multi`)&&(He(n),oi(e)),!!i}function gs(e,t){var n=ts(t,!0);return n?t.shiftKey&&!e.state.keySeq?ms(e,`Shift-`+n,t,function(t){return fs(e,t,!0)})||ms(e,n,t,function(t){if(typeof t==`string`?/^go[A-Z]/.test(t):t.motion)return fs(e,t)}):ms(e,n,t,function(t){return fs(e,t)}):!1}function _s(e,t,n){return ms(e,`'`+n+`'`,t,function(t){return fs(e,t,!0)})}var J=null;function Y(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ee(ie(t)),!Re(t,e))){o&&s<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var i=gs(t,e);f&&(J=i?r:null,!i&&r==88&&!tt&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection(``,null,`cut`)),n&&!y&&!i&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand(`cut`),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&vs(t)}}function vs(e){var t=e.display.lineDiv;te(t,`CodeMirror-crosshair`);function n(e){(e.keyCode==18||!e.altKey)&&(E(t,`CodeMirror-crosshair`),Ie(document,`keyup`,n),Ie(document,`mouseover`,n))}R(document,`keyup`,n),R(document,`mouseover`,n)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),Re(this,e)}function bs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(ar(t.display,e)||Re(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(f&&n==J){J=null,He(e);return}if(!(f&&(!e.which||e.which<10)&&gs(t,e))){var i=String.fromCharCode(r??n);i!=`\b`&&(_s(t,e,i)||t.display.input.onKeyPress(e))}}}var xs=400,Ss=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ss.prototype.compare=function(e,t,n){return this.time+xs>e&&Ct(t,this.pos)==0&&n==this.button};var X,Z;function Cs(e,t){var n=+new Date;return Z&&Z.compare(n,e,t)?(X=Z=null,`triple`):X&&X.compare(n,e,t)?(Z=new Ss(n,e,t),X=null,`double`):(X=new Ss(n,e,t),Z=null,`single`)}function ws(e){var t=this,n=t.display;if(!(Re(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,ar(n,e)){c||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Ns(t,e)){var r=Jr(t,e),i=qe(e),a=r?Cs(r,i):`single`;P(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ts(t,i,r,a,e))&&(i==1?r?Ds(t,r,a,e):Ke(e)==n.scroller&&He(e):i==2?(r&&Ka(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(w?t.display.input.onContextMenu(e):ci(t)))}}}function Ts(e,t,n,r,i){var a=`Click`;return r==`double`?a=`Double`+a:r==`triple`&&(a=`Triple`+a),a=(t==1?`Left`:t==2?`Middle`:`Right`)+a,ms(e,es(a,i),i,function(t){if(typeof t==`string`&&(t=cs[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=le}finally{e.state.suppressEdits=!1}return r})}function Es(e,t,n){var r=e.getOption(`configureMouse`),i=r?r(e,t,n):{};return i.unit??=(b?n.shiftKey&&n.metaKey:n.altKey)?`rectangle`:t==`single`?`char`:t==`double`?`word`:`line`,(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew??=y?n.metaKey:n.ctrlKey,i.moveOnDrag??=!(y?n.altKey:n.ctrlKey),i}function Ds(e,t,n,r){o?setTimeout(F(si,e),0):e.curOp.focus=ee(ie(e));var i=Es(e,n,r),a=e.doc.sel,s;e.options.dragDrop&&Je&&!e.isReadOnly()&&n==`single`&&(s=a.contains(t))>-1&&(Ct((s=a.ranges[s]).from(),t)<0||t.xRel>0)&&(Ct(s.to(),t)>0||t.xRel<0)?Os(e,r,t,i):As(e,r,t,i)}function Os(e,t,n,r){var i=e.display,a=!1,l=Wi(e,function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ci(e)),Ie(i.wrapper.ownerDocument,`mouseup`,l),Ie(i.wrapper.ownerDocument,`mousemove`,u),Ie(i.scroller,`dragstart`,d),Ie(i.scroller,`drop`,l),a||(He(t),r.addNew||Ka(e.doc,n,null,null,r.extend),c&&!p||o&&s==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),u=function(e){a||=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return a=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,R(i.wrapper.ownerDocument,`mouseup`,l),R(i.wrapper.ownerDocument,`mousemove`,u),R(i.scroller,`dragstart`,d),R(i.scroller,`drop`,l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(e,t,n){if(n==`char`)return new K(t,t);if(n==`word`)return e.findWordAt(t);if(n==`line`)return new K(B(t.line,0),kt(e.doc,B(t.line+1,0)));var r=n(e,t);return new K(r.from,r.to)}function As(e,t,n,r){o&&ci(e);var i=e.display,a=e.doc;He(t);var s,c,l=a.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=a.sel.contains(n),s=c>-1?u[c]:new K(n,n)):(s=a.sel.primary(),c=a.sel.primIndex),r.unit==`rectangle`)r.addNew||(s=new K(n,n)),n=Jr(e,t,!0,!0),c=-1;else{var d=ks(e,n,r.unit);s=r.extend?Ga(s,d.anchor,d.head,r.extend):d}r.addNew?c==-1?(c=u.length,Qa(a,_a(e,u.concat([s]),c),{scroll:!1,origin:`*mouse`})):u.length>1&&u[c].empty()&&r.unit==`char`&&!r.extend?(Qa(a,_a(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:`*mouse`}),l=a.sel):Ja(a,c,s,de):(c=0,Qa(a,new ga([s],0),de),l=a.sel);var f=n;function p(t){if(Ct(f,t)!=0){if(f=t,r.unit==`rectangle`){for(var i=[],o=e.options.tabSize,u=oe(z(a,n.line).text,n.ch,o),d=oe(z(a,t.line).text,t.ch,o),p=Math.min(u,d),m=Math.max(u,d),h=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));h<=g;h++){var _=z(a,h).text,v=pe(_,p,o);p==m?i.push(new K(B(h,v),B(h,v))):_.length>v&&i.push(new K(B(h,v),B(h,pe(_,m,o))))}i.length||i.push(new K(n,n)),Qa(a,_a(e,l.ranges.slice(0,c).concat(i),c),{origin:`*mouse`,scroll:!1}),e.scrollIntoView(t)}else{var y=s,b=ks(e,t,r.unit),x=y.anchor,S;Ct(b.anchor,x)>0?(S=b.head,x=Dt(y.from(),b.anchor)):(S=b.anchor,x=Et(y.to(),b.head));var C=l.ranges.slice(0);C[c]=js(e,new K(kt(a,x),S)),Qa(a,_a(e,C,c),de)}}}var m=i.wrapper.getBoundingClientRect(),h=0;function g(t){var n=++h,o=Jr(e,t,!0,r.unit==`rectangle`);if(o){if(Ct(o,f)!=0){e.curOp.focus=ee(ie(e)),p(o);var s=pi(i,a);(o.line>=s.to||o.line<s.from)&&setTimeout(Wi(e,function(){h==n&&g(t)}),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(Wi(e,function(){h==n&&(i.scroller.scrollTop+=c,g(t))}),50)}}}function _(t){e.state.selectingText=!1,h=1/0,t&&(He(t),i.input.focus()),Ie(i.wrapper.ownerDocument,`mousemove`,v),Ie(i.wrapper.ownerDocument,`mouseup`,y),a.history.lastSelOrigin=null}var v=Wi(e,function(e){e.buttons===0||!qe(e)?_(e):g(e)}),y=Wi(e,_);e.state.selectingText=y,R(i.wrapper.ownerDocument,`mousemove`,v),R(i.wrapper.ownerDocument,`mouseup`,y)}function js(e,t){var n=t.anchor,r=t.head,i=z(e.doc,n.line);if(Ct(n,r)==0&&n.sticky==r.sticky)return t;var a=Ne(i);if(!a)return t;var o=je(a,n.ch,n.sticky),s=a[o];if(s.from!=n.ch&&s.to!=n.ch)return t;var c=o+(s.from==n.ch==(s.level!=1)?0:1);if(c==0||c==a.length)return t;var l;if(r.line!=n.line)l=(r.line-n.line)*(e.doc.direction==`ltr`?1:-1)>0;else{var u=je(a,r.ch,r.sticky),d=u-o||(r.ch-n.ch)*(s.level==1?-1:1);l=u==c-1||u==c?d<0:d>0}var f=a[c+(l?-1:0)],p=l==(f.level==1),m=p?f.from:f.to,h=p?`after`:`before`;return n.ch==m&&n.sticky==h?t:new K(new B(n.line,m,h),r)}function Ms(e,t,n,r){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&He(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Be(e,n))return We(t);a-=s.top-o.viewOffset;for(var c=0;c<e.display.gutterSpecs.length;++c){var l=o.gutters.childNodes[c];if(l&&l.getBoundingClientRect().right>=i){var u=bt(e.doc,a),d=e.display.gutterSpecs[c];return Le(e,n,e,u,d.className,t),We(t)}}}function Ns(e,t){return Ms(e,t,`gutterClick`,!0)}function Ps(e,t){ar(e.display,t)||Fs(e,t)||Re(e,t,`contextmenu`)||w||e.display.input.onContextMenu(t)}function Fs(e,t){return Be(e,`gutterContextMenu`)?Ms(e,t,`gutterContextMenu`,!1):!1}function Is(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,``)+e.options.theme.replace(/(^|\s)\s*/g,` cm-s-`),Tr(e)}var Ls={toString:function(){return`CodeMirror.Init`}},Rs={},zs={};function Bs(e){var t=e.optionHandlers;function n(n,r,i,a){e.defaults[n]=r,i&&(t[n]=a?function(e,t,n){n!=Ls&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Ls,n(`value`,``,function(e,t){return e.setValue(t)},!0),n(`mode`,null,function(e,t){e.doc.modeOption=t,wa(e)},!0),n(`indentUnit`,2,wa,!0),n(`indentWithTabs`,!1),n(`smartIndent`,!0),n(`tabSize`,4,function(e){Ta(e),Tr(e),Xr(e)},!0),n(`lineSeparator`,null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var a=e.text.indexOf(t,i);if(a==-1)break;i=a+t.length,n.push(B(r,a))}r++});for(var i=n.length-1;i>=0;i--)ho(e.doc,t,n[i],B(n[i].line,n[i].ch+t.length))}}),n(`specialChars`,/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(e,t,n){e.state.specialChars=RegExp(t.source+(t.test(` `)?``:`| `),`g`),n!=Ls&&e.refresh()}),n(`specialCharPlaceholder`,jn,function(e){return e.refresh()},!0),n(`electricChars`,!0),n(`inputStyle`,v?`contenteditable`:`textarea`,function(){throw Error(`inputStyle can not (yet) be changed in a running editor`)},!0),n(`spellcheck`,!1,function(e,t){return e.getInputField().spellcheck=t},!0),n(`autocorrect`,!1,function(e,t){return e.getInputField().autocorrect=t},!0),n(`autocapitalize`,!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n(`rtlMoveVisually`,!x),n(`wholeLineUpdateBefore`,!0),n(`theme`,`default`,function(e){Is(e),la(e)},!0),n(`keyMap`,`default`,function(e,t,n){var r=ns(t),i=n!=Ls&&ns(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n(`extraKeys`,null),n(`configureMouse`,null),n(`lineWrapping`,!1,Hs,!0),n(`gutters`,[],function(e,t){e.display.gutterSpecs=sa(t,e.options.lineNumbers),la(e)},!0),n(`fixedGutter`,!0,function(e,t){e.display.gutters.style.left=t?Gr(e.display)+`px`:`0`,e.refresh()},!0),n(`coverGutterNextToScrollbar`,!1,function(e){return Ai(e)},!0),n(`scrollbarStyle`,`native`,function(e){Ni(e),Ai(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n(`lineNumbers`,!1,function(e,t){e.display.gutterSpecs=sa(e.options.gutters,t),la(e)},!0),n(`firstLineNumber`,1,la,!0),n(`lineNumberFormatter`,function(e){return e},la,!0),n(`showCursorWhenSelecting`,!1,ni,!0),n(`resetSelectionOnContextMenu`,!0),n(`lineWiseCopyCut`,!0),n(`pasteLinesPerSelection`,!0),n(`selectionsMayTouch`,!1),n(`readOnly`,!1,function(e,t){t==`nocursor`&&(ui(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),n(`screenReaderLabel`,null,function(e,t){t=t===``?null:t,e.display.input.screenReaderLabelChanged(t)}),n(`disableInput`,!1,function(e,t){t||e.display.input.reset()},!0),n(`dragDrop`,!0,Vs),n(`allowDropFileTypes`,null),n(`cursorBlinkRate`,530),n(`cursorScrollMargin`,0),n(`cursorHeight`,1,ni,!0),n(`singleCursorHeightPerLine`,!0,ni,!0),n(`workTime`,100),n(`workDelay`,100),n(`flattenSpans`,!0,Ta,!0),n(`addModeClass`,!1,Ta,!0),n(`pollInterval`,100),n(`undoDepth`,200,function(e,t){return e.doc.history.undoDepth=t}),n(`historyEventDelay`,1250),n(`viewportMargin`,10,function(e){return e.refresh()},!0),n(`maxHighlightLength`,1e4,Ta,!0),n(`moveInputWithCursor`,!0,function(e,t){t||e.display.input.resetPosition()}),n(`tabindex`,null,function(e,t){return e.display.input.getField().tabIndex=t||``}),n(`autofocus`,null),n(`direction`,`ltr`,function(e,t){return e.doc.setDirection(t)},!0),n(`phrases`,null)}function Vs(e,t,n){if(!t!=!(n&&n!=Ls)){var r=e.display.dragFunctions,i=t?R:Ie;i(e.display.scroller,`dragstart`,r.start),i(e.display.scroller,`dragenter`,r.enter),i(e.display.scroller,`dragover`,r.over),i(e.display.scroller,`dragleave`,r.leave),i(e.display.scroller,`drop`,r.drop)}}function Hs(e){e.options.lineWrapping?(te(e.display.wrapper,`CodeMirror-wrap`),e.display.sizer.style.minWidth=``,e.display.sizerWidth=null):(E(e.display.wrapper,`CodeMirror-wrap`),Cn(e)),qr(e),Xr(e),Tr(e),setTimeout(function(){return Ai(e)},100)}function Us(e,t){var n=this;if(!(this instanceof Us))return new Us(e,t);this.options=t=t?I(t):{},I(Rs,t,!1);var r=t.value;typeof r==`string`?r=new Po(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Us.inputStyles[t.inputStyle](this),a=this.display=new ua(e,r,i,t);for(var l in a.wrapper.CodeMirror=this,Is(this),t.lineWrapping&&(this.display.wrapper.className+=` CodeMirror-wrap`),Ni(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new se,keySeq:null,specialChars:null},t.autofocus&&!v&&a.input.focus(),o&&s<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ws(this),Ho(),Fi(this),this.curOp.forceUpdate=!0,ka(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&li(n)},20):ui(this),zs)zs.hasOwnProperty(l)&&zs[l](this,t[l],Ls);oa(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Gs.length;++u)Gs[u](this);Ii(this),c&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering==`optimizelegibility`&&(a.lineDiv.style.textRendering=`auto`)}Us.defaults=Rs,Us.optionHandlers=zs;function Ws(e){var t=e.display;R(t.scroller,`mousedown`,Wi(e,ws)),o&&s<11?R(t.scroller,`dblclick`,Wi(e,function(t){if(!Re(e,t)){var n=Jr(e,t);if(!(!n||Ns(e,t)||ar(e.display,t))){He(t);var r=e.findWordAt(n);Ka(e.doc,r.anchor,r.head)}}})):R(t.scroller,`dblclick`,function(t){return Re(e,t)||He(t)}),R(t.scroller,`contextmenu`,function(t){return Ps(e,t)}),R(t.input.getField(),`contextmenu`,function(n){t.scroller.contains(n.target)||Ps(e,n)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function a(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}R(t.scroller,`touchstart`,function(i){if(!Re(e,i)&&!a(i)&&!Ns(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),R(t.scroller,`touchmove`,function(){t.activeTouch&&(t.activeTouch.moved=!0)}),R(t.scroller,`touchend`,function(n){var r=t.activeTouch;if(r&&!ar(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var a=e.coordsChar(t.activeTouch,`page`),o=!r.prev||c(r,r.prev)?new K(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new K(B(a.line,0),kt(e.doc,B(a.line+1,0)));e.setSelection(o.anchor,o.head),e.focus(),He(n)}i()}),R(t.scroller,`touchcancel`,i),R(t.scroller,`scroll`,function(){t.scroller.clientHeight&&(wi(e,t.scroller.scrollTop),Ei(e,t.scroller.scrollLeft,!0),Le(e,`scroll`,e))}),R(t.scroller,`mousewheel`,function(t){return ha(e,t)}),R(t.scroller,`DOMMouseScroll`,function(t){return ha(e,t)}),R(t.wrapper,`scroll`,function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){Re(e,t)||Ge(t)},over:function(t){Re(e,t)||(Ro(e,t),Ge(t))},start:function(t){return Lo(e,t)},drop:Wi(e,Io),leave:function(t){Re(e,t)||zo(e)}};var l=t.input.getField();R(l,`keyup`,function(t){return ys.call(e,t)}),R(l,`keydown`,Wi(e,Y)),R(l,`keypress`,Wi(e,bs)),R(l,`focus`,function(t){return li(e,t)}),R(l,`blur`,function(t){return ui(e,t)})}var Gs=[];Us.defineInitHook=function(e){return Gs.push(e)};function Ks(e,t,n,r){var i=e.doc,a;n??=`add`,n==`smart`&&(i.mode.indent?a=It(e,t).state:n=`prev`);var o=e.options.tabSize,s=z(i,t),c=oe(s.text,null,o);s.stateAfter&&=null;var l=s.text.match(/^\s*/)[0],u;if(!r&&!/\S/.test(s.text))u=0,n=`not`;else if(n==`smart`&&(u=i.mode.indent(a,s.text.slice(l.length),s.text),u==le||u>150)){if(!r)return;n=`prev`}n==`prev`?u=t>i.first?oe(z(i,t-1).text,null,o):0:n==`add`?u=c+e.options.indentUnit:n==`subtract`?u=c-e.options.indentUnit:typeof n==`number`&&(u=c+n),u=Math.max(0,u);var d=``,f=0;if(e.options.indentWithTabs)for(var p=Math.floor(u/o);p;--p)f+=o,d+=` `;if(f<u&&(d+=he(u-f)),d!=l)return ho(i,d,B(t,0),B(t,l.length),`+input`),s.stateAfter=null,!0;for(var m=0;m<i.sel.ranges.length;m++){var h=i.sel.ranges[m];if(h.head.line==t&&h.head.ch<l.length){var g=B(t,l.length);Ja(i,m,new K(g,g));break}}}var qs=null;function Js(e){qs=e}function Ys(e,t,n,r,i){var a=e.doc;e.display.shift=!1,r||=a.sel;var o=new Date-200,s=i==`paste`||e.state.pasteIncoming>o,c=$e(t),l=null;if(s&&r.ranges.length>1){if(qs&&qs.text.join(`
|
|
41
|
+
`)==t){if(r.ranges.length%qs.text.length==0){l=[];for(var u=0;u<qs.text.length;u++)l.push(a.splitLines(qs.text[u]))}}else c.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(l=_e(c,function(e){return[e]}))}for(var d=e.curOp.updateInput,f=r.ranges.length-1;f>=0;f--){var p=r.ranges[f],m=p.from(),h=p.to();p.empty()&&(n&&n>0?m=B(m.line,m.ch-n):e.state.overwrite&&!s?h=B(h.line,Math.min(z(a,h.line).text.length,h.ch+ge(c).length)):s&&qs&&qs.lineWise&&qs.text.join(`
|
|
42
|
+
`)==c.join(`
|
|
43
|
+
`)&&(m=h=B(m.line,0)));var g={from:m,to:h,text:l?l[f%l.length]:c,origin:i||(s?`paste`:e.state.cutIncoming>o?`cut`:`+input`)};co(e.doc,g),Wn(e,`inputRead`,e,g)}t&&!s&&Zs(e,t),yi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Xs(e,t){var n=e.clipboardData&&e.clipboardData.getData(`Text`);if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Ui(t,function(){return Ys(t,n,0,null,`paste`)}),!0}function Zs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=Ks(e,i.head.line,`smart`);break}}else a.electricInput&&a.electricInput.test(z(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Ks(e,i.head.line,`smart`));o&&Wn(e,`electricInput`,e,i.head.line)}}}function Qs(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:B(i,0),head:B(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function $s(e,t,n,r){e.setAttribute(`autocorrect`,n?`on`:`off`),e.setAttribute(`autocapitalize`,r?`on`:`off`),e.setAttribute(`spellcheck`,!!t)}function ec(){var e=k(`textarea`,null,null,`position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none`),t=k(`div`,[e],null,`overflow: hidden; position: relative; width: 3px; height: 0px;`);return c?e.style.width=`1000px`:e.setAttribute(`wrap`,`off`),g&&(e.style.border=`1px solid black`),t}function tc(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){P(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];(r[e]!=n||e==`mode`)&&(r[e]=n,t.hasOwnProperty(e)&&Wi(this,t[e])(this,n,i),Le(this,`optionChange`,this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?`push`:`unshift`](ns(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Gi(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw Error(`Overlays may not be stateful.`);ve(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Xr(this)}),removeOverlay:Gi(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e==`string`&&r.name==e){t.splice(n,1),this.state.modeGen++,Xr(this);return}}}),indentLine:Gi(function(e,t,n){typeof t!=`string`&&typeof t!=`number`&&(t=t==null?this.options.smartIndent?`smart`:`prev`:t?`add`:`subtract`),xt(this.doc,e)&&Ks(this,e,t,n)}),indentSelection:Gi(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Ks(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&yi(this));else{var a=i.from(),o=i.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-+!o.ch)+1;for(var c=s;c<n;++c)Ks(this,c,e);var l=this.doc.sel.ranges;a.ch==0&&t.length==l.length&&l[r].from().ch>0&&Ja(this.doc,r,new K(a,l[r].to()),ue)}}}),getTokenAt:function(e,t){return Vt(this,e,t)},getLineTokens:function(e,t){return Vt(this,B(e),t,!0)},getTokenTypeAt:function(e){e=kt(this.doc,e);var t=Ft(this,z(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,a;if(i==0)a=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else if(t[o*2+1]<i)n=o+1;else{a=t[o*2+2];break}}var s=a?a.indexOf(`overlay `):-1;return s<0?a:s==0?null:a.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],a=this.getModeAt(e);if(typeof a[t]==`string`)i[a[t]]&&r.push(i[a[t]]);else if(a[t])for(var o=0;o<a[t].length;o++){var s=i[a[t][o]];s&&r.push(s)}else a.helperType&&i[a.helperType]?r.push(i[a.helperType]):i[a.name]&&r.push(i[a.name]);for(var c=0;c<i._global.length;c++){var l=i._global[c];l.pred(a,this)&&L(r,l.val)==-1&&r.push(l.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=Ot(n,e??n.first+n.size-1),It(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=e==null?r.head:typeof e==`object`?kt(this.doc,e):e?r.from():r.to(),jr(this,n,t||`page`)},charCoords:function(e,t){return Ar(this,kt(this.doc,e),t||`page`)},coordsChar:function(e,t){return e=kr(this,e,t||`page`),Pr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=kr(this,{top:e,left:0},t||`page`).top,bt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r=!1,i;if(typeof e==`number`){var a=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>a&&(e=a,r=!0),i=z(this.doc,e)}else i=e;return Or(this,i,{top:0,left:0},t||`page`,n||r).top+(r?this.doc.height-xn(i):0)},defaultTextHeight:function(){return Hr(this.display)},defaultCharWidth:function(){return Ur(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var a=this.display;e=jr(this,kt(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position=`absolute`,t.setAttribute(`cm-ignore-events`,`true`),this.display.input.setUneditable(t),a.sizer.appendChild(t),r==`over`)o=e.top;else if(r==`above`||r==`near`){var c=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);(r==`above`||e.bottom+t.offsetHeight>c)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=c&&(o=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=o+`px`,t.style.left=t.style.right=``,i==`right`?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right=`0px`):(i==`left`?s=0:i==`middle`&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+`px`),n&&gi(this,{left:s,top:o,right:s+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Gi(Y),triggerOnKeyPress:Gi(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Gi(ws),execCommand:function(e){if(cs.hasOwnProperty(e))return cs[e].call(null,this)},triggerElectric:Gi(function(e){Zs(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var a=kt(this.doc,e),o=0;o<t&&(a=nc(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Gi(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?nc(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},fe)}),deleteH:Gi(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection(``,null,`+delete`):rs(this,function(n){var i=nc(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,a=r;t<0&&(i=-1,t=-t);for(var o=kt(this.doc,e),s=0;s<t;++s){var c=jr(this,o,`div`);if(a==null?a=c.left:c.left=a,o=rc(this,c,i,n),o.hitSide)break}return o},moveV:Gi(function(e,t){var n=this,r=this.doc,i=[],a=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(o){if(a)return e<0?o.from():o.to();var s=jr(n,o.head,`div`);o.goalColumn!=null&&(s.left=o.goalColumn),i.push(s.left);var c=rc(n,s,e,t);return t==`page`&&o==r.sel.primary()&&vi(n,Ar(n,c,`div`).top-s.top),c},fe),i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=z(t,e.line).text,r=e.ch,i=e.ch;if(n){var a=this.getHelper(e,`wordChars`);(e.sticky==`before`||i==n.length)&&r?--r:++i;for(var o=n.charAt(r),s=Ce(o,a)?function(e){return Ce(e,a)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ce(e)};r>0&&s(n.charAt(r-1));)--r;for(;i<n.length&&s(n.charAt(i));)++i}return new K(B(e.line,r),B(e.line,i))},toggleOverwrite:function(e){(e==null||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?te(this.display.cursorDiv,`CodeMirror-overwrite`):E(this.display.cursorDiv,`CodeMirror-overwrite`),Le(this,`overwriteToggle`,this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ee(ie(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Gi(function(e,t){bi(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-lr(this)-this.display.barHeight,width:e.scrollWidth-lr(this)-this.display.barWidth,clientHeight:dr(this),clientWidth:ur(this)}},scrollIntoView:Gi(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t??=this.options.cursorScrollMargin):typeof e==`number`?e={from:B(e,0),to:null}:e.from??(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,e.from.line==null?Ci(this,e.from,e.to,e.margin):xi(this,e)}),setSize:Gi(function(e,t){var n=this,r=function(e){return typeof e==`number`||/^\d+$/.test(String(e))?e+`px`:e};e!=null&&(this.display.wrapper.style.width=r(e)),t!=null&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&wr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets){for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Zr(n,i,`widget`);break}}++i}),this.curOp.forceUpdate=!0,Le(this,`refresh`,this)}),operation:function(e){return Ui(this,e)},startOperation:function(){return Fi(this)},endOperation:function(){return Ii(this)},refresh:Gi(function(){var e=this.display.cachedTextHeight;Xr(this),this.curOp.forceUpdate=!0,Tr(this),bi(this,this.doc.scrollLeft,this.doc.scrollTop),ra(this.display),(e==null||Math.abs(e-Hr(this.display))>.5||this.options.lineWrapping)&&qr(this),Le(this,`refresh`,this)}),swapDoc:Gi(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ka(this,e),Tr(this),this.display.input.reset(),bi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Wn(this,`swapDoc`,this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ve(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,a){e.registerHelper(t,r,a),n[t]._global.push({pred:i,val:a})}}function nc(e,t,n,r,i){var a=t,o=n,s=z(e,t.line),c=i&&e.direction==`rtl`?-n:n;function l(){var n=t.line+c;return n<e.first||n>=e.first+e.size?!1:(t=new B(n,t.ch,t.sticky),s=z(e,n))}function u(a){var o;if(r==`codepoint`){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))o=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;o=new B(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else o=i?ss(e.cm,s,t,n):as(s,t,n);if(o==null){if(!a&&l())t=os(i,e.cm,s,t.line,c);else return!1}else t=o;return!0}if(r==`char`||r==`codepoint`)u();else if(r==`column`)u(!0);else if(r==`word`||r==`group`)for(var d=null,f=r==`group`,p=e.cm&&e.cm.getHelper(t,`wordChars`),m=!0;!(n<0&&!u(!m));m=!1){var h=s.text.charAt(t.ch)||`
|
|
44
|
+
`,g=Ce(h,p)?`w`:f&&h==`
|
|
45
|
+
`?`n`:!f||/\s/.test(h)?null:`p`;if(f&&!m&&!g&&(g=`s`),d&&d!=g){n<0&&(n=1,u(),t.sticky=`after`);break}if(g&&(d=g),n>0&&!u(!m))break}var _=io(e,t,a,o,!0);return wt(a,_)&&(_.hitSide=!0),_}function rc(e,t,n,r){var i=e.doc,a=t.left,o;if(r==`page`){var s=Math.min(e.display.wrapper.clientHeight,P(e).innerHeight||i(e).documentElement.clientHeight),c=Math.max(s-.5*Hr(e.display),3);o=(n>0?t.bottom:t.top)+n*c}else r==`line`&&(o=n>0?t.bottom+3:t.top-3);for(var l;l=Pr(e,a,o),l.outside;){if(n<0?o<=0:o>=i.height){l.hitSide=!0;break}o+=n*5}return l}var Q=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new se,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Q.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$s(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-?:line?widget\b/.test(t.className))break}return!1}R(i,`paste`,function(e){!a(e)||Re(r,e)||Xs(e,r)||s<=11&&setTimeout(Wi(r,function(){return t.updateFromDOM()}),20)}),R(i,`compositionstart`,function(e){t.composing={data:e.data,done:!1}}),R(i,`compositionupdate`,function(e){t.composing||={data:e.data,done:!1}}),R(i,`compositionend`,function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),R(i,`touchstart`,function(){return n.forceCompositionEnd()}),R(i,`input`,function(){t.composing||t.readFromDOMSoon()});function o(e){if(a(e)&&!Re(r,e)){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()}),e.type==`cut`&&r.replaceSelection(``,null,`cut`);else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`&&r.operation(function(){r.setSelections(t.ranges,0,ue),r.replaceSelection(``,null,`cut`)})}else return;if(e.clipboardData){e.clipboardData.clearData();var o=qs.text.join(`
|
|
46
|
+
`);if(e.clipboardData.setData(`Text`,o),e.clipboardData.getData(`Text`)==o){e.preventDefault();return}}var s=ec(),c=s.firstChild;$s(c),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),c.value=qs.text.join(`
|
|
47
|
+
`);var l=ee(ae(i));ne(c),setTimeout(function(){r.display.lineSpace.removeChild(s),l.focus(),l==i&&n.showPrimarySelection()},50)}}R(i,`copy`,o),R(i,`cut`,o)},Q.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute(`aria-label`,e):this.div.removeAttribute(`aria-label`)},Q.prototype.prepareSelection=function(){var e=ri(this.cm,!1);return e.focus=ee(ae(this.div))==this.div,e},Q.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Q.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Q.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),a=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||a.line<t.display.viewFrom){e.removeAllRanges();return}var o=cc(t,e.anchorNode,e.anchorOffset),s=cc(t,e.focusNode,e.focusOffset);if(!o||o.bad||!s||s.bad||Ct(Dt(o,s),i)!=0||Ct(Et(o,s),a)!=0){var c=t.display.view,l=i.line>=t.display.viewFrom&&ic(t,i)||{node:c[0].measure.map[2],offset:0},u=a.line<t.display.viewTo&&ic(t,a);if(!u){var d=c[c.length-1].measure,f=d.maps?d.maps[d.maps.length-1]:d.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!l||!u){e.removeAllRanges();return}var p=e.rangeCount&&e.getRangeAt(0),m;try{m=j(l.node,l.offset,u.offset,u.node)}catch{}m&&(!n&&t.state.focused?(e.collapse(l.node,l.offset),m.collapsed||(e.removeAllRanges(),e.addRange(m))):(e.removeAllRanges(),e.addRange(m)),p&&e.anchorNode==null?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}},Q.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Q.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Q.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Q.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return M(this.div,t)},Q.prototype.focus=function(){this.cm.options.readOnly!=`nocursor`&&((!this.selectionInEditor()||ee(ae(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Q.prototype.blur=function(){this.div.blur()},Q.prototype.getField=function(){return this.div},Q.prototype.supportsTouch=function(){return!0},Q.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Ui(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Q.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Q.prototype.pollSelection=function(){if(this.readDOMTimeout==null&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(_&&u&&this.cm.display.gutterSpecs.length&&ac(e.anchorNode)){this.cm.triggerOnKeyDown({type:`keydown`,keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=cc(t,e.anchorNode,e.anchorOffset),r=cc(t,e.focusNode,e.focusOffset);n&&r&&Ui(t,function(){Qa(t.doc,va(n,r),ue),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Q.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=B(r.line-1,z(e.doc,r.line-1).length)),i.ch==z(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=B(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;r.line==t.viewFrom||(a=Yr(e,r.line))==0?(o=yt(t.view[0].line),s=t.view[0].node):(o=yt(t.view[a].line),s=t.view[a-1].node.nextSibling);var c=Yr(e,i.line),l,u;if(c==t.view.length-1?(l=t.viewTo-1,u=t.lineDiv.lastChild):(l=yt(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var d=e.doc.splitLines(sc(e,s,u,o,l)),f=gt(e.doc,B(o,0),B(l,z(e.doc,l).text.length));d.length>1&&f.length>1;)if(ge(d)==ge(f))d.pop(),f.pop(),l--;else if(d[0]==f[0])d.shift(),f.shift(),o++;else break;for(var p=0,m=0,h=d[0],g=f[0],_=Math.min(h.length,g.length);p<_&&h.charCodeAt(p)==g.charCodeAt(p);)++p;for(var v=ge(d),y=ge(f),b=Math.min(v.length-(d.length==1?p:0),y.length-(f.length==1?p:0));m<b&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)++m;if(d.length==1&&f.length==1&&o==r.line)for(;p&&p>r.ch&&v.charCodeAt(v.length-m-1)==y.charCodeAt(y.length-m-1);)p--,m++;d[d.length-1]=v.slice(0,v.length-m).replace(/^\u200b+/,``),d[0]=d[0].slice(p).replace(/\u200b+$/,``);var x=B(o,p),S=B(l,f.length?ge(f).length-m:0);if(d.length>1||d[0]||Ct(x,S))return ho(e.doc,d,x,S,`+input`),!0},Q.prototype.ensurePolled=function(){this.forceCompositionEnd()},Q.prototype.reset=function(){this.forceCompositionEnd()},Q.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Q.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout??=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(e.composing.done)e.composing=null;else return}e.updateFromDOM()},80)},Q.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ui(this.cm,function(){return Xr(e.cm)})},Q.prototype.setUneditable=function(e){e.contentEditable=`false`},Q.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Wi(this.cm,Ys)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Q.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!=`nocursor`)},Q.prototype.onContextMenu=function(){},Q.prototype.resetPosition=function(){},Q.prototype.needsContentAttribute=!0;function ic(e,t){var n=gr(e,t.line);if(!n||n.hidden)return null;var r=z(e.doc,t.line),i=pr(n,r,t.line),a=Ne(r,e.doc.direction),o=`left`;a&&(o=je(a,t.ch)%2?`right`:`left`);var s=yr(i.map,t.ch,o);return s.offset=s.collapse==`right`?s.end:s.start,s}function ac(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function oc(e,t){return t&&(e.bad=!0),e}function sc(e,t,n,r,i){var a=``,o=!1,s=e.doc.lineSeparator(),c=!1;function l(e){return function(t){return t.id==e}}function u(){o&&=(a+=s,c&&(a+=s),c=!1)}function d(e){e&&(u(),a+=e)}function f(t){if(t.nodeType==1){var n=t.getAttribute(`cm-text`);if(n){d(n);return}var a=t.getAttribute(`cm-marker`),p;if(a){var m=e.findMarks(B(r,0),B(i+1,0),l(+a));m.length&&(p=m[0].find(0))&&d(gt(e.doc,p.from,p.to).join(s));return}if(t.getAttribute(`contenteditable`)==`false`)return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0)return;h&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(c=!0),h&&(o=!0)}else t.nodeType==3&&d(t.nodeValue.replace(/\u200b/g,``).replace(/\u00a0/g,` `))}for(;f(t),t!=n;)t=t.nextSibling,c=!1;return a}function cc(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return oc(e.clipPos(B(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==r)return lc(a,t,n)}}function lc(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!M(r,t))return oc(B(yt(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var a=e.rest?ge(e.rest):e.line;return oc(B(yt(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&=o.nodeValue.length);s.parentNode!=r;)s=s.parentNode;var c=e.measure,l=c.maps;function u(t,n,r){for(var i=-1;i<(l?l.length:0);i++)for(var a=i<0?c.map:l[i],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==n){var u=yt(i<0?e.line:e.rest[i]),d=a[o]+r;return(r<0||s!=t)&&(d=a[o+ +!!r]),B(u,d)}}}var d=u(o,s,n);if(d)return oc(d,i);for(var f=s.nextSibling,p=o?o.nodeValue.length-n:0;f;f=f.nextSibling){if(d=u(f,f.firstChild,0),d)return oc(B(d.line,d.ch-p),i);p+=f.textContent.length}for(var m=s.previousSibling,h=n;m;m=m.previousSibling){if(d=u(m,m.firstChild,-1),d)return oc(B(d.line,d.ch+h),i);h+=m.textContent.length}}var uc=function(e){this.cm=e,this.prevInput=``,this.pollingFast=!1,this.polling=new se,this.hasSelection=!1,this.composing=null,this.resetting=!1};uc.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width=`0px`),R(i,`input`,function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),R(i,`paste`,function(e){Re(r,e)||Xs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function a(e){if(!Re(r,e)){if(r.somethingSelected())Js({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var t=Qs(r);Js({lineWise:!0,text:t.text}),e.type==`cut`?r.setSelections(t.ranges,null,ue):(n.prevInput=``,i.value=t.text.join(`
|
|
48
|
+
`),ne(i))}else return;e.type==`cut`&&(r.state.cutIncoming=+new Date)}}R(i,`cut`,a),R(i,`copy`,a),R(e.scroller,`paste`,function(t){if(!(ar(e,t)||Re(r,t))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var a=new Event(`paste`);a.clipboardData=t.clipboardData,i.dispatchEvent(a)}}),R(e.lineSpace,`selectstart`,function(t){ar(e,t)||He(t)}),R(i,`compositionstart`,function(){var e=r.getCursor(`from`);n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor(`to`),{className:`CodeMirror-composing`})}}),R(i,`compositionend`,function(){n.composing&&=(n.poll(),n.composing.range.clear(),null)})},uc.prototype.createField=function(e){this.wrapper=ec(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$s(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},uc.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute(`aria-label`,e):this.textarea.removeAttribute(`aria-label`)},uc.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ri(e);if(e.options.moveInputWithCursor){var i=jr(e,n.sel.primary().head,`div`),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return r},uc.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+`px`,this.wrapper.style.left=e.teLeft+`px`)},uc.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput=``;var n=t.getSelection();this.textarea.value=n,t.state.focused&&ne(this.textarea),o&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value=``,o&&s>=9&&(this.hasSelection=null));this.resetting=!1}},uc.prototype.getField=function(){return this.textarea},uc.prototype.supportsTouch=function(){return!1},uc.prototype.focus=function(){if(this.cm.options.readOnly!=`nocursor`&&(!v||ee(ae(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},uc.prototype.blur=function(){this.textarea.blur()},uc.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},uc.prototype.receivedFocus=function(){this.slowPoll()},uc.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},uc.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){!t.poll()&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},uc.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||et(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r=``),a==8666)return this.reset(),this.cm.execCommand(`undo`)}for(var c=0,l=Math.min(r.length,i.length);c<l&&r.charCodeAt(c)==i.charCodeAt(c);)++c;return Ui(t,function(){Ys(t,i.slice(c),r.length-c,null,e.composing?`*compose`:null),i.length>1e3||i.indexOf(`
|
|
49
|
+
`)>-1?n.value=e.prevInput=``:e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor(`to`),{className:`CodeMirror-composing`}))}),!0},uc.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},uc.prototype.onKeyPress=function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},uc.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Jr(n,e),l=r.scroller.scrollTop;if(!a||f)return;n.options.resetSelectionOnContextMenu&&n.doc.sel.contains(a)==-1&&Wi(n,Qa)(n.doc,va(a),ue);var u=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText=`position: static`,i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
50
|
+
top: `+(e.clientY-p.top-5)+`px; left: `+(e.clientX-p.left-5)+`px;
|
|
51
|
+
z-index: 1000; background: `+(o?`rgba(255, 255, 255, .05)`:`transparent`)+`;
|
|
52
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var m;c&&(m=i.ownerDocument.defaultView.scrollY),r.input.focus(),c&&i.ownerDocument.defaultView.scrollTo(null,m),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=` `),t.contextMenuPending=g,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function h(){if(i.selectionStart!=null){var e=n.somethingSelected(),a=``+(e?i.value:``);i.value=`⇚`,i.value=a,t.prevInput=e?``:``,i.selectionStart=1,i.selectionEnd=a.length,r.selForContextMenu=n.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!o||o&&s<9)&&h();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==``?Wi(n,oo)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(a,200)}}if(o&&s>=9&&h(),w){Ge(e);var _=function(){Ie(window,`mouseup`,_),setTimeout(g,20)};R(window,`mouseup`,_)}else setTimeout(g,50)},uc.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e==`nocursor`,this.textarea.readOnly=!!e},uc.prototype.setUneditable=function(){},uc.prototype.needsContentAttribute=!1;function dc(e,t){if(t=t?I(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ee(ae(e));t.autofocus=n==e||e.getAttribute(`autofocus`)!=null&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(R(e.form,`submit`,r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=o}}catch{}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display=``,e.form&&(Ie(e.form,`submit`,r),!t.leaveSubmitMethodAlone&&typeof e.form.submit==`function`&&(e.form.submit=i))}},e.style.display=`none`;var s=Us(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s}function fc(e){e.off=Ie,e.on=R,e.wheelEventPixels=ma,e.Doc=Po,e.splitLines=$e,e.countColumn=oe,e.findColumn=pe,e.isWordChar=Se,e.Pass=le,e.signal=Le,e.Line=wn,e.changeEnd=ya,e.scrollbarModel=Mi,e.Pos=B,e.cmpPos=Ct,e.modes=it,e.mimeModes=at,e.resolveMode=ct,e.getMode=lt,e.modeExtensions=ut,e.extendMode=dt,e.copyState=ft,e.startState=mt,e.innerMode=pt,e.commands=cs,e.keyMap=Yo,e.keyName=ts,e.isModifierKey=$o,e.lookupKey=Qo,e.normalizeKeyMap=Zo,e.StringStream=ht,e.SharedTextMarker=Oo,e.TextMarker=Eo,e.LineWidget=So,e.e_preventDefault=He,e.e_stopPropagation=Ue,e.e_stop=Ge,e.addClass=te,e.contains=M,e.rmClass=E,e.keyNames=Go}Bs(Us),tc(Us);var pc=`iter insert remove copy getEditor constructor`.split(` `);for(var mc in Po.prototype)Po.prototype.hasOwnProperty(mc)&&L(pc,mc)<0&&(Us.prototype[mc]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Po.prototype[mc]));return Ve(Po),Us.inputStyles={textarea:uc,contenteditable:Q},Us.defineMode=function(e){!Us.defaults.mode&&e!=`null`&&(Us.defaults.mode=e),ot.apply(this,arguments)},Us.defineMIME=st,Us.defineMode(`null`,function(){return{token:function(e){return e.skipToEnd()}}}),Us.defineMIME(`text/plain`,`null`),Us.defineExtension=function(e,t){Us.prototype[e]=t},Us.defineDocExtension=function(e,t){Po.prototype[e]=t},Us.fromTextArea=dc,fc(Us),Us.version=`5.65.21`,Us}))})),cz=l(sz(),1);function lz(e){let t=new Set([`has`,`in`,`no`,`not`,`and`,`or`,`is`,`asc`,`ascN`,`ascA`,`ascAN`,`ascNA`,`desc`,`descN`,`descA`,`descAN`,`descNA`]),n=cz.default.getMode(e,{name:`javascript`,json:!0});return{...n,indent(t,n){return t.indented+e.indentUnit*(t.lastType===`{`&&n.trim()[0]!==`}`||t.lastType===`(`&&n.trim()[0]!==`)`||t.lastType===`[`&&n.trim()[0]!==`]`)},token(e,r){let i=e.peek();if(i===`#`||i===`@`)return n.token(new cz.default.StringStream(`$`,4,e.lineOracle),r),e.pos++,`variable`;let a=n.token(e,r),o=e.string.slice(e.start,e.pos);if(e.string[e.start-1]!==`.`){if(r.isAssertionContext){if((a===`variable`||a===`atom`)&&r.isAssertionParen===0&&o!==`not`)return`type`;o===`(`?r.isAssertionParen++:o===`)`&&(r.isAssertionParen>0&&r.isAssertionParen--,r.isAssertionParen===0&&(r.isAssertionContext=!1))}if(t.has(o))return o===`is`&&(r.isAssertionContext=!0,r.isAssertionParen=0),`keyword`}if(r.isAssertionContext){if(a===`variable`||a===`atom`||a===`def`||o===`function`)return`type`;r.isAssertionParen===0&&(a||/\S/.test(o))&&(r.isAssertionContext=!1)}return a}}}function uz(e,t){let n=typeof t.isDiscoveryViewDefined==`function`?t.isDiscoveryViewDefined:()=>{},r=cz.default.getMode(e,{name:`javascript`,json:!0});return{...r,indent(t,n){return t.indented+e.indentUnit*(t.lastType===`{`&&n.trim()[0]!==`}`||t.lastType===`(`&&n.trim()[0]!==`)`||t.lastType===`[`&&n.trim()[0]!==`]`)},token:function(e,t){if(t.suspendTokens){let{pos:n,token:r}=t.suspendTokens.shift();return e.pos=n,t.suspendTokens.length===0&&(t.suspendTokens=null),r}let i=e.pos,a=r.token(e,t);if(a===`string`){let r=e.pos,[,o]=e.string.slice(i+1,r-1).match(/^(.+?)([:{]|$)/)||[];n(o)&&(e.pos=i+1,t.suspendTokens=[{pos:i+1+o.length,token:`string discovery-view-name`},{pos:r,token:a}])}return a}}}o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(sz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`javascript`,function(t,n){var r=t.indentUnit,i=n.statementIndent,a=n.jsonld,o=n.json||a,s=n.trackScope!==!1,c=n.typescript,l=n.wordCharacters||/[\w$\xa1-\uffff]/,u=function(){function e(e){return{type:e,style:`keyword`}}var t=e(`keyword a`),n=e(`keyword b`),r=e(`keyword c`),i=e(`keyword d`),a=e(`operator`),o={type:`atom`,style:`atom`};return{if:e(`if`),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e(`new`),delete:r,void:r,throw:r,debugger:e(`debugger`),var:e(`var`),const:e(`var`),let:e(`var`),function:e(`function`),catch:e(`catch`),for:e(`for`),switch:e(`switch`),case:e(`case`),default:e(`default`),in:a,typeof:a,instanceof:a,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e(`this`),class:e(`class`),super:e(`atom`),yield:r,export:e(`export`),import:e(`import`),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,f=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e){for(var t=!1,n,r=!1;(n=e.next())!=null;){if(!t){if(n==`/`&&!r)return;n==`[`?r=!0:r&&n==`]`&&(r=!1)}t=!t&&n==`\\`}}var m,h;function g(e,t,n){return m=e,h=n,t}function _(e,t){var n=e.next();if(n==`"`||n==`'`)return t.tokenize=v(n),t.tokenize(e,t);if(n==`.`&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g(`number`,`number`);if(n==`.`&&e.match(`..`))return g(`spread`,`meta`);if(/[\[\]{}\(\),;\:\.]/.test(n))return g(n);if(n==`=`&&e.eat(`>`))return g(`=>`,`operator`);if(n==`0`&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g(`number`,`number`);if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g(`number`,`number`);if(n==`/`)return e.eat(`*`)?(t.tokenize=y,y(e,t)):e.eat(`/`)?(e.skipToEnd(),g(`comment`,`comment`)):vt(e,t,1)?(p(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g(`regexp`,`string-2`)):(e.eat(`=`),g(`operator`,`operator`,e.current()));if(n=="`")return t.tokenize=b,b(e,t);if(n==`#`&&e.peek()==`!`)return e.skipToEnd(),g(`meta`,`meta`);if(n==`#`&&e.eatWhile(l))return g(`variable`,`property`);if(n==`<`&&e.match(`!--`)||n==`-`&&e.match(`->`)&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g(`comment`,`comment`);if(d.test(n))return(n!=`>`||!t.lexical||t.lexical.type!=`>`)&&(e.eat(`=`)?(n==`!`||n==`=`)&&e.eat(`=`):/[<>*+\-|&?]/.test(n)&&(e.eat(n),n==`>`&&e.eat(n))),n==`?`&&e.eat(`.`)?g(`.`):g(`operator`,`operator`,e.current());if(l.test(n)){e.eatWhile(l);var r=e.current();if(t.lastType!=`.`){if(u.propertyIsEnumerable(r)){var i=u[r];return g(i.type,i.style,r)}if(r==`async`&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g(`async`,`keyword`,r)}return g(`variable`,`variable`,r)}}function v(e){return function(t,n){var r=!1,i;if(a&&t.peek()==`@`&&t.match(f))return n.tokenize=_,g(`jsonld-keyword`,`meta`);for(;(i=t.next())!=null&&(i!=e||r);)r=!r&&i==`\\`;return r||(n.tokenize=_),g(`string`,`string`)}}function y(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=_;break}n=r==`*`}return g(`comment`,`comment`)}function b(e,t){for(var n=!1,r;(r=e.next())!=null;){if(!n&&(r=="`"||r==`$`&&e.eat(`{`))){t.tokenize=_;break}n=!n&&r==`\\`}return g(`quasi`,`string-2`,e.current())}var x=`([{}])`;function S(e,t){t.fatArrowAt&&=null;var n=e.string.indexOf(`=>`,e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,a=!1,o=n-1;o>=0;--o){var s=e.string.charAt(o),u=x.indexOf(s);if(u>=0&&u<3){if(!i){++o;break}if(--i==0){s==`(`&&(a=!0);break}}else if(u>=3&&u<6)++i;else if(l.test(s))a=!0;else if(/["'\/`]/.test(s))for(;;--o){if(o==0)return;if(e.string.charAt(o-1)==s&&e.string.charAt(o-2)!=`\\`){o--;break}}else if(a&&!i){++o;break}}a&&!i&&(t.fatArrowAt=o)}}var C={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,a){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=a,r!=null&&(this.align=r)}function T(e,t){if(!s)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function E(e,t,n,r,i){var a=e.cc;for(D.state=e,D.stream=i,D.marked=null,D.cc=a,D.style=t,e.lexical.hasOwnProperty(`align`)||(e.lexical.align=!0);;)if((a.length?a.pop():o?L:oe)(n,r)){for(;a.length&&a[a.length-1].lex;)a.pop()();return D.marked?D.marked:n==`variable`&&T(e,r)?`variable-2`:t}}var D={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)D.cc.push(arguments[e])}function k(){return O.apply(null,arguments),!0}function A(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function j(e){var t=D.state;if(D.marked=`def`,s){if(t.context){if(t.lexical.info==`var`&&t.context&&t.context.block){var r=M(e,t.context);if(r!=null){t.context=r;return}}else if(!A(e,t.localVars)){t.localVars=new N(e,t.localVars);return}}n.globalVars&&!A(e,t.globalVars)&&(t.globalVars=new N(e,t.globalVars))}}function M(e,t){if(!t)return null;if(t.block){var n=M(e,t.prev);return n?n==t.prev?t:new te(n,t.vars,!0):null}return A(e,t.vars)?t:new te(t.prev,new N(e,t.vars),!1)}function ee(e){return e==`public`||e==`private`||e==`protected`||e==`abstract`||e==`readonly`}function te(e,t,n){this.prev=e,this.vars=t,this.block=n}function N(e,t){this.name=e,this.next=t}var ne=new N(`this`,new N(`arguments`,null));function re(){D.state.context=new te(D.state.context,D.state.localVars,!1),D.state.localVars=ne}function ie(){D.state.context=new te(D.state.context,D.state.localVars,!0),D.state.localVars=null}re.lex=ie.lex=!0;function ae(){D.state.localVars=D.state.context.vars,D.state.context=D.state.context.prev}ae.lex=!0;function P(e,t){var n=function(){var n=D.state,r=n.indented;if(n.lexical.type==`stat`)r=n.lexical.indented;else for(var i=n.lexical;i&&i.type==`)`&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,D.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function F(){var e=D.state;e.lexical.prev&&(e.lexical.type==`)`&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}F.lex=!0;function I(e){function t(n){return n==e?k():e==`;`||n==`}`||n==`)`||n==`]`?O():k(t)}return t}function oe(e,t){return e==`var`?k(P(`vardef`,t),Ue,I(`;`),F):e==`keyword a`?k(P(`form`),le,oe,F):e==`keyword b`?k(P(`form`),oe,F):e==`keyword d`?D.stream.match(/^\s*$/,!1)?k():k(P(`stat`),de,I(`;`),F):e==`debugger`?k(I(`;`)):e==`{`?k(P(`}`),ie,Oe,F,ae):e==`;`?k():e==`if`?(D.state.lexical.info==`else`&&D.state.cc[D.state.cc.length-1]==F&&D.state.cc.pop()(),k(P(`form`),le,oe,F,Ye)):e==`function`?k($e):e==`for`?k(P(`form`),ie,Xe,oe,ae,F):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(P(`form`,e==`class`?e:t),it,F)):e==`variable`?c&&t==`declare`?(D.marked=`keyword`,k(oe)):c&&(t==`module`||t==`enum`||t==`type`)&&D.stream.match(/^\s*\w/,!1)?(D.marked=`keyword`,t==`enum`?k(z):t==`type`?k(tt,I(`operator`),Ne,I(`;`)):k(P(`form`),We,I(`{`),P(`}`),Oe,F,F)):c&&t==`namespace`?(D.marked=`keyword`,k(P(`form`),L,oe,F)):c&&t==`abstract`?(D.marked=`keyword`,k(oe)):k(P(`stat`),xe):e==`switch`?k(P(`form`),le,I(`{`),P(`}`,`switch`),ie,Oe,F,F,ae):e==`case`?k(L,I(`:`)):e=="default"?k(I(`:`)):e==`catch`?k(P(`form`),re,se,oe,F,ae):e==`export`?k(P(`stat`),ct,F):e==`import`?k(P(`stat`),ut,F):e==`async`?k(oe):t==`@`?k(L,oe):O(P(`stat`),L,I(`;`),F)}function se(e){if(e==`(`)return k(nt,I(`)`))}function L(e,t){return ue(e,t,!1)}function ce(e,t){return ue(e,t,!0)}function le(e){return e==`(`?k(P(`)`),de,I(`)`),F):O()}function ue(e,t,n){if(D.state.fatArrowAt==D.stream.start){var r=n?_e:ge;if(e==`(`)return k(re,P(`)`),Ee(nt,`)`),F,I(`=>`),r,ae);if(e==`variable`)return O(re,We,I(`=>`),r,ae)}var i=n?pe:fe;return C.hasOwnProperty(e)?k(i):e==`function`?k($e,i):e==`class`||c&&t==`interface`?(D.marked=`keyword`,k(P(`form`),rt,F)):e==`keyword c`||e==`async`?k(n?ce:L):e==`(`?k(P(`)`),de,I(`)`),F,i):e==`operator`||e==`spread`?k(n?ce:L):e==`[`?k(P(`]`),ht,F,i):e==`{`?De(Ce,`}`,null,i):e==`quasi`?O(me,i):e==`new`?k(ve(n)):k()}function de(e){return e.match(/[;\}\)\],]/)?O():O(L)}function fe(e,t){return e==`,`?k(de):pe(e,t,!1)}function pe(e,t,n){var r=n==0?fe:pe,i=n==0?L:ce;if(e==`=>`)return k(re,n?_e:ge,ae);if(e==`operator`)return/\+\+|--/.test(t)||c&&t==`!`?k(r):c&&t==`<`&&D.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?k(P(`>`),Ee(Ne,`>`),F,r):t==`?`?k(L,I(`:`),i):k(i);if(e==`quasi`)return O(me,r);if(e!=`;`){if(e==`(`)return De(ce,`)`,`call`,r);if(e==`.`)return k(Se,r);if(e==`[`)return k(P(`]`),de,I(`]`),F,r);if(c&&t==`as`)return D.marked=`keyword`,k(Ne,r);if(e==`regexp`)return D.state.lastType=D.marked=`operator`,D.stream.backUp(D.stream.pos-D.stream.start-1),k(i)}}function me(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(de,he):k(me):O()}function he(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(me)}function ge(e){return S(D.stream,D.state),O(e==`{`?oe:L)}function _e(e){return S(D.stream,D.state),O(e==`{`?oe:ce)}function ve(e){return function(t){return t==`.`?k(e?be:ye):t==`variable`&&c?k(Be,e?pe:fe):O(e?ce:L)}}function ye(e,t){if(t==`target`)return D.marked=`keyword`,k(fe)}function be(e,t){if(t==`target`)return D.marked=`keyword`,k(pe)}function xe(e){return e==`:`?k(F,oe):O(fe,I(`;`),F)}function Se(e){if(e==`variable`)return D.marked=`property`,k()}function Ce(e,t){if(e==`async`)return D.marked=`property`,k(Ce);if(e==`variable`||D.style==`keyword`){if(D.marked=`property`,t==`get`||t==`set`)return k(we);var n;return c&&D.state.fatArrowAt==D.stream.start&&(n=D.stream.match(/^\s*:\s*/,!1))&&(D.state.fatArrowAt=D.stream.pos+n[0].length),k(Te)}if(e==`number`||e==`string`)return D.marked=a?`property`:D.style+` property`,k(Te);if(e==`jsonld-keyword`)return k(Te);if(c&&ee(t))return D.marked=`keyword`,k(Ce);if(e==`[`)return k(L,ke,I(`]`),Te);if(e==`spread`)return k(ce,Te);if(t==`*`)return D.marked=`keyword`,k(Ce);if(e==`:`)return O(Te)}function we(e){return e==`variable`?(D.marked=`property`,k($e)):O(Te)}function Te(e){if(e==`:`)return k(ce);if(e==`(`)return O($e)}function Ee(e,t,n){function r(i,a){if(n?n.indexOf(i)>-1:i==`,`){var o=D.state.lexical;return o.info==`call`&&(o.pos=(o.pos||0)+1),k(function(n,r){return n==t||r==t?O():O(e)},r)}return i==t||a==t?k():n&&n.indexOf(`;`)>-1?O(e):k(I(t))}return function(n,i){return n==t||i==t?k():O(e,r)}}function De(e,t,n){for(var r=3;r<arguments.length;r++)D.cc.push(arguments[r]);return k(P(t,n),Ee(e,t),F)}function Oe(e){return e==`}`?k():O(oe,Oe)}function ke(e,t){if(c){if(e==`:`)return k(Ne);if(t==`?`)return k(ke)}}function Ae(e,t){if(c&&(e==`:`||t==`in`))return k(Ne)}function je(e){if(c&&e==`:`)return D.stream.match(/^\s*\w+\s+is\b/,!1)?k(L,Me,Ne):k(Ne)}function Me(e,t){if(t==`is`)return D.marked=`keyword`,k()}function Ne(e,t){if(t==`keyof`||t==`typeof`||t==`infer`||t==`readonly`)return D.marked=`keyword`,k(t==`typeof`?ce:Ne);if(e==`variable`||t==`void`)return D.marked=`type`,k(ze);if(t==`|`||t==`&`)return k(Ne);if(e==`string`||e==`number`||e==`atom`)return k(ze);if(e==`[`)return k(P(`]`),Ee(Ne,`]`,`,`),F,ze);if(e==`{`)return k(P(`}`),R,F,ze);if(e==`(`)return k(Ee(Re,`)`),Pe,ze);if(e==`<`)return k(Ee(Ne,`>`),Ne);if(e==`quasi`)return O(Ie,ze)}function Pe(e){if(e==`=>`)return k(Ne)}function R(e){return e.match(/[\}\)\]]/)?k():e==`,`||e==`;`?k(R):O(Fe,R)}function Fe(e,t){if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(Fe);if(t==`?`||e==`number`||e==`string`)return k(Fe);if(e==`:`)return k(Ne);if(e==`[`)return k(I(`variable`),Ae,I(`]`),Fe);if(e==`(`)return O(et,Fe);if(!e.match(/[;\}\)\],]/))return k()}function Ie(e,t){return e==`quasi`?t.slice(t.length-2)=="${"?k(Ne,Le):k(Ie):O()}function Le(e){if(e==`}`)return D.marked=`string-2`,D.state.tokenize=b,k(Ie)}function Re(e,t){return e==`variable`&&D.stream.match(/^\s*[?:]/,!1)||t==`?`?k(Re):e==`:`?k(Ne):e==`spread`?k(Re):O(Ne)}function ze(e,t){if(t==`<`)return k(P(`>`),Ee(Ne,`>`),F,ze);if(t==`|`||e==`.`||t==`&`)return k(Ne);if(e==`[`)return k(Ne,I(`]`),ze);if(t==`extends`||t==`implements`)return D.marked=`keyword`,k(Ne);if(t==`?`)return k(Ne,I(`:`),Ne)}function Be(e,t){if(t==`<`)return k(P(`>`),Ee(Ne,`>`),F,ze)}function Ve(){return O(Ne,He)}function He(e,t){if(t==`=`)return k(Ne)}function Ue(e,t){return t==`enum`?(D.marked=`keyword`,k(z)):O(We,ke,qe,Je)}function We(e,t){if(c&&ee(t))return D.marked=`keyword`,k(We);if(e==`variable`)return j(t),k();if(e==`spread`)return k(We);if(e==`[`)return De(Ke,`]`);if(e==`{`)return De(Ge,`}`)}function Ge(e,t){return e==`variable`&&!D.stream.match(/^\s*:/,!1)?(j(t),k(qe)):(e==`variable`&&(D.marked=`property`),e==`spread`?k(We):e==`}`?O():e==`[`?k(L,I(`]`),I(`:`),Ge):k(I(`:`),We,qe))}function Ke(){return O(We,qe)}function qe(e,t){if(t==`=`)return k(ce)}function Je(e){if(e==`,`)return k(Ue)}function Ye(e,t){if(e==`keyword b`&&t==`else`)return k(P(`form`,`else`),oe,F)}function Xe(e,t){if(t==`await`)return k(Xe);if(e==`(`)return k(P(`)`),Ze,F)}function Ze(e){return e==`var`?k(Ue,Qe):e==`variable`?k(Qe):O(Qe)}function Qe(e,t){return e==`)`?k():e==`;`?k(Qe):t==`in`||t==`of`?(D.marked=`keyword`,k(L,Qe)):O(L,Qe)}function $e(e,t){if(t==`*`)return D.marked=`keyword`,k($e);if(e==`variable`)return j(t),k($e);if(e==`(`)return k(re,P(`)`),Ee(nt,`)`),F,je,oe,ae);if(c&&t==`<`)return k(P(`>`),Ee(Ve,`>`),F,$e)}function et(e,t){if(t==`*`)return D.marked=`keyword`,k(et);if(e==`variable`)return j(t),k(et);if(e==`(`)return k(re,P(`)`),Ee(nt,`)`),F,je,ae);if(c&&t==`<`)return k(P(`>`),Ee(Ve,`>`),F,et)}function tt(e,t){if(e==`keyword`||e==`variable`)return D.marked=`type`,k(tt);if(t==`<`)return k(P(`>`),Ee(Ve,`>`),F)}function nt(e,t){return t==`@`&&k(L,nt),e==`spread`?k(nt):c&&ee(t)?(D.marked=`keyword`,k(nt)):c&&e==`this`?k(ke,qe):O(We,ke,qe)}function rt(e,t){return e==`variable`?it(e,t):at(e,t)}function it(e,t){if(e==`variable`)return j(t),k(at)}function at(e,t){if(t==`<`)return k(P(`>`),Ee(Ve,`>`),F,at);if(t==`extends`||t==`implements`||c&&e==`,`)return t==`implements`&&(D.marked=`keyword`),k(c?Ne:L,at);if(e==`{`)return k(P(`}`),ot,F)}function ot(e,t){if(e==`async`||e==`variable`&&(t==`static`||t==`get`||t==`set`||c&&ee(t))&&D.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return D.marked=`keyword`,k(ot);if(e==`variable`||D.style==`keyword`)return D.marked=`property`,k(st,ot);if(e==`number`||e==`string`)return k(st,ot);if(e==`[`)return k(L,ke,I(`]`),st,ot);if(t==`*`)return D.marked=`keyword`,k(ot);if(c&&e==`(`)return O(et,ot);if(e==`;`||e==`,`)return k(ot);if(e==`}`)return k();if(t==`@`)return k(L,ot)}function st(e,t){if(t==`!`||t==`?`)return k(st);if(e==`:`)return k(Ne,qe);if(t==`=`)return k(ce);var n=D.state.lexical.prev;return O(n&&n.info==`interface`?et:$e)}function ct(e,t){return t==`*`?(D.marked=`keyword`,k(mt,I(`;`))):t=="default"?(D.marked=`keyword`,k(L,I(`;`))):e==`{`?k(Ee(lt,`}`),mt,I(`;`)):O(oe)}function lt(e,t){if(t==`as`)return D.marked=`keyword`,k(I(`variable`));if(e==`variable`)return O(ce,lt)}function ut(e){return e==`string`?k():e==`(`?O(L):e==`.`?O(fe):O(dt,ft,mt)}function dt(e,t){return e==`{`?De(dt,`}`):(e==`variable`&&j(t),t==`*`&&(D.marked=`keyword`),k(pt))}function ft(e){if(e==`,`)return k(dt,ft)}function pt(e,t){if(t==`as`)return D.marked=`keyword`,k(dt)}function mt(e,t){if(t==`from`)return D.marked=`keyword`,k(L)}function ht(e){return e==`]`?k():O(Ee(ce,`]`))}function z(){return O(P(`form`),We,I(`{`),P(`}`),Ee(gt,`}`),F,F)}function gt(){return O(We,qe)}function _t(e,t){return e.lastType==`operator`||e.lastType==`,`||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function vt(e,t,n){return t.tokenize==_&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType==`quasi`&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return{startState:function(e){var t={tokenize:_,lastType:`sof`,cc:[],lexical:new w((e||0)-r,0,`block`,!1),localVars:n.localVars,context:n.localVars&&new te(null,null,!1),indented:e||0};return n.globalVars&&typeof n.globalVars==`object`&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty(`align`)||(t.lexical.align=!1),t.indented=e.indentation(),S(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return m==`comment`?n:(t.lastType=m==`operator`&&(h==`++`||h==`--`)?`incdec`:m,E(t,n,m,h,e))},indent:function(t,a){if(t.tokenize==y||t.tokenize==b)return e.Pass;if(t.tokenize!=_)return 0;var o=a&&a.charAt(0),s=t.lexical,c;if(!/^\s*else\b/.test(a))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==F)s=s.prev;else if(u!=Ye&&u!=ae)break}for(;(s.type==`stat`||s.type==`form`)&&(o==`}`||(c=t.cc[t.cc.length-1])&&(c==fe||c==pe)&&!/^[,\.=+\-*:?[\(]/.test(a));)s=s.prev;i&&s.type==`)`&&s.prev.type==`stat`&&(s=s.prev);var d=s.type,f=o==d;return d==`vardef`?s.indented+(t.lastType==`operator`||t.lastType==`,`?s.info.length+1:0):d==`form`&&o==`{`?s.indented:d==`form`?s.indented+r:d==`stat`?s.indented+(_t(t,a)?i||r:0):s.info==`switch`&&!f&&n.doubleIndentSwitch!=0?s.indented+(/^(?:case|default)\b/.test(a)?r:2*r):s.align?s.column+ +!f:s.indented+(f?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:`/*`,blockCommentEnd:o?null:`*/`,blockCommentContinue:o?null:` * `,lineComment:o?null:`//`,fold:`brace`,closeBrackets:`()[]{}''""\`\``,helperType:o?`json`:`javascript`,jsonldMode:a,jsonMode:o,expressionAllowed:vt,skipExpression:function(t){E(t,`atom`,`atom`,`true`,new e.StringStream(``,2,null))}}}),e.registerHelper(`wordChars`,`javascript`,/[\w$]/),e.defineMIME(`text/javascript`,`javascript`),e.defineMIME(`text/ecmascript`,`javascript`),e.defineMIME(`application/javascript`,`javascript`),e.defineMIME(`application/x-javascript`,`javascript`),e.defineMIME(`application/ecmascript`,`javascript`),e.defineMIME(`application/json`,{name:`javascript`,json:!0}),e.defineMIME(`application/x-json`,{name:`javascript`,json:!0}),e.defineMIME(`application/manifest+json`,{name:`javascript`,json:!0}),e.defineMIME(`application/ld+json`,{name:`javascript`,jsonld:!0}),e.defineMIME(`text/typescript`,{name:`javascript`,typescript:!0}),e.defineMIME(`application/typescript`,{name:`javascript`,typescript:!0})})}))();var{documentElement:dz,compatMode:fz}=document,pz=fz===`CSS1Compat`;function mz(e){let t=e.offsetParent;for(;t!==null&&t!==dz&&getComputedStyle(t).position===`static`;)t=t.offsetParent;return t||dz}function hz(e){let t=e.parentNode;for(;t!==null&&t!==dz&&getComputedStyle(t).overflow===`visible`;)t=t.parentNode;return t||dz}function gz(e=null){let t=0,n=0;if(typeof e?.getBoundingClientRect==`function`){let r=e.getBoundingClientRect();t=-r.top,n=-r.left}else if(pz)t=window.pageYOffset||dz.scrollTop,n=window.pageXOffset||dz.scrollLeft;else{let{body:r}=document;e!==r&&(t=r.scrollTop-r.clientTop,n=r.scrollLeft-r.clientLeft)}return{left:n,top:t}}function _z(e,t=null){let n=gz(t),r=0,i=0,a=0,o=0;return e instanceof Element&&typeof e?.getBoundingClientRect==`function`&&({top:r,left:i,right:a,bottom:o}=e.getBoundingClientRect()),{top:r+n.top,left:i+n.left,right:a+n.left,bottom:o+n.top,width:a-i,height:o-r}}function vz(e,t=null){let{top:n,left:r}=e===(pz?dz:document.body)&&!t?gz():_z(e,t),i=0,a=0;return!e||e instanceof Window?(i=window.innerWidth||0,a=window.innerHeight||0):(n+=e.clientTop,r+=e.clientLeft,i=e.clientWidth,a=e.clientHeight),{top:n,left:r,right:r+i,bottom:n+a,width:i,height:a}}var yz=`discovery-view-editor-hints-popup`,bz=`discovery-view-editor-hint`,xz=`active`,Sz=window.requestAnimationFrame||(e=>setTimeout(e,1e3/60)),Cz=window.cancelAnimationFrame||clearTimeout;cz.default.commands.autocomplete=cz.default.showHint,cz.default.defineOption(`showHintOptions`,null),cz.default.defineExtension(`showHint`,function(e){e={closeOnUnfocus:!0,container:null,...this.options.showHintOptions,...e},this.state.completionActive&&this.state.completionActive.close(),!(this.listSelections().length>1)&&(this.somethingSelected()||typeof e.hint==`function`&&(this.state.completionActive=new wz(this,e),this.state.completionActive.update(!0),cz.default.signal(this,`startCompletion`,this)))});var wz=class{constructor(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor(`start`),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,e.on(`cursorActivity`,this.activityFunc=()=>this.cursorActivity()),t.closeOnUnfocus){let t;this.onFocus=()=>clearTimeout(t),this.onBlur=()=>t=setTimeout(()=>this.close(),100),e.on(`focus`,this.onFocus),e.on(`blur`,this.onBlur)}}close(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.cm.off(`cursorActivity`,this.activityFunc),this.options.closeOnUnfocus&&(this.cm.off(`blur`,this.onBlur),this.cm.off(`focus`,this.onFocus)),this.widget&&(this.data&&cz.default.signal(this.data,`close`),this.widget.close()),cz.default.signal(this.cm,`endCompletion`,this.cm))}active(){return this.cm.state.completionActive===this}pick(e,t){let n=e.list[t];this.cm.state.completionEnabled=!1,n.hint?n.hint(this.cm,e,n):this.cm.replaceRange(Tz(n),n.from||e.from,n.to||e.to,`complete`),cz.default.signal(e,`pick`,n),this.close()}cursorActivity(){this.debounce&&=(Cz(this.debounce),0);let e=this.cm.getCursor(),t=this.cm.getLine(e.line);e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()?this.close():(this.debounce=Sz(()=>this.update()),this.widget&&this.widget.disable())}update(e){if(this.tick===null)return;let t=++this.tick;Promise.resolve(this.options.hint(this.cm,this.options)).then(n=>{this.tick==t&&this.finishUpdate(n,e)})}finishUpdate(e){this.data&&cz.default.signal(this.data,`update`);let t=this.widget&&this.widget.picked;this.widget&&this.widget.close(),this.data=e,e&&e.list.length&&(t&&e.list.length==1?this.pick(e,0):(this.widget=new Dz(this,e),cz.default.signal(e,`shown`)))}};function Tz(e){return typeof e==`string`?e:e.text}function Ez(e,t){for(;t&&t.parentNode!==e;)t=t.parentNode;return t}var Dz=class{constructor(e,t){let n=e.cm,r=this.hintsEl=document.createElement(`ul`),i=[yz,e.cm.options.theme].filter(Boolean),a=e.options.container||document.body;this.rootEls=new Set([a.getRootNode()]),this.completion=e,this.data=t,this.picked=!1,this.selectedHint=t.selectedHint||0,r.style.visibility=`hidden`,r.classList.add(...i),a.appendChild(r),this.items=t.list.map((e,n)=>{let i=r.appendChild(document.createElement(`li`));return i.className=bz,n===this.selectedHint&&i.classList.add(xz),e.render?e.render(i,t,e):i.appendChild(document.createTextNode(e.displayText||Tz(e))),i}),n.addKeyMap(this.keyMap={Up:()=>this.changeActive(this.selectedHint-1),Down:()=>this.changeActive(this.selectedHint+1),Enter:()=>this.pick(),Tab:()=>this.pick(),Esc:()=>{n.state.completionEnabled=!1,e.close()}}),this.updatePosSize(),this.onScroll=()=>this.updatePosSize();for(let e of this.rootEls)e.addEventListener(`scroll`,this.onScroll,$R);cz.default.on(r,`mousedown`,e=>{let t=Ez(r,e.target),i=this.items.indexOf(t);i!==-1&&(this.close(),this.selectedHint=i,this.pick(),setTimeout(()=>n.focus(),1))}),cz.default.signal(t,`select`,t.list[this.selectedHint],this.items[this.selectedHint])}close(){if(this.completion.widget===this){this.completion.widget=null,this.completion.cm.removeKeyMap(this.keyMap),this.hintsEl.remove();for(let e of this.rootEls)e.removeEventListener(`scroll`,this.onScroll,$R)}}disable(){this.completion.cm.removeKeyMap(this.keyMap),this.keyMap={Enter:()=>this.picked=!0},this.completion.cm.addKeyMap(this.keyMap)}pick(){this.completion.pick(this.data,this.selectedHint)}changeActive(e,t){e>=this.items.length?e=t?this.items.length-1:0:e<0&&(e=t?0:this.items.length-1);let n=this.items[this.selectedHint],r=this.items[this.selectedHint=e];r!==n&&(n&&n.classList.remove(xz),r.classList.add(xz),r.offsetTop<this.hintsEl.scrollTop?this.hintsEl.scrollTop=r.offsetTop-3:r.offsetTop+r.offsetHeight>this.hintsEl.scrollTop+this.hintsEl.clientHeight&&(this.hintsEl.scrollTop=r.offsetTop+r.offsetHeight-this.hintsEl.clientHeight+3),cz.default.signal(this.data,`select`,this.data.list[this.selectedHint],r))}getCursorCoords(){let{completion:e,hintsEl:t}=this,n=e.cm,r=mz(t),i=n.cursorCoords(null,`local`),a=_z(n.display.wrapper,r);return{top:a.top+i.top+5,left:a.left+i.left+9,bottom:a.top+i.bottom+5,right:a.left+i.right+9}}updatePosSize(){let{hintsEl:e}=this,t=this.getCursorCoords(),{clientWidth:n,clientHeight:r}=hz(e);e.style.left=`0px`,e.style.top=`0px`;let{width:i,height:a}=e.getBoundingClientRect(),o=r-t.bottom,s=t.top;if(o<a&&s>o){let n=Math.min(a,s-6-1);e.style.top=`${t.top-1-n-6}px`,e.style.maxHeight=`${n}px`}else e.style.top=`${t.bottom+1}px`,e.style.maxHeight=`${o-1-6}px`;let c=n-t.right,l=t.left;c<i&&l>c?(e.style.left=`${t.left+1-Math.min(i,l-6)}px`,e.style.maxWidth=`${l-6}px`):(e.style.left=`${t.right}px`,e.style.maxWidth=`${c-6}px`),e.style.visibility=`visible`}};Object.defineProperty(cz.default.prototype,"display",{configurable:!0,set(e){return e.scroller.addEventListener=function(e,t,n){EventTarget.prototype.addEventListener.call(this,e,t,typeof n==`boolean`?{capture:n,passive:[`touchstart`,`touchmove`,`wheel`,`mousewheel`].includes(e)}:n)},Object.defineProperty(this,"display",{configurable:!0,enumerable:!0,value:e}),e}});var Oz=(e,t,{entry:{type:n,text:r,value:i}})=>{let a=r[0],o=r[r.length-1],s=+(a===`"`||a===`'`),c=+(o===`"`||o===`'`),l=r.toLowerCase().substring(s,r.length-c),u=l?i.toLowerCase().indexOf(l,+(i[0]===`"`||i[0]===`'`)):-1;u!==-1&&(i=tz(i.substring(0,u))+`<span class="match">`+tz(i.slice(u,u+l.length))+`</span>`+tz(i.slice(u+l.length))),e.classList.add(`type-`+n),e.appendChild($(`span`,`name`,i))},kz=class extends oz{static CodeMirror=cz.default;el;cm;get container(){return null}constructor({hint:e,mode:t,placeholder:n}){super(),this.el=document.createElement(`div`),this.el.className=`discovery-view-editor empty-value`;let r=this,i=(0,cz.default)(this.el,{extraKeys:{"Alt-Space":`autocomplete`},mode:t||`javascript`,theme:`neo`,indentUnit:0,showHintOptions:{hint:e,get container(){return r.container}}});n&&(i.display.lineDiv.parentNode.dataset.placeholder=n),i.on(`change`,(e,t)=>{let n=i.getValue();this.el.classList.toggle(`empty-value`,n===``),this.emit(`change`,n,t)}),typeof e==`function`&&(i.on(`cursorActivity`,e=>{e.state.completionEnabled&&e.state.focused&&e.showHint()}),i.on(`focus`,e=>{e.getValue()===``&&(e.state.completionEnabled=!0),e.state.completionEnabled&&!e.state.completionActive&&e.showHint()}),i.on(`change`,(e,t)=>{t.origin!==`complete`&&(i.state.completionEnabled=!0)})),this.cm=i;let a=new az;a.subscribe(()=>i.refresh()),a.observe(i.display.wrapper)}getValue(){return this.cm.getValue()}setValue(e){return requestAnimationFrame(()=>this.cm.refresh()),typeof e==`string`&&this.getValue()!==e&&(this.cm.setValue(e||``),!0)}focus(){this.cm.focus()}},Az=class extends kz{queryData;queryContext;inputPanelEl;outputPanelEl;constructor(e){super({mode:`discovery-query`,placeholder:`Enter a jora query`,hint:t=>{let n=t.getCursor(),r=e(t.getValue(),t.doc.indexFromPos(n),this.queryData,this.queryContext);return r?{list:r.slice(0,50).map(e=>({entry:e,text:e.value,render:Oz,from:t.posFromIndex(e.from),to:t.posFromIndex(e.to)}))}:null}}),this.inputPanelEl=$(`div`,`discovery-view-editor__input-panel`),this.outputPanelEl=$(`div`,`discovery-view-editor__output-panel`),this.el.append(this.inputPanelEl,this.outputPanelEl)}setValue(e,t,n){let r=this.queryData!==t||this.queryContext!==n;return this.queryData=t,this.queryContext=n,super.setValue(e)?!0:(r&&this.cm.state.completionEnabled&&this.cm.state.focused&&this.cm.showHint(),!1)}},jz=class extends kz{constructor(){super({mode:{name:`discovery-view`,isDiscoveryViewDefined:e=>this.isViewDefined(e)}})}isViewDefined(){return!1}};cz.default.defineMode(`jora`,lz),cz.default.defineMode(`discovery-query`,lz),cz.default.defineMode(`discovery-view`,uz);function Mz(e){Object.assign(e.view,{QueryEditor:class extends Az{get container(){return e.dom.container}},ViewEditor:class extends jz{isViewDefined(t){return e.view.isDefined(t)||e.textView.isDefined(t)}}})}var Nz={class:`flex flex-col gap-2 h-full min-h-0`},Pz={key:0,class:`m-0 px-3 py-2 font-mono text-11px leading-relaxed whitespace-pre-wrap break-all rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},Fz={key:1,class:`px-3 py-1.5 font-mono text-11px rounded-lg border border-amber-600/40 bg-amber-500:8 color-amber-700 dark:border-amber-400/40 dark:color-amber-300`},Iz=`jora query, runs as you type. Ctrl+Space for suggestions, Ctrl+Enter to run now`,Lz=G({__name:`QueryEditor`,props:Ia({syntax:{},suggestions:{}},{modelValue:{default:``},modelModifiers:{}}),emits:Ia([`run`,`suggest`,`accept`,`dismiss`],[`update:modelValue`]),setup(e,{emit:t}){let n=e,r=t,i=io(e,`modelValue`),a=fn(null),o=null,s=null,c;function l(){return s?s.indexFromPos(s.getCursor()):i.value.length}function u(e){return e[0]===`"`||e[0]===`'`?e.slice(1):e}function d(e,t,n){e.classList.add(`type-${t.type}`);let r=document.createElement(`span`);r.className=`name`;let i=u(n).toLowerCase(),a=i?t.value.toLowerCase().indexOf(i,+(t.value[0]===`"`||t.value[0]===`'`)):-1;if(a===-1)r.textContent=t.value;else{let e=document.createElement(`span`);e.className=`match`,e.textContent=t.value.slice(a,a+i.length),r.append(t.value.slice(0,a),e,t.value.slice(a+i.length))}e.appendChild(r)}function f(e){let t=Math.max(e.to,l());r(`accept`,t===e.to?e:{...e,to:t}),er(()=>{s&&(s.setCursor(s.posFromIndex(e.from+e.value.length)),s.focus())})}function p(){if(!s)return null;let e=n.suggestions;if(!e.length)return null;let t=s.getValue(),r=l(),i=[];for(let n of e.slice(0,50)){if(n.from>r||n.to>t.length)continue;let e=t.slice(n.from,r);(!e||u(n.value).toLowerCase().startsWith(u(e).toLowerCase()))&&i.push({text:n.value,from:s.posFromIndex(n.from),to:s.posFromIndex(n.to),render:t=>d(t,n,e),hint:()=>f(n)})}return i.length?{list:i}:null}return Qi(()=>{let e=a.value;if(!e)return;let t=new kz({mode:`jora`,placeholder:Iz,hint:p});t.on(`change`,(e,t)=>{t.origin!==`setValue`&&(i.value=e,r(`suggest`,l()))}),s=t.cm,s.setOption(`extraKeys`,{"Cmd-Enter":()=>r(`run`),"Ctrl-Enter":()=>r(`run`),"Ctrl-Space":()=>r(`suggest`,l()),"Alt-Space":`autocomplete`}),s.on(`endCompletion`,()=>{s?.state.completionEnabled===!1&&r(`dismiss`)}),s.on(`blur`,()=>{c=setTimeout(r,150,`dismiss`)}),s.on(`focus`,()=>clearTimeout(c)),e.appendChild(t.el),t.setValue(i.value),o=t}),ta(()=>{clearTimeout(c),s?.state.completionActive?.close(),o?.el.remove(),o=null,s=null}),W(i,e=>o?.setValue(e??``)),W(()=>n.suggestions,e=>{if(s){if(!e.length){s.state.completionActive?.close();return}s.hasFocus()&&(s.state.completionEnabled=!0,s.showHint())}}),(t,n)=>(q(),J(`div`,Nz,[X(`div`,{ref_key:`hostEl`,ref:a,class:ye([`di-query-editor relative flex flex-1 min-h-24 min-w-0`,{"di-query-editor-error":e.syntax.kind===`error`}])},null,2),e.syntax.kind===`error`?(q(),J(`pre`,Pz,je(e.syntax.message),1)):e.syntax.kind===`pending`?(q(),J(`div`,Fz,` incomplete query, keep typing `)):Os(``,!0)]))}}),Rz=`outline-none border border-base rounded bg-raised flex h-4 w-4 transition items-center justify-center data-[state=checked]:border-primary-500 data-[state=checked]:bg-primary-500 focus-visible:ring-2 focus-visible:ring-primary-500/40`,zz=G({inheritAttrs:!1,__name:`FormCheckbox`,props:Ia({label:{},disabled:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=io(e,`modelValue`);return(n,r)=>e.label||n.$slots.default?(q(),J(`label`,Ms({key:0},n.$attrs,{class:[`text-sm inline-flex gap-1.5 cursor-pointer select-none items-center`,{"op-fade saturate-0 pointer-events-none":e.disabled}]}),[Z(H(JL),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,disabled:e.disabled,class:ye(Rz)},{default:U(()=>[Z(H(YL),{class:`text-white`},{default:U(()=>[...r[2]||=[X(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},8,[`modelValue`,`disabled`]),X(`span`,null,[K(n.$slots,`default`,{},()=>[Es(je(e.label),1)])])],16)):(q(),Y(H(JL),Ms({key:1},n.$attrs,{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e,disabled:e.disabled,class:Rz}),{default:U(()=>[Z(H(YL),{class:`text-white`},{default:U(()=>[...r[3]||=[X(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},16,[`modelValue`,`disabled`]))}}),Bz={class:`flex flex-col gap-2 text-sm`},Vz={class:`flex items-center gap-4 flex-wrap`},Hz={class:`flex items-center gap-2 select-none color-base`},Uz=[`disabled`],Wz=G({__name:`QuerySettings`,props:{modelValue:{required:!0},modelModifiers:{},autoRun:{type:Boolean,default:!1},autoRunModifiers:{},autoRunSeconds:{default:5},autoRunSecondsModifiers:{}},emits:[`update:modelValue`,`update:autoRun`,`update:autoRunSeconds`],setup(e){let t=io(e,`modelValue`),n=io(e,`autoRun`),r=io(e,`autoRunSeconds`);return(e,i)=>(q(),J(`div`,Bz,[X(`div`,Vz,[i[5]||=X(`span`,{class:`text-xs font-medium color-muted uppercase tracking-wide select-none`},`Filters`,-1),Z(zz,{modelValue:t.value.excludeFunctions,"onUpdate:modelValue":i[0]||=e=>t.value.excludeFunctions=e,label:`Exclude functions`},null,8,[`modelValue`]),Z(zz,{modelValue:t.value.excludeUnderscoreProps,"onUpdate:modelValue":i[1]||=e=>t.value.excludeUnderscoreProps=e,label:`Exclude _ props`},null,8,[`modelValue`]),Z(zz,{modelValue:t.value.excludeDollarProps,"onUpdate:modelValue":i[2]||=e=>t.value.excludeDollarProps=e,label:`Exclude $ props`},null,8,[`modelValue`])]),X(`div`,Hz,[Z(zz,{modelValue:n.value,"onUpdate:modelValue":i[3]||=e=>n.value=e,label:`Auto rerun every`},null,8,[`modelValue`]),vr(X(`input`,{"onUpdate:modelValue":i[4]||=e=>r.value=e,type:`number`,min:`1`,max:`3600`,disabled:!n.value,class:`w-14 px-1.5 py-0.5 text-center rounded border border-base bg-secondary font-mono text-xs tabular-nums disabled:op-fade focus:border-primary-600/50 dark:focus:border-primary-400/50 outline-none`,"aria-label":`Auto rerun interval in seconds`},null,8,Uz),[[Jl,r.value,void 0,{number:!0}]]),X(`span`,{class:ye([`text-xs`,n.value?`color-muted`:`color-faint`])},`seconds`,2)])]))}}),Gz={class:`border-b border-base flex-auto flex-col flex`},Kz={class:`flex px3 py2 items-center gap-2 select-none`},qz=G({__name:`QueryPanel`,setup(e){let t=EN(),n=fn(!1),r;function i(){try{navigator.clipboard.writeText(t.query.value||`$`),n.value=!0,clearTimeout(r),r=setTimeout(()=>n.value=!1,1200)}catch{}}return(e,r)=>(q(),J(`div`,Gz,[X(`div`,Kz,[r[12]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Jora Query `,-1),r[13]||=X(`a`,{href:`https://discoveryjs.github.io/jora/#article:jora-syntax`,target:`_blank`,title:`Jora query language reference`,class:`flex items-center gap-1 color-muted hover:color-active`},[X(`span`,{class:`i-ph:question-duotone`})],-1),r[14]||=X(`div`,{class:`flex-auto`},null,-1),H(t).query.value?(q(),Y(Gv,{key:0,class:`text-sm`,icon:n.value?`i-ph:check`:`i-ph:copy-duotone`,label:`Copy query`,tooltip:`Copy the jora query`,onClick:i},null,8,[`icon`])):Os(``,!0),H(t).query.value?(q(),Y(GR,{key:1,class:`text-sm`,title:`Clear query`,icon:`i-ph:trash-duotone`,onClick:r[0]||=e=>H(t).query.value=``},{default:U(()=>[...r[10]||=[X(`span`,null,`Clear`,-1)]]),_:1})):Os(``,!0),Z(GR,{disabled:H(t).running.value,loading:H(t).running.value,class:`text-sm`,title:`Run query`,icon:`i-ph:play-duotone`,onClick:r[1]||=e=>H(t).runNow()},{default:U(()=>[...r[11]||=[X(`span`,null,`Run`,-1)]]),_:1},8,[`disabled`,`loading`])]),Z(Lz,{modelValue:H(t).query.value,"onUpdate:modelValue":r[2]||=e=>H(t).query.value=e,syntax:H(t).syntax.value,suggestions:H(t).suggestions.value,class:`flex-1 min-h-32 mx2`,onRun:r[3]||=e=>H(t).runNow(),onSuggest:r[4]||=e=>H(t).scheduleSuggestions(e),onAccept:r[5]||=e=>H(t).acceptSuggestion(e),onDismiss:r[6]||=e=>H(t).suggestions.value=[]},null,8,[`modelValue`,`syntax`,`suggestions`]),Z(Wz,{modelValue:H(t).settings,"onUpdate:modelValue":r[7]||=e=>H(t).settings=e,"auto-run":H(t).autoRun.value,"onUpdate:autoRun":r[8]||=e=>H(t).autoRun.value=e,"auto-run-seconds":H(t).autoRunSeconds.value,"onUpdate:autoRunSeconds":r[9]||=e=>H(t).autoRunSeconds.value=e,class:`py2 px4`},null,8,[`modelValue`,`auto-run`,`auto-run-seconds`])]))}}),Jz={neutral:`color-scale-neutral`,low:`color-scale-low`,medium:`color-scale-medium`,high:`color-scale-high`,critical:`color-scale-critical`};function Yz(e,t){for(let[n,r]of t)if(e<=n)return r;return t.at(-1)?.[1]??Jz.neutral}var Xz=`en-US`,Zz=[`B`,`KB`,`MB`,`GB`,`TB`,`PB`],Qz=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`];function $z(e,t={}){let{base:n=1024,digits:r=2}=t;if(!e||e<0)return[`0`,`B`];let i=n===1e3?Qz:Zz,a=Math.min(Math.floor(Math.log(e)/Math.log(n)),i.length-1);return a===0?[String(e),`B`]:[(e/n**a).toFixed(r).replace(/\.?0+$/,``),i[a]??`B`]}var eB=1024,tB=1024*eB,nB=[[80*eB,Jz.neutral],[500*eB,Jz.low],[tB,Jz.medium],[10*tB,Jz.high],[1/0,Jz.critical]];function rB(e,t=nB){return Yz(e,t)}var iB={ns:1e-6,us:.001,ms:1,s:1e3};function aB(e,t={}){if(e==null)return[``,`-`];let n=t.unit??`ms`,r=e*iB[n];if(r<1){if(n===`ms`)return[`<1`,`ms`];let e=r*1e3;return e<1?[Math.round(e*1e3).toString(),`ns`]:[(e<10?e.toFixed(1):e.toFixed(0)).replace(/\.0$/,``),`µs`]}return r<1e3?[r.toFixed(0),`ms`]:r<6e4?[(r/1e3).toFixed(1),`s`]:r<36e5?[(r/6e4).toFixed(1),`min`]:r<864e5?[(r/36e5).toFixed(1),`h`]:[(r/864e5).toFixed(1),`d`]}var oB=[[50,Jz.neutral],[200,Jz.low],[1e3,Jz.medium],[5e3,Jz.high],[1/0,Jz.critical]];function sB(e,t=oB){return Yz(e,t)}var cB=1e3,lB=60*cB,uB=60*lB,dB=24*uB,fB=30*dB,pB=365*dB,mB=[[lB,cB,`s`],[uB,lB,`min`],[dB,uB,`h`],[fB,dB,`d`],[pB,fB,`mo`],[1/0,pB,`y`]];function hB(e,t=Date.now()){let n=t-(e instanceof Date?e.getTime():e),r=Math.abs(n);if(r<cB)return`just now`;for(let[e,t,i]of mB)if(r<e){let e=Math.round(r/t);return n>=0?`${e} ${i} ago`:`in ${e} ${i}`}return``}var gB=[[180*dB,Jz.neutral],[365*dB,Jz.low],[3*pB,Jz.medium],[5*pB,Jz.high],[1/0,Jz.critical]];function _B(e,t=gB){return Yz(e,t)}function vB(e,t,n){return new Intl.DateTimeFormat(n??Xz,t??{dateStyle:`medium`,timeStyle:`short`}).format(e)}var yB={class:`text-xs ml-0.5 op-fade`},bB={key:0,class:`text-xs ml-1 op-mute`},xB=G({__name:`DisplayBytes`,props:{bytes:{},base:{default:1024},digits:{},colorize:{type:Boolean},scale:{},total:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=Q(()=>$z(t.bytes,{base:t.base,digits:t.digits})),r=Q(()=>t.colorize?rB(t.bytes,t.scale):``),i=Q(()=>t.total&&t.total>0?t.bytes/t.total*100:void 0);return(t,a)=>(q(),J(`span`,{class:ye([[r.value,{"font-mono tabular-nums":e.mono}],`inline-flex gap-1 items-center`])},[t.$slots.icon?K(t.$slots,`icon`,{},void 0,void 0,0):Os(``,!0),K(t.$slots,`default`,{value:n.value[0],unit:n.value[1],percent:i.value},()=>[X(`span`,null,[Es(je(n.value[0]),1),X(`span`,yB,je(n.value[1]),1),i.value==null?Os(``,!0):(q(),J(`span`,bB,je(i.value.toFixed(0))+`%`,1))])])],2))}}),SB=[`datetime`],CB=G({__name:`DisplayDate`,props:{date:{},colorize:{type:Boolean},scale:{},live:{type:Boolean},interval:{default:3e4}},setup(e){let t=e,n=V(Date.now());wh(()=>{t.live&&(n.value=Date.now())},wn(t,`interval`)),W(()=>t.date,()=>{t.live&&(n.value=Date.now())});let r=Q(()=>new Date(t.date).getTime()),i=Q(()=>hB(r.value,t.live?n.value:Date.now())),a=Q(()=>vB(r.value)),o=Q(()=>t.colorize?_B(Math.abs(n.value-r.value),t.scale):``);return(e,t)=>vr((q(),J(`time`,{datetime:new Date(r.value).toISOString(),class:ye(o.value)},[K(e.$slots,`default`,{relative:i.value,exact:a.value},()=>[Es(je(i.value),1)])],10,SB)),[[H(Wv),a.value]])}}),wB={class:`text-xs ml-0.5 op-fade`},TB=G({__name:`DisplayDuration`,props:{ms:{},unit:{default:`ms`},colorize:{type:Boolean},scale:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n={ns:1e-6,us:.001,ms:1,s:1e3},r=Q(()=>aB(t.ms,{unit:t.unit})),i=Q(()=>t.colorize?sB(t.ms*n[t.unit],t.scale):``);return(t,n)=>(q(),J(`span`,{class:ye([i.value,{"font-mono tabular-nums":e.mono}])},[Es(je(r.value[0]),1),X(`span`,wB,je(r.value[1]),1)],2))}}),EB=`1.0.0-beta.99`,DB=`1.0.0-beta.15`,OB=Object.hasOwn||((e,t)=>Object.hasOwnProperty.call(e,t)),kB=Object.prototype.toString;function AB(e,t){return t!==void 0&&(IB(t)?t.forEach(t=>e.add(t)):e.add(t)),e}function jB(e,t,n){e.has(t)?e.get(t).add(n):e.set(t,new Set([n]))}function MB(e,t){return e&&OB(e,t)?e[t]:void 0}function NB(e){return typeof e==`object`&&!!e&&e.constructor===Object}function PB(e){return kB.call(e)===`[object RegExp]`}function FB(e){return e&&(IB(e)||OB(e,`length`)&&isFinite(e.length))}function IB(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function LB(e,t=0){let n=parseInt(e,10);return isNaN(n)?t:n}function RB(e){if(IB(e))return e.length>0;if(NB(e)){for(let t in e)if(OB(e,t))return!0;return!1}return!!e}var zB=(function(){return{yy:{},options:{ranges:!0},rules:[/^(?:\/\/.*?(?:\n|\r\n?|\u2028|\u2029|$)|\/\*(?:.|\s)*?(?:\*\/|$))/,/^\s+/,/^\//,/^<(?!=)/,/^/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\(?)/,/^/,(e,t)=>{if(e[0]!==(t===`template`?`}`:"`"))return null;for(let t=1;t<e.length;t++){if(e[t]==="`")return t+1;if(e[t]===`$`&&e[t+1]===`{`)return t+2;e[t]===`\\`&&t++}return null},(e,t)=>{if(e[0]!==(t===`template`?`}`:"`"))return null;for(let t=1;t<e.length;t++){if(e[t]==="`")return t+1;if(e[t]===`$`&&e[t+1]===`{`)return t+2;e[t]===`\\`&&t++}return null},/^/,/^\(/,/^\)/,/^\[/,/^\]/,/^\{/,/^\}/,/^(?:(true|false|null|undefined|Infinity|NaN)\b)/,/^and\b/,/^or\b/,/^is\b/,/^has\s+no\b/,/^has\b/,/^in\b/,/^not\s+in\b/,/^not\b/,/^no\b/,/^(?:(asc|desc)(NA?|AN?)?\b)/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*\()/,/^(?:(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:\$(?:[a-zA-Z_]|\\u[0-9a-fA-F]{4})(?:[a-zA-Z_$0-9]|\\u[0-9a-fA-F]{4})*)/,/^(?:[_\d]*\.)?[_\d]+(?:[eE][-+]?[_\d]+)?\b/,/^(?:\d*\.)?\d+(?:[eE][-+]?\d+)?\b/,/^0[xX][_0-9a-fA-F]+/,/^0[xX][0-9a-fA-F]+/,/^(?:"(?:\\[\\"]|[^"])*")/,/^(?:'(?:\\[\\']|[^'])*')/,/^(?:\/(?:\\.|[^/])+\/[gimsu]*)/,/^@/,/^#/,/^\$\$/,/^\$/,/^=>/,/^=/,/^!=/,/^~=/,/^>=/,/^<=/,/^</,/^>/,/^\.\.\(/,/^\.\(/,/^\.\[/,/^\.\.\./,/^\.\./,/^\./,/^\?\?/,/^\?/,/^,/,/^:/,/^;/,/^\-/,/^\+/,/^\*/,/^\//,/^\%/,/^(?:\|)/,/^./,/^$/],conditions:{preventPrimitive:{rules:[0,1,2,3,4,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0},preventKeyword:{rules:[5,6],inclusive:!1},template:{rules:[8,9],inclusive:!1},INITIAL:{rules:[0,1,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68],inclusive:!0}},performAction(e,t,n,r){switch(n){case 0:e.commentRanges.push(t.yylloc.range);break;case 1:break;case 2:return this.popState(),40;case 3:return this.popState(),44;case 4:this.done=!1,this.popState();break;case 5:if(this.popState(),t.yytext.endsWith(`(`)){this.unput(t.yytext);return}return e.pps(),14;case 6:this.done=!1,this.popState();break;case 7:{let n=t.yytext.endsWith("`")?`TEMPLATE`:`TPL_START`;return t.yytext=this.toStringLiteral(t.yytext,!0,1+Number(n!==`TEMPLATE`)),n===`TEMPLATE`&&e.pps(),n}case 8:{let n=t.yytext.endsWith("`")?`TPL_END`:`TPL_CONTINUE`;return t.yytext=this.toStringLiteral(t.yytext,!0,1+Number(n!==`TPL_END`)),this.popState(),n===`TPL_END`&&e.pps(),n}case 9:this.parseError(`Unexpected end of input`);break;case 10:return 21;case 11:return e.pps(),22;case 12:return 61;case 13:return e.pps(),63;case 14:return 84;case 15:if(this.bracketStack[this.bracketStack.length-1]!==`TPL_END`)return e.pps(),85;this.unput(`}`),this.begin(`template`);break;case 16:return t.yytext=this.toLiteral(t.yytext),57;case 17:return 36;case 18:return 37;case 19:return 30;case 20:return 35;case 21:return 33;case 22:return 32;case 23:return 34;case 24:return 25;case 25:return 26;case 26:return 95;case 27:return t.yytext=t.yytext.slice(0,-1),70;case 28:return t.yytext=t.yytext.slice(1,-1),72;case 29:return e.pps(),14;case 30:return e.pps(),t.yytext=t.yytext.slice(1),15;case 31:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!0),55;case 32:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext),55;case 33:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!0,!0),55;case 34:return e.pps(),t.yytext=this.toNumberLiteral(t.yytext,!1,!0),55;case 35:return e.pps(),t.yytext=this.toStringLiteral(t.yytext),54;case 36:return e.pps(),t.yytext=this.toStringLiteral(t.yytext),54;case 37:return e.pps(),t.yytext=this.toRegExp(t.yytext),56;case 38:return e.pps(),51;case 39:return e.pps(),52;case 40:return e.pps(),53;case 41:return e.pps(),9;case 42:return 20;case 43:return 42;case 44:return 43;case 45:return 48;case 46:return 47;case 47:return 45;case 48:return 44;case 49:return 46;case 50:return 69;case 51:return 66;case 52:return 67;case 53:return 89;case 54:return e.pps(),e.pks(),68;case 55:return e.pps(),e.pks(),65;case 56:return 38;case 57:return 17;case 58:return 73;case 59:return 11;case 60:return 10;case 61:return 27;case 62:return 28;case 63:return 39;case 64:return 40;case 65:return 41;case 66:return 29;case 67:this.parseError(`Bad input on line ${t.yylloc.first_line} column ${t.yylloc.first_column}\n`+this.showPosition(),{text:t.yytext,token:`BAD_TOKEN`});break;case 68:return 5}},setInput(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=!1,this._backtrack=!1,this.done=!1,this.currentCondition=`INITIAL`,this.conditionStack=[`INITIAL`],this.offset=0,this.yytext=this.match=``,this.yyleng=0,this.yylineno=0,this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.yylloc.range=[0,0],this},parseError(e,t){if(!this.yy.parser)throw Error(e);this.yy.parser.parseError(e,t)},input(){let e=this._input[this.offset],t=/\n|\r\n?|\u2028|\u2029/g.test(e);return this.offset++,this.yyleng++,this.yytext=this.match=this.yytext+e,t?(this.yylineno++,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++,this.yylloc.range[1]++,e},lineColumnForOffset(e=this.offset,t=this._input,n=1,r=0){let i=/\n|\r\n?|\u2028|\u2029/g,a=n,o=r,s=0,c;for(;(c=i.exec(t))!==null;)if(c.index<e)a++,o=0,s=c.index+c[0].length;else{o+=e-s,s=-1;break}return s!==-1&&(o+=e-s),{line:a,column:o}},setMatch(e,t){let n=this._input.slice(e,t),r=e===this.offset?{line:this.yylloc.last_line,column:this.yylloc.last_column}:this.lineColumnForOffset(e),i=e===t?r:this.lineColumnForOffset(t-e,n,r.line,r.column);this.yytext=this.match=n,this.yyleng=t-e,this.offset=t,this.yylineno=i.line-1,this.yylloc={first_line:r.line,first_column:r.column,last_line:i.line,last_column:i.column},this.yylloc.range=[e,t]},less(e){let t=this.offset-this.match.length;this.setMatch(t,t+e)},unput(e){let t=this.match.length-e.length;if(!this.match.startsWith(e,t))throw Error(`Lexer#unput() should receive a part of matched text only`);this.less(t)},more(){this._more=!0},reject(){throw Error(`reject() is allowed only when options.backtrack_lexer = true`)},showPosition(e=this.offset-this.match.length){let t=this._input,n=Math.max(e-20,0),r=Math.min(e+20,t.length),i=(n===0?``:`...`)+t.slice(n,e).replace(/\n|\r\n?|\u2028|\u2029/g,`\\n`);return i+(t.slice(e,r).replace(/\n|\r\n?|\u2028|\u2029/g,`\\n`)+(r===t.length?``:`...`))+`\n${`-`.repeat(i.length)}^`},test_match(e,t){let n;this._more=!1,this._backtrack=!1,this.setMatch(this.offset,this.offset+e[0].length),this.matches=e;let r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]);return!r&&this._backtrack?(Object.assign(this,n),!1):(this.eof()||(this.done=!1),typeof r==`number`&&this.yy.parser?this.yy.parser.terminals_[r]:r||!1)},eof(){return this.offset===this._input.length},next(){if(this.done)return 1;this.eof()&&(this.done=!0),this._more||(this.yytext=``,this.match=``);let e,t;for(let n of this.conditions[this.currentCondition].rules){let r=this.rules[n],i=this._input.slice(this.offset),a;if(typeof r==`function`){let e=r(i,this.currentCondition);switch(typeof e){case`string`:a=[e];break;case`number`:a=[i.slice(0,e)];break;default:a=e}}else a=i.match(r);if(a&&(!e||a[0].length>e[0].length)){e=a,t=n;break}}if(e)return this.test_match(e,t);if(this.eof())return 1;this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
|
|
53
|
+
`+this.showPosition(),{text:``,token:null,line:this.yylineno})},lex(){let e;for(;!e;)e=this.next();return e},begin(e){this.currentCondition=e,this.conditionStack.push(e)},pushState(e){this.begin(e)},popState(){return this.conditionStack.pop(),this.currentCondition=this.conditionStack.length?this.conditionStack[this.conditionStack.length-1]:`INITIAL`},topState(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},stateStackSize(){return this.conditionStack.length}}})();function BB(){this.yy={}}BB.prototype={Parser:BB,lexer:zB,symbols_:{error:2,root:3,block:4,EOF:5,definitions:6,e:7,def:8,$:9,";":10,":":11,$ident:12,ident:13,IDENT:14,$IDENT:15,condConsequent:16,"?":17,condAlternate:18,query:19,"=>":20,"(":21,")":22,functionArgs:23,compareFunction:24,NOT:25,NO:26,"-":27,"+":28,"|":29,IS:30,assertion:31,IN:32,HAS:33,NOTIN:34,HASNO:35,AND:36,OR:37,"??":38,"*":39,"/":40,"%":41,"=":42,"!=":43,"<":44,"<=":45,">":46,">=":47,"~=":48,queryRoot:49,relativePath:50,"@":51,"#":52,$$:53,STRING:54,NUMBER:55,REGEXP:56,LITERAL:57,template:58,object:59,array:60,"[":61,sliceNotation:62,"]":63,"method()":64,".":65,".(":66,".[":67,"..":68,"..(":69,"METHOD(":70,arguments:71,"$METHOD(":72,",":73,functionArg:74,templateString:75,templateStart:76,templateTail:77,templateEnd:78,templateContinue:79,TEMPLATE:80,TPL_START:81,TPL_CONTINUE:82,TPL_END:83,"{":84,"}":85,objectEntries:86,objectEntry:87,objectEntryKeyLiteral:88,"...":89,arrayElements:90,arrayElement:91,assertionTerm:92,assertionList:93,compareExpr:94,ORDER:95,sliceNotationComponent:96,$accept:0,$end:1},terminals_:{2:`error`,5:`EOF`,9:`$`,10:`;`,11:`:`,14:`IDENT`,15:`$IDENT`,17:`?`,20:`=>`,21:`(`,22:`)`,25:`NOT`,26:`NO`,27:`-`,28:`+`,29:`|`,30:`IS`,32:`IN`,33:`HAS`,34:`NOTIN`,35:`HASNO`,36:`AND`,37:`OR`,38:`??`,39:`*`,40:`/`,41:`%`,42:`=`,43:`!=`,44:`<`,45:`<=`,46:`>`,47:`>=`,48:`~=`,51:`@`,52:`#`,53:`$$`,54:`STRING`,55:`NUMBER`,56:`REGEXP`,57:`LITERAL`,61:`[`,63:`]`,65:`.`,66:`.(`,67:`.[`,68:`..`,69:`..(`,70:`METHOD(`,72:`$METHOD(`,73:`,`,80:`TEMPLATE`,81:`TPL_START`,82:`TPL_CONTINUE`,83:`TPL_END`,84:`{`,85:`}`,89:`...`,95:`ORDER`},productions_:[0,[3,2],[4,2],[4,1],[4,1],[4,0],[6,1],[6,2],[8,2],[8,4],[8,2],[8,4],[13,1],[12,1],[16,2],[16,1],[18,2],[18,1],[18,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,1],[7,2],[7,2],[7,2],[7,2],[7,3],[7,4],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[7,3],[19,1],[19,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,1],[49,3],[49,2],[49,2],[49,1],[49,1],[49,3],[49,4],[49,2],[49,2],[49,3],[49,3],[49,2],[49,2],[49,3],[49,2],[49,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[50,4],[50,3],[50,3],[50,4],[64,2],[64,3],[64,2],[64,3],[71,1],[71,3],[74,1],[23,1],[23,3],[58,1],[58,2],[77,1],[77,2],[77,2],[77,3],[75,1],[76,1],[79,1],[78,1],[59,2],[59,3],[59,4],[59,3],[59,4],[59,5],[86,1],[86,3],[88,1],[88,1],[88,1],[87,1],[87,1],[87,1],[87,1],[87,1],[87,3],[87,3],[87,3],[87,2],[87,2],[87,2],[87,5],[87,1],[87,2],[90,1],[90,3],[91,1],[91,1],[91,2],[60,2],[60,3],[60,4],[31,1],[31,2],[31,3],[31,4],[92,1],[92,1],[92,1],[92,1],[93,1],[93,3],[93,3],[24,1],[24,3],[94,2],[62,1],[62,2],[62,2],[62,3],[96,1],[96,2]],table:(function(e){function t(e){let t=e.match(/[\x20-\x2f]/g),n=t?Math.max(...t.map(e=>e.charCodeAt()-32)):-1;for(let t=n;t>=0;t--){let n=(32+t).toString(16),r;e=e.replace(RegExp(`\\[\\x`+n+`(.+?)\\]`),(e,t)=>r=t).replace(RegExp(`\\x`+n,`g`),r)}return e=e.replace(/<([^>]+?)>/g,(e,t)=>{let n=r[t[0]],i=1;return n>>5==1&&(n=n&31|r[t[1]]<<5,i=2),t.slice(i).repeat(n)}),e}function n(e){let t=[];for(let n=0;n<e.length;n++){let i=r[e[n]];if(i&32){let a=r[e[++n]];t.push(i&31|a<<5)}else t.push(i)}return t}let r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~|=`.split(``).reduce((e,t,n)=>(e[t]=n,e),Object.create(null)),[i,a,...o]=e.split(`=`).map(t),s=a.split(`;`).map(e=>{let t=[];for(let n=0;n<e.length;n++)for(let i=0,a=r[e[n]];i<3;i++)t.push(a>>i*2&3);return t}),c=o.map(n),l=n(i).map(e=>{let t=s[e],n=Object.create(null);for(let e=0;e<t.length;e++){let r=t[e];if(r!==0){let t=c[r-1].shift();n[e]=r===1?t:[r-1,t]}}return n});for(let e=0;e<c[3].length;e+=2)l[c[3][e]][c[3][e+1]]=[3];return l})(`ABCDEFGHIJKHHHHLL<NM>NOPMMQRSQRTMUVWXYYMZaEFTO<TH>PMbQRSQRcMMHdefgBhBiBHj[ BjBkBk]BFHFHlBMmBnBoBpBqBrBMMsBtBMMMMXMWMMuB[!lBMMuB]vBgBMMwBUMZMxByBzB0B1B2B3B4BH5<DB6>BvBXe7BXevBgBM<E8B>9B~ <DB|>BgCgC<EhC>gCMMiC<C!>cHdjCMfMkClClCMMmCnCnBoCpCMtBqCrCvBMMMvBMUMMsCMxBHtCHtCtCHuCvCTXHXvB<FM>cHhBhBMFFMpBpCnCqCMOOMMzBzB2BMsCwCtCtCxC7BcMrCrCHMHtCtC=A1[ V[!C["lmkCpqC]]]<FA>[#[$[%[&['UqqWJkq]K]C][([)FgCCAAE];]]A];Ag;AwU[*ClmkOpqC]<FA>[+[,U[-qqWJnqK]]C(A]wAA[.A[/kAMAqi]]<Fq>CAAAAD<JA>g;AwADwzwP8|D<GA>||DMz|PDAwDPw;AwA8AwAMA|z<F|>DAAAIjqCMAA8MAAw;AAE!<FA>#wA8AwgMA|z<F|>DAAAMz|DMAA8MAAw;AAVClmkapqC<FA>&S(AwA8AwAMA|z<F|>DAAAMz|DIAA8MAAw;AwAoAwAMA|z<F|>DAAAMz|DMAA8MAAw;AwA8AwAMA|z<F|>DAAAMz|DMAA8MAAw;AAEi"<FA>UqqWZmqKCFgCCgFEB;AAAChCACIAE<IA>C<KA>Q;AwAsAwBMA|z<F|>DAAAMz|DMAA8MAAw;AAAAk<QA>EAIC;AEV*<FA>#E <FA>+A <FA>#AE!<FA>%VlqCAAE;AARClC<MA>KCIEAICAAAYl;AwE~lmkOp6y<F|>X-OFg~OAA0;AwA|wzwP8|z<F|>D||DMz|PPAw|PAAw;AAEClmkKpqC<FA>'aC(AAADwzwD8|D<GA>||DMw|PDAw|D;M;AAEi"<FA>UqqWZmqKC)B;AwA8.<Fq>CAAAMz|DMAA8MAA<Cg;AAAAAA>AI<QA>I;<FA>kAIAqi<Fq>C<OA>g;AAU!<FA>$<HA>M<QA>M;AAA8AwgMA|z<F|>DAAAMw|DM<GA>w;AwA8A0AMA6jq|qqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z||q||DAAAMz|DMAA8MAAw<C;AAAAAAAAAAAAAAAAAAAAAC>AAI;AAAg<RA>D<KA>B;AAAgAkAAAqi<Fq>CAAAADAAM<GA>gB;<VA>DAAM;AAEy"<FA>+AE!<FA>,O(AAAChCACA<KA>C<KA>Q;AAAChCACIAE<IA>C<KA>QB;<HA>I;AwA8AkAMA6i<Fq>CAAAMz|DMAA8MAAw;<FA>kAAAqi<Fq>C<JA>FoAAAg;<YA>IAAAI;AAQClC<MA>KCIEAICAAAYl;<YA>MAAAM;AAAo<UA>MAAAM;AAEq"<FA>&OFgCOAAE;AAEi"<FA>&OFgCOAAE;AAE!<FA>&OFgCOAAE;AAAg<UA>MAAAM;AAAClmECAgC<FA>&OFgCO;AAAw<UA>MAAAM;<FA>/<Fq>C<HA>M<GA>g;AwA8A0AMA6z||qqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jqvqqqCAAAMz|DMAA8MAAw;AwA8A0AMA6jquqqqCAAAMz|DMAA8MAAw;AwA8A0AMA|z<F|>DAAAMz|DMAA8MAAw;AwA8A0AMA6z||qvqDAAAMz|DMAA8MAAw;AwA8A0AMA6z||q||DAAAMz|DMAA8MAAw;AAAgAkAAAqi<Fq><CCAAAA><FA>gB;<FA>C<SA>Q;<FA>kAAAqi<Fq>C<OA>g;AAAIAkAAAqi<Fq>C<OA>g;AAE!<FA>UqqWJmqKCFgCCgEE;<VA>D;AAAwAkAAAqi<Fq>CAAAAD<JA>g;<FA>kAAAqi<Fq>CAAAADAAM<GA>g;<HA>IAAAAK;<HA>MAAAAP;AAAClC<MA>KCIEAICAAAIl;<FA>kAAAqi<Fq>C<HA>MAAAMAAg;<FA>kAAAqi<Fq><CCAAAA><FA>g;<UA>IgqCMAAAM;AAAIAkAAAqi<Fq>C<HA>MAAAMAAg;AAAg=BC[ D[!E["[#F[$QhBgBG]][%[&['[(KRSbcd]iB]pBqB]T]]]]zB[)0B$%qC]y[*C[[,+[-0ChBgB]]G%]]5C4C#3C'6CpBqBT9*~*|*gD+pD-G(lD[.iBpBqB]nDqDToDzDtDuD2D4D5D6D 7D 8D9D~D gE|D"jE-G&hEiEkETpEF[/sEtEuE]oEqEvE1E+4E-G'3EpBqBT4E-G'6EpBqBTqC8E7!zD9EuD~E+|E+gF+hF+iF+jF+kF+lF+mF+nF+oF+pF+qF+rF+sF+tF+uF+vF+wF+xFzF-G(0F.ToD1F2F3F 4F 5F6F7F qC8F+qChG0B$%jG-G&iG<EqC>kG+lG+pGqCqGrG+sG+zDtGzDwGuDvGxG+qC1G)2G3GjE-G&4GiEkET0B/8GqEvE~G+gH+hH+jH,kHRSbcd.qCqCqCpH0B$%<UqC>qGqCvH+xH<EqC>4H-G&3HT5HqCqCzDwGuD6HqCqCjE-G&~HiEkETiItEuEgIvElI+qCmI+qCqCnI+qC5C4C"pI+qCqCqI+qCzDsIuDzDtIuD~G+iItEuEgIvE<FqC>xI+yI+qCqC=[ [!["P[#[$[%[&['tBIsBHJ]LMNO][(oB[)fUVWXYZae]]][*jBkBlBmBnBuBvBwBxB]]r]]B]y][+B[,![-[.sB|B~B][/1B2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC]]]rC]sCtCuCvCwCxCzC#B1CPtB7CsBHJ2CLMNO(*rB8C<EzC#B>hDiDjDkDzCrD%mD*rBsDyDxD1DwDvD0D3D<CtBuBvB!!>zC$mElErBrEtB1DyEzE0EwEuBvBnExEzC&)*rBzC'2ELMNO(*rBzC'5ELMNO(*rB-rC DxD1DwDvD0D<TzC#B>3DzCrD%yF*rBtBuBv<CB">BtBuBv+zC#B9F~F|FsBgG|B~B/rC!1CzC#B<C|B~B3B4B5B6BgChCiCjCkClCmCnCoCpC><CgChCiC><CzC#B>mGnGoGrDrD-rC<CzC#B>yDxD1DuG0DyDxD1DwDvD0DzC&)*rByGzG0G.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC,mElErCzC$mElErB6G5GrEtB1DyEzE0EwEuBvB7GxEhDiDzCjD9G#BzC|G#BzC#BiHzC#BzCtB1DsBlH(*rB.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpCmHnH-rCoHnH.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC!<E|B~BgChCiCjCkClCmCnCoCpC>|B~B3B4B5B6B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6B7B9BgChCiCjCkClCmCnCoCpC|B~B3B4B5B6BgChCiCjCkClCmCnCoCp<CCgChCi><CC|B~BgChCiClCmCnCo><FC|B~BgChCi>ClCmCnCoCrD-qHrCrHsHtHuH-rCzC#BwHyHsBzH|B~B/rC-rC0H-rC1H-rCzC%2H*rBsDrD<C-rC>yDxD1DwDvD0D7H8H9H<C.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC>zC$mElErBhItB1DyEzE0EwEuBvB|HxEkIjI<CzC#B-rC>-rCzC#B-oIrCsCtCuCvCwCxC!zC#B.2B3B4B5B6B7B8B9BgChCiCjCkClCmCnCoCpC-rCzC#B-rCrI8H9H<CyDxD1DwDvD0D>zCuI#BhItB1DyEzE0EwEuBvBvIxE1H<D-rC>wI<C-rC><CzC#B><C-rC>=FDDDEEE<jBG><gBT><mBN><lBY><kB4B><kB6B><mB0B><mB1B><mB7E><mB2B><mB3B><mB5B><mB7B><mB8B><mB9B><mB~B><mB|B><mBgC><mBhC><lBS><mBlC><mBmC>FFF<mBlD><cP><5BM><mBrD><gBsD>BCCC<jBH><lBS><mB9E>FFF<PU><mB4B><mB6B>jDjDNNNiD<bN>iDN<WZ><Wa><jBb><jBc><jBI><jBK><mBtE>~EqEqEoEoEiFiFrErE<mBjC><mBwE><mB0E><mB1E><mB2E><mB3E><5BN><mBkC><cR><mBpC><mBqC><mBtC><mBuC><RwC><mBmD><mBnD><mBuD><gBtD><mBvD>1D1[ D6D6D7D7D]8D8D9D9D~D~DmEmE<D3D><D4D><D5D><RO><5B8C>gDgD<5B~C><Rd><mBf><agB><ahB><aiB><ajB><VkB><UlB><WmB><jBnB><jBoB><mBpB><mBqB><mBrB><dsB><dtB><hBuB><hBvB><hBwB><hBxB><dyB><mBzB><mByC><mB1C><mB2C><mB5C><mB6C><PV><mBnC><mB8E><mBiC><mBuE>|EgFjFjFsEsE<mBxE><D4E><RQ><mBrC><mBsC><mBvC><RxC><mBoD><mBpD><mBwD><mByD>iEiEjEjEkEkEnEnE<5B9C><5B|C><Re><mBzC><mB0C><mB3C><mB4C><mB7C><PW>kDkDiDiD<mBoC><jBJ><jBL><mBvE>pEpEqEqEhF<mByE><mBqD><mBxD>2D2 <mBzD>hEhE|D|DgEgEhDhD<PX><mBzE><D5E><D6E><mB0D>hEhElElE=BB`),defaultActions:{50:[2,1],201:[2,159],249:[2,161]},performAction(e,t,n,r,i,a,o){let s=a.length-1;switch(i){case 1:return r.buildResult(a[s-1]);case 2:this.$={type:`Block`,definitions:a[s-1],body:a[s],range:this._$.range};break;case 3:this.$={type:`Block`,definitions:a[s],body:{type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]},range:this._$.range};break;case 4:this.$={type:`Block`,definitions:[],body:a[s],range:this._$.range};break;case 5:this.$={type:`Block`,definitions:[],body:{type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]},range:this._$.range};break;case 6:case 96:case 99:case 101:case 117:case 136:case 152:case 155:this.$=[a[s]];break;case 7:a[s-1].push(a[s]);break;case 8:this.$={type:`Definition`,declarator:{type:`Declarator`,name:null,range:o[s-1].range},value:null,range:this._$.range};break;case 9:this.$={type:`Definition`,declarator:{type:`Declarator`,name:null,range:o[s-3].range},value:a[s-1],range:this._$.range};break;case 10:this.$={type:`Definition`,declarator:{type:`Declarator`,name:a[s-1].name,range:o[s-1].range},value:null,range:this._$.range};break;case 11:this.$={type:`Definition`,declarator:{type:`Declarator`,name:a[s-3].name,range:o[s-3].range},value:a[s-1],range:this._$.range};break;case 12:case 13:case 98:case 148:case 149:this.$={type:`Identifier`,name:a[s],range:this._$.range};break;case 14:case 16:case 163:this.$=a[s];break;case 15:case 17:this.$={type:`Placeholder`,range:[o[s].range[1],o[s].range[1]]};break;case 18:case 162:this.$=null;break;case 19:case 52:case 53:case 64:case 65:case 138:break;case 20:case 22:this.$={type:`Function`,arguments:[],body:a[s],range:this._$.range};break;case 21:this.$={type:`Function`,arguments:[{type:`Identifier`,name:a[s-2],range:o[s-2].range}],body:a[s],range:this._$.range};break;case 23:this.$={type:`Function`,arguments:a[s-3],body:a[s],range:this._$.range};break;case 24:this.$={type:`CompareFunction`,compares:a[s],range:this._$.range};break;case 25:case 26:case 27:case 28:case 67:this.$={type:`Prefix`,operator:a[s-1],argument:a[s],range:this._$.range};break;case 29:this.$={type:`Pipeline`,left:a[s-2],right:a[s],range:this._$.range};break;case 30:this.$={type:`Pipeline`,left:a[s-3],right:{type:`Block`,definitions:a[s-1],body:a[s]},range:this._$.range};break;case 31:this.$={type:`Postfix`,operator:a[s],argument:a[s-2],range:this._$.range};break;case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:this.$={type:`Binary`,operator:a[s-1],left:a[s-2],right:a[s],range:this._$.range};break;case 51:this.$={type:`Conditional`,test:a[s-2],consequent:a[s-1],alternate:a[s],range:this._$.range};break;case 54:this.$={type:`Data`,range:this._$.range};break;case 55:this.$={type:`Context`,range:this._$.range};break;case 56:this.$={type:`Current`,range:this._$.range};break;case 57:this.$={type:`Arg1`,range:this._$.range};break;case 58:this.$={type:`Reference`,name:a[s],range:this._$.range};break;case 59:case 60:case 61:case 62:case 107:case 108:case 109:case 110:case 119:case 120:case 121:this.$={type:`Literal`,value:a[s],range:this._$.range};break;case 63:this.$={type:`Template`,values:a[s],range:this._$.range};break;case 66:this.$={type:`SliceNotation`,value:null,arguments:a[s-1],range:this._$.range};break;case 68:this.$={type:`Conditional`,test:null,consequent:a[s-1],alternate:a[s],range:this._$.range};break;case 69:case 73:this.$={type:`GetProperty`,value:null,property:a[s],range:this._$.range};break;case 70:case 74:this.$={type:`MethodCall`,value:null,method:a[s],range:this._$.range};break;case 71:this.$={type:`Parentheses`,body:a[s-1],range:this._$.range};break;case 72:this.$={type:`Parentheses`,body:{type:`Block`,definitions:a[s-2],body:a[s-1]},range:this._$.range};break;case 75:this.$={type:`Map`,value:null,query:a[s-1],range:this._$.range};break;case 76:this.$={type:`Filter`,value:null,query:a[s-1],range:this._$.range};break;case 77:this.$={type:`MapRecursive`,value:null,query:{type:`GetProperty`,value:null,property:a[s]},range:this._$.range};break;case 78:this.$={type:`MapRecursive`,value:null,query:{type:`MethodCall`,value:null,method:a[s]},range:this._$.range};break;case 79:this.$={type:`MapRecursive`,value:null,query:a[s-1],range:this._$.range};break;case 80:this.$={type:`Pipeline`,left:null,right:a[s],range:this._$.range};break;case 81:this.$={type:`Pipeline`,left:null,right:{type:`Block`,definitions:a[s-1],body:a[s]},range:this._$.range};break;case 82:this.$={type:`Pick`,value:a[s-2],getter:null,range:this._$.range};break;case 83:this.$={type:`Pick`,value:a[s-3],getter:a[s-1],range:this._$.range};break;case 84:this.$={type:`SliceNotation`,value:a[s-3],arguments:a[s-1],range:this._$.range};break;case 85:this.$={type:`GetProperty`,value:a[s-2],property:a[s],range:this._$.range};break;case 86:this.$={type:`MethodCall`,value:a[s-2],method:a[s],range:this._$.range};break;case 87:this.$={type:`Map`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 88:this.$={type:`Filter`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 89:this.$={type:`MapRecursive`,value:a[s-2],query:{type:`GetProperty`,value:null,property:a[s]},range:this._$.range};break;case 90:this.$={type:`MapRecursive`,value:a[s-2],query:{type:`MethodCall`,value:null,method:a[s]},range:this._$.range};break;case 91:this.$={type:`MapRecursive`,value:a[s-3],query:a[s-1],range:this._$.range};break;case 92:this.$={type:`Method`,reference:{type:`Identifier`,name:a[s-1],range:[o[s-1].range[0],o[s-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=a[s-1];break;case 93:this.$={type:`Method`,reference:{type:`Identifier`,name:a[s-2],range:[o[s-2].range[0],o[s-2].range[1]-1]},arguments:a[s-1],range:this._$.range},this._mn=a[s-2];break;case 94:this.$={type:`Method`,reference:{type:`Reference`,name:{type:`Identifier`,name:a[s-1],range:[o[s-1].range[0],o[s-1].range[1]-1]},range:[o[s-1].range[0],o[s-1].range[1]-1]},arguments:[],range:this._$.range},this._mn=a[s-1];break;case 95:this.$={type:`Method`,reference:{type:`Reference`,name:{type:`Identifier`,name:a[s-2],range:[o[s-2].range[0],o[s-2].range[1]-1]},range:[o[s-2].range[0],o[s-2].range[1]-1]},arguments:a[s-1],range:this._$.range},this._mn=a[s-2];break;case 97:case 100:case 118:case 137:case 156:a[s-2].push(a[s]);break;case 102:this.$=[a[s-1],...a[s]];break;case 103:case 158:this.$=[null,a[s]];break;case 104:case 160:this.$=[a[s-1],a[s]];break;case 105:this.$=[null,a[s-1],...a[s]];break;case 106:this.$=[a[s-2],a[s-1],...a[s]];break;case 111:case 114:this.$={type:`Object`,properties:[],range:this._$.range};break;case 112:this.$={type:`Object`,properties:a[s-1],range:this._$.range};break;case 113:this.$={type:`Object`,properties:a[s-2],range:this._$.range};break;case 115:this.$={type:`Block`,definitions:a[s-2],body:{type:`Object`,properties:a[s-1]},range:this._$.range};break;case 116:this.$={type:`Block`,definitions:a[s-3],body:{type:`Object`,properties:a[s-2]},range:this._$.range};break;case 122:this.$={type:`ObjectEntry`,key:{type:`Current`},value:null,range:this._$.range};break;case 123:this.$={type:`ObjectEntry`,key:{type:`Reference`,name:a[s]},value:null,range:this._$.range};break;case 124:case 126:this.$={type:`ObjectEntry`,key:a[s],value:null,range:this._$.range};break;case 125:this.$={type:`ObjectEntry`,key:{type:`Literal`,value:this._mn},value:a[s],range:this._$.range};break;case 127:case 128:this.$={type:`ObjectEntry`,key:a[s-2],value:a[s],range:this._$.range};break;case 129:this.$={type:`ObjectEntry`,key:{type:`Identifier`,name:`$`+a[s-2].name,range:o[s-2].range},value:a[s],range:this._$.range};break;case 130:this.$={type:`ObjectEntry`,key:a[s-1],value:{type:`Pipeline`,left:{type:`Reference`,name:a[s-1]},right:a[s]},range:this._$.range};break;case 131:this.$={type:`ObjectEntry`,key:a[s-1],value:{type:`Pipeline`,left:{type:`GetProperty`,value:null,property:a[s-1]},right:a[s]},range:this._$.range};break;case 132:this.$={type:`ObjectEntry`,key:{type:`Literal`,value:this._mn},value:{type:`Pipeline`,left:a[s-1],right:a[s]},range:this._$.range};break;case 133:this.$={type:`ObjectEntry`,key:a[s-3],value:a[s],range:this._$.range};break;case 134:this.$={type:`Spread`,query:null,array:!1,range:this._$.range};break;case 135:this.$={type:`Spread`,query:a[s],array:!1,range:this._$.range};break;case 139:this.$={type:`Spread`,query:null,array:!0,range:this._$.range};break;case 140:this.$={type:`Spread`,query:a[s],array:!0,range:this._$.range};break;case 141:this.$={type:`Array`,elements:[],range:this._$.range};break;case 142:this.$={type:`Array`,elements:a[s-1],range:this._$.range};break;case 143:this.$={type:`Array`,elements:a[s-2],range:this._$.range};break;case 144:this.$={type:`Assertion`,negation:!1,assertion:a[s],range:this._$.range};break;case 145:this.$={type:`Assertion`,negation:!0,assertion:a[s],range:this._$.range};break;case 146:this.$={type:`Assertion`,negation:!1,assertion:a[s-1],range:this._$.range};break;case 147:this.$={type:`Assertion`,negation:!0,assertion:a[s-1],range:this._$.range};break;case 150:this.$={type:`Method`,reference:{type:`Reference`,name:a[s]},arguments:[],range:this._$.range};break;case 151:this.$={type:`Identifier`,name:String(a[s]),range:this._$.range};break;case 153:case 154:a[s-2].push(a[s-1],a[s]);break;case 157:this.$={type:`Compare`,query:a[s-1],order:a[s],range:this._$.range};break;case 159:this.$=[null,a[s-1],a[s]];break;case 161:this.$=[a[s-2],a[s-1],a[s]]}},trace(...e){this.DEBUG&&Jison.print(...e)},parseError(e,t){if(t.recoverable)this.trace(e);else{let n=Error(e);throw n.hash=t,n}},parse(e,...t){let n=e=>{u.length-=2*e,d.length-=e,f.length-=e},r=()=>{let e=i.lex()||1;return typeof e!=`number`&&(e=this.symbols_[e]||e),e},i=Object.create(this.lexer),a=i.options&&i.options.ranges,o={...this.yy,parser:this,lexer:i};i.setInput(e,o),typeof o.parseError==`function`&&(this.parseError=o.parseError),i.yylloc===void 0&&(i.yylloc={});let s=this.table,c={},l=i.yylloc,u=[0],d=[null],f=[l],p=``,m=0,h=0,g=0,_,v;for(;;){let e=u[u.length-1],y;if(this.defaultActions[e]?y=this.defaultActions[e]:(_??=r(),y=s[e]&&s[e][_]),!y||!y[0]){let t,a=``;if(!g){let t=[];for(let n in s[e])n in this.terminals_&&n>2&&t.push(`'`+this.terminals_[n]+`'`);a=i.showPosition?`Parse error on line `+(m+1)+`:
|
|
54
|
+
`+i.showPosition()+`
|
|
55
|
+
Expecting `+t.join(`, `)+`, got '`+(this.terminals_[_]||_)+`'`:`Parse error on line `+(m+1)+`: Unexpected `+(_===1?`end of input`:`'`+(this.terminals_[_]||_)+`'`),this.parseError(a,{text:i.match,token:this.terminals_[_]||_,line:i.yylineno,loc:l,expected:t})}if(g===3){if(_===1||v===1)throw Error(a||`Parsing halted while starting to recover from another error.`);h=i.yyleng,p=i.yytext,m=i.yylineno,l=i.yylloc,_=r()}n(t),v=_==2?null:_,_=2,e=u[u.length-1],y=s[e]&&s[e][2],g=3}if(Array.isArray(y[0])&&y.length>1)throw Error(`Parse Error: multiple actions possible at state: `+e+`, token: `+_);switch(y[0]){case 1:u.push(_),d.push(i.yytext),f.push(i.yylloc),u.push(y[1]),_=null,v?(_=v,v=null):(h=i.yyleng,p=i.yytext,m=i.yylineno,l=i.yylloc,g>0&&g--);break;case 2:{let e=this.productions_[y[1]][1],r=f[f.length-(e||1)],i=f[f.length-1];c.$=d[d.length-e],c._$={first_line:r.first_line,last_line:i.last_line,first_column:r.first_column,last_column:i.last_column},a&&(c._$.range=[r.range[0],i.range[1]]);let l=this.performAction.call(c,p,h,m,o,y[1],d,f,...t);if(l!==void 0)return l;e&&n(e),u.push(this.productions_[y[1]][0]),d.push(c.$),f.push(c._$),u.push(s[u[u.length-2]][u[u.length-1]]);break}case 3:return!0}}}};var VB=(function(e){function t(e,t){Object.entries(t).forEach(([t,n])=>e[t]=n(e[t]))}let n=new Map([[`EOF`,[`<end of input>`]],[`IDENT`,[`ident`]],[`$IDENT`,[`$ident`]],[`NOT`,[`'not'`]],[`NO`,[`'no'`]],[`IS`,[`'is'`]],[`IN`,[`'in'`]],[`HAS`,[`'has'`]],[`NOTIN`,[`'not in'`]],[`HASNO`,[`'has no'`]],[`AND`,[`'and'`]],[`OR`,[`'or'`]],[`STRING`,[`string`]],[`TPL_START`,[`template`]],[`TEMPLATE`,[`template`]],[`NUMBER`,[`number`]],[`REGEXP`,[`regexp`]],[`LITERAL`,[`'true'`,`'false'`,`'null'`,`'undefined'`,`'NaN'`,`'Infinity'`]],[`ORDER`,[`'asc'`,`'desc'`,`'ascN'`,`'descN'`]],[`METHOD(`,[`'method('`]],[`$METHOD(`,[`'$method('`]]]),r=e=>n.get(e)||`'${e}'`,i=function(e,t={},n){if(t.recoverable)this.trace(e);else{if(Array.isArray(t.inside)){let e=n.lexer.offset-n.lexer.match.length;n.lexer.setMatch(e+t.inside[0],e+t.inside[1])}let i=n.lexer.yylloc,a=[e.split(/\n/)[0],``,n.lexer.showPosition()],o=Array.isArray(t.expected)?[...new Set([].concat(...t.expected.map(e=>r(e.slice(1,-1)))))]:null;o&&a.push(``,`Expecting `+o.join(`, `)+` got `+r(t.token));let s=SyntaxError(a.join(`
|
|
56
|
+
`));throw s.details={rawMessage:e,text:t.text,token:t.token,expected:o,loc:{range:i.range,start:{line:i.first_line,column:i.first_column,offset:i.range[0]},end:{line:i.last_line,column:i.last_column,offset:i.range[1]}}},s}},a=new Set([`
|
|
57
|
+
`,`\r`,`\u2028`,`\u2029`]),o=new Map([[`undefined`,void 0],[`null`,null],[`false`,!1],[`true`,!0],[`Infinity`,1/0],[`NaN`,NaN]]);Object.assign(e.lexer,{toLiteral:e=>o.get(e),toNumberLiteral(e,t,n=!1){if(t){let t=e.match(n?/(?:^|[^0-9a-fA-F])_|_(?:[^0-9a-fA-F]|$)/:/(?:^|\D)_|_(?:\D|$)/);if(t){let e=t[0],n=t.index+Number(e[1]===`_`),r=e===`__`?`Only one underscore is allowed`:`Wrong underscore`;this.parseError(r+` as numeric separator`,{inside:[n,n+1]})}e=e.replace(/_/g,``)}return n?parseInt(e,16):parseFloat(e)},toStringLiteral(e,t=!1,n=1){let r=e.length-n,i=``;for(let n=1;n<r;n++){if(!t&&a.has(e[n])&&this.parseError(`Invalid line terminator`,{inside:[n,n+1]}),e[n]!==`\\`){i+=e[n];continue}n===r-1&&this.parseError(`Invalid backslash`,{inside:[n,n+1]});let o=e[++n];switch(o){case`\r`:n+=e[n+1]===`
|
|
58
|
+
`;break;case`
|
|
59
|
+
`:case`\u2028`:case`\u2029`:break;case`0`:i+=`\0`;break;case`b`:i+=`\b`;break;case`n`:i+=`
|
|
60
|
+
`;break;case`r`:i+=`\r`;break;case`f`:i+=`\f`;break;case`t`:i+=` `;break;case`v`:i+=`\v`;break;case`u`:{let[t=``]=e.slice(n+1,n+5).match(/^[0-9a-f]*/i)||[];if(t.length===4){i+=String.fromCharCode(parseInt(t,16)),n+=4;break}this.parseError(`Invalid Unicode escape sequence`,{inside:[n-1,Math.min(n+1+t.length,r)]});break}case`x`:{let[t=``]=e.slice(n+1,n+3).match(/^[0-9a-f]*/i)||[];if(t.length===2){i+=String.fromCharCode(parseInt(t,16)),n+=2;break}this.parseError(`Invalid hexadecimal escape sequence`,{inside:[n-1,Math.min(n+1+t.length,r)]});break}default:i+=o}}return i},toRegExp(e){let t=e.lastIndexOf(`/`)+1,n=e.substr(t);return n.split(``).forEach((e,n,r)=>{let i=r.indexOf(e,n+1);i!==-1&&this.parseError(`Duplicate flag in regexp`,{inside:[t+i,t+i+1]})}),new RegExp(e.substr(1,e.lastIndexOf(`/`)-1),n)}}),t(e.lexer,{setInput:e=>function(t,n){let r=[];return n.commentRanges=r,n.buildResult=e=>({ast:e,commentRanges:r}),n.parseError=function(...e){return i.call(this,...e,n)},n.pks=()=>{this.eof()||this.begin(`preventKeyword`)},n.pps=()=>{this.eof()||this.begin(`preventPrimitive`)},this.bracketStack=[],this.prevToken=null,this.prevYylloc={first_line:1,last_line:1,first_column:0,last_column:0,range:[0,0]},e.call(this,t,n)}});let s=new e.Parser;s.lexer={...e.lexer},s.yy={...e.yy};let c=[`AND`,`OR`,`IN`,`NOTIN`,`HAS`,`HASNO`,`IS`],l=[...c,`NOT`,`NO`,`ORDER`],u=[`+`,`-`,`*`,`/`,`%`,`|`,`=`,`!=`,`~=`,`>=`,`<=`,`<`,`>`],d=[null,`?`,`:`,`;`,`,`,`.`,`..`,`(`,`.(`,`..(`,`METHOD(`,`$METHOD(`,`[`,`.[`,`=>`,...u,...c,`NOT`,`NO`],f=[`,`,`?`,`:`,`;`,`EOF`,`]`,`)`,`}`,`TPL_CONTINUE`,`TPL_END`,...u,...c,`ORDER`],p=new Map(d.map(e=>[e,new Set(f)]));for(let e of[`.(`,`..(`,`METHOD(`,`$METHOD(`])p.get(e).delete(`)`);for(let e of[`[`,`.[`])p.get(e).delete(`]`);t(s.lexer,{lex:e=>function(){let t=this.offset,n=e.call(this);if(p.has(this.prevToken)&&p.get(this.prevToken).has(n)){let e={first_line:this.prevYylloc.last_line,last_line:this.yylloc.first_line,first_column:this.prevYylloc.last_column,last_column:this.yylloc.first_column,range:[this.prevYylloc.range[1],this.yylloc.range[0]]};if(this.unput(this.match),this.pushState(`preventPrimitive`),this.done=!1,this.yytext=``,this.yylloc=this.prevYylloc=e,t!==this.offset&&l.includes(n))switch(this._input[t]){case` `:case` `:e.last_column--,e.range[1]--;break;case`
|
|
61
|
+
`:{let n=this._input.lastIndexOf(`
|
|
62
|
+
`,t-1);e.last_line--,e.last_column=n===-1?e.last_column-1:t-n,e.range[1]--;break}}return this.prevToken=`IDENT`}if(this.prevYylloc=this.yylloc,l.includes(n))switch(this._input[this.offset]){case` `:case` `:this.prevYylloc={...this.prevYylloc,last_column:this.prevYylloc.last_column+1,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]};break;case`
|
|
63
|
+
`:this.prevYylloc={...this.prevYylloc,last_line:this.prevYylloc.last_line+1,last_column:0,range:[this.prevYylloc.range[0],this.prevYylloc.range[1]+1]}}return this.prevToken=n}});let m=new Map([[`(`,`)`],[`.(`,`)`],[`..(`,`)`],[`METHOD(`,`)`],[`$METHOD(`,`)`],[`[`,`]`],[`.[`,`]`],[`{`,`}`],[`TPL_START`,`TPL_END`]]),h=new Set([`)`,`]`,`}`,`TPL_END`]),g=e=>function(){let t=e.call(this);if(h.has(t)){let e=this.bracketStack.pop();e!==t&&this.parseError(`Expected "${e}" got "${t}"`)}return m.has(t)&&this.bracketStack.push(m.get(t)),t};return t(e.lexer,{lex:g}),t(s.lexer,{lex:g}),{parse(t,n){return n?s.parse(t):e.parse(t)},*tokenize(t,n,r){let i=n?s:e,a=Object.create(i.lexer);for(a.setInput(t,{parser:i});!a.done;){let e={type:a.lex(),value:a.match,offset:a.yylloc.range[0]};r&&(e.loc={range:a.yylloc.range,start:{line:a.yylloc.first_line,column:a.yylloc.first_column},end:{line:a.yylloc.last_line,column:a.yylloc.last_column}}),yield e}}}})(new BB),HB=s({compile:()=>UB,stringify:()=>GB,walk:()=>WB});function UB(e,t){let n=t.scope.arg1;t.put(typeof n==`string`?n:`undefined`)}function WB(){}function GB(e,t){t.put(`$$`)}var KB=s({compile:()=>JB,stringify:()=>XB,suggest:()=>qB,walk:()=>YB});function qB(e,t){e.elements.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function JB(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}function YB(e,t){t.list(e.elements)}function XB(e,t){t.put(`[`),t.list(e.elements,`,`),t.put(`]`)}var ZB=s({compile:()=>$B,stringify:()=>tV,suggest:()=>QB,walk:()=>eV});function QB(e,t){Array.isArray(e.assertion)||(t.range(e.assertion.range,`var`),t.range(e.assertion.range,`assertion`))}function $B(e,t){if(Array.isArray(e.assertion)){t.put(e.negation?`!(`:`(`);for(let n=0;n<e.assertion.length;n++)if(n%2==0)t.node(e.assertion[n]);else switch(e.assertion[n]){case`and`:t.put(`&&`);break;case`or`:t.put(`||`);break;default:t.error(`Bad conjuction operator in assertion`,e)}t.put(`)`)}else switch(e.negation&&t.put(`!`),e.assertion.type){case`Identifier`:e.assertion.name?(t.put(`!!`),t.tolerant&&t.put(`(typeof `),t.put(`a[`),t.node(e.assertion),t.put(`]`),t.tolerant&&(t.put(`==="function"?a[`),t.node(e.assertion),t.put(`]`)),t.put(`.call(mctx,`),t.nodeOrCurrent(),t.put(`)`),t.tolerant&&t.put(`:false)`),t.usedAssertions.has(e.assertion.name)?t.usedAssertions.get(e.assertion.name).push(e.assertion.range):t.usedAssertions.set(e.assertion.name,e.assertion.range)):t.put(`false`);break;case`Method`:t.put(`!!`),t.node(e.assertion);break;default:t.error(`Unknown assertion node type "`+e.assertion.type+`"`,e.assertion)}}function eV(e,t){if(Array.isArray(e.assertion))for(let n=0;n<e.assertion.length;n++)n%2==0&&t.node(e.assertion[n]);else t.node(e.assertion)}function tV(e,t){if(e.negation&&t.put(`not `),Array.isArray(e.assertion)){t.put(`(`);for(let n=0;n<e.assertion.length;n++)n%2==0?t.node(e.assertion[n]):(t.put(` `),t.put(e.assertion[n]),t.put(` `));t.put(`)`)}else t.node(e.assertion)}var nV=s({compile:()=>oV,stringify:()=>cV,suggest:()=>aV,walk:()=>sV}),rV={in:`in`,"not in":`notIn`,has:`has`,"has no":`hasNo`,and:`and`,or:`or`,"??":`nullish`,"+":`add`,"-":`sub`,"*":`mul`,"/":`div`,"%":`mod`,"=":`eq`,"!=":`ne`,"<":`lt`,"<=":`lte`,">":`gt`,">=":`gte`,"~=":`match`};function iV(e,t,n){if(n.type===`Array`){if(n.elements.length===0){e.range([n.range[0]+1,n.range[1]-1],`value-subset`,t,!1);return}let r=[];for(let{type:e,range:t,value:i}of n.elements)t&&(e===`Literal`||e===`Identifier`)&&r.push(i);let i=r.length?e.literalList(r):!1;for(let{type:r,range:a,value:o}of n.elements)a&&(r===`Literal`||r===`Identifier`||r===`GetProperty`&&o===null)&&e.range(a,`value-subset`,t,i)}}function aV(e,t){switch(e.operator){case`in`:t.range(e.left.range,`in-value`,e.right,null),iV(t,e.left,e.right);break;case`not in`:iV(t,e.left,e.right);break;case`has`:t.range(e.right.range,`in-value`,e.left,null),iV(t,e.right,e.left);break;case`has no`:iV(t,e.right,e.left);break;case`=`:case`!=`:t.range(e.right.range,`value`,e.left,null)}}function oV(e,t){if(!(e.operator in rV)){t.error(`Unknown operator "`+e.operator+`"`,e);return}switch(e.operator){case`and`:t.put(`!`);case`or`:{let n=t.allocateVar();t.put(`${t.buildinFn(`bool`)}(${n}=`),t.node(e.left),t.put(`)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`??`:{let n=t.allocateVar();t.put(`(${n}=`),t.node(e.left),t.put(`,${n}!==null&&${n}!==undefined)?${n}:`),t.createScope(()=>t.node(e.right),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref);break}case`has no`:t.put(`!`);case`has`:t.put(t.buildinFn(`in`)),t.put(`(`),t.node(e.right),t.put(`,`),t.node(e.left),t.put(`)`);break;default:t.put(t.buildinFn(rV[e.operator])),t.put(`(`),t.node(e.left),t.put(`,`),t.node(e.right),t.put(`)`)}}function sV(e,t){t.node(e.left),t.node(e.right)}function cV(e,t){t.node(e.left),/^[a-z]/i.test(e.operator)?(t.put(` `),t.put(e.operator),t.put(` `)):t.put(e.operator),t.node(e.right)}var lV=s({compile:()=>dV,stringify:()=>pV,suggest:()=>uV,walk:()=>fV});function uV(e,t){e.body===null&&t.queryRoot(e.range[1])}function dV(e,t){e.definitions.length?(t.put(`(()=>{`),t.createScope(()=>{for(let{declarator:n}of e.definitions)n.name&&t.scope.awaitInit.add(t.unescapeName(`$`+n.name,n));t.list(e.definitions),t.put(`return `),t.nodeOrCurrent(e.body)},e=>e+`;`,t.scope.$ref),t.put(`})()`)):e.body&&e.body.type===`Object`?(t.put(`(`),t.nodeOrCurrent(e.body),t.put(`)`)):t.nodeOrCurrent(e.body)}function fV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}function pV(e,t){t.list(e.definitions),t.nodeOrNothing(e.body)}var mV=s({compile:()=>gV,stringify:()=>vV,walk:()=>_V}),hV={"":`cmp`,N:`cmpNatural`,A:`cmpAnalytical`,NA:`cmpNaturalAnalytical`,AN:`cmpNaturalAnalytical`};function gV(e,t){let n=e.order.startsWith(`desc`),r=hV[e.order.slice(n?4:3)]||hV[``];n&&t.put(`-`),t.put(t.buildinFn(r)),t.put(`((_q=$=>(`),t.createScope(()=>t.node(e.query),e=>e+`,`),t.put(`))(_a),_q(_b))`)}function _V(e,t){t.node(e.query)}function vV(e,t){t.node(e.query),t.put(` `),t.put(e.order)}var yV=s({compile:()=>bV,stringify:()=>SV,walk:()=>xV});function bV(e,t){t.put(`(_a, _b)=>{let _q;return `),t.list(e.compares,`||`),t.put(`||0}`)}function xV(e,t){t.list(e.compares)}function SV(e,t){t.list(e.compares,`,`)}var CV=s({compile:()=>wV,stringify:()=>EV,walk:()=>TV});function wV(e,t){t.put(t.buildinFn(`bool`)),t.put(`(`),t.nodeOrCurrent(e.test),t.put(`)?`),t.createScope(()=>t.nodeOrCurrent(e.consequent),e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref),t.put(`:`),t.createScope(()=>{e.alternate?e.alternate.type===`Placeholder`?(t.put(`(`),t.node(e.alternate),t.put(`,undefined)`)):t.node(e.alternate):t.put(`undefined`)},e=>(t.put(`)`),`(`+e+`,`),t.scope.$ref)}function TV(e,t){t.nodeOrNothing(e.test),t.nodeOrNothing(e.consequent),t.nodeOrNothing(e.alternate)}function EV(e,t){t.nodeOrNothing(e.test),t.put(`?`),t.nodeOrNothing(e.consequent),e.alternate&&(t.put(`:`),t.node(e.alternate))}var DV=s({compile:()=>OV,stringify:()=>AV,walk:()=>kV});function OV(e,t){t.put(`context`)}function kV(){}function AV(e,t){t.put(`#`)}var jV=s({compile:()=>NV,stringify:()=>FV,suggest:()=>MV,walk:()=>PV});function MV(e,t){e.range&&t.range(e.range,`var`)}function NV(e,t){t.put(t.scope.$ref)}function PV(){}function FV(e,t){t.put(`$`)}var IV=s({compile:()=>LV,stringify:()=>zV,walk:()=>RV});function LV(e,t){t.put(`data`)}function RV(){}function zV(e,t){t.put(`@`)}var BV=s({compile:()=>VV,stringify:()=>UV,walk:()=>HV});function VV(e,t){e.name&&t.putIdent(`$`+t.unescapeName(e.name,e),e)}function HV(){}function UV(e,t){t.put(e.name?`$`+e.name:`$`)}function WV(e,t){return{type:`GetProperty`,value:e,property:t}}function GV(e){return{type:`Identifier`,name:e}}var KV=s({compile:()=>YV,stringify:()=>ZV,suggest:()=>JV,walk:()=>XV}),qV=[`$data`,`$context`,`$ctx`,`$array`,`$idx`,`$index`];function JV(e,t){e.value===null&&t.range(e.declarator.range,`path`)}function YV(e,t){let n=e.declarator.name,r=n&&t.unescapeName(`$`+n,e);if(r===null){t.node(e.declarator),t.nodeOrCurrent(e.value),t.put(`;`);return}if(t.scope.own.has(r)){t.error(`Identifier "${r}" has already been declared`,e.declarator);return}if(qV.includes(r)){t.error(`Identifier "${r}" is reserved for future use`,e.declarator);return}t.put(`const `),t.node(e.declarator),t.put(`=`),t.node(e.value||WV(null,GV(n))),t.put(`;`),t.scope.add(r),t.scope.own.add(r),t.scope.awaitInit.delete(r)}function XV(e,t){t.node(e.declarator),t.nodeOrNothing(e.value)}function ZV(e,t){t.node(e.declarator),e.value!==null&&(t.put(`:`),t.node(e.value)),t.put(`;`)}var QV=s({compile:()=>$V,stringify:()=>tH,walk:()=>eH});function $V(e,t){t.put(t.buildinFn(`filter`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function eH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function tH(e,t){t.nodeOrNothing(e.value),t.put(`.[`),t.node(e.query),t.put(`]`)}var nH=s({compile:()=>rH,stringify:()=>aH,walk:()=>iH});function rH(e,t){let n=e.arguments.map(e=>t.unescapeName(`$`+e.name,e)),r=e.arguments.find((e,t)=>t>0&&n.lastIndexOf(`$`+e.name,t-1)!==-1);r&&t.error(`Duplicate parameter name "$`+r.name+`" is not allowed`,r),t.put(`function(`),t.put(String(n)||`$`),t.put(`){return `),t.createScope(()=>{t.scope.arg1=n[1]||`arguments[1]`,t.scope.$ref=n[0]||`$`;for(let e of n)t.scope.add(e);t.node(e.body)},e=>e+`,`),t.put(`}`)}function iH(e,t){t.node(e.body)}function aH(e,t){t.put(`=>`),t.node(e.body)}var oH=s({compile:()=>cH,stringify:()=>uH,suggest:()=>sH,walk:()=>lH});function sH(e,t){t.range(e.property.range,`path`,e.value||void 0,!e.value),e.value===null&&t.range(e.property.range,`var`),e.range&&e.value===null&&e.property.range[0]!==e.range[0]&&t.queryRoot(e.range[0])}function cH(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,`),t.node(e.property),t.put(`)`)}function lH(e,t){t.nodeOrNothing(e.value),t.node(e.property)}function uH(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.property)}var dH=s({compile:()=>fH,stringify:()=>mH,walk:()=>pH});function fH(e,t){t.put(JSON.stringify(t.unescapeName(e.name,e,!1)))}function pH(){}function mH(e,t){t.put(e.name)}var hH=s({compile:()=>gH,stringify:()=>vH,walk:()=>_H});function gH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}function _H(){}function vH(e,t){t.put(typeof e.value==`string`?JSON.stringify(e.value):String(e.value))}var yH=s({compile:()=>bH,stringify:()=>SH,walk:()=>xH});function bH(e,t){t.put(t.buildinFn(`map`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function xH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function SH(e,t){t.nodeOrNothing(e.value),t.put(`.(`),t.node(e.query),t.put(`)`)}var CH=s({compile:()=>wH,stringify:()=>EH,walk:()=>TH});function wH(e,t){t.put(t.buildinFn(`mapRecursive`)),t.put(`(`),t.nodeOrCurrent(e.value),t.put(`,$=>`),t.createScope(()=>t.node(e.query),e=>(t.put(`)`),`(`+e+`,`)),t.put(`)`)}function TH(e,t){t.nodeOrNothing(e.value),t.node(e.query)}function EH(e,t){t.nodeOrNothing(e.value),t.put(`..`),t.isSimpleGetPropertyQuery(e.query)||t.isSimpleMethodCallQuery(e.query)?t.node(e.query):(t.put(`(`),t.node(e.query),t.put(`)`))}var DH=s({compile:()=>kH,stringify:()=>jH,suggest:()=>OH,walk:()=>AH});function OH(e,t){e.arguments.length===0&&t.queryRoot(e.range[1]-1)}function kH(e,t,n){let r=e.reference.type===`Identifier`;t.tolerant&&t.put(`(typeof `),r?(t.usedMethods.has(e.reference.name)?t.usedMethods.get(e.reference.name).push(e.reference.range):t.usedMethods.set(e.reference.name,[e.reference.range]),t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference),t.tolerant&&(t.put(`==="function"?`),r?(t.put(`m[`),t.node(e.reference),t.put(`]`)):t.node(e.reference)),t.put(r?`.call(mctx,`:`(`),t.nodeOrCurrent(n),e.arguments.length&&(t.put(`,`),t.list(e.arguments,`,`)),t.put(`)`),t.tolerant&&t.put(`:undefined)`)}function AH(e,t){t.node(e.reference),t.list(e.arguments)}function jH(e,t){t.node(e.reference),t.put(`(`),t.list(e.arguments,`,`),t.put(`)`)}var MH=s({compile:()=>NH,stringify:()=>FH,walk:()=>PH});function NH(e,t){t.node(e.method,e.value)}function PH(e,t){t.nodeOrNothing(e.value),t.node(e.method)}function FH(e,t){t.nodeOrNothing(e.value)&&t.put(`.`),t.node(e.method)}var IH=s({compile:()=>RH,stringify:()=>BH,suggest:()=>LH,walk:()=>zH});function LH(e,t){e.properties.length===0&&t.queryRoot(e.range[0]+1,e.range[1]-1)}function RH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}function zH(e,t){t.list(e.properties)}function BH(e,t){t.put(`{`),t.list(e.properties,`,`),t.put(`}`)}var VH=s({compile:()=>WH,stringify:()=>KH,suggest:()=>UH,walk:()=>GH}),HH=new Set([`Literal`,`Identifier`,`Reference`,`Current`]);function UH(e,t){if(e.value===null)switch(e.key.type){case`Literal`:case`Identifier`:t.range(e.range,`path`),t.range(e.range,`var`);break;case`Current`:case`Reference`:t.range(e.range,`var`)}}function WH(e,t){let n=e.value;switch(e.key.type){case`Current`:t.put(`...null`);return;case`Literal`:t.node(e.key),n||=WV(null,GV(String(e.key.value)));break;case`Identifier`:t.node(e.key),n||=WV(null,e.key);break;case`Reference`:t.node(e.key.name),n||=e.key;break;default:t.put(`[`),t.node(e.key),t.put(`]`)}t.put(`:`),t.node(n)}function GH(e,t){t.node(e.key),t.nodeOrNothing(e.value)}function KH(e,t){if(HH.has(e.key.type)){if(t.node(e.key),e.value===null)return}else t.put(`[`),t.node(e.key),t.put(`]`);t.put(`:`),t.node(e.value)}var qH=s({compile:()=>JH,stringify:()=>XH,walk:()=>YH});function JH(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}function YH(e,t){t.node(e.body)}function XH(e,t){t.put(`(`),t.node(e.body),t.put(`)`)}var ZH=s({compile:()=>$H,stringify:()=>tU,suggest:()=>QH,walk:()=>eU});function QH(e,t){if(e.getter===null){let n=e.range[1]-1;t.range([n,n],`key`,e.value,!1),t.queryRoot(n)}else(e.getter.type===`GetProperty`||e.getter.type===`Reference`||e.getter.type===`Literal`&&typeof e.getter.value==`string`)&&t.range(e.getter.range,`key`,e.value,!1)}function $H(e,t){t.put(t.buildinFn(`pick`)),t.put(`(`),t.node(e.value),e.getter&&(t.put(`,`),t.node(e.getter)),t.put(`)`)}function eU(e,t){t.node(e.value),e.getter!==null&&t.node(e.getter)}function tU(e,t){t.node(e.value),t.put(`[`),e.getter!==null&&t.node(e.getter),t.put(`]`)}var nU=s({compile:()=>rU,stringify:()=>aU,walk:()=>iU});function rU(e,t){t.put(`($=>(`),t.createScope(()=>t.node(e.right),e=>e+`,`),t.put(`))`),t.put(`(`),t.nodeOrCurrent(e.left),t.put(`)`)}function iU(e,t){t.node(e.left),t.node(e.right)}function aU(e,t){t.node(e.left),t.put(`|`),t.node(e.right)}var oU=s({compile:()=>cU,stringify:()=>uU,suggest:()=>sU,walk:()=>lU});function sU(e,t){t.queryRoot(e.range[1])}function cU(e,t){t.put(t.scope.$ref)}function lU(){}function uU(){}var dU=s({compile:()=>fU,stringify:()=>mU,walk:()=>pU});function fU(e,t){if(e.operator&&e.operator.type){t.put(`($=>(`),t.createScope(()=>t.node(e.operator),e=>e+`,`),t.put(`))`),t.put(`(`),t.node(e.argument),t.put(`)`);return}t.error(`Unknown operator "`+e.operator+`"`,e)}function pU(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function mU(e,t){t.node(e.argument),t.put(` `),t.node(e.operator)}var hU=s({compile:()=>gU,stringify:()=>vU,walk:()=>_U});function gU(e,t){switch(e.operator){case`no`:case`not`:t.put(`!`),t.put(t.buildinFn(`bool`)),t.put(`(`),t.node(e.argument),t.put(`)`);break;case`+`:case`-`:t.put(e.operator),t.node(e.argument);break;case`is`:t.put(`!!(`),t.node(e.argument),t.put(`)`);break;default:t.error(`Unknown operator "`+e.operator+`"`,e)}}function _U(e,t){t.node(e.argument),e.operator&&e.operator.type&&t.node(e.operator)}function vU(e,t){t.put(e.operator),e.operator!==`-`&&e.operator!==`+`&&t.put(` `),t.node(e.argument)}var yU=s({compile:()=>xU,stringify:()=>CU,suggest:()=>bU,walk:()=>SU});function bU(e,t){e.range&&t.range(e.range,`var`)}function xU(e,t){let n=e.name,r=t.unescapeName(`$`+n.name,n),i=t.scope.has(r),a=t.scope.awaitInit.has(r);if(!i||a){a?(t.put(`f.awaitInitRef(()=>`),t.putIdent(r,n),t.tolerant||(t.put(`,`),t.put(JSON.stringify(r)),t.put(`,`),t.put(JSON.stringify(n.range))),t.put(`)`)):t.tolerant?t.put(`undefined`):(t.putIdent(r,e),t.error(`${r} is not defined`,e));return}t.putIdent(r,n)}function SU(e,t){t.node(e.name)}function CU(e,t){t.put(`$`),t.node(e.name)}var wU=s({compile:()=>TU,stringify:()=>DU,walk:()=>EU});function TU(e,t){t.put(t.buildinFn(`slice`)),t.put(`(`),t.nodeOrCurrent(e.value),e.arguments.slice(0,3).forEach(e=>{t.put(`,`),e?t.node(e):t.put(`undefined`)}),t.put(`)`)}function EU(e,t){t.nodeOrNothing(e.value);for(let n of e.arguments.slice(0,3))n&&t.node(n)}function DU(e,t){let[n,r,i]=e.arguments;t.nodeOrNothing(e.value),t.put(`[`),n&&t.node(n),t.put(`:`),r&&t.node(r),i&&(t.put(`:`),t.node(i)),t.put(`]`)}var OU=s({compile:()=>AU,stringify:()=>MU,suggest:()=>kU,walk:()=>jU});function kU(e,t){e.query===null&&t.queryRoot(e.range[1])}function AU(e,t){if(e.array){t.put(`...`),t.put(t.buildinFn(`ensureArray`)),t.put(`(`),t.nodeOrCurrent(e.query),t.put(`)`);return}t.put(`...`),t.nodeOrCurrent(e.query)}function jU(e,t){t.nodeOrNothing(e.query)}function MU(e,t){t.put(`...`),t.nodeOrNothing(e.query)}var NU=s({compile:()=>FU,stringify:()=>LU,suggest:()=>PU,walk:()=>IU});function PU(e,t){for(let[n,r]of Object.entries(e.values))r===null&&t.queryRoot(e.values[Number(n)-1].range[1])}function FU(e,t){for(let[n,r]of Object.entries(e.values)){let e=Number(n);r!==null&&(e!==0&&t.put(`+`),e%2==0?t.put(`"`+BU(r.value,RU)+`"`):(t.put(`(`),t.node(r),t.put(`)`)))}}function IU(e,t){for(let n of e.values)n!==null&&t.node(n)}function LU(e,t){let n=e.values.length-1;for(let[r,i]of Object.entries(e.values)){let e=Number(r);e%2==0?(t.put(e===0?"`":`}`),t.put(BU(i.value,zU)),t.put(e===n?"`":"${")):i!==null&&t.node(i)}}var RU=new Map([[`\b`,`\\b`],[`
|
|
64
|
+
`,`\\n`],[`\r`,`\\r`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\u2028`,`\\u2028`],[`\u2029`,`\\u2029`],[`\\`,`\\\\`],[`"`,`\\"`]]),zU=new Map([[`\b`,`\\b`],[`\f`,`\\f`],[` `,`\\t`],[`\v`,`\\v`],[`\\`,`\\\\`],[`$`,`\\$`]]);function BU(e,t){let n=``;for(let r=0;r<e.length;r++)n+=t.get(e[r])||e[r];return n}var VU={Arg1:HB,Array:KB,Assertion:ZB,Binary:nV,Block:lV,Compare:mV,Conditional:CV,Context:DV,Current:jV,Data:IV,Declarator:BV,Definition:KV,Filter:QV,Function:nH,GetProperty:oH,Identifier:dH,Literal:hH,Map:yH,MapRecursive:CH,Method:DH,MethodCall:MH,Object:IH,ObjectEntry:VH,Parentheses:qH,Pick:ZH,Pipeline:nU,Placeholder:oU,Postfix:dU,Prefix:hU,Reference:yU,SliceNotation:wU,CompareFunction:yV,Spread:OU,Template:NU},HU=e=>new Map(Object.entries(VU).map(([t,n])=>[t,n[e]]).filter(([,e])=>typeof e==`function`)),UU={};HU(`build`).forEach((e,t)=>UU[t]=e);var WU=HU(`compile`),GU=HU(`walk`),KU=HU(`stringify`),qU=HU(`suggest`);function JU(e,t){function n(e){if(GU.has(e.type))i(e),GU.get(e.type)(e,r),a(e);else throw Error(`Unknown node type "`+e.type+`"`)}let r={node:n,nodeOrNothing(e){e!==null&&n(e)},list(e){e.forEach(n)}},i=()=>{},a=()=>{};typeof t==`function`&&(t={enter:t}),t&&(typeof t.enter==`function`&&(i=t.enter),typeof t.leave==`function`&&(a=t.leave)),n(e)}function YU(e,t){return t>=0&&t<e.length&&/[a-zA-Z_$0-9]/.test(e[t])}function XU(e,t){let n=e.charCodeAt(t);return n===9||n===10||n===13||n===32}function ZU(e,t,n){for(;t<n;t++)if(!XU(e,t))return!1;return!0}function QU(e,t,n,r,i){let a=[];for(let n=0;n<r.length;n++){let[i,o]=r[n];if(i>=t)break;i<e||(a.push(e,i),e=o)}return(e!==n.length||!i)&&a.push(e,t),a}function $U(e,t,n,r){let i=[];for(let a=0;a<e.length;a++){let[o,s,c,l]=e[a];if(ZU(t,o,s)){for(;o>=0&&XU(t,o-1);)o--;for(;s<t.length&&XU(t,s);)s++;if(YU(t,o-1)){if(o===s)continue;o++}if(YU(t,s)){if(o===s)continue;s--}}let u=QU(o,s,t,n,r);for(let e=0;e<u.length;e+=2)i.push([u[e],u[e+1],c,l])}return i}function eW(e){let t=null,n=[],r=Object.assign(new Map,{literalList:n}),i=(e,t)=>{r.has(e)?r.get(e).push(t):r.set(e,[t])},a={range(e,n,r=t,a=!0){i(r,[...e,n,a])},literalList(e){let t=`l`+n.length;return n.push([t,e]),t},queryRoot(e,n=e){i(t,[e,n,`var`,!0]),i(t,[e,n,`path`,!0])}};return JU(e,e=>{if(qU.has(e.type)){let n=t;t=e,qU.get(e.type)(e,a),t=n}}),r}function tW(e,{ast:t,commentRanges:n}){let r=eW(t),i=n.length&&n[n.length-1][1]===e.length&&!/[\r\n]$/.test(e);for(let[t,a]of r)r.set(t,$U(a,e,n,i));return r}function nW(e){return e.type===`GetProperty`}function rW(e){return e.type===`MethodCall`}function iW(e){function t(e){if(KU.has(e.type))KU.get(e.type)(e,r);else throw Error(`Unknown node type "`+e.type+`"`)}let n=[],r={isSimpleGetPropertyQuery:nW,isSimpleMethodCallQuery:rW,put(e){n.push(e)},node:t,nodeOrNothing(e){if(e!==null)return t(e),!0},list(e,n){if(!n){e.forEach(t);return}e.forEach((e,i)=>{i>0&&r.put(n),t(e)})}};return t(e),n.join(``)}function aW(e,t,n){let r=Object.assign(Object.create(SyntaxError.prototype),n),i=Error();return r.name=e,r.message=t,Object.defineProperty(r,"stack",{get:function(){return(i.stack||``).replace(/^(.+\n){1,3}/,e+`: `+t+`
|
|
65
|
+
`)}}),r}var oW=/^[\p{ID_Start}$_]$/u,sW=/^[\p{ID_Continue}$]$/u;function cW(e,t,n){return dW(e,`query`,t,n)}function lW(e,t,n){return dW(e,`method`,t,n)}var uW=class e extends Set{constructor(e,t=[],n=!1,r=`$`){super(e),this.own=new Set,this.awaitInit=new Set(t),this.firstCurrent=null,this.captureCurrent=[],this.arg1=n,this.$ref=r}spawn(t,n){return new e(this,this.awaitInit,t,n)}};function dW(e,t,n=!1,r=null){function i(e){let t=`s`+l.length;return l.push(e?[t,e]:[t]),t}function a(e){let t=u.get(e);return t||u.set(e,t=i()),t}function o(e,t,n,r,o){let s=[e,t,JSON.stringify(n)];if(n===`var`){if(!g.scope.size)return;s.push(JSON.stringify([...g.scope]))}else r||=i(),s.push(r),o&&s.push(typeof o==`string`?o:a(o));return f.push(s),r}function s(e,n,r=`$`){let i=g.scope,a=p.length-1,s=i.arg1||t===`method`&&`arguments[1]`;if(g.scope=i.spawn(s,r),e(),g.scope.captureCurrent.length){let e=`stat(`+g.scope.captureCurrent.reduce((e,t)=>o(...t,e),void 0)+`,`+g.scope.$ref+`)`;g.scope.firstCurrent?p[g.scope.firstCurrent]=e:p[a]+=n(e)}g.scope=i}function c(e,t){let n=!1;if(r!==null){if(r.has(e))for(let[t,i,s,c]of r.get(e))s===`var`?o(t,i,s):c===!0?g.scope.captureCurrent.push([t,i,s]):(n||(n=a(e),p.push(`stat(`+n+`,`)),s&&o(t,i,s,n,c));e.type===`Current`&&g.scope.firstCurrent===null&&(g.scope.firstCurrent=p.length)}if(WU.has(e.type))WU.get(e.type)(e,g,t);else throw Error(`Unknown node type "`+e.type+`"`);n&&p.push(`)`)}let l=[],u=new WeakMap,d=[],f=[],p=[{toString(){if(t===`query`)return[`((data,context)=>{`,...g.usedMethods.size||g.usedAssertions.size?[`const method = (name,...args)=>m[name].apply(mctx,args);`,`const assertion = (name,...args)=>a[name].apply(mctx,args);`,`const mctx = Object.freeze({context,method,assertion});`]:[]].join(`
|
|
66
|
+
`)+`
|
|
67
|
+
`;if(t===`method`)return[`(function(data){`,`const mctx = this;`,`const context = mctx.context;`].join(`
|
|
68
|
+
`)+`
|
|
69
|
+
`;throw Error(`Unknown kind: `+t)}},{toString(){return d.length>0?`let `+d+`;
|
|
70
|
+
`:``}},{toString(){return l.length>0?[`const stat=(s,v)=>(s.add(v),v);
|
|
71
|
+
`,`const `+l.map(([e,t])=>e+`=new Set(`+(t?JSON.stringify(t):``)+`)`)+`;
|
|
72
|
+
`].join(``):``}},{toString(){let e=r&&Array.isArray(r.literalList)&&r.literalList.map(([e,t])=>e+`=`+JSON.stringify(t));return e&&e.length?`const `+e+`;
|
|
73
|
+
`:``}},r===null?`return `:`return{
|
|
74
|
+
value: `],m={},h=new Set,g={tolerant:n,usedAssertions:new Map,usedMethods:new Map,suggestions:r!==null,buildinFn(e){return h.add(e),`f.`+e},scope:new uW,createScope:s,error(e,t){let r=SyntaxError(e);if(t&&t.range&&(r.details={loc:{range:t.range}}),!n)throw r;return r},allocateVar(){let e=`tmp`+d.length;return d.push(e),e},unescapeName(e,t,n=!0){return e.replace(/\\u[0-9a-fA-F]{4}/g,(e,r)=>{let i=String.fromCharCode(parseInt(e.slice(2),16)),a=r===0?oW:sW;return n&&!a.test(i)&&this.error(`Bad escape sequence in indentifier name (expected ${a})`,t&&{range:[t.range[0]+r,t.range[0]+r+6]}),i})},put:e=>p.push(e),putIdent(e,t){if(!/^[\p{ID_Start}$_][\p{ID_Continue}$]*$/u.test(e))throw this.error(`Bad identifier name `+JSON.stringify(e),t);this.put(e)},node:c,nodeOrCurrent(e,t){c(e||{type:`Current`},t)},list(e,t,n){e.forEach((e,r)=>{r>0&&p.push(t),c(e,n)})}};if(s(()=>c(e),e=>(p.push(`)`),`(`+e+`,`),`data`),!n){let{usedMethods:e,usedAssertions:t}=g;t.size&&(p.unshift(` this.assertAssertions(a)||`),m.assertAssertions=function(e){for(let[n,r]of t.entries())if(!OB(e,n))return()=>{throw Object.assign(Error(`Assertion "${n}" is not defined`),{details:{loc:{range:r}}})}}),e.size&&(p.unshift(` this.assertMethods(m)||`),m.assertMethods=function(t){for(let[n,r]of e.entries())if(!OB(t,n))return()=>{throw Object.assign(Error(`Method "${n}" is not defined. If that's a custom method make sure you added it with "methods" section in options`),{details:{loc:{range:r[0]}}})}})}return r!==null&&p.push(`,
|
|
75
|
+
stats: [`+f.map(e=>`[`+e+`]`)+`],
|
|
76
|
+
methods: m,
|
|
77
|
+
assertions: a
|
|
78
|
+
}`),fW(m,`return`+p.join(``)+`})`)}function fW(e,t){try{let n=Function(`f,m,a`,t);return Object.assign(n.bind(e),{toString(){return n.toString().replace(/^(\S+\s+)anonymous([^)\s]+)\s*\)/,`$1query$2)`)}})}catch(e){throw aW(`SyntaxError`,`Jora query compilation error`,{compiledSource:`function(f,m,a){\n${t}\n}`,details:e})}}var pW=1,mW=2,hW=3,gW=4,_W=5,vW=6,yW=7,bW=8;function xW(e){switch(typeof e){case`boolean`:return pW;case`number`:return e===e?hW:mW;case`string`:return gW;case`object`:return e===null?_W:vW;case`undefined`:return bW;default:return yW}}function SW(e,t){let n=xW(e),r=xW(t);return n===r?e<t?-1:+(e>t):n<r?-1:1}function CW(e,t){let n=xW(e),r=xW(t);return n===r?n===hW?t-e:e<t?-1:+(e>t):n<r?-1:1}function wW(e,t){let n=xW(e),r=xW(t);return(n===hW||n===gW)&&(r===hW||r===gW)?Dj(e,t):n===r?e<t?-1:+(e>t):n<r?-1:1}function TW(e,t){let n=xW(e),r=xW(t);return(n===hW||n===gW)&&(r===hW||r===gW)?Oj(e,t,!0):n===r?e<t?-1:+(e>t):n<r?-1:1}function EW(e,t){return e.length===1?(n,r)=>t(e(n),e(r)):e}var DW=Object.freeze({awaitInitRef:OW,ensureArray:kW,bool:RB,and:(e,t)=>RB(e)?t:e,or:(e,t)=>RB(e)?e:t,add:AW,sub:jW,mul:MW,div:NW,mod:PW,eq:FW,ne:IW,lt:LW,lte:RW,gt:zW,gte:BW,in:VW,notIn:(e,t)=>!VW(e,t),has:(e,t)=>VW(t,e),hasNo:(e,t)=>!VW(t,e),cmp:SW,cmpAnalytical:CW,cmpNatural:wW,cmpNaturalAnalytical:TW,match:HW,pick:UW,indexOf:WW,lastIndexOf:KW,map:JW,mapRecursive:YW,some:XW,filter:ZW,slice:QW});function OW(e,t,n){try{return e()}catch{if(t)throw Object.assign(ReferenceError(`Cannot access ${t} before initialization`),{details:{name:t,loc:{range:n}}})}}function kW(e){return IB(e)?e:[e]}function AW(e,t){return IB(e)||IB(t)?[...new Set([...IB(e)?e:[e],...IB(t)?t:[t]])]:e+t}function jW(e,t){if(IB(e)){let n=new Set(e);return IB(t)?t.forEach(e=>n.delete(e)):n.delete(t),[...n]}return e-t}function MW(e,t){return e*t}function NW(e,t){return e/t}function PW(e,t){return e%t}function FW(e,t){return Object.is(e,t)}function IW(e,t){return!Object.is(e,t)}function LW(e,t){return e<t}function RW(e,t){return e<=t}function zW(e,t){return e>t}function BW(e,t){return e>=t}function VW(e,t){return NB(t)?OB(t,e):t?GW(t,e)!==-1:!1}function HW(e,t){return typeof t==`function`?XW(e,t):PB(t)?XW(e,t.test.bind(t)):t==null}function UW(e,t=()=>!0){if(e){if(typeof t==`function`){if(IB(e)||typeof e==`string`){for(let n=0;n<e.length;n++)if(RB(t(e[n],n)))return e[n]}for(let n in e)if(OB(e,n)&&RB(t(e[n],n)))return e[n];return}return IB(e)||typeof e==`string`?isFinite(t)?e[t<0?e.length+Number(t):Number(t)||0]:void 0:OB(e,t)?e[t]:void 0}}function WW(e,t,n){return e?GW(e,t,n):-1}function GW(e,t,n=0){if(Number.isNaN(t)&&FB(e)){for(let t=LB(n,0);t<e.length;t++)if(Number.isNaN(e[t]))return t}return typeof e.indexOf==`function`?e.indexOf(t,n):-1}function KW(e,t,n){return e?qW(e,t,n):-1}function qW(e,t,n){if(Number.isNaN(t)&&FB(e)){for(let t=LB(n,e.length-1);t>=0;t--)if(Number.isNaN(e[t]))return t}return typeof e.lastIndexOf==`function`?e.lastIndexOf(t,LB(n,e.length-1)):-1}function JW(e,t){let n=typeof t==`function`?t:e=>MB(e,t);return IB(e)?[...e.reduce((e,t)=>AB(e,n(t)),new Set)]:e===void 0?e:n(e)}function YW(e,t){let n=new Set;return AB(n,JW(e,t)),n.forEach(e=>AB(n,JW(e,t))),[...n]}function XW(e,t){return IB(e)?e.some(e=>RB(t(e))):RB(t(e))}function ZW(e,t){return IB(e)?e.filter(e=>RB(t(e))):RB(t(e))?e:void 0}function QW(e,t,n,r=1){if(!FB(e))return[];if(t=LB(t,0),n=LB(n,e.length),r=LB(r,1)||1,t=t<0?Math.max(0,e.length+t):Math.min(e.length,t),n=n<0?Math.max(0,e.length+n):Math.min(e.length,n),t>=0&&n>=0&&t<=n&&r===1)return typeof e==`string`?e.slice(t,n):Array.prototype.slice.call(e,t,n);t>n&&([t,n]=[n,t],r=-r);let i=[];if(r>0)for(let a=t;a<n;a+=r)i.push(e[a]);else for(let a=n-1;a>=t;a+=r)i.push(e[a]);return typeof e==`string`?i.join(``):i}var $W=eG(20)?1/0:eG(10)?10:0;function eG(e){return Array.from({length:e},(e,t)=>({idx:t})).sort((e,t)=>e.idx%2-t.idx%2).every((t,n)=>n<e/2?t.idx>>1===n:Math.ceil(e/2)+(t.idx>>1)===n)}function tG(e,t){return e.length<=$W?e.slice().sort(t):e.map((e,t)=>({value:e,idx:t})).sort((e,n)=>(e.value===void 0?n.value!==void 0:n.value===void 0?-1:t(e.value,n.value))||e.idx-n.idx).map(e=>e.value)}var nG=(e,t)=>e-t,rG=(e,t)=>t-e,iG=class{constructor(e,t,n,r=!1){this.maxSize=e||1/0,this.compare=t||rG,this.accept=n||null,this.values=[],this.valuesSet=r?new Set:null}add(e){(this.accept===null||this.accept(e))&&(this.valuesSet!==null&&this.valuesSet.has(e)||(this.values.length<this.maxSize?(this.valuesSet!==null&&this.valuesSet.add(e),this.values.push(e),this.heapifyUp(this.values.length-1)):this.compare(this.values[0],e)>0&&(this.valuesSet!==null&&(this.valuesSet.delete(this.values[0]),this.valuesSet.add(e)),this.values[0]=e,this.heapifyDown())))}addArray(e){for(let t=0;t<e.length;t++)this.add(e[t])}extract(){let e=this.values[0],t=this.values.pop();return this.values.length>0&&(this.values[0]=t,this.heapifyDown()),this.valuesSet!==null&&this.valuesSet.delete(e),e}heapifyUp(e){let t=this.values,n=t[e];for(;e>0;){let r=e-1>>1,i=t[r];if(this.compare(i,n)>0)break;t[r]=n,t[e]=i,e=r}}heapifyDown(){let e=this.values,t=e.length,n=t>>1,r=0,i=e[r],a=r,o=i;for(;r<n;){let n=2*r+1,s=e[n],c=n+1;if(this.compare(s,i)>0&&(a=n,o=s),c<t){let t=e[c];this.compare(t,o)>0&&(a=c,o=t)}if(a===r)break;e[r]=o,e[a]=i,r=a,o=i}}[Symbol.iterator](){return this.values.slice().sort(this.compare)[Symbol.iterator]()}},aG=class extends iG{},oG=class extends iG{constructor(e,t,n,r){super(e,t?(e,n)=>-t(e,n):nG,n,r)}},sG=e=>e;function cG(e){return typeof e==`object`&&e?NaN:Number(e)}function lG(e,t,n){if(FB(e)){typeof t!=`function`&&(t=sG);for(let r of e){let e=t(r);e!==void 0&&n(cG(e))}}}function uG(e,t,n,r){if(e.length===0||!isFinite(t)||t<0||t>100)return;let i=0,a=t*(e.length-1)/100,o=Math.floor(a),s=Math.ceil(a),c=!1,l=t<50?new oG(s+1,r):new aG(e.length-o,r);if(lG(e,n,e=>{Number.isNaN(e)&&(c=!0),l.add(e),i++}),c)return NaN;if(e.length!==i){if(i===0)return;a=t*(i-1)/100,o=Math.floor(a),s=Math.ceil(a);let e=t<50?s+1:i-o;for(let t=l.values.length;t>e;t--)l.extract()}if(o!==s){let e=l.extract(),t=l.values[0];return e<=t?e+(t-e)*(a-o):t+(e-t)*(a-o)}return l.values[0]}var dG=e=>e;function fG(e,t){let n,r=0,i=0;return lG(e,t,e=>{if(i++,n===void 0)n=e;else{let t=n,i=Math.abs(t),a=Math.abs(e);n+=e,i!==1/0&&a!==1/0&&(r+=i>=a?t-n+e:e-n+t)}}),n!==void 0&&(n+=r),{sum:n,count:i}}function pG(e,t){let n=[];return lG(e,t,n.push.bind(n)),n}function mG(e,t){let n=0;if(FB(e)){typeof t!=`function`&&(t=dG);for(let r of e)t(r)!==void 0&&n++}return n}function hG(e,t){return fG(e,t).sum}function gG(e,t){let{sum:n,count:r}=fG(e,t);if(r>0)return n/r}function _G(e,t){let n=0,r=0,i=0;if(lG(e,t,e=>{n+=1;let t=e-r;r+=t/n,i+=t*(e-r)}),n>0)return i/n}function vG(e,t){let n=_G(e,t);if(n!==void 0)return Math.sqrt(n)}function yG(e,t=wW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=EW(t,wW);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)<0)&&t(i,void 0)!==0&&(n=i)}}return n}function bG(e,t=wW){let n;if(e&&isFinite(e.length)&&typeof t==`function`){t=EW(t,wW);for(let r=0;r<e.length;r++){let i=e[r];(n===void 0||t(i,n)>=0)&&t(i,void 0)!==0&&(n=i)}}return n}function xG(e,t,n){if(FB(e))return uG(e,t,n)}function SG(e,t){return xG(e,50,t)}function CG(){}function wG(e){return e}function TG(e){return e===null?null:{matched:e.slice(),start:e.index,end:e.index+e[0].length,input:e.input,groups:e.groups||null}}function EG(e){let t=e.pop(),n=typeof t==`string`?null:t,r=n===null?t:e.pop(),i=e.pop();return{matched:e,start:i,end:i+e[0].length,input:r,groups:n}}var DG=String.prototype.replaceAll||function(e,t){return PB(e)?this.replace(e,t):this.split(e).join(String(t))},OG=Object.freeze({bool:DW.bool,filter:DW.filter,map:DW.map,pick:DW.pick,indexOf:DW.indexOf,lastIndexOf:DW.lastIndexOf,keys(e){return Object.keys(e||{})},values(e){let t=new Set;for(let n in e)OB(e,n)&&AB(t,e[n]);return[...t]},entries(e){let t=[];for(let n in e)OB(e,n)&&t.push({key:n,value:e[n]});return t},fromEntries(e){let t=Object.create(null);if(Array.isArray(e))for(let n of e)n&&(t[n.key]=n.value);return t},size(e){return NB(e)?Object.keys(e).length:e&&e.length||0},sort(e,t=SW){if(!IB(e))return e;if(typeof t==`function`&&t.length!==2){let e=t;t=(t,n)=>{if(t=e(t),n=e(n),Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return t.length<n.length?-1:1;for(let e=0;e<t.length;e++){let r=SW(t[e],n[e]);if(r!==0)return r}return 0}return SW(t,n)}}return tG(e,t)},reverse(e){return IB(e)?e.slice().reverse():e},slice(e,t,n){return typeof e==`string`||IB(e)?e.slice(t,n):Array.prototype.slice.call(e,t,n)},group(e,t,n){let r=new Map,i=[];typeof t!=`function`&&(t=CG),typeof n!=`function`&&(n=wG),IB(e)||(e=[e]);for(let i of e){let e=t(i);if(IB(e)){if(e.length>0){let t=n(i);for(let n of e)jB(r,n,t)}else jB(r,void 0,n(i))}else jB(r,e,n(i))}for(let[e,t]of r)i.push({key:e,value:[...t]});return i},join(e,t){return IB(e)?e.join(t):String(e)},match(e,t,n){let r=String(e),i=PB(t)?t.flags:``;if(n||i.includes(`g`)){let e=[],n=new RegExp(t,(i||``).replace(/g|$/,`g`)),a;for(;a=n.exec(r);)e.push(TG(a));return e}return TG(r.match(t))},reduce(e,t,n=void 0){return IB(e)?n===void 0?e.reduce((e,n)=>t(n,e)):e.reduce((e,n)=>t(n,e),n):t(e,n)},split(e,t){if(IB(e)){let n=typeof t==`function`?t:Object.is.bind(null,t),r=[],i=0,a=0;for(;a<e.length;a++)n(e[a])&&(r.push(e.slice(i,a)),i=a+1);return r.push(e.slice(i,a)),r}return String(e).split(t)},replace(e,t,n){if(IB(e)){let r=typeof t==`function`?t:Object.is.bind(null,t),i=[...e];for(let e=0;e<i.length;e++){let t=i[e];r(t)&&(i[e]=typeof n==`function`?n(t):n)}return i}return PB(t)&&!t.flags.includes(`g`)&&(t=new RegExp(t,t.flags+`g`)),DG.call(String(e),t,typeof n==`function`?(...e)=>n(EG(e)):n)},toLowerCase(e,t){return String(e).toLocaleLowerCase(t)},toUpperCase(e,t){return String(e).toLocaleUpperCase(t)},trim(e){return String(e).trim()},...`abs.acos.acosh.asin.asinh.atan.atan2.atanh.cbrt.ceil.clz32.cos.cosh.exp.expm1.floor.fround.hypot.imul.log10.log2.pow.round.sign.sin.sinh.sqrt.tan.tanh.trunc`.split(`.`).reduce((e,t)=>(e[t]=Math[t],e),{}),ln:Math.log,ln1p:Math.log1p,numbers:pG,count:mG,sum:hG,avg:gG,variance:_G,stdev:vG,min:yG,max:bG,percentile:xG,p:xG,median:SG}),kG=Object.freeze({function:e=>typeof e==`function`,symbol:e=>typeof e==`symbol`,primitive:e=>e===null||typeof e!=`object`&&typeof e!=`function`,string:e=>typeof e==`string`,number:e=>typeof e==`number`,int:Number.isInteger,finite:e=>Number.isFinite(e),nan:e=>Number.isNaN(e),infinity:e=>e===1/0||e===-1/0,boolean:e=>e===!0||e===!1,null:e=>e===null,undefined:e=>e===void 0,nullish:e=>e==null,object:NB,array:IB,regexp:PB,truthy:RB,falsy:e=>!RB(e)}),AG={path:`property`,key:`value`,value:`value`,"in-value":`value`,"value-subset":`value`,var:`variable`,assertion:`assertion`};function jG(e,t){Object.keys(e).forEach(t.add,t)}function MG(e,t,n,r=new Set){let i=e=>{switch(typeof e){case`string`:case`number`:r.add(e)}};switch(e){case`path`:{let e=new Set;for(let n of t)if(Array.isArray(n))for(let t of n)NB(t)&&jG(t,e);else NB(n)&&jG(n,e);e.forEach(r.add,r);break}case`key`:{let e=new Set;for(let n of t)typeof n==`object`&&n&&!Array.isArray(n)&&jG(n,e);e.forEach(r.add,r);break}case`value`:for(let e of t)i(e);break;case`in-value`:{let e=new Set;for(let n of t)IB(n)?n.forEach(i):NB(n)&&jG(n,e);e.forEach(r.add,r);break}case`var`:for(let e of t)r.add(e);break;case`value-subset`:{let e=new Set(n);for(let n of t)e.has(n)||i(n);break}}return r}function NG(e,t,n,r=!1){let i=[];for(let[a,o,s,c,l=null]of n)if(t>=a&&t<=o&&(r||c.size||c.length)){let n=e.substring(a,o);/\S/.test(n)||(a=o=t,n=``),i.push({context:s,from:a,to:o,text:n,values:c,related:l})}return i}function PG(e,t){return typeof e==`function`?e:e===!0&&t}function FG(e){if(/^(["']).*\1$/.test(e))try{return e[0]===`'`&&(e=`"${e.slice(1,-1).replace(/\\.|"/g,e=>e===`\\'`?`'`:e===`"`?`\\"`:e)}"`),JSON.parse(e)}catch{}return e}function IG(e){return t=>(typeof t==`string`?t:String(t)).toLowerCase().indexOf(e)!==-1}var LG=(e,{value:t,stats:n,assertions:r})=>({get value(){return t},stat(t,r){return NG(e,t,n,r)},suggestion(t,i){let{limit:a=1/0,sort:o,filter:s}=i||{};o=PG(o,DW.cmp),s=PG(s,IG);let c=o&&isFinite(a)?aG:Set,l=NG(e,t,n,!0),u=new Map,d=[];for(let e of l){let{context:t,text:n,from:i,to:l,values:d,related:f}=e,p=AG[t];if(!u.has(p)){let e;switch(c){case aG:e=new aG(a,o,s&&s(FG(n)),!0);break;case Set:e=new Set}u.set(p,{type:p,from:i,to:l,text:n,suggestions:e})}let{suggestions:m}=u.get(p);switch(t){case`assertion`:if(m.size===0||m.values&&m.values.length===0)for(let e of Object.keys(r))m.add(e);break;default:MG(t,d,f,m)}}if(c===Set)for(let e of u.values()){let{suggestions:t}=e;if(o&&(t=[...t].sort(o)),s||isFinite(a)){let n=[],r=s?s(FG(e.text)):()=>!0;for(let e of t)if(r(e)&&n.push(e)>=a)break;t=n}e.suggestions=t}for(let e of u.values())e.suggestions=Array.isArray(e.suggestions)?e.suggestions:[...e.suggestions],e.suggestions.length&&d.push(e);return d.length?d:null}}),RG=new Map,zG=new Map,BG=new Map,VG=new Map;function HG(e,t,n,r,i){typeof n==`string`?Object.defineProperty(e,t,{configurable:!0,get(){let a=GG(n,`method`)(DW,r,i);return Object.defineProperty(e,t,{enumerable:!0,value:a}),a}}):typeof n==`function`&&Object.defineProperty(e,t,{enumerable:!0,value:n})}function UG(e,t){if(!e&&!t)return{queryMethods:OG,queryAssertions:kG};let n={...OG},r={...kG};for(let[t,i]of Object.entries(e||{})){if(OB(OG,t))throw Error(`Builtin method "${t}" can\'t be overridden`);HG(n,t,i,n,r)}for(let[e,i]of Object.entries(t||{})){if(OB(kG,e))throw Error(`Builtin assertion "${e}" can\'t be overridden`);HG(r,e,i,n,r)}return{queryMethods:n,queryAssertions:r}}function WG(e,t){console.log(`[${e}]`),typeof t==`string`?console.log(t):t!==void 0&&console.dir(t,{depth:null}),console.log()}function GG(e,t,n,r,i){i=typeof i==`function`?i:i?WG:!1,i&&(i(`=========================`),i(`Compile query from source`,e));let a=VB.parse(e,r);i&&(i(`AST`,a.ast),i(`Restored source`,iW(a.ast)));let o=n?tW(e,a):null;if(i&&o){let t=e=>JSON.stringify(e).slice(1,-1),n=[].concat(...[...o.entries()].map(([e,t])=>t.map(t=>[e,...t]))),r=[],a=null;i(`Stat/suggestion ranges`,n.sort((e,t)=>e[1]-t[1]).map(([n,...i])=>{let[o,s,c,l]=i,u;if(o===r[0]&&s===r[1])u=` `.repeat(a.length);else{let n=t(e.slice(0,o)).length,c=t(e.substring(o,s)).length;r=i,a=` `.repeat(n)+(c?`~`.repeat(c):`\\`)+` `+o+`:`+s,u=t(e)+`
|
|
79
|
+
`+a}return u+` [`+c+`] on `+n.type+(l===!0?` (current)`:l&&l.type?` & `+l.type:``)}).join(`
|
|
80
|
+
`))}let s=t===`method`?lW(a.ast,r,o):cW(a.ast,r,o);return i&&i(`Compiled code`,s.toString()),s}function KG(e,t){t||={};let n=!!t.stat,r=!!t.tolerant,i=n?r?VG:zG:r?BG:RG,{methods:a,assertions:o}=t||{},{queryMethods:s,queryAssertions:c}=UG(a,o),l;return e=String(e),i.has(e)&&!t.debug?l=i.get(e):(l=GG(e,`query`,n,r,t.debug),i.set(e,l)),l=l(DW,s,c),n?Object.assign((t,n)=>LG(e,l(t,n)),{query:l}):l}function qG(e){let t=new Map,n=new Map,r=new Map,i=new Map,{methods:a,assertions:o}=e||{},{queryMethods:s,queryAssertions:c}=UG(a,o);return function(e,a){a||={};let o=!!a.stat,l=!!a.tolerant,u=o?l?i:n:l?r:t,d;if(e=String(e),u.has(e)&&!a.debug)d=u.get(e);else{let t=GG(e,`query`,o,l,a.debug)(DW,s,c);d=o?Object.assign((n,r)=>LG(e,t(n,r)),{query:t}):t,u.set(e,d)}return d}}var JG=Object.assign(KG,{version:DB,buildin:DW,methods:OG,assertions:kG,setup:qG,syntax:{tokenize:VB.tokenize,parse:VB.parse,suggest:tW,walk:JU,stringify:iW,compile:cW,compileMethod:lW}});function YG(e){if(!e||typeof e!=`object`)return`value is not an object`;let{name:t,test:n,decode:r}=e;return typeof t==`string`?typeof n==`function`?typeof r!=`function`&&`missed decode function`:`missed test function`:`missed name`}function XG(e){let t=YG(e);if(t)throw Error(`Bad encoding config${e?.name?` "${e.name}"`:``}: ${t}`);let{name:n,test:r,streaming:i,decode:a}=e;return Object.freeze(i?{name:n||`unknown`,test:r,streaming:!0,decode:a}:{name:n||`unknown`,test:r,streaming:!1,decode:a})}function ZG(e){if(!e)return[];if(!Array.isArray(e))throw Error(`Encodings must be an array`);return e.map(XG)}function QG(e){return typeof e==`object`&&!!e&&(typeof e[Symbol.iterator]==`function`||typeof e[Symbol.asyncIterator]==`function`)}function $G(e,t,n,r){switch(n&&typeof n.toJSON==`function`&&(n=n.toJSON()),r!==null&&(n=r.call(e,String(t),n)),typeof n){case`function`:case`symbol`:n=void 0;break;case`object`:if(n!==null){let e=n.constructor;(e===String||e===Number||e===Boolean)&&(n=n.valueOf())}}return n}function eK(e){return typeof e==`function`?e:Array.isArray(e)?[...new Set(e.map(e=>{let t=e&&e.constructor;return t===String||t===Number?String(e):null}).filter(e=>typeof e==`string`))]:null}function tK(e){return typeof e==`number`?!Number.isFinite(e)||e<1?!1:` `.repeat(Math.min(e,10)):typeof e==`string`&&e.slice(0,10)||!1}function nK(e,t){(e===null||Array.isArray(e)||typeof e!=`object`)&&(e={replacer:e,space:t});let n=eK(e.replacer),r=Object.keys;if(Array.isArray(n)){let e=n;r=()=>e,n=null}return{...e,replacer:n,getKeys:r,space:tK(e.space)}}var rK=1,iK=2,aK=new TextDecoder;function oK(e,t){return e.name===`SyntaxError`&&t.jsonParseOffset&&(e.message=e.message.replace(/at position (\d+)/,(e,n)=>`at position `+(Number(n)+t.jsonParseOffset))),e}function sK(e,t){let n=e.length;e.length+=t.length;for(let r=0;r<t.length;r++)e[n+r]=t[r]}async function cK(e){let t=typeof e==`function`?e():e;if(QG(t)){let e=new lK;try{for await(let n of t){if(typeof n!=`string`&&!ArrayBuffer.isView(n))throw TypeError(`Invalid chunk: Expected string, TypedArray or Buffer`);e.push(n)}return e.finish()}catch(t){throw oK(t,e)}}throw TypeError(`Invalid chunk emitter: Expected an Iterable, AsyncIterable, generator, async generator, or a function returning an Iterable or AsyncIterable`)}var lK=class{constructor(){this.value=void 0,this.valueStack=null,this.stack=Array(100),this.lastFlushDepth=0,this.flushDepth=0,this.stateString=!1,this.stateStringEscape=!1,this.pendingByteSeq=null,this.pendingChunk=null,this.chunkOffset=0,this.jsonParseOffset=0}parseAndAppend(e,t){this.stack[this.lastFlushDepth-1]===rK?(t&&(this.jsonParseOffset--,e=`{`+e+`}`),Object.assign(this.valueStack.value,JSON.parse(e))):(t&&(this.jsonParseOffset--,e=`[`+e+`]`),sK(this.valueStack.value,JSON.parse(e)))}prepareAddition(e){let{value:t}=this.valueStack;if(Array.isArray(t)?t.length!==0:Object.keys(t).length!==0){if(e[0]===`,`)return this.jsonParseOffset++,e.slice(1);if(e[0]!==`}`&&e[0]!==`]`)return this.jsonParseOffset-=3,`[[]`+e}return e}flush(e,t,n){let r=e.slice(t,n);if(this.jsonParseOffset=this.chunkOffset+t,this.pendingChunk!==null&&(r=this.pendingChunk+r,this.jsonParseOffset-=this.pendingChunk.length,this.pendingChunk=null),this.flushDepth===this.lastFlushDepth)this.flushDepth>0?this.parseAndAppend(this.prepareAddition(r),!0):(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null});else if(this.flushDepth>this.lastFlushDepth){for(let e=this.flushDepth-1;e>=this.lastFlushDepth;e--)r+=this.stack[e]===rK?`}`:`]`;this.lastFlushDepth===0?(this.value=JSON.parse(r),this.valueStack={value:this.value,prev:null}):this.parseAndAppend(this.prepareAddition(r),!0);for(let e=this.lastFlushDepth||1;e<this.flushDepth;e++){let t=this.valueStack.value;if(this.stack[e-1]===rK){let e;for(e in t);t=t[e]}else t=t[t.length-1];this.valueStack={value:t,prev:this.valueStack}}}else{r=this.prepareAddition(r);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.jsonParseOffset--,r=(this.stack[e]===rK?`{`:`[`)+r;this.parseAndAppend(r,!1);for(let e=this.lastFlushDepth-1;e>=this.flushDepth;e--)this.valueStack=this.valueStack.prev}this.lastFlushDepth=this.flushDepth}push(e){if(typeof e!=`string`){if(this.pendingByteSeq!==null){let t=e;e=new Uint8Array(this.pendingByteSeq.length+t.length),e.set(this.pendingByteSeq),e.set(t,this.pendingByteSeq.length),this.pendingByteSeq=null}if(e[e.length-1]>127)for(let t=0;t<e.length;t++){let n=e[e.length-1-t];if(n>>6==3){t++,(t!==4&&n>>3==30||t!==3&&n>>4==14||t!==2&&n>>5==6)&&(this.pendingByteSeq=e.slice(e.length-t),e=e.slice(0,-t));break}}e=aK.decode(e)}let t=e.length,n=0,r=0;scan:for(let i=0;i<t;i++){if(this.stateString){for(;i<t;i++)if(this.stateStringEscape)this.stateStringEscape=!1;else switch(e.charCodeAt(i)){case 34:this.stateString=!1;continue scan;case 92:this.stateStringEscape=!0}break}switch(e.charCodeAt(i)){case 34:this.stateString=!0,this.stateStringEscape=!1;break;case 44:r=i;break;case 123:r=i+1,this.stack[this.flushDepth++]=rK;break;case 91:r=i+1,this.stack[this.flushDepth++]=iK;break;case 93:case 125:r=i+1,this.flushDepth--,this.flushDepth<this.lastFlushDepth&&(this.flush(e,n,r),n=r);break;case 9:case 10:case 13:case 32:n===i&&n++,r===i&&r++}}r>n&&this.flush(e,n,r),r<t&&(this.pendingChunk===null?this.pendingChunk=e.slice(r,t):this.pendingChunk+=e),this.chunkOffset+=t}finish(){return this.pendingChunk!==null&&(this.flush(``,0,0),this.pendingChunk=null),this.value}},uK=typeof Object.hasOwn==`function`?Object.hasOwn:(e,t)=>Object.hasOwnProperty.call(e,t),dK={8:`\\b`,9:`\\t`,10:`\\n`,12:`\\f`,13:`\\r`,34:`\\"`,92:`\\\\`},fK=Uint8Array.from({length:2048},(e,t)=>uK(dK,t)?2:t<32?6:t<128?1:2);function pK(e){return e>=55296&&e<=56319}function mK(e){return e>=56320&&e<=57343}function hK(e){if(!/[^\x20\x21\x23-\x5B\x5D-\x7F]/.test(e))return e.length+2;let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i<2048)t+=fK[i];else if(pK(i)){t+=6,n=!0;continue}else mK(i)?t=n?t-2:t+6:t+=3;n=!1}return t+2}function gK(e){let t=0;return e<0&&(t=1,e=-e),e>=1e9&&(t+=9,e=(e-e%1e9)/1e9),e>=1e4?e>=1e6?t+(e>=1e8?9:e>=1e7?8:7):t+(e>=1e5?6:5):t+(e>=100?e>=1e3?4:3:e>=10?2:1)}function _K(e){switch(typeof e){case`string`:return hK(e);case`number`:return Number.isFinite(e)?Number.isInteger(e)?gK(e):String(e).length:4;case`boolean`:return e?4:5;case`undefined`:case`object`:return 4;default:return 0}}function vK(e,...t){let{replacer:n,getKeys:r,...i}=nK(...t),a=!!i.continueOnCircular,o=i.space?.length||0,s=new Map,c=new Map,l=new Set,u=[],d={"":e},f=!1,p=0,m=0,h=0;return g(d,``,e),p===0&&(p+=9),{bytes:isNaN(p)?1/0:p+m,spaceBytes:o>0&&isNaN(p)?1/0:m,circular:[...l]};function g(e,t,i){if(!f){if(i=$G(e,t,i,n),typeof i!=`object`||!i)(i!==void 0||Array.isArray(e))&&(p+=_K(i));else{if(u.includes(i)){l.add(i),p+=4,a||(f=!0);return}if(c.has(i)){p+=c.get(i);return}h++;let e=h,t=p,n=0;if(u.push(i),Array.isArray(i)){n=i.length;for(let e=0;e<n;e++)g(i,e,i[e])}else{let e=p;for(let t of r(i))if(g(i,t,i[t]),e!==p){let r=s.get(t);r===void 0&&s.set(t,r=hK(t)+1),p+=r,n++,e=p}}p+=n===0?2:1+n,o>0&&n>0&&(m+=(Array.isArray(i)?0:n)+(1+u.length*o)*(n+1)-o),u.pop(),e!==h&&c.set(i,p-t)}}}}var yK=Object.freeze({name:`json`,test:()=>!0,streaming:!0,decode:cK}),bK=new Uint8Array([0,0,74,83,79,78,88,76]),xK=9,SK=268435455,CK=2,wK=4,TK=8,EK=16,DK=32,OK=64,kK=128,AK=0,jK=1,MK=2,NK=3,PK=4,FK=5,IK=6,LK=8,RK=9,zK=10,BK=11,VK=12,HK=224,UK=7936,WK=0,GK=1,KK=2,qK=3,JK=4,YK=5,XK=6,ZK=7,QK=8,$K=16,eq=32;~EK;var tq=CK|DK|OK,nq=new Uint8Array(256).map((e,t)=>{for(let n=0;n<8;n++)e+=t>>n&1;return e}),rq=new Uint32Array(16);rq.subarray(0,8),rq.subarray(8,16),new TextEncoder;var iq=new Uint8Array(33);for(let e=0;e<33;e++)iq[32-e]=Math.ceil(e/7)||1;function aq(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}var oq=new Map;Object.freeze({hasInlinedEntries:!1,columns:oq}),Object.freeze({hasInlinedEntries:!0,columns:oq}),sq();function sq(){return new Proxy(Object.create(null),{get(e,t){return Object.hasOwn(e,t)?Reflect.get(...arguments):e[t]=0}})}Object.hasOwnProperty;function cq(e,t,n,r=Array(n)){let i=t&15,a=t&48,o=n,s=0,c=0;switch(a){case $K:s=r[0]=e.readIntVar(),o--,c=1;break;case eq:s=e.readIntVar()}switch(i){case KK:for(let t=0;t<o;t++)r[c+t]=e.readVlq();break;case qK:for(let t=0;t<o;t++)r[c+t]=e.readIntVar();break;case JK:{let t=e.readBytes(Math.ceil(o/2));for(let n=0,i=0;n<o;n++)i=n&1?i>>4:t[n>>1],r[c+n]=i&8?e.readVlq()*8+(i&7):i&7;break}case YK:{let t=e.readBytes(Math.ceil(o/2));for(let n=0,i=0;n<o;n++){i=n&1?i>>4:t[n>>1];let a=i&4?-1:1;r[c+n]=i&8?a*(e.readVlq()*4+(i&3)):a*(i&3)}break}case XK:{let n=t>>8,i=(1<<n)-1,a=e.readBytes(Math.ceil(o*n/8)),s=0,l=0,u=0;for(let e=0;e<o;e++){for(;l<n;)u|=a[s++]<<l,l+=8;r[c+e]=u&i,u>>=n,l-=n}break}case ZK:{let n=t>>8,i=(1<<n)-1,a=e.readBytes(Math.ceil(o*n/8)),s=0,l=0,u=0;for(let e=0;e<o;e++){for(;l<n;)u|=a[s++]<<l,l+=8;r[c+e]=u&1?-((u&i)>>1):(u&i)>>1,u>>=n,l-=n}break}case QK:{let t=r[0]=e.readIntVar(),i=e.readIntVar();for(let e=1;e<n;e++)r[e]=t+=i;break}case WK:case GK:{let n=i===GK,a=t>>8,s=n?t&UK|a&HK:a;if(nq[a]>1){let t=e.readTypeIndex(o,s);for(let n=0;n<o;n++)r[c+n]=e.readNumber(t[n])}else{let t=31-Math.clz32(s);for(let n=0;n<o;n++)r[c+n]=e.readNumber(t)}break}default:throw Error(`Unknown numeric array encoding method: ${i}`)}switch(a){case $K:r[0]=s;for(let e=1;e<n;e++)r[e]+=r[e-1];break;case eq:for(let e=0;e<n;e++)r[e]+=s}return r}function lq(e){let t=uq(e.readBytes(e.readVlq())),n=e.readNumericArray(),r=e.readNumericArray(),i=e.readNumericArray(),a=Array(n);for(let e=0,o=0,s=0,c=``;e<n.length;e++){let l=n[e],u=t(l>>2);l&2&&(u=c.slice(0,r[o++])+u),l&1&&(u+=c.slice(-i[s++])),a[e]=u,c=u}return a}function uq(e){function t(e){if(r!==null){let t=e;e=new Uint8Array(r.length+t.length),e.set(r),e.set(t,r.length),r=null}if(e[e.length-1]>127)for(let t=0;t<e.length;t++){let n=e[e.length-1-t];if(n>>6==3){t++,(t!==4&&n>>3==30||t!==3&&n>>4==14||t!==2&&n>>5==6)&&(r=e.slice(e.length-t),e=e.subarray(0,-t));break}}return n.decode(e)}let n=new TextDecoder(`utf8`,{ignoreBOM:!0}),r=null,i=0,a=``,o=0;return function(n){for(;n>a.length-o;)a=a.slice(o)+t(e.subarray(i,i+=16777216)),o=0;return a.slice(o,o+=n)}}var dq=12;function fq(e){return e===xK}function pq(e){try{let{version:t}=mq(e);if(fq(t))return!0;throw Error(`Unsupported jsonxl version "${t}", expected "${xK}"`)}catch{return!1}}function mq(e){if(e.byteLength<dq)throw Error(`Header length must be at least ${dq} bytes`);let t=new Uint8Array(e.buffer,e.byteOffset,dq);if(t.subarray(0,8).some((e,t)=>e!==bK[t]))throw Error(`Bad magic number`);let n=new DataView(t.buffer,t.byteOffset,dq);return{version:n.getUint16(8,!0),flags:n.getUint16(10,!0),headerSize:dq}}var hq=class{constructor(e,t){this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.bytes=e,this.pos=0,typeof t==`function`&&t(this),this.consumeHeader(),this.loadStrings(),this.loadArrayLengths(),this.loadArrayHeaders(),this.loadObjectEntries()}consumeHeader(){let{version:e,flags:t,headerSize:n}=mq(this.view);return this.pos+=n,{version:e,flags:t}}loadStrings(){this.strings=lq(this),this.stringRefs=this.readNumericArray(),this.stringRefsCursor=0}loadArrayHeaders(){this.arrayHeaders=this.readNumericArray(),this.arrayHeaderRefs=this.readNumericArray(),this.arrayHeaderRefsCursor=0}loadArrayLengths(){this.arrayLengths=this.readNumericArray(),this.arrayLengthsCursor=0}loadObjectEntries(){let e=this.readVlq(),t=this.readVlq();this.objectEntries=Array(e),this.objectKeys=t?this.stringRefs.slice(-t).map(e=>this.strings[e]):[];for(let t=0;t<e;t++)this.objectEntries[t]={dict:this.readNumericArray(),refs:this.readNumericArray(),cursor:0}}readString(){return this.strings[this.stringRefs[this.stringRefsCursor++]]}readArrayHeader(){return this.arrayHeaders[this.arrayHeaderRefs[this.arrayHeaderRefsCursor++]]}readArrayLength(){return this.arrayLengths[this.arrayLengthsCursor++]}readObjectEntry(e){let t=this.objectEntries[e],n=t.refs[t.cursor++],r=t.dict[n];return r===0?null:{key:this.objectKeys[r>>8],type:r&255}}readBytes(e){return this.bytes.subarray(this.pos,this.pos+=e)}readTypeIndex(e,t,n){let r=0,i=0,a=0;for(;t>0;)t&1&&(r|=a<<(i++<<2)),a++,t>>=1;let o=new Uint8Array(e),s=32-Math.clz32(i-1),c=(1<<s)-1,l=this.readBytes(Math.ceil(s*e/8)),u=0,d=0,f=0;for(let t=0;t<e;t++){f<s&&(d|=l[u++]<<f,f+=8);let e=r>>((d&c)<<2)&15;o[t]=n?1<<e:e,d>>=s,f-=s}return o}readVlq(){let e=this.view.getUint8(this.pos);if(!(e&1))e>>=1,this.pos+=1;else if(!(e&2))e=this.view.getUint8(this.pos+1)<<6|e>>2,this.pos+=2;else if(!(e&4))e=this.view.getUint16(this.pos+1,!0)<<5|e>>3,this.pos+=3;else{let t=this.view.getUint32(this.pos,!0);e=t>>>3&SK,this.pos+=4,t>>>31&&(e+=this.readUintVar()*(1<<28))}return e}readUintVar(){let e=this.view.getUint8(this.pos++),t=e&127,n=128;for(;e&128;)e=this.view.getUint8(this.pos++),t+=(e&127)*n,n*=128;return t}readIntVar(){let e=this.view.getUint8(this.pos++),t=e&128?this.readUintVar()*64:0,n=(e&127)>>1;return e&1?-(n+t):n+t}readUint8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readInt8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readUint16(){let e=this.view.getUint16(this.pos,!0);return this.pos+=2,e}readInt16(){let e=this.view.getInt16(this.pos,!0);return this.pos+=2,e}readUint24(){let e=this.view.getUint16(this.pos,!0)|this.view.getUint8(this.pos+2)<<16;return this.pos+=3,e}readInt24(){let e=this.view.getUint16(this.pos,!0),t=this.view.getUint8(this.pos+2),n=t&128?(t<<16|e)-16777216:t<<16|e;return this.pos+=3,n}readUint32(){let e=this.view.getUint32(this.pos,!0);return this.pos+=4,e}readInt32(){let e=this.view.getInt32(this.pos,!0);return this.pos+=4,e}readFloat32(){let e=this.view.getFloat32(this.pos,!0);return this.pos+=4,e}readFloat64(){let e=this.view.getFloat64(this.pos,!0);return this.pos+=8,e}readNumber(e){switch(e){case AK:return this.readUint8();case jK:return this.readUint16();case MK:return this.readUint24();case NK:return this.readUint32();case PK:return this.readUintVar();case LK:return this.readInt8();case RK:return this.readInt16();case zK:return this.readInt24();case BK:return this.readInt32();case VK:return this.readIntVar();case FK:return this.readFloat32();case IK:return this.readFloat64()}}readNumericArrayEncoding(){let e=this.readUint8();switch(e&15){case WK:case GK:case XK:case ZK:e|=this.readUint8()<<8}return e}readNumericArray(e=this.readVlq()){if(e===0)return[];let t=this.readNumericArrayEncoding();return this.readNumbers(t,e)}readNumbers(e,t,n){return cq(this,e,t,n)}};function gq(e,t){function n(e={}){let t=0,n;for(;n=a.readObjectEntry(t++);)e[n.key]=i(n.type);return e}function r(e=a.readArrayLength()){if(e===0)return[];let t=a.readArrayHeader(),i=t>>16,o=t&65535,s=i&1,c=i>>5&1,l=i>>9&1,u=i>>1&255|(i&1)<<4,d=Array(e),f=nq[u]>1?a.readTypeIndex(e,u,!0):null;if(u&tq){if(f===null)switch(u){case CK:d.fill(null);break;case DK:d.fill(!0);break;case OK:d.fill(!1)}else for(let t=0;t<e;t++)switch(f[t]){case CK:d[t]=null;break;case DK:d[t]=!0;break;case OK:d[t]=!1}}if(u&TK)for(let t=0;t<e;t++)(f===null||f[t]===TK)&&(d[t]=a.readString());if(u&wK){if(u===wK)a.readNumbers(o,e,d);else{let t=aq(f,wK),n=a.readNumbers(o,t);for(let t=0,r=0;t<e;t++)f[t]===wK&&(d[t]=n[r++])}}if(u&kK){if(l){let t=u===kK?e:aq(f,kK),n=a.readNumericArray(t),i=r();for(let t=0,r=0,a=0;t<e;t++)(f===null||f[t]===kK)&&(d[t]=i.slice(a,a+=n[r++]))}else for(let t=0;t<e;t++)(f===null||f[t]===kK)&&(d[t]=r())}if(u&EK){let t=u===EK?d:[];for(let n=0,r=0;n<e;n++)(f===null||f[n]===EK)&&(d[n]=t[r++]={});if(c){let e=a.readVlq(),n=Array(e);for(let t=0;t<e;t++)n[t]=a.readString();for(let i=0;i<e;i++){let e=n[i],a=r(t.length);for(let n=0;n<t.length;n++)a[n]!==void 0&&(t[n][e]=a[n])}}if(s)for(let e=0;e<t.length;e++)n(t[e])}return d}function i(e){switch(1<<(e&7)){case CK:return null;case TK:return a.readString();case wK:return a.readNumber(e>>3);case EK:return n();case DK:return!0;case OK:return!1;case kK:return r()}}let a=new hq(e,t),o=i(a.readUint8());if(a.pos!==e.byteLength)throw Error(`End of input is not reached`);return o}var _q=Object.freeze({name:`jsonxl/snapshot9`,test:pq,streaming:!1,decode:gq}),vq=[{name:`gzip`,test:e=>e[0]===31&&e[1]===139&&e[2]===8,createTransformStream:()=>new DecompressionStream(`gzip`)},{name:`zlib`,test:e=>(e[0]&15)==8&&e[0]>>4<=7&&(e[0]<<8|e[1])%31==0,createTransformStream:()=>new DecompressionStream(`deflate`)}];function yq(e){return e.reduce((e,t)=>e+t.byteLength,0)}function bq(e,t){switch(e.length){case 0:return;case 1:return e[0];default:{let n=new Uint8Array(t||yq(e)),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}}}async function xq(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.byteLength;return bq(t,n)}function Sq(e,t){if(typeof e!=`string`){for(let n of t)if(n.test(e))return n}return null}var Cq=class{#e;#t;#n;#r;constructor(e,t){this.#e=e,this.#t=t,this.#n=null,this.#r=null}transform(e,t){if(this.#r===null){let n=Sq(e,this.#e);if(n===null)this.#r=Promise.resolve();else{let{readable:e,writable:r}=n.createTransformStream();this.#n=r.getWriter(),this.#r=e.pipeTo(new WritableStream({write(e){t.enqueue(e)},close(){t.terminate()},abort(e){t.error(e)}})),typeof this.#t==`function`&&this.#t(n.name)}}if(this.#n!==null)return this.#n.write(e);t.enqueue(e)}async flush(){this.#n!==null&&(this.#n.close(),this.#n=null),this.#r!==null&&(await this.#r,this.#r=null)}},wq=262144,Tq=class{#e;#t;#n;constructor(e,t=wq){this.#e=e,this.#t=``,this.#n=t}async transform(e,t){if(typeof this.#t!=`string`&&await this.#i(t),typeof e==`string`){if(this.#t+=e,this.#r>=this.#n)return this.#i(t)}else this.#t=e,await this.#i(t)}async flush(e){await this.#i(e),await this.#e(!0)}get#r(){return this.#t.length}async#i(e){let t=this.#t;if(this.#r!==0){this.#t=``;for(let n=0;n<t.length;){let r=n===0&&t.length-n<this.#n*1.5?t:t.slice(n,n+this.#n);e.enqueue(r),n+=r.length,await this.#e(!1,r.length)}}}};function Eq(e){try{return new URL(e,location.origin).origin===location.origin}catch{return!1}}function Dq(e){return e.ok}function Oq(e){return e.headers.get(`x-file-encoded-size`)||e.headers.get(`content-length`)}function kq(e){return e.headers.get(`x-file-size`)||(Eq(e.url)&&!e.headers.get(`content-encoding`)?e.headers.get(`content-length`):void 0)}function Aq(e){return e.headers.get(`x-file-created-at`)||e.headers.get(`last-modified`)||void 0}function jq(e){let t=e?Object.keys(e):[],n=[`name`,`createdAt`,`elapsedTime`,`data`];return!(t.length!==4||t.some(e=>!n.includes(e)))}function Mq(e,t,{size:n,compression:r,encoding:i}){let a=null;if(jq(e)){let{data:n,...r}=e;e=n,t={...t,createdAt:n.createdAt},a=r}let o=e,s=a||{},{type:c,name:l,encoding:u,size:d,encodedSize:f,createdAt:p,...m}=t||{};return{resource:{type:c||`unknown`,name:l||`unknown`,compression:r,encoding:i,...Number.isFinite(n)?{size:n}:null,...Number.isFinite(f)?{encodedSize:f}:null,createdAt:new Date((typeof p==`string`?Date.parse(p):p)||Date.now()),...m},meta:s,data:o}}async function Nq(e,t,n,r){let i=Date.now(),a=[...ZG(t),_q,yK],o=0,s=!1,c=`unknown`,l=0;await r(`receiving`,d(!1));let u=e.pipeThrough(new TransformStream(new Tq(f))).pipeThrough(new TransformStream(new Cq(vq,e=>s=e))).getReader();try{let e=await u.read(),{value:t,done:n}=e;if(n)throw Error(`Empty payload`);for(let{name:n,test:r,streaming:i,decode:d}of a)if(r(t)){c=n;let t=p(u,e);return{data:await(i?d(t):xq(t).then(m(d))),compression:s,encoding:c,size:l,decodingTime:o}}throw Error(`No matched encoding found for the payload`)}finally{u.releaseLock()}function d(e){return{done:e,elapsed:Date.now()-i,units:`bytes`,completed:l,total:n}}async function f(e,t=0){l+=t,await r(`receiving`,d(e))}async function*p(e,t){for(;;){let{value:n,done:r}=t||await e.read();if(t=void 0,r)break;let i=performance.now();yield n,o+=performance.now()-i}}function m(e){return async t=>{await r(`decoding`,void 0,c);let n=performance.now();try{return await e(t)}finally{o=performance.now()-n}}}}async function Pq(e,t){try{await t.asyncSet({stage:`request`});let n=new Date,{method:r,stream:i,resource:a,options:o,data:s}=await e(),c=new Date,l=a?.size,{encodings:u}=o||{},{data:d,compression:f=!1,encoding:p=`unknown`,size:m=void 0,decodingTime:h=0}=s?{data:s}:await Nq(i,u,Number(l)||0,(e,n,r)=>t.asyncSet({stage:e,progress:n,step:r}));await t.asyncSet({stage:`received`});let{data:g,resource:_,meta:v}=Mq(d,a,{size:m,compression:f,encoding:p}),y=new Date,b=Number(y)-Number(n),x=Math.round(h||0);return{loadMethod:r,resource:_,meta:v,data:g,timings:{time:b,start:n,end:y,loadingTime:b-x,decodingTime:x,requestTime:Number(c)-Number(n),requestStart:n,requestEnd:c,responseTime:Number(y)-Number(c),responseStart:c,responseEnd:y}}}catch(e){throw console.error(`[Discovery] Error loading data:`,e),await t.asyncSet({stage:`error`,error:e}),e}}function Fq(e,t){let n=new rz({stage:`inited`});return{state:n,dataset:e(n),...t}}function Iq(e){return t=>Pq(e,t)}function Lq(e,t){return Fq(Iq(()=>({method:`stream`,stream:e,resource:t?.resource,options:t})))}function Rq(e,t){let n=Hq(e);return Fq(Iq(()=>({method:`file`,stream:e.stream(),resource:t?.resource||n,options:t})),{title:`Load data from file: `+(n?.name||`unknown`)})}function zq(e,t){let n=(e.dataTransfer||e.clipboardData||e.target)?.files?.[0];if(e.stopPropagation(),e.preventDefault(),!n)throw Error(`Can't extract a file from an event object`);return Rq(n,t)}function Bq(e,t){return t||={},Fq(Iq(async()=>{let n=await fetch(e,t.fetch),r=Hq(n,t);if(r&&n.body)return{method:`fetch`,stream:n.body,resource:t.resource||r,options:t};let i=n.headers.get(`content-type`)||``,a=await n.text();if(i.toLowerCase().startsWith(`application/json`))try{let e=JSON.parse(a);a=e.error||e}catch{}throw a=Error(a),a.isFetchError=!0,a.status=n.status,a.statusText=n.statusText,a.stack=null,a}),{title:`Load data from url: ${e}`})}function Vq(e){let t,n=new ReadableStream({start(e){t=e},cancel(){t=null}}),r,i=null,a=new Promise(t=>{r=r=>t({method:`push`,stream:n,resource:r?i=r:e?.resource,options:e})});return e||={},Fq(Iq(()=>a),{start(e){r(e)},push(e){r(),t?.enqueue(e)},finish(e){t?.close(),t=null,e!==void 0&&isFinite(e)&&i!==null&&(i.encodedSize=Number(e)),i=null}})}function Hq(e,t){if(e instanceof Response){let n=t?.isResponseOk||Dq,r=t?.getContentSize||kq,i=t?.getContentEncodedSize||Oq,a=t?.getContentCreatedAt||Aq;if(n(e))return{type:`url`,name:e.url,size:Number(r(e))||null,encodedSize:Number(i(e)),createdAt:a(e)}}if(e instanceof File)return{type:`file`,name:e.name,size:e.size,createdAt:e.lastModified};if(e instanceof Blob)return{size:e.size};if(ArrayBuffer.isView(e))return{size:e.byteLength};if(typeof e==`string`)return{size:e.length}}var Uq=class extends oz{#e;#t;static define(e,t,n){return e.#e.set(t,n),e.emit(`define`,t,n),n}constructor(e){super(),this.#e=new Map,this.#t=!!e}revoke(e){if(!this.#t)throw Error(`Entry revoking is not allowed`);this.#e.delete(e),this.emit(`revoke`,e)}isDefined(e){return this.#e.has(e)}has(e){return this.#e.has(e)}get(e){return this.#e.get(e)}get names(){return[...this.#e.keys()]}get keys(){return this.#e.keys()}get values(){return this.#e.values()}get entries(){return this.#e.entries()}};function Wq(e,t){let{ast:n}=JG.syntax.parse(t),r={view:e};if(n.type!==`Block`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): query root must be a "Block"`);if(n.body.type!==`Object`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): query root must return an "Object"`);for(let e of n.body.properties){if(e.type!==`ObjectEntry`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): unsupported object entry type "`+e.type+`"`);let t,n=e.value;switch(e.key.type){case`Literal`:t=e.key.value;break;case`Identifier`:t=e.key.name,n||=e.key;break;case`Reference`:t=e.key.name.name,n||=e.key;break;default:throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): unsupported object key type "`+e.key.type+`"`)}if(t===`view`||t===`postRender`)throw SyntaxError(`[Discovery] ViewModel#queryToConfig(): set a value for "`+t+`" property in shorthand notation is prohibited`);t===`when`||t===`data`||t===`whenData`?r[t]=n.type===`Literal`&&typeof n.value!=`string`?n.value:JG.syntax.stringify(n):r[t]=n.type===`Literal`&&(typeof n.value!=`string`||n.value[0]!==`=`)?n.value:`=`+JG.syntax.stringify(n)}return r}var Gq=Object.freeze({type:void 0}),Kq=Object.freeze({view:``}),qq=new WeakMap,Jq=new WeakMap,Yq=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`]);function Xq(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function Zq(e,t){return qq.set(e,t),e}function Qq(){return{name:`config-error`,options:Gq,render(e,t){e.appendText(`[Error: ${t.reason}]`),`config`in t}}}function $q(e,t,n,r,i,a,o,s){return!YR(n,e)||n[e]===void 0||t.host.queryBool(n[e]===!0?``:n[e],r,i)?!0:(t.viewEls.set(s,{skipped:e,config:n,inputData:a,inputDataIndex:o,data:r,context:i}),!1)}var eJ=class e{type;children;border;constructor(e=`inline`,t){if(this.type=e,this.children=[],this.border=null,Array.isArray(t))for(let e of t)this.append(e)}appendText(e){this.append(new tJ(e))}appendInlineBlock(){let t=new e(`inline-block`);return this.append(t),t}appendBlock(){let t=new e(`block`);return this.append(t),t}appendLine(){let t=new e(`line`);return this.append(t),t}append(e){return this.children.push(e),this}setBorder(e){if(!e){this.border=null;return}this.border=typeof e==`string`?new lJ(e,e,e,e):Array.isArray(e)?new lJ(...e):new lJ(e.top||null,e.right||null,e.bottom||null,e.left||null)}},tJ=class{value;constructor(e){this.value=String(e)}},nJ=class{node;constructor(){this.node=null}setNode(e){this.node=e}};function rJ(e,t=0,n=e.length-1){let r=e[t].length;for(let i=t+1;i<=n;i++)r=Math.max(r,e[i].length);return r}function iJ(e,t){return e.length>t?e.slice(0,t):e}function aJ(e,t=e,n=t,r=e){return(i,a)=>a===1?r:i===0?e:i+1===a?n:t}function oJ(e){return Array.isArray(e)?aJ(...e):e}function sJ(e,t=e,n=t){return(r,i,a)=>`${e}${``.padStart(r+i+a-e.length-n.length,t)}${n}`}function cJ(e){return Array.isArray(e)?sJ(...e):e}var lJ=class{top;left;right;bottom;constructor(e=null,t=null,n=e,r=t){this.top=e||null,this.left=r||null,this.right=t||null,this.bottom=n||null}render(e,t,n){let r=oJ(this.left),i=oJ(this.right),a=cJ(this.top),o=cJ(this.bottom),s=rJ(e),c=0,l=0;if(r){if(typeof r==`function`){let t=e.map((t,n)=>String(r(n,e.length)??``));c=rJ(t),e=e.map((e,n)=>t[n].padEnd(c)+e)}else c=r.length,e=e.map(e=>r+e);if(c>0)for(let r=0;r<e.length;r++)t[r].unshift({length:c,node:n})}if(i){if(typeof i==`function`){let r=e.map((t,n)=>String(i(n,e.length)??``));if(l=rJ(r),l>0){for(let r=0;r<e.length;r++)t[r].push({length:c+s-e[r].length+l,node:n});e=e.map((e,t)=>e.padEnd(c+s)+r[t].padStart(l))}}else{l=i.length;for(let r=0;r<e.length;r++)t[r].push({length:c+s-e[r].length+l,node:n});e=e.map(e=>e.padEnd(c+s)+i)}}if(a||o){let r=s+c+l;if(a){let i=typeof a==`function`?a(s,c,l)||``:``.padStart(r,a);i&&(e.unshift(iJ(i,r)),t.unshift([{length:e[0].length,node:n}]))}if(o){let i=typeof o==`function`?o(s,c,l)||``:``.padStart(r,o);i&&(e.push(iJ(i,r)),t.push([{length:e[e.length-1].length,node:n}]))}}return{spans:t,lines:e}}};async function uJ(e,t,n,r,i,a,o,s,c){let l=new eJ(t.options.type||`inline`);t.options.border&&l.setBorder(t.options.border),await t.render(l,i,a,o),typeof r.postRender==`function`&&await r.postRender(l,r,a,o);let u={config:r,props:i,inputData:s,inputDataIndex:c,data:a,context:o};return e.viewEls.set(l,u),n.setNode(l),n}function dJ(e,t,n,r){return uJ(e,e.defaultRenderErrorRenderer,n,Kq,{type:`render`,reason:t,config:r})}function fJ(e,t){return{name:t,normalizeConfig:e.normalizeConfig.bind(e),ensureValidConfig:e.ensureValidConfig.bind(e),composeConfig:e.composeConfig.bind(e),propsFromConfig:e.propsFromConfig.bind(e),render:e.render.bind(e),listLimit:e.listLimit.bind(e),renderList:e.renderList.bind(e)}}async function pJ(e,t,n,r,i,a){if(Array.isArray(n))return Promise.all(n.map(n=>pJ(e,t,n,r,i,a))).then(e=>new eJ(`inline`,e));let o=r&&typeof i==`number`?r[i]:r,s=null;switch(typeof n.view){case`function`:s={name:!1,options:Gq,render:n.view};break;case`string`:s=e.get(n.view)||null}t||=new eJ;let c=new nJ;if(t.append(c),!s){let t=typeof n.view==`string`?"View `"+n.view+"` is not found":`Render is not a function`;return e.host.logger.error(t,n),dJ(e,t,c,n)}try{if($q(`when`,e,n,o,a,r,i,c)){let t=`context`in n?await e.host.query(n.context,o,a):a,l=`data`in n?await e.host.query(n.data,o,t):o;if($q(`whenData`,e,n,l,t,r,i,c))return await uJ(e,s,c,n,e.propsFromConfig(n,l,t),l,t,r,i)}return c}catch(t){return e.host.logger.error(`View render error:`,t.message),dJ(e,String(t),c,Kq)}}var mJ=class e extends Uq{host;defaultRenderErrorRenderer;viewEls;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=Qq(),this.viewEls=new WeakMap}define(t,n,r){let i=Xq(n)||typeof n==`function`?{...r,render:n}:n,{render:a=[],...o}=i,{type:s,props:c}=o;return e.define(this,t,Object.freeze({name:t,options:Object.freeze({...i,type:typeof s==`string`||s===void 0?s:void 0,props:typeof c==`string`?this.host.queryFn(c):c}),render:typeof a==`function`?a.bind(fJ(this,t)):(e,t,n,r)=>this.render(e,a,n,r)}))}normalizeConfig(e){if(!e)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=this.normalizeConfig(n);e!==null&&(Array.isArray(e)?t.push(...e):t.push(e))}return t}if(typeof e==`string`){let[,t,n,r]=e.match(/^(\S+?)([:{])((?:.|\s)+)$/)||[];if(t){if(n===`{`)try{return Zq(Wq(t,n+r),e)}catch(t){return Zq(this.badConfig(e,t),e)}return Zq({view:t,data:r},e)}return Zq({view:e},e)}return typeof e==`function`?Zq({view:e},e):e}badConfig(e,t){let n=t?.message||`Unknown error`;return this.host.logger.error(n,{config:e,error:t}),{view:this.defaultRenderErrorRenderer.render,type:`config`,reason:n,config:e}}ensureValidConfig(e){return Array.isArray(e)?e.map(e=>this.ensureValidConfig(e)).flat():!e||!e.view?this.badConfig(e,Error(e?"Option `view` is missed":`Config is not a valid value`)):e}composeConfig(e,t){return e=this.normalizeConfig(e),t=this.normalizeConfig(t),e&&t?Array.isArray(e)?e.map(e=>Zq({...e,...t},[e,t])):Zq({...e,...t},[e,t]):e||t}propsFromConfig(e,t,n,r=this.get(e?.view)?.options.props){let i={};for(let[r,a]of Object.entries(e))Yq.has(r)||(i[r]=typeof a==`string`&&a.startsWith(`=`)?this.host.query(a.slice(1),t,n):a);if(typeof r==`function`){let e=r(t,{props:i,context:n});typeof e==`object`&&e&&e!==i&&(Jq.set(e,{props:i,fn:r}),i=e)}return i}textWidth(e){if(e===null)return 0;if(e instanceof eJ){let t=0;for(let n of e.children)t+=this.textWidth(n);return t}return e instanceof nJ?this.textWidth(e.node):e.value.length}cleanUpRenderTree(e){if(e===null)return null;if(e instanceof nJ)return this.cleanUpRenderTree(e.node);if(e instanceof eJ){let t=e.children.map(this.cleanUpRenderTree,this).filter(e=>e!==null);if(t.length===0)return null;let n=this.viewEls.get(e),r=e.border;e=new eJ(e.type,t),e.border=r,n&&this.viewEls.set(e,n)}else if(e.value===``)return null;return e}serialize(e){let t=this.cleanUpRenderTree(e),n=[],r=``;if(t!==null){let{lines:e,spans:i}=a(t,null),o=0;for(let e of i){for(let t of e)if(t.length>0){let e=o+t.length;n.push({range:[o,e],view:(t.node&&this.viewEls.get(t.node))??null}),o=e}o++}r=e.join(`
|
|
81
|
+
`)}return{text:r,ranges:n};function i(e,t,n,r,i){if(t<e.length&&e[t].length<n){let a=e[t],o=a.padEnd(n),s=r[t].at(-1);e[t]=o,s?s.length+=o.length-a.length:r[t].push({length:o.length,node:i})}}function a(e,t){if(e instanceof tJ){let n=e.value.split(/\r\n?|\n/);return{spans:n.map(e=>[{length:e.length,node:t}]),lines:n}}let n=[[]],r=[``],o=0;if(e instanceof eJ){let t=`none`;for(let s of e.children){let c=s instanceof eJ?s.type:`inline`,{lines:l,spans:u}=a(s,e);if(l.length>0){switch(c){case`block`:o=r.length-1,r[o]===``?o>0&&r[o]!==``?(n.push([]),r.push(``)):o===0&&(n.pop(),r.pop()):(n.push([]),r.push(``)),n.push(...u),r.push(...l),n.push([]),o=r.push(``)-1;break;case`line`:t===`block`||r[o]===``&&(n.pop(),r.pop()),n.push(...u),r.push(...l),n.push([]),o=r.push(``)-1;break;case`inline-block`:{t===`block`?(o=r.push(``)-1,n.push([])):(t===`inline`||t===`inline-block`)&&i(r,o,rJ(r,o)+1,n,e);let a=r[o].length;if(n[o].push(...u[0]),r[o]+=l[0],l.length>1){let t=l.length-(r.length-o);for(let e=0;e<t;e++)n.push([]),r.push(``);for(let t=1;t<l.length;t++)i(r,o+t,a,n,e),n[o+t].push(...u[t]),r[o+t]+=l[t]}break}case`inline`:if(t===`block`?(o=r.push(``)-1,n.push([])):t===`inline-block`&&i(r,o,rJ(r,o)+1,n,e),n[o].push(...u[0]),r[o]+=l[0],l.length>1)for(let e=1;e<l.length;e++)o=r.push(l[e])-1,n[o]=u[e]}t=c}}for(;t!==`inline`&&r[o]===``;)o--,n.pop(),r.pop();if(e.border)return e.border.render(r,n,e)}return{spans:n,lines:r}}}async render(e,t,n,r,i){return typeof e==`string`?e=new eJ(e):e||=new eJ,await pJ(this,e,this.ensureValidConfig(this.normalizeConfig(t)),n,i,r),e}async renderString(e,t,n,r,i){return this.serialize(await this.render(e,t,n,r,i))}listLimit(e,t){return e===!1?!1:!e||isNaN(e)?t:Math.max(parseInt(e,10),0)||t}renderList(e,t,n,r,i){let{offset:a=0,moreContainer:o,beforeItem:s,afterItem:c,beforeMore:l=s,afterMore:u=c}=i,{limit:d=!1}=i;d===!1&&(d=n.length);let f=Promise.all(n.slice(a,a+d).map((i,o,l)=>{s&&e.appendText(s);let u=this.render(e,t,n,{...r,index:a+o,array:n,sliceIndex:o,slice:l},a+o);return c&&e.appendText(c),u}));return this.maybeMore(o||e,null,n.length,a+d,l,u),f}maybeMore(e,t,n,r,i,a){if(n>r){let t=n-r;e.appendText((i||``)+`(`+t+` more…)`+(a||``))}}getViewConfigTransitionTree(e){let t=qq.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=Jq.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},hJ=e=>({demo:`${e}:"hello world\\nsome text..."`}),gJ=s({default:()=>_J});function _J({textView:e}){e.define(`alert`,{type:`block`,usage:hJ,border:{top:[`╔`,`═`,`╗`],left:`║ `,right:` ║`,bottom:[`╚`,`═`,`╝`]},render(t,n,r,i){let{content:a=`text`}=n;return e.render(t,a,r,i)}})}var vJ=(e,t)=>({demo:{view:e,text:`hello world`},examples:[{title:`Variations`,demo:t.map(e=>[`${e}:"${e}"`,`${e}:"${e}\\nmulti-line"`,`${e}:"${e}\\nmulti-line\\nmore..."`]).flat()},{title:`Complex content`,highlightProps:[`content`],demo:{view:e,content:[`text:"text"`,`link:"#example"`,`text:"text"`]}}]}),yJ=s({default:()=>bJ});function bJ({textView:e}){let t={type:`inline-block`,usage:vJ,props:`is not array? | {
|
|
82
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
83
|
+
content: undefined,
|
|
84
|
+
prefix,
|
|
85
|
+
postfix
|
|
86
|
+
} | overrideProps()`,render(e,t,n,r){let{text:i,content:a,prefix:o,postfix:s}=t,c;return o&&e.appendText(String(o)+` `),a?c=this.render(e,a,n,r):e.appendText(String(i)),s&&e.appendText(` `+String(s)),c}};e.define(`badge`,{...t,border:{left:[`⎡`,`⎢`,`⎣`,`[`],right:[`⎤`,`⎥`,`⎦`,`]`]}}),e.define(`pill-badge`,{...t,border:{left:[`⎧`,`⎪`,`⎩`,`(`],right:[`⎫`,`⎪`,`⎭`,`)`]}})}var xJ=(e,t)=>({demo:`${e}:'just a text'`,examples:[{title:`Variations`,demo:t.map(e=>[`header:"${e}"`,`text:"…text…"`,`${e}:"⎡${e}⎦"`,`text:"…text…"`,`${e}:"⎡${e}\\nmulti-line⎦"`,`text:"…text…"`,`${e}:"⎡${e}\\nmulti-line\\nmore and more…⎦"`,`text:"…text…"`]).flat()},{title:`Variations with border`,demo:t.map(e=>[`header:"${e}"`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}⎦" }`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}\\nmulti-line⎦" }`,`text:"…text…"`,`${e}{ border: [null, " |", null, "| "], data:"⎡${e}\\nmulti-line\\nmore and more…⎦" }`,`text:"…text…"`]).flat()}]}),SJ=s({default:()=>CJ});function CJ({textView:e}){function t(t,n,r,i){let{content:a=`text`,border:o}=n;return o&&t.setBorder(o),e.render(t,a,r,i)}e.define(`inline`,{type:`inline`,usage:xJ,render:t}),e.define(`inline-block`,{type:`inline-block`,usage:xJ,render:t}),e.define(`block`,{type:`block`,usage:xJ,render:t}),e.define(`line`,{type:`line`,usage:xJ,render:t})}var wJ=e=>({demo:{view:e,content:[`text:"Blockquote text..."`,`blockquote:"Nested blockquote\\nmulti-line text..."`]},examples:[{title:`Variations`,demoData:`Blockquote text...`,demo:[{kind:``,text:`Default blockquote without any kind.`},{kind:`note`,text:`Useful information that users should know, even when skimming content.`},{kind:`tip`,text:`Helpful advice for doing things better or more easily.`},{kind:`important`,text:`Key information users need to know to achieve their goal.`},{kind:`warning`,text:`Urgent info that needs immediate user attention to avoid problems.`},{kind:`caution`,text:`Advises about risks or negative outcomes of certain actions.`}].map(({kind:t,text:n})=>t?`${e}{ kind: "${t}", data: ${JSON.stringify(n)} }`:`${e}:${JSON.stringify(n)}`)}]}),TJ=wJ,EJ=s({default:()=>DJ});function DJ({textView:e}){e.define(`blockquote`,function(t,n,r,i){let{content:a=`text`,kind:o}=n;return typeof o==`string`&&/\S/.test(o)&&t.appendLine().appendText(`[!${o.trim().toUpperCase()}]`),e.render(t,a,r,i)},{type:`block`,usage:TJ,border:{left:`> `}})}var OJ={beforeDemo:['md:"A non-visual view used to group views, manage their visibility, or explicitly define data and context for nested views. In the example, the `context` view sets up specific data and context, allowing nested views (`content`) to utilize these shared definitions directly:"'],demo:{view:`context`,data:{name:`World`,age:`1000 years`},context:`{ ...#, greeting: "Hello" }`,content:["text:`${#.greeting}, ${name}!`",`table`]}},kJ=s({default:()=>AJ});function AJ({textView:e}){e.define(`context`,function(t,n,r,i){let{content:a=[]}=n;return e.render(t,a,r,i)},{usage:OJ})}var jJ=(e,t)=>({demo:`${e}:"Header \\"${e}\\""`,examples:[{title:`Variations`,view:t.map(e=>`${e}:"Header \\"${e}\\""`)},{title:`Complex content`,demo:{view:e,content:[`text:"Text "`,`link:{ text: "Link" }`]}},{title:`Using anchor`,demo:[{view:e,anchor:`foo`,content:`text:"Explicit value for an anchor"`},{view:e,anchor:!0,content:`text:"Auto generated anchor based on text content of header"`}]}]}),MJ=s({default:()=>NJ});function NJ({textView:e}){function t(t){let n=`#`.repeat(t)+` `;return async function(t,r,i,a){let{content:o}=r;return t.appendText(n),e.render(t,o||`text`,i,a)}}e.define(`header`,t(1),{type:`block`,usage:jJ}),e.define(`h1`,t(1),{type:`block`,usage:jJ}),e.define(`h2`,t(2),{type:`block`,usage:jJ}),e.define(`h3`,t(3),{type:`block`,usage:jJ}),e.define(`h4`,t(4),{type:`block`,usage:jJ}),e.define(`h5`,t(5),{type:`block`,usage:jJ})}var PJ={demo:{view:`link`,text:`I am a link`,href:`#example`},examples:[{title:`Infering text ⇿ href`,highlightProps:[`text`,`href`,`data`],beforeDemo:['md:"When `text` is omitted but `href` is specified, or vice versa, the opposite component is inferred from the specified one"'],demo:[{view:`link`,text:`http://example1.com`},{view:`link`,href:`http://example2.com`},{view:`link`,data:`"http://example3.com"`}]}]},FJ=s({default:()=>LJ}),IJ=`is not array? | {
|
|
87
|
+
text: #.props.content is undefined ? is string ?: text,
|
|
88
|
+
content: undefined,
|
|
89
|
+
href
|
|
90
|
+
} | overrideProps() | {
|
|
91
|
+
$text; $href;
|
|
92
|
+
...,
|
|
93
|
+
text: $text | is not undefined or no $href ?: $href,
|
|
94
|
+
href: $href | is not undefined or no $text ?: $text
|
|
95
|
+
}`;function LJ({textView:e}){e.define(`link`,async function(t,n,r,i){let{text:a,content:o,href:s}=n;s&&t.appendText(`[`),o?await e.render(t,o,r,i):t.appendText(a),s&&t.appendText(`](${s})`)},{type:`inline-block`,props:IJ,usage:PJ})}var RJ=(e,t)=>({demo:{view:e,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Variations`,demoData:[`foo`,`bar`,`baz`],demo:t.map(e=>[`header:'view: \\"${e}\\"'`,e]).flat()},{title:`Variations long lists`,demoData:Array.from({length:100},(e,t)=>`item#`+t),demo:t.map(e=>[`header:'view: \\"${e}\\"'`,{view:e,limit:3}]).flat()},{title:`Configure item's content`,demo:[{view:e,data:[`one`,`two`,`three`,`four`],item:[`text:"<item> "`,{view:`link`,data:`{ href: "#" + $ }`}]}]}]}),zJ=s({default:()=>BJ});function BJ({textView:e}){e.define(`list`,t(`line`,``),{type:`block`,usage:RJ}),e.define(`inline-list`,t(`inline-block`),{type:`inline-block`,usage:RJ}),e.define(`comma-list`,t(`inline-block`,``,`,`),{type:`inline-block`,usage:RJ}),e.define(`ol`,t(`line`,e=>1+e.index+`. `),{type:`block`,usage:RJ}),e.define(`ul`,t(`line`,`- `),{type:`block`,usage:RJ}),e.define(`list-item`,function(t,n,r,i){let{content:a=`text`,bullet:o,delim:s,renderType:c=`line`}=n,l=typeof o==`function`?o:o?(()=>o):null,u=typeof s==`function`?s:s?(()=>s):null;return t.type=c,(l||u)&&t.setBorder({left:l?(e=>e===0?l(i):``):null,right:u?(e=>e===0&&i.index!==i.array.length-1?u(i):``):null}),e.render(t,a,r,i)});function t(t,n,r){return async function(i,a,o,s){let{item:c,itemConfig:l,limit:u,emptyText:d}=a,f;return!Array.isArray(o)&&o&&(o=[o]),Array.isArray(o)&&o.length>0?f=e.renderList(i,this.composeConfig({view:`list-item`,content:c,bullet:n,delim:r,renderType:t},l),o,s,{limit:e.listLimit(u,25)}):i.appendText(String(d||`<empty list>`)),f}}}var VJ='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',HJ=Function(`return num => num + 5`)(),UJ={demo:{view:`source`,syntax:`js`,source:VJ},examples:[{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:VJ,syntax:`js`,lineNum:HJ},{view:`source`,source:VJ,syntax:`js`,lineNum:`==> $ + 12345`}]},{title:`Hide line numbers`,highlightProps:[`lineNum`],beforeDemo:['md:"Pass falsy value to `lineNum` option to hide line numbers:"'],demo:{view:`source`,source:VJ,syntax:`js`,lineNum:!1}},{title:`Marks`,highlightProps:[`marks`],beforeDemo:{view:`md`,source:["The `marks` option allows injecting text marks at specific points in the source text. The `marks` value must be an array of objects with the following fields:",`
|
|
96
|
+
`,"- `offset` (required) - the offset in the source where the mark is injected.","- `content` - view config for content (e.g., `'text:\"hello\"'` or `{ view: 'name', ... }`)","- `prefix` - text to display before the content of mark","- `postfix` - text to display after the content of mark"]},demo:{view:`source`,source:`let demo = "mark";
|
|
97
|
+
|
|
98
|
+
if (expr) {
|
|
99
|
+
// do something
|
|
100
|
+
}`,syntax:`js`,marks:[{offset:4},{offset:4,content:`text:"mark"`},{offset:24,prefix:`self: `,content:`text:"123"`,postfix:`ms`}]}}]},WJ=s({default:()=>KJ}),GJ=`is not array? | {
|
|
101
|
+
source: #.props has no 'source' ? is string ?: content is string ? content : source,
|
|
102
|
+
syntax,
|
|
103
|
+
lineNum is function ?: is not undefined ? bool() : true,
|
|
104
|
+
marks is array ?: null
|
|
105
|
+
} | overrideProps()`;function KJ(e){e.textView.define(`source`,{type:`block`,props:GJ,usage:UJ,async render(t,n,r,i){let a=[],{source:o,syntax:s,lineNum:c=!0,marks:l}=n,u={...i,sourceViewProps:{source:o,syntax:s,lineNum:c,marks:l}};if(typeof o!=`string`)return;let d=typeof c==`function`?c:e=>e+1,f=c?o.split(/\r\n?|\n/g).map((e,t)=>String(d(t))):[];if(f.length>2){let e=f.reduce((e,t)=>Math.max(e,t.length),3);for(let t=0;t<f.length;t++)f[t].length<e&&(f[t]=f[t].padStart(e))}if(t.appendLine().appendText(`\`\`\`${s||``}`),t.appendText(p()),Array.isArray(l)){for(let t of l){if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.mark, must be an object`,{props:n,mark:t});return}let r=typeof t.offset==`number`&&isFinite(t.offset)?Math.max(0,Math.round(t.offset)):void 0;if(typeof r!=`number`){e.logger.warn(`Bad "offset" value for an entry in "source" view props.marks`,{props:n,mark:t});return}a.push({...t,offset:Math.max(0,Math.min(r,o.length))})}a.sort((e,t)=>e.offset-t.offset);let r=0;for(let e of a){let{offset:n,content:i=[],prefix:a=``,postfix:s=``}=e;n>r&&(m(o.slice(r,n)),r=n),t.appendText(`/* `+a),await this.render(t,i,e,u),t.appendText(s+` */`)}r<o.length&&m(o.slice(r))}else m(o);t.appendLine().appendText("```");function p(){let e=f.shift();return typeof e==`string`?e+` │ `:``}function m(e){let n=e.split(/\r\n?|\n/);t.appendText(n[0]);for(let e=1;e<n.length;e++)t.appendText(`
|
|
106
|
+
`+p()+n[e])}}})}var qJ={demo:{view:`switch`,content:[{when:`expr`,content:'text:"Renders when `expr` is truthy"'},{content:'text:"Renders when all other `when` conditions are falsy"'}]}},JJ=s({default:()=>YJ});function YJ(e){e.textView.define(`switch`,function(t,n,r,i){let{content:a}=n,o=`text:"<switch: no case choosen>"`;if(Array.isArray(a)){for(let t of a)if(t&&e.queryBool(t.when||!0,r,i)){o=`data`in t?{view:`context`,data:t.data,content:t.content}:t.content;break}}return e.textView.render(t,o,r,i)},{usage:qJ})}function XJ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ZJ(e){return Array.isArray(e)||XJ(e)}function QJ(e){return JR(e)===`[object Set]`}function $J(e){return JR(e)===`[object RegExp]`}function eY(e){return typeof e==`object`&&!!e}var tY=typeof Symbol.toStringTag==`symbol`,nY=Error,rY=globalThis.DOMError,iY=typeof nY.isError==`function`?nY.isError:aY;function aY(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return!1;if(!tY||!(Symbol.toStringTag in e)){let t=JR(e);return t===`[object Error]`||t===`[object DOMException]`||t===`[object DOMError]`||t===`[object Exception]`}return rY!==void 0&&e instanceof rY||e instanceof Error}var oY={demoData:[{name:`Alice`,age:34,occupation:`Engineer`},{name:`Bob`,age:42,occupation:`Doctor`},{name:`Charlie`,age:9,occupation:`Student`},{name:`David`,age:50,occupation:`Doctor`},{name:`Eve`,age:15,occupation:`Engineer`}],demo:{view:`table`,limit:2,cols:{age:{footer:`text:sum(=>age)`},occupation:{footer:{}}}}},sY=s({default:()=>uY});function cY(e,t){return{header:e,view:`table-cell`,data:t}}function lY(e,t,n){return typeof t==`string`&&(t={content:t}),YR(t,`content`)||YR(t,`data`)?{header:e,view:`table-cell`,...t}:{...cY(e,n),...t}}function uY(e){let t=e.queryFn(`is not object`);e.textView.define(`table`,async function(n,r,i,a){let{rows:o,cols:s,valueCol:c=!1,headerWhen:l=!0,footerWhen:u=!0,limit:d=25}=r,f=0;`rows`in r||(o=i),QJ(o)&&(o=[...o]),ZJ(o)||(o=o?[o]:[]),d!==!1&&o.length>d&&(f=o.length-d,o=o.slice(0,d));let p=[];if(Array.isArray(s))s=s.map((t,n)=>typeof t==`string`?cY(t,e.pathToQuery([t])):{header:`col`+n,view:`table-cell`,...t});else{let n=new Set,r=s&&typeof s==`object`?s:{};s=[];for(let e of o)if(t(e))c=!0;else for(let t of Object.keys(e))n.add(t);for(let e of Object.keys(r))r[e]?n.add(e):n.delete(e);for(let t of n)s.push(YR(r,t)?lY(t,r[t],e.pathToQuery([t])):cY(t,e.pathToQuery([t])))}if(c&&s.unshift({header:`[value]`,view:`table-cell`,details:!1}),s=s.filter(t=>!YR(t,`colWhen`)||e.queryBool(t.colWhen,i,a)),!s.length)return n.appendText(`
|
|
107
|
+
<empty table>
|
|
108
|
+
`);let m=e.query(l,i,a),h=e.query(u,i,a),g=Array.from(o,()=>[]),_=[],v=[];for(let t of s){let n=String(t.header).trim(),r=0;if(m){let t=await this.render(null,`text`,n),i=e.textView.textWidth(t);r=Math.max(r,i),p.push({width:i,content:t})}for(let n=0;n<o.length;n++){let i=await this.render(null,t,o[n],a),s=e.textView.textWidth(i);r=Math.max(r,s),g[n].push({width:s,align:t.align,content:i})}if(h&&t.footer){let{align:n,...o}=typeof t.footer==`object`&&t.footer!==null&&!YR(t.footer,`view`)?t.footer:{content:t.footer},s=await this.render(null,this.composeConfig(`block`,o),i,a),c=e.textView.textWidth(s);r=Math.max(r,c),v.push({width:c,align:n,content:s})}else v.push(null);_.push(r)}y(_,`┌`,`┬`,`┐`),m&&(b(_,p),y(_,`├`,`┼`,`┤`));for(let e of g)b(_,e);if(f>0){let e=_.reduce((e,t)=>e+t+3,0)+1,t=` ${f} more rows… `,r=Math.max(1,e-t.length);n.appendLine().appendText(`${`~`.repeat(1)}${t}${`~`.repeat(Math.ceil(r-1))}`),h&&v.some(e=>e!==null)&&(y(_,`├`,`┼`,`┤`),b(_,v),y(_,`└`,`┴`,`┘`))}else h&&v.some(e=>e!==null)&&(y(_,`├`,`┼`,`┤`),b(_,v)),y(_,`└`,`┴`,`┘`);function y(e,t,r,i){let a=t+`─`.repeat((e[0]||0)+2);for(let t=1;t<e.length;t++)a+=r+`─`.repeat(e[t]+2);n.appendLine().appendText(a+i)}function b(e,t){let r=n.appendLine();for(let n=0;n<t.length;n++){let{width:i=0,align:a,content:o=``}=t[n]||{},s=e[n]-i+1;s>0&&a!==`right`?r.appendText(`│ `):r.appendText(`│`+` `.repeat(s)),r.append(o),s>0&&a===`right`?r.appendText(` `):r.appendText(` `.repeat(s))}r.appendText(`│`)}},{type:`block`,usage:oY}),e.textView.define(`table-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0}=n,s=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(e.queryBool(o,r,i)){if(a)return e.textView.render(t,a,r,i);t.appendText(dY(r,s))}})}function dY(e,t){if(Array.isArray(e)||ArrayBuffer.isView(e))return e.length||``;if(t){for(let t in e)if(YR(e,t))return`{…}`;return`{}`}return e===void 0?``:String(e)}var fY={demo:`text:"just a text"`},pY=s({default:()=>mY});function mY({textView:e}){e.define(`text`,{props:`{ text: #.props has no 'text'? } | overrideProps()`,usage:fY,render(e,t){let{text:n}=t;e.appendText(String(n))}})}var hY=s({alert:()=>gJ,badge:()=>yJ,block:()=>SJ,blockquote:()=>EJ,context:()=>kJ,headerViews:()=>MJ,link:()=>FJ,listViews:()=>zJ,source:()=>WJ,switchView:()=>JJ,table:()=>sY,textViews:()=>pY}),gY=class e extends Uq{#e;constructor(){super(!0),this.#e=Object.create(null)}define(t,n){if(typeof n!=`function`)throw Error(`callback is not a function`);return this.#e=Object.freeze({...this.#e,[t]:n}),e.define(this,t,Object.freeze({name:t,callback:n}))}revoke(e){if(this.has(e)){let t={...this.#e};delete t[e],this.#e=Object.freeze(t)}super.revoke(e)}get actionMap(){return this.#e}call(e,...t){let n=this.get(e);if(n===void 0)throw Error(`action "${e}" doesn't exist`);let{callback:r}=n;return r(...t)}},_Y=new Map,vY=null;function yY(e){vY=null;for(let[t,n]of _Y.entries())e.warn.groupCollapsed(`${t} (${n.length})`,n);_Y.clear()}function bY(e,t,...n){vY===null&&_Y.size===0&&(vY=setTimeout(()=>yY(e),1));let r=_Y.get(t);r===void 0?_Y.set(t,[n]):r.push(n)}function xY(e,t,n){switch(typeof t){case`function`:return t;case`string`:return Object.assign(e=>e&&YR(e,t)?e[t]:void 0,{getterFromString:`object[${JSON.stringify(t)}]`});default:throw Error(`[Discovery] Bad type "${typeof t}" for ${n} in object marker "${e}" config (must be a string or a function)`)}}function SY(e,t,n,r){let i=t&&YR(t,n)?t[n]:void 0;return i===void 0?r:xY(e,i,`"${n}" option`)}function CY(e,t,n){return(Array.isArray(t[n])&&t[n]||[]).map(t=>xY(e,t,`"${n}" option`))}function wY(e,t=!1){return e===null?!1:t?typeof e==`object`:typeof e==`object`||typeof e==`number`||typeof e==`string`}function TY(e,t){let{name:n,indexRefs:r,lookupRefs:i,annotateScalars:a,page:o,getRef:s,getTitle:c}=t;s!==null&&r.unshift(s),o&&s===null&&e.warn(`Option "ref" for "${n}" marker must be specified when "page" options is defined ("page" option ignored)`),r.length>0&&i.unshift(e=>e);let l=new Set,u=new Map,d=new Map,f=new WeakMap;return{name:n,page:s===null?null:o,mark:t=>{if(typeof t!=`object`||!t){e.warn(`Invalid value used for "${n}" marker (should be an object)`);return}l.add(t);for(let i of r){let r=i(t);if(wY(r)){if(!u.has(r)){u.set(r,t);continue}u.get(r)!==t&&bY(e,`The same reference value used for different objects for "${n}" marker`,`Reference value "${r}"`,{refGetter:i.getterFromString||i,ref:r,currentObject:u.get(r),newObject:t})}}},lookup:(e,t=!1)=>{if(!wY(e,t?!a:!1))return null;let r=typeof e==`object`,p=r?f.get(e):d.get(e);if(p!==void 0)return p;let m=null;if(r&&l.has(e))m=e;else for(let t of i){let n=t(e),r=u.get(n);if(r!==void 0){m=r;break}}if(m===null)return null;let h=d.get(m);if(h!==void 0)return h;let g=s===null?null:s(m),_=Object.freeze({type:n,object:m,ref:g,title:c(m),href:o!==null&&g!==null?`#${encodeURIComponent(o)}:${encodeURIComponent(g)}`:null});return d.set(m,_),e!==m&&(r?f.set(e,_):d.set(e,_)),_},reset:()=>{l.clear(),u.clear(),d.clear(),f=new WeakMap}}}var EY=class e extends Uq{constructor(e){super(),this.logger=e}#e=!1;lock(){this.#e=!0}define(t,n){if(this.#e)throw Error(`Object marker definition is not allowed after setup`);if(this.isDefined(t))throw Error(`Object marker "${t}" is already defined, new definition ignored`);n||={};let r=CY(t,n,`refs`),i=CY(t,n,`lookupRefs`),a=!!n.annotateScalars,o=n.page,s=typeof o==`string`?o:null,c=SY(t,n,`ref`,null),l=SY(t,n,`title`,c||(()=>null));return e.define(this,t,Object.freeze(TY(this.logger,{name:t,indexRefs:r,lookupRefs:i,annotateScalars:a,page:s,getRef:c,getTitle:l})))}reset(){for(let{reset:e}of this.values)e()}markerMap(){return Object.fromEntries([...this.entries].map(([e,t])=>[e,t.mark]))}lookup(e,t){if(typeof t==`string`)return this.get(t)?.lookup(e)||null;for(let{lookup:t}of this.values){let n=t(e);if(n!==null)return n}return null}lookupAll(e){let t=[];for(let{lookup:n}of this.values){let r=n(e);r!==null&&t.push(r)}return t}};function DY(e,t,n){let r=String(e),[i,a]=r.match(/^(?:\S+\s+)?(\S+)\(/)||[];if(i!==`function`&&i!==`function*`&&a===n.trim().slice(0,-1)&&(n=``),r.indexOf(`
|
|
109
|
+
`)===-1)return n+r;let o=r.split(/\n/),s=o[o.length-1].match(/^\s*/)?.[0].length||0,c=RegExp(`^\\s{0,`+s+`}`);return n+o.map((e,n)=>n&&e.length?e.replace(c,t):e).join(`
|
|
110
|
+
`)}function OY(e,t,n){return typeof e==`function`?DY(e,t,n):e instanceof Date?`${n}new Date("${e.toISOString()}")`:Array.isArray(e)?`${n}[${e.join(`, `)}]`:n+String(e)}var kY=new Set([`[object Function]`,`[object RegExp]`,`[object Date]`]);function AY(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function jY(e,t,n=4){let r=[];return String(JSON.stringify(e,t||function(e,t){return typeof t==`string`&&JR(this[e])===`[object Date]`&&(t=this[e]),t!==null&&(kY.has(JR(t))||AY(t))?(r.push(t),`{{{__placeholder__}}}`):t},n)).replace(/"((?:\\.|[^"])*)"(:?)/g,(e,t,n)=>n&&/^[a-z$_][a-z$_\d]*$/i.test(t)?t+n:`'${t.replace(/\\"/g,`"`).replace(/'/g,`\\'`)}'`+n).replace(/(^|\n)([ \t]*)(.*?)([a-zA-Z$_][a-zA-Z0-9$_]+:\s*)?'{{{__placeholder__}}}'/g,(e,t,n,i,a)=>t+n+i+OY(r.shift(),n,a))}function MY(...e){try{return JSON.parse(...e)}catch(e){return e}}function NY(...e){try{return JSON.stringify(...e)??`null`}catch(e){return String(e)}}var PY=new TextEncoder,FY=new TextDecoder,[IY,LY]=(()=>{let e=new Uint8Array(64),t=new Uint8Array(256);for(let n=0;n<64;n++){let r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charCodeAt(n);t[r]=n,e[n]=r}return[e,t]})();function RY(e){return FY.decode(zY(e))}function zY(e){typeof e==`string`&&(e=PY.encode(e));let t=new Uint8Array(Math.ceil(e.length/3)*4),n=0,r=0,i=0;for(let a=0;a<e.length;a++)for(r=r<<8|e[a],i+=8;i>=6;){let e=r>>(i-=6);t[n++]=IY[e],r-=e<<i}for(i!==0&&(t[n++]=IY[r<<6-i]);n<t.length;)t[n++]=61;return t}function BY(e){return FY.decode(VY(e))}function VY(e){let t=e.length;for(;t>0&&e[t-1]===`=`;)t--;let n=new Uint8Array(3*Math.ceil(t/4)),r=0,i=0,a=0;for(let o=0;o<t;o++)if(i=i<<6|LY[e.charCodeAt(o)&255],a+=6,a>8){let e=i>>(a-=8);n[r++]=e,i-=e<<a}return a!==0&&(n[r++]=i),n.subarray(0,(t>>2)*3+(t%4*6>>3))}var HY=/^data:image\/([a-z\+]+?(?:;base64)?),/,UY=/^([a-z\-]+:|\.{0,2}\/)/i;function WY(e){return e.includes(`http://www.w3.org/2000/svg`)?/(?:<|%3[cC])svg[:\s]/.test(e):!1}function GY(e){return typeof e==`string`&&HY.test(e)}function KY(e){let t=XY(e);if(t!==null)return`data:image/${t.type},${t.content}`}function qY(e){return typeof e==`string`&&UY.test(e)&&(GY(e)||!YY(e))}function JY(e){if(typeof e==`string`)return qY(e)?e:KY(e)}function YY(e){return XY(e)!==null}function XY(e){if(typeof e==`string`&&e.length>100){let t=null,n=null;switch(e.charCodeAt(0)){case 47:e.startsWith(`/9j/`)&&(t=`jpeg;base64`,n=e);break;case 37:case 60:WY(e)&&(t=`svg+xml`,n=e);break;case 65:(e.startsWith(`AAAB`)||e.startsWith(`AAAC`))&&(t=`ico;base64`,n=e);break;case 80:(e.startsWith(`PD94bWwg`)||e.startsWith(`PHN2`))&&WY(BY(e))&&(t=`svg+xml;base64`,n=e);break;case 82:(e.startsWith(`R0lGODdh`)||e.startsWith(`R0lGODlh`))&&(t=`gif;base64`,n=e);break;case 100:if(e.startsWith(`data:image/`)){let r=e.match(HY);r!==null&&(t=r[1],n=e.slice(r[0].length))}break;case 105:if(e.startsWith(`iVBORw0KGg`))t=`png;base64`,n=e;else if(e.startsWith(`image/`)){let r=e.match(/^image\/([a-z\+]+?(;base64)?),/);r!==null&&(t=r[1],n=e.slice(r[0].length))}}if(t!==null&&n!==null)return{type:t,content:n}}return null}var ZY={overrideProps:QY,jsonInfo:vK,jsonParse:MY,jsonStringify:NY,imagecontent:XY,imagedatauri:KY,imagesrc:JY};function QY(e,t=this.context.props){if(!t)return e;let n={...e};for(let e of Object.keys(n))YR(t,e)&&(n[e]=t[e]);return n}var $Y={error:iY,imagecontent:YY,imagedatauri:GY,imagesrc:qY};function eX(e,t){return{before(){e.objectMarkers.reset()},contextApi:{markers:e.objectMarkers.markerMap(),setWorkTitle:t?.setPrepareWorkTitle||(()=>Promise.resolve()),rejectData(e,t){throw Object.assign(Error(e),{renderContent:t})}}}}function tX(e,t){let n=e.objectMarkers,r={setPrepare:e.setPrepare.bind(e),defineObjectMarker:c,addQueryHelpers(t){return e.logger.warn(`addQueryHelpers() is deprecated, use addQueryMethods() instead`),o(t)},addQueryMethods:o,addQueryAssertions:s},i={...ZY,query:e.query.bind(e),pageLink:(t,n,r,i)=>e.encodePageHash(n,t,r,i),marker:n.lookup.bind(n),markerAll:n.lookupAll.bind(n),callAction:l,actionHandler:(t,...n)=>e.action.has(t)?()=>l(t,...n):void 0},a={...$Y};typeof t==`function`&&t(r),n.lock(),e.queryFnFromString=JG.setup({methods:i,assertions:a});function o(e){i={...i,...e}}function s(e){a={...a,...e}}function c(e,t){let{mark:r,lookup:i}=n.define(e,t);return i?r:()=>{}}function l(t,...n){let r=n[n.length-1],i=null;typeof r==`function`&&(i=r,n.pop());let a=e.action.call(t,...n);return a&&i&&typeof a.then==`function`?a.then(i):i?i(a):a}}function nX(e,t){let n=new EY(e.logger),r=[],i=[],a={setWorkTitle:t?.setPrepareWorkTitle||(()=>Promise.resolve()),rejectData(e,t){throw Object.assign(Error(e),{renderContent:t})},defineObjectMarker:d,lookupObjectMarker:f,lookupObjectMarkerAll:p,addValueAnnotation:m,addQueryHelpers(t){return e.logger.warn(`addQueryHelpers() is deprecated, use addQueryMethods() instead`),l(t)},addQueryMethods:l,addQueryAssertions:u,query(t,...n){return e.queryFn.call({queryFnFromString:c},t)(...n)}},o={...ZY,query:e.query.bind(e),pageLink:(t,n,r,i)=>e.encodePageHash(n,t,r,i),marker:f,markerAll:p,callAction:h,actionHandler:(t,...n)=>e.action.has(t)?()=>h(t,...n):void 0},s={...$Y},c=JG.setup({methods:o,assertions:s});return{contextApi:a,after(e){Object.assign(e,{objectMarkers:n,linkResolvers:r,annotations:i,queryFnFromString:c})}};function l(e){c=JG.setup({methods:o={...o,...e}})}function u(e){c=JG.setup({assertions:s={...s,...e}})}function d(t,i){let{page:a,mark:o,lookup:s}=n.define(t,i)||{};if(!s)return()=>{};if(a!==null){if(!e.page?.isDefined(a))return e.logger.error(`Page reference "${a}" doesn't exist`),()=>{};r.push(e=>{let t=s(e);return t&&{type:a,text:t.title,href:t.href,entity:t.object}})}return m((e,n)=>{let r=s(e,!0);if(r!==null&&r.object!==n.host)return{place:`before`,style:`badge`,text:t,href:r.href}}),o}function f(e,t){return n.lookup(e,t)}function p(e){return n.lookupAll(e)}function m(e,t=!1){typeof t==`boolean`&&(t={debug:t}),i.push({query:e,...t})}function h(t,...n){let r=n[n.length-1],i=null;typeof r==`function`&&(i=r,n.pop());let a=e.action.call(t,...n);return a&&i&&typeof a.then==`function`?a.then(i):i?i(a):a}}var rX=new WeakMap,iX=[`variable`,`property`,`value`,`assertion`,`method`],aX=(e,t)=>iX.indexOf(e.type)-iX.indexOf(t.type),oX=e=>{let t=e.toLowerCase();return n=>n!==e&&(typeof n==`string`?n:String(n)).toLowerCase().indexOf(t)!==-1};function sX(e,t){return typeof e==`string`?(e=JSON.stringify(e),t[0]===`'`?`'${e.slice(1,-1).replace(/\\.|'/g,e=>e===`\\"`?`"`:e===`'`?`\\'`:e)}'`:e):String(e)}function cX(e,t,n){if(t===n)return!0;let r=e.stat(t)||[],i=e.stat(n)||[];if(r.length!==i.length)return!1;for(let e=0;e<r.length;e++){let t=r[e],n=i[e];for(let e of Object.keys(t))if(t[e]!==n[e])return!1}return!0}function lX(e,t,n,r,i){try{let a=rX.get(e);if((!a||a.query!==t||a.data!==r||a.context!==i)&&(rX.set(e,a={query:t,data:r,context:i,offset:-1,suggestions:null,api:null}),a.api=e.queryFnFromString(t,{tolerant:!0,stat:!0})(r,i)),a.api===null)return null;if(a.offset!==-1&&cX(a.api,a.offset,n))return a.suggestions;let o=a.api.suggestion(a.offset=n,{sort:!0,filter:oX,limit:50});if(o){a.suggestions=[];for(let e of o.sort(aX))a.suggestions.push(...e.suggestions.map(t=>({type:e.type,from:e.from,to:e.to,text:e.text,value:e.type===`value`?sX(t,e.text):t})))}else a.suggestions=null;return a.suggestions}catch(t){return e.logger.error(`Error while attempting to retrieve suggestions for the query:`,t.message),null}}var uX=new Proxy({},{get:()=>()=>{}}),dX=[`silent`,`error`,`warn`,`info`,`perf`,`debug`],fX={error:[`error`,`error`],warn:[`warn`,`warn`],info:[`info`,`info`],perf:[`log`,`perf`],log:[`log`,`any`],debug:[`debug`,`debug`]},pX=class{#e;#t;#n;error;warn;info;perf;debug;log;constructor(e=``,t=`debug`,n=console){this.#t=e,this.#n=n||uX,this.logLevel=t}shouldLogLevel(e){let t=dX.indexOf(e);return this.#e!==`silent`&&t!==-1&&t<=dX.indexOf(this.#e)}get logLevel(){return this.#e}set logLevel(e){if(dX.indexOf(e)===-1&&console.error(this.#t,`Bad log level "${e}", supported: ${dX.join(`, `)}`),e!==this.#e){let t=this.#n,n=this.#t,r=e=>Function.prototype.bind.call(this.#n[e],this.#n,...this.#t?[this.#t]:[]),i=(e,r)=>(i,a)=>{t[r?`groupCollapsed`:`group`](`${n} ${i}`);let o=typeof a==`function`?a():a;if(Array.isArray(o))for(let n of o)t[e](...Array.isArray(n)?n:[n]);t.groupEnd()};this.#e=e;for(let[e,[t,n]]of Object.entries(fX))this[e]=n===`any`||this.shouldLogLevel(n)?Object.assign(r(t),{group:i(t,!1),groupCollapsed:i(t,!0)}):Object.assign(()=>{},{group:()=>()=>{},groupCollapsed:()=>()=>{}})}}},mX=(e,t)=>hX(e,t,mX);function hX(e,t,n=Object.is){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;for(let r in e)if(YR(e,r)&&(!YR(t,r)||!n(e[r],t[r])))return!1;for(let n in t)if(YR(t,n)&&!YR(e,n))return!1;return!0}var gX=()=>void 0,_X=`[Discovery]`,vX=e=>/^[a-zA-Z_][a-zA-Z_$0-9]*$/.test(e)&&!yX.includes(e),yX=[`and`,`or`,`in`,`has`,`is`,`not`,`no`,`asc`,`ascN`,`ascA`,`ascNA`,`ascAN`,`desc`,`descN`,`descA`,`descNA`,`descAN`],bX=(e,t)=>({...t,encodings:Array.isArray(t?.encodings)?[...t.encodings,...e.encodings]:e.encodings}),xX=class extends oz{options;info;logger;action;objectMarkers;linkResolvers;encodings;datasets;data;#e;prepare;#t;#n;textView;constructor(e){super(),this.options=e||{};let{name:t,version:n,description:r,icon:i,logLevel:a=`warn`,logger:o=console,extensions:s,encodings:c,context:l,setup:u}=e||{};this.info={name:t||`Untitled model`,version:n||null,description:r||null,icon:i||null},this.logger=new pX(_X,a,o),this.action=new gY,this.objectMarkers=new EY(this.logger),this.linkResolvers=[],this.datasets=[],this.encodings=ZG(c),this.data=void 0,this.#e=l,this.prepare=e=>e,this.#t=!0,this.textView=new mJ(this),this.apply(s),typeof u==`function`?(this.#t=!1,tX(this,u)):tX(this,()=>{}),this.apply(hY);for(let{page:e,lookup:t}of this.objectMarkers.values)e&&this.linkResolvers.push(n=>{let r=t(n);return r&&{type:e,text:r.title,href:r.href,entity:r.object}})}apply(e){Array.isArray(e)?e.forEach(e=>this.apply(e)):typeof e==`function`?e.call(null,this):e&&this.apply(Object.values(e))}log(){this.logger.error(`Model#log() is deprecated, use Model#logger interface instead`)}get legacyPrepare(){return this.#t}setPrepare(e){if(typeof e!=`function`)throw Error(`An argument should be a function`);this.prepare=e}get context(){return this.#e}set context(e){this.setContext(e,!0)}setContext(e,t=!1){let n=this.#e;if(t)this.#e=e;else{let t={...this.#e,...e};hX(t,n)||(this.#e=t)}Object.is(this.#e,n)||this.emit(`context`,n,this.#e)}getContext(){return{model:this.info,actions:this.action.actionMap,datasets:this.datasets,data:this.data,...this.context}}setData(e,t){t||={};let n=Symbol();this.#n=n;let r=Date.now(),i=()=>{if(this.#n!==n)throw Error(`Prevented by another setData()`)},a=this.#t?nX(this,t):eX(this,t);return Promise.resolve().then(()=>(i(),a.before?.(this),this.prepare.call(null,e,a.contextApi)||e)).then(e=>{i(),this.datasets=[{...t.dataset,data:e}],this.data=e,a.after?.(this),this.emit(`data`),this.logger.perf(`Data prepared in ${Date.now()-r}ms`)})}async trackLoadDataProgress(e){let t=Date.now(),n=await e.dataset;return this.logger.perf(`Data loaded in ${Date.now()-t}ms`),this.setData(n.data,{dataset:n})}loadDataFromStream(e,t){return this.trackLoadDataProgress(Lq(e,bX(this,t)))}loadDataFromEvent(e,t){return this.trackLoadDataProgress(zq(e,bX(this,t)))}loadDataFromFile(e,t){return this.trackLoadDataProgress(Rq(e,bX(this,t)))}loadDataFromUrl(e,t){return this.trackLoadDataProgress(Bq(e,bX(this,t)))}unloadData(){this.hasDatasets()&&(this.datasets=[],this.data=void 0,this.emit(`unloadData`))}hasDatasets(){return this.datasets.length!==0}getQueryEngineInfo(){return{name:`jora`,version:JG.version,link:`https://discoveryjs.github.io/jora/#article:jora-syntax`}}queryFnFromString(){return gX}queryFn(e){switch(typeof e){case`function`:return e;case`string`:return Object.assign(this.queryFnFromString(e),{query:e})}}query(e,t,n){switch(typeof e){case`function`:return e(t,n);case`string`:return this.queryFn(e)(t,n);default:return e}}queryBool(e,t,n){return JG.buildin.bool(this.query(e,t,n))}querySuggestions(e,t,n,r){return lX(this,e,t,n,r)}pathToQuery(e){let t=``,n=e=>t+=t===``?e[0]===`[`?`$`+e:e:e[0]===`[`?e:`.`+e;for(let t of e)t===`*`?n(`values()`):typeof t==`number`?n(`[${t}]`):vX(t)?n(t):n(`["${t}"]`);return t}stripAnchorFromHash(e){return typeof e==`string`?e.replace(/(^|&)!anchor(=[^&]+|(?=&|$))/g,``):e}encodePageHash(e=null,t=null,n,r=null){let i=n;return i&&(typeof i==`string`?i=this.stripAnchorFromHash(i):(Array.isArray(i)||(i=Object.entries(i)),i=i.filter(([e])=>e!==`!anchor`).map(e=>e.map(encodeURIComponent).join(`=`)).join(`&`))),`#${e?encodeURIComponent(e):``}${typeof t==`string`&&t||typeof t==`number`?`:`+encodeURIComponent(t):``}${i?`&`+i:``}${r?`&!anchor=`+encodeURIComponent(r):``}`}decodePageHash(e,t=()=>Object.fromEntries){let n=(e.indexOf(`&`)+1||e.length+1)-1,[r,i=null]=e.substring(+(e[0]===`#`),n).split(`:`).map(decodeURIComponent),a=[],o=null;for(let t of e.slice(n+1).split(`&`).filter(Boolean)){let e=t.indexOf(`=`),n,r;e===-1?(n=decodeURIComponent(t),r=!0):(n=decodeURIComponent(t.slice(0,e)),r=decodeURIComponent(t.slice(e+1))),n===`!anchor`?o=r&&r!==!0?r:null:a.push([n,r])}return{pageId:r,pageRef:i,pageParams:t(r)(a),pageAnchor:o}}resolveValueLinks(e){let t=[],n=typeof e;if(e&&(n===`object`||n===`string`))for(let n of this.linkResolvers){let r=n(e);r&&t.push(r)}return t.length?t:null}};async function SX(e,t){let n=$(`style`,null,`:host{display:none}`),r=new Set;Array.isArray(t)&&(e.append(...t.map(e=>{switch(typeof e==`string`&&(e={type:`style`,content:e}),e.type){case`style`:case`inline`:return $(`style`,{media:e.media},e.content);case`link`:case`external`:{let t,n,i=new Promise((e,r)=>{t=e,n=r});return r.add(i),$(`link`,{rel:`stylesheet`,href:e.href,media:e.media,onerror(e){r.delete(i),n(e)},onload(){r.delete(i),t()}})}default:throw Error(`Unknown type "${e.type}" for a style descriptor`)}})),r.size&&(e.append(n),await Promise.all(r),n.remove()))}var CX=EX(`localStorage`),wX=DX(`localStorage`),TX=new Map;function EX(e){let t=OX(e),n=new Map;return function(e){let r=n.get(e);return r===void 0&&(r=new AX(t,e),n.set(e,r),kX(t,n)),r}}function DX(e){let t=OX(e);return function(e){return t?.getItem(e)??null}}function OX(e){let t=`__storage_test__`+Math.random(),n;try{n=window[e]}catch{return null}try{n.setItem(t,t),n.removeItem(t)}catch(e){if(!(e instanceof DOMException&&(e.code===22||e.code===1014||e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&n.length!==0))return null}return n}function kX(e,t){e!==null&&!TX.has(e)&&(TX.set(e,t),TX.size===1&&addEventListener(`storage`,e=>{let t=TX.get(e.storageArea);if(t!==void 0){let n=t.get(e.key);n&&n.forceSync()}}))}var AX=class extends rz{#e;#t;constructor(e,t){super(e?.getItem(t)??null),this.#e=e,this.#t=t}#n(){return this.#e?.getItem(this.#t)??null}get storage(){return this.#e}get key(){return this.#t}get(){return this.value}set(e){return this.#e&&e!==this.#n()?(this.#e.setItem(this.#t,e),super.set(e)):!1}delete(){this.#e&&this.#e.removeItem(this.#t)}forceSync(){return this.#e?super.set(this.#n()):!1}},jX=`discoveryjs:color-scheme`,MX=Object.freeze([`auto`,`light`,`dark`]),NX=Object.freeze([`auto`,`light`,`dark`,`light-only`,`dark-only`]);function PX(e){return MX.includes(e)}function FX(){return matchMedia(`(prefers-color-scheme:dark)`)}function IX(e,t){let n=e;switch(e){case!0:e=`dark`;break;case!1:e=`light`;break;case`disabled`:case`disable`:case`off`:e=`light-only`;break;case`only`:e=`dark-only`}if(n!==e&&console.warn(`Used legacy value "${n}" for ColorSheme, value replaced for "${e}"`),e!==`light-only`&&e!==`dark-only`&&t){let t=wX(jX);PX(t)&&(e=t)}return e}function LX(e){switch(e){case`light`:case`dark`:return`manual`;case`light-only`:case`dark-only`:return`only`;case`auto`:return`auto`;default:return e}}function RX(e){let t=zX(e);return t===`auto`?FX().matches?`dark`:`light`:t}function zX(e){switch(e){case`auto`:return`auto`;case`dark`:case`dark-only`:return`dark`;default:return`light`}}var BX=class{#e;#t;#n;#r;#i;#a;persistent;state;value;serializedValue;mode;constructor(e=`auto`,t=!1){this.#e=t?CX(jX):null,this.#r=[],this.#i=IX(e,t),this.#a=RX(this.#i),Object.defineProperties(this,{persistent:{get:()=>this.#e!==null},state:{get:()=>this.#i},value:{get:()=>this.#a},serializedValue:{get:()=>zX(this.#i)},mode:{get:()=>LX(this.#i)}}),this.#t=this.#e?.subscribe(e=>{PX(e)&&e!==this.serializedValue&&this.mode!==`only`&&this.set(e)}),this.#n=()=>{let e=FX(),t=()=>{this.state===`auto`&&this.set(`auto`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}}subscribe(e,t=!1){let n={fn:e};return this.#r.push(n),t&&n.fn(this.#a,this.#i),()=>{let e=n===null?-1:this.#r.indexOf(n);n=null,e!==-1&&this.#r.splice(e,1)}}destroy(){this.#t?.(),this.#t=void 0,this.#n?.(),this.#n=void 0}set(e){let t=this.serializedValue,n=this.#a,r=this.#i;if(!NX.includes(e)){console.warn(`Bad value "${e}" for ColorScheme#state, value ignored`);return}this.#i=e,this.#a=RX(e),this.serializedValue!==t&&this.#e?.set(this.serializedValue),(this.#i!==r||this.#a!==n)&&this.#r.forEach(({fn:e})=>e(this.#a,this.#i))}toggle(e=!1){switch(this.#i){case`auto`:this.set(FX().matches?`dark`:`light`);return;case`dark`:this.set(e&&!FX().matches?`auto`:`light`);return;case`light`:this.set(e&&FX().matches?`auto`:`dark`);return}console.warn(`ColorScheme is locked for changes (mode=${this.#i})`)}},VX=class{items;host;baseConfig;constructor(e,t){this.host=e,this.baseConfig=t,this.items=[]}insert(e,t,n){switch(t){case`after`:t=this.items.findIndex(e=>e.name===n),t===-1?t=this.items.length:t++;break;case`before`:t=this.items.findIndex(e=>e.name===n),t===-1&&(t=this.items.length);break;default:(t===void 0||isNaN(t)||!isFinite(t))&&(t=this.items.length)}t=Math.max(0,Math.min(this.items.length,t));let r=this.host.view.composeConfig(this.baseConfig,e);this.items.splice(t,0,r)}prepend(e){this.insert(e,0)}append(e){this.insert(e)}before(e,t){this.insert(t,`before`,e)}after(e,t){this.insert(t,`after`,e)}replace(e,t){let n=this.items.findIndex(t=>t.name===e);n===-1?this.insert(t):this.items[n]=this.host.view.composeConfig(this.baseConfig,t)}remove(e){let t=this.items.findIndex(t=>t.name===e);if(t!==-1)return this.items.splice(t,1)[0]}},HX=class extends VX{host;popup;data;context;config;primary;secondary;menu;contentRect;constructor(e,t=`nav-button`){super(e,t);let n=$(`div`,`powered-by-discoveryjs`,[`powered by `,$(`a`,{class:`view-link`,href:`https://github.com/discoveryjs/discovery`,target:`_blank`},`Discovery.js`),` ${EB}`]);this.host=e,this.popup=null,this.data=null,this.context=null,this.primary=new VX(e,`nav-button`),this.secondary=this,this.menu=new VX(e,`menu-item`),this.config=[this.secondary.items,{view:`nav-button`,name:`burger`,whenData:!0,data:async()=>{let e=QR();return await this.host.view.render(e,this.menu.items,this.host.data,{...this.context,hide:()=>this.popup?.hide()}),[...e.childNodes].filter(e=>e.nodeType===1||e.nodeType===3)},onClick:(e,t)=>{let r=this.popup||new this.host.view.Popup({className:`discovery-nav-popup`});this.popup||(this.popup=r,r.el.addEventListener(`click`,({target:e})=>{e.closest(`a[href]`)&&setTimeout(()=>r.hide(),50)},!0)),r.toggle(e,e=>e.append(...t,n))}},this.primary.items],this.contentRect=new az,this.contentRect.subscribe(t=>{let{container:n}=e.dom;if(n&&t){let{width:e,height:r}=t;n.style.setProperty(`--discovery-nav-width`,e+`px`),n.style.setProperty(`--discovery-nav-height`,r+`px`)}})}render(e,t,n){this.contentRect.observe(e),e&&(this.data=t,this.context={...n,widget:this.host},this.host.view.setViewRoot(e,`nav`,{config:this.config,data:this.data,context:this.context}),e.innerHTML=``,this.host.view.render(e,this.config,this.data,this.context))}},UX=Object.freeze({tag:void 0}),WX=Object.freeze({view:``}),GX=new WeakMap,KX=new WeakMap,qX=new WeakMap,JX=new WeakMap,YX=new Set([`view`,`when`,`context`,`data`,`whenData`,`postRender`,`className`,`tooltip`]);function XX(e){return typeof e==`string`||Array.isArray(e)||typeof e==`object`&&!!e&&typeof e.view==`string`}function ZX(e){let{base:t,tolerance:n,start:r,startTolerance:i}=typeof e==`object`&&e?e:{base:e,start:e};return(typeof n!=`number`||!Number.isInteger(n)||n<=0)&&(n=0),i===void 0?i=n:(typeof i!=`number`||!Number.isInteger(n)||n<=0)&&(n=0),(typeof t!=`number`||Number.isNaN(t))&&(t=t===!1?1/0:10),(typeof r!=`number`||Number.isNaN(r))&&(r=r===void 0?t:r===!1?1/0:10),{base:t,tolerance:n,start:r,startTolerance:i}}function QX(e,t,n){return t+n>=e?e:t}function $X(e,t){return qX.set(e,t),e}function eZ(e,t,n,r){if(t===null||r.has(t))return;let i=e.fragmentEls.get(t);if(i!==void 0)for(let e of i){let t=n.children.find(t=>t.view===e);t?n=t:n.children.push(n={node:null,parent:n,view:e,children:[]})}let a=KX.get(t);if(a!==void 0)n.children.push(n={node:t,parent:n,viewRoot:a,children:[]});else{let r=e.viewEls.get(t);r!==void 0&&n.children.push(n={node:t,parent:n,view:r,children:[]})}if(t.nodeType===1)for(let i=t.firstChild;i;i=i.nextSibling)eZ(e,i,n,r)}function tZ(e){return{name:`config-error`,options:UX,render(t,n){if(t.className=`discovery-buildin-view-render-error`,t.dataset.type=n.type,t.textContent=n.reason,`config`in n){let r=t.appendChild(document.createElement(`span`));r.className=`toggle-config`,r.textContent=`show config...`,r.addEventListener(`click`,()=>{t.classList.toggle(`expanded`)?(r.textContent=`hide config...`,e.render(t,{view:`struct`,expanded:1},n.config)):(r.textContent=`show config...`,t.lastChild?.remove())})}}}}function nZ(e,t,n,r,i,a,o,s){return!YR(n,e)||n[e]===void 0||t.host.queryBool(n[e]===!0?``:n[e],r,i)?!0:(t.viewEls.set(s,{skipped:e,config:n,inputData:a,inputDataIndex:o,data:r,context:i}),!1)}function rZ(e,t,n,r){let i=t;return typeof i==`string`&&i.startsWith(`=`)&&(i=e.queryFn(i.slice(1))),typeof i==`function`&&(i=i(n,r)),typeof i==`string`&&(i=i.trim().split(/\s+/)),Array.isArray(i)&&(i=i.map(e=>typeof e==`function`?e(n,r):e).filter(Boolean),i.length)?i:null}function iZ(e,t,n,r,i){let a=n?rZ(e,n,r,i):null;a!==null&&t.classList.add(...a)}async function aZ(e,t,n,r,i,a,o,s,c){let{tag:l}=t.options,u=l===null?document.createDocumentFragment():document.createElement(l||`div`);await t.render(u,i,a,o),typeof r.postRender==`function`&&await r.postRender(u,r,a,o);let d={config:r,props:i,inputData:s,inputDataIndex:c,data:a,context:o};if(!ZR(u))e.viewEls.set(u,d),t.name&&u.classList.add(`view-${t.name}`),iZ(e.host,u,r.className,a,o),r.tooltip&&cZ(e.host,u,r.tooltip,a,o);else for(let t of u.childNodes){let n=e.fragmentEls.get(t);n===void 0?e.fragmentEls.set(t,[d]):n.unshift(d)}n.replaceWith(u)}function oZ(e,t,n,r){return aZ(e,e.defaultRenderErrorRenderer,n,WX,{type:`render`,reason:t,config:r})}function sZ(e,t){return{name:t,normalizeConfig:e.normalizeConfig.bind(e),ensureValidConfig:e.ensureValidConfig.bind(e),composeConfig:e.composeConfig.bind(e),propsFromConfig:e.propsFromConfig.bind(e),computeClassName:rZ.bind(null,e),applyComputedClassName:iZ.bind(null,e),render:e.render.bind(e),listLimit:e.listLimit.bind(e),renderList:e.renderList.bind(e),maybeMoreButtons:e.maybeMoreButtons.bind(e),renderMoreButton:e.renderMoreButton.bind(e),tooltip(t,n,r,i){t&&t.nodeType===1?cZ(e.host,t,n,r,i):e.host.logger.warn(`A tooltip can be attached to a HTML element only`)}}}function cZ(e,t,n,r,i){t.classList.add(`discovery-view-has-tooltip`),GX.set(t,{config:n,data:r,context:i}),e.view.tooltip===null&&(e.view.tooltip=dZ(e))}function lZ(e){return!!e&&!Array.isArray(e)&&typeof e!=`string`&&typeof e!=`function`&&!e.view}function uZ(e,t){return Number.isFinite(e)?Number(e):t}function dZ(e){let t=null,n=new e.view.Popup({className:`discovery-buildin-view-tooltip`,hoverTriggers:`.discovery-view-has-tooltip`,position:`pointer`,showDelay(e){let{config:t}=GX.get(e)||{};return lZ(t)?t.showDelay??!0:!0},render(r,i){let{config:a,data:o,context:s}=GX.get(i)||{},c=`pointer`,l=`natural`,u=3,d=3,f=!1,p=a;return t!==null&&(r.classList.remove(...t),t=null),lZ(a)&&(t=rZ(e,a.className,o,s),t!==null&&r.classList.add(...t),c=a.position||c,l=a.positionMode||l,u=uZ(a.pointerOffsetX,u),d=uZ(a.pointerOffsetY,d),f=!!a.hideOnTriggerClick,p=a.content),n.position=c,n.positionMode=l,n.pointerOffsetX=u,n.pointerOffsetY=d,n.hideOnTriggerClick=f,p?e.view.render(r,p,o,s):e.view.render(r,{view:e.view.defaultRenderErrorRenderer.render,reason:`Element marked as having a tooltip but related data is not found`})}});return n}async function fZ(e,t,n,r,i,a){if(Array.isArray(n)){await Promise.all(n.map(n=>fZ(e,t,n,r,i,a)));return}let o=r&&typeof i==`number`?r[i]:r,s=null;switch(typeof n.view){case`function`:s={name:!1,options:UX,render:n.view};break;case`string`:if(n.view===`render`){let{config:t=``,context:i=``}=e.propsFromConfig(n,r,a);s={name:!1,options:{tag:null},render(n,r,s){let c=t===``?s:e.host.query(t,o,a),l=e.host.query(i,a,o);return e.render(n,c,s===c?o:s,l)}}}else if(n.view.startsWith(`preset/`)){let t=n.view.substr(7);s={name:!1,options:{tag:null},render:e.host.preset.isDefined(t)?e.host.preset.get(t).render:()=>{}}}else s=e.get(n.view)||null}t||=document.createDocumentFragment();let c=t.appendChild(document.createComment(``));if(!s){let t=typeof n.view==`string`?"View `"+n.view+"` is not found":`Render is not a function`;return e.host.logger.error(t,n),oZ(e,t,c,n)}try{if(nZ(`when`,e,n,o,a,r,i,c)){let t=`context`in n?await e.host.query(n.context,o,a):a,l=`data`in n?await e.host.query(n.data,o,t):o;if(nZ(`whenData`,e,n,l,t,r,i,c))return await aZ(e,s,c,n,e.propsFromConfig(n,l,t),l,t,r,i)}}catch(t){return e.host.logger.error(`View render error:`,t.message),oZ(e,String(t),c,WX)}}var pZ=class{el;position;positionMode;pointerOffsetX;pointerOffsetY;hideOnTriggerClick;constructor(){}toggle(){}async show(){}hide(){}},mZ=class e extends Uq{host;defaultRenderErrorRenderer;viewEls;fragmentEls;tooltip;Popup=pZ;constructor(e){super(),this.host=e,this.defaultRenderErrorRenderer=tZ(this),this.viewEls=new WeakMap,this.fragmentEls=new WeakMap,this.tooltip=null}define(t,n,r){let i=XX(n)||typeof n==`function`?{...r,render:n}:n,{render:a=[],...o}=i,{tag:s,props:c}=o;return e.define(this,t,Object.freeze({name:t,options:Object.freeze({...i,tag:typeof s==`string`||s===void 0?s:null,props:typeof c==`string`?this.host.queryFn(c):c}),render:typeof a==`function`?a.bind(sZ(this,t)):(e,t,n,r)=>this.render(e,a,n,r)}))}normalizeConfig(e){if(!e)return null;if(Array.isArray(e)){let t=[];for(let n of e){let e=this.normalizeConfig(n);e!==null&&(Array.isArray(e)?t.push(...e):t.push(e))}return t}if(typeof e==`string`){let[,t,n,r]=e.match(/^(\S+?)([:{])((?:.|\s)+)$/)||[];if(t){if(n===`{`)try{return $X(Wq(t,n+r),e)}catch(t){return $X(this.badConfig(e,t),e)}return $X({view:t,data:r},e)}return $X({view:e},e)}return typeof e==`function`?$X({view:e},e):e}badConfig(e,t){let n=t?.message||`Unknown error`;return this.host.logger.error(n,{config:e,error:t}),{view:this.defaultRenderErrorRenderer.render,type:`config`,reason:n,config:e}}ensureValidConfig(e){return Array.isArray(e)?e.map(e=>this.ensureValidConfig(e)).flat():!e||!e.view?this.badConfig(e,Error(e?"Option `view` is missed":`Config is not a valid value`)):e}composeConfig(e,t){return e=this.normalizeConfig(e),t=this.normalizeConfig(t),e&&t?Array.isArray(e)?e.map(e=>$X({...e,...t},[e,t])):$X({...e,...t},[e,t]):e||t}propsFromConfig(e,t,n,r=this.get(e?.view)?.options.props){let i={};for(let[r,a]of Object.entries(e))YX.has(r)||(i[r]=typeof a==`string`&&a.startsWith(`=`)?this.host.query(a.slice(1),t,n):a);if(typeof r==`function`){let e=r(t,{props:i,context:n});typeof e==`object`&&e&&e!==i&&(JX.set(e,{props:i,fn:r}),i=e)}return i}render(e,t,n,r,i){return fZ(this,e,this.ensureValidConfig(this.normalizeConfig(t)),n,i,r)}renderError(e,t,n){let r=e instanceof Comment?e:e.appendChild(document.createComment(``));return oZ(this,t,r,n)}listLimit(e,t){return e===!1?!1:typeof e==`object`&&e?e.base===void 0?{...e,base:t}:e:!e||isNaN(e)?t:Math.max(parseInt(e,10),0)||t}renderList(e,t,n,r,i=0,a=!1,o){let s=o instanceof HTMLElement||o&&`nodeType`in o?{moreContainer:o}:o||{},{moreContainer:c,onSliceRender:l}=s,u=ZX(a),d=e.appendChild(document.createComment(``)),f=document.createDocumentFragment(),p=n.length,m=p-i,h=i===0?QX(m,u.start,u.startTolerance):QX(m,u.base,u.tolerance),g=QX(m-h,u.base,u.tolerance),_=Promise.all(n.slice(i,i+h).map((e,a,o)=>this.render(f,t,n,{...r,index:i+a,array:n,sliceIndex:a,slice:o},i+a))).then(()=>d.replaceWith(f));return typeof l==`function`&&_.then(()=>l(m-h,i,g,p)),this.maybeMoreButtons(c||e,null,p,i+h,g,(i,a)=>this.renderList(e,t,n,r,i,a===u.base?u:{...u,base:a},s)),_}maybeMoreButtons(e,t,n,r,i,a){if(n<=r)return null;let o=n-r,s=document.createElement(`span`);return o>i&&this.renderMoreButton(s,`Show `+i+` more...`,()=>a(r,i)),o>0&&this.renderMoreButton(s,`Show all the rest `+o+` items...`,()=>a(r,1/0)),s!==null&&(s.className=`more-buttons`,e.insertBefore(s,t)),s}renderMoreButton(e,t,n){let r=document.createElement(`button`);r.className=`more-button`,r.innerHTML=t,r.addEventListener(`click`,()=>{e.remove(),n()}),e.appendChild(r)}attachTooltip(e,t,n,r){cZ(this.host,e,t,n,r)}adoptFragment(e,t){let n=this.fragmentEls.get(t);if(n)for(let t of e.childNodes)this.fragmentEls.set(t,n)}setViewRoot(e,t,n){KX.set(e,{name:t,...n})}getViewTree(e){let t=new Set(e||[]),n=[];return eZ(this,this.host.dom?.container||null,{parent:null,children:n},t),n}getViewStackTrace(e){let{container:t}=this.host.dom;if(!t||!(e instanceof Node)||!t.contains(e))return null;let n=[],r=e;for(;r!==null&&r!==t;){let e=this.viewEls.get(r);e!==void 0&&n.push(e),r=r.parentNode}return n.length===0?null:n.reverse()}getViewConfigTransitionTree(e){let t=qX.get(e)||[];return Array.isArray(t)||(t=[t]),{value:e,deps:t.map(this.getViewConfigTransitionTree,this)}}getViewPropsTransition(e){let t=JX.get(e)||null;return t&&{props:t.props,fn:t.fn,query:t.fn.query||null}}},hZ=Symbol(`config`),gZ={name:`not-found`,render:(e,{name:t})=>{e.style.cssText=`color:#a00`,e.innerText=`Page \`${t}\` not found`}},_Z=class e extends Uq{#e;#t;#n;lastPage;lastPageRef;pageOverscrolled;setPageOverscroll;constructor(e,t){if(super(),this.#e=e,this.#t=t,this.#n=null,this.lastPage=null,this.lastPageRef=null,this.pageOverscrolled=new rz(!1),this.setPageOverscroll=()=>{},typeof IntersectionObserver==`function`){let t=$(`div`,{style:`position:absolute`}),n=e.dom?.content||null,r=()=>{};if(n!==null){let e=new IntersectionObserver(e=>this.pageOverscrolled.set(!e[e.length-1].isIntersecting),{root:n});this.setPageOverscroll=n=>{e.unobserve(t),r(),n&&(n.prepend(t),e.observe(t),r=this.pageOverscrolled.subscribeSync(e=>{n.classList.toggle(`page_overscrolled`,e)}))}}}}define(t,n,r){let{render:i,...a}=XX(n)||typeof n==`function`?{...r,render:n}:n;if(i===void 0)throw Error(`Page "${t}" requires a specified render option`);return e.define(this,t,Object.freeze({name:t,render:typeof i==`function`?i.bind(this.#t):(e,t,n)=>this.#t.render(e,i,t,n),options:Object.freeze(a),[hZ]:i}))}render(e,t,n,r){let i=this.get(t);i||(i=this.get(`not-found`)||gZ,n={name:t});let{reuseEl:a,init:o,keepScrollOffset:s=!0}=i.options||{},c=this.#e.pageRef,l=this.lastPage!==t,u=this.lastPageRef!==c,d=a&&!l?e:$(`article`,`page page-${CSS.escape(t)}`);this.#n=d,this.lastPage=t,this.lastPageRef=c,l&&typeof o==`function`&&o(d);let f=new Promise(async(t,a)=>{try{if(await i.render(d,n,r),this.#n!==d){a(Error(`Aborted by new page render`));return}d!==e&&(e.replaceWith(d),this.setPageOverscroll(d));let o=d.parentNode;o!==null&&(l||u||!s)&&(o.scrollTop=0),t()}catch(e){d.replaceChildren(),this.#t.render(d,`alert-danger`,String(e)+` (see details in console)`),a(e)}});return{pageEl:d,config:i[hZ],renderState:f}}},vZ=class e extends Uq{#e;constructor(e){super(),this.#e=e}define(t,n){return n=JSON.parse(JSON.stringify(n)),e.define(this,t,Object.freeze({name:t,render:(e,t,r,i)=>this.#e.render(e,n,r,i),config:n}))}render(e,t,n,r){let i=this.get(t);if(!i){let n="Preset `"+t+"` is not found";console.error(n,t);let r=e.appendChild(document.createElement(`div`));return r.className=`discovery-buildin-view-config-error`,r.textContent=n,Promise.resolve()}return i.render(e,null,n,r)}},yZ=(()=>{let e=new rz({x:0,y:0},(e,t)=>e.x!==t.x||e.y!==t.y);return document.addEventListener(`pointermove`,({x:t,y:n})=>e.set({x:t,y:n}),$R),e.readonly})();function bZ(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function xZ(e,t){if(typeof e!=`function`)throw TypeError(`Expected a function`);if(typeof t==`number`&&(t={wait:t}),!bZ(t)){let t;return Object.assign(function(...n){return t=e.apply(this,n)},{cancel(){},flush(){return t},pending(){return!1}})}let n=Math.max(0,Number(t.wait)||0),r=!!t.leading,i=`maxWait`in t,a=i?Math.max(Number(t.maxWait)||0,n):1/0,o=`trailing`in t?!!t.trailing:!0,s,c,l,u,d,f=0;function p(t){let n=s,r=c;return s=c=void 0,f=t,l=e.apply(r,n),l}function m(e,t){return setTimeout(e,t)}function h(e){clearTimeout(e)}function g(e){return f=e,u=m(y,n),r?p(e):l}function _(e,t){let r=e-t,i=e-f,o=n-r;return Math.min(o,a-i)}function v(e,t){let r=e-t,i=e-f;return r>=n||r<0||i>=a}function y(){let e=Date.now();if(d===void 0||v(e,d))return b(e);u=m(y,_(e,d))}function b(e){return u=void 0,o&&s?p(e):(s=c=void 0,l)}function x(){u!==void 0&&h(u),f=0,s=d=c=u=void 0}function S(){return u===void 0?l:b(Date.now())}function C(){return u!==void 0}return Object.assign(function(...e){let t=Date.now(),r=d===void 0||v(t,d);if(s=e,c=this,d=t,r){if(u===void 0)return g(d);if(i)return u=m(y,n),p(d)}return u===void 0&&(u=m(y,n)),l},{cancel:x,flush:S,pending:C})}var SZ=0,CZ=[{view:`badge`,when:`view.data != parent.(view or viewRoot).data or "data" in view.config`,data:{text:`D`},tooltip:`text:"Data value was changed"`},{view:`badge`,when:`view.context != parent.(view or viewRoot).context`,data:{text:`C`},tooltip:`text:"Context value was changed"`}];function wZ(e){let t=hz(e),n=_z(e,t),{scrollTop:r,scrollLeft:i,clientWidth:a,clientHeight:o}=t,s=r+0,c=i+0,l=i+a,u=r+o,d=r+n.top,f=i+n.left,p=f+n.width,m=r,h=i;(d<s||d>u)&&(m=d-0),f<c?h=f-0:p>l&&(h=Math.max(f,i-(p-l))-0),t?.scrollTo(h,m)}function TZ(){SZ=0}function EZ(e,{selectTreeViewLeaf:t,detailsSidebarLeafExpanded:n}){return{view:`tree`,when:`#.selectedView`,data:`$[0]`,className:`sidebar`,limitLines:!1,itemConfig:{collapsible:`=not viewRoot`,expanded:e=>e.viewRoot||n.has(e),onToggle:(e,t,r)=>e?n.add(r):n.delete(r)},item:{view:`switch`,content:[{when:`viewRoot`,content:{view:`block`,className:`view-root`,content:`text:viewRoot.name`}},{when:`$ = #.selectedView`,content:[{view:`block`,className:[e=>e.view?.skipped?`skipped`:!1,`selected`],content:`text:view.config.view or "#root" | is string ?: "ƒn"`,postRender(t){requestAnimationFrame(()=>{e.querySelector(`.sidebar`).scrollTop=SZ,wZ(t)})}},...CZ]},{content:[{view:`link`,className:e=>e.view?.skipped?`skipped`:!1,data:`{ text: view.config.view or "#root" | is string ?: "ƒn", href: false, view, self: $ }`,onClick(n,r){SZ=e.querySelector(`.sidebar`)?.scrollTop||0,t(r.self)}},...CZ]}]}}}function DZ(e){e=e.replace(/^(?:\s*[\n]+)+?([ \t]*)/,`$1`).trimRight(),e=e.replace(/\n[ \t]+(?=\n)/g,`
|
|
111
|
+
`);let t=e.split(/\n+/),n=Number(e.match(/^\s/)===null),r=1e3;for(var i=n;i<t.length;i++){let e=t[i].match(/^\s*/);if(e[0].length<r&&(r=e[0].length),r==0)break}return r>0&&(e=e.replace(RegExp(`^ {`+r+`}`,`gm`),``)),e}var OZ={view:`block`,className:[`content`,`props-config`],data:`#.view | view or viewRoot`,content:[{view:`block`,className:`content-section skip`,when:`skipped`,content:`block{ content: "badge:{ text: skipped }" }`},{view:`block`,className:`content-section render`,when:`config.view is not string`,content:`source:{ content: config.view + "", syntax: "js" }`},{view:`block`,when:`props != undefined`,className:`content-section props`,content:[{view:`struct`,expanded:1,data:`props`},{view:`context`,data:(e,t)=>t.host.view.getViewPropsTransition(e.props),whenData:!0,content:[{view:`block`,className:`transition-fn`,data:e=>({...e,query:typeof e.query==`string`?DZ(e.query):void 0}),content:{view:`switch`,content:[{when:`query is string`,content:{view:`source`,data:`{ content: query, syntax: "jora", lineNum: false }`}},{content:`struct:fn`}]}},{view:`struct`,expanded:2,data:`props`}]}]},{view:`block`,className:`content-section config`,content:[{view:`struct`,expanded:1,data:`config`},{view:`tree`,data:(e,t)=>t.host.view.getViewConfigTransitionTree(e.config).deps,whenData:!0,expanded:3,children:`deps`,item:{view:`struct`,expanded:1,data:`value`}}]}]},kZ={view:`list`,className:`data-flow-transitions`,limit:1,when:`.[view]`,data:`
|
|
112
|
+
[null] // to show empty list on first render
|
|
113
|
+
+ .[view] // filter viewRoot
|
|
114
|
+
.(
|
|
115
|
+
$parent;
|
|
116
|
+
$parentName: parent.view.config.view;
|
|
117
|
+
$queryData: view | inputDataIndex != undefined ? inputData[inputDataIndex] : inputData;
|
|
118
|
+
|
|
119
|
+
view | [
|
|
120
|
+
...'data' in config ? { inputData: $queryData, transition: config.data, name: config.view, view: $, $parent } : [],
|
|
121
|
+
...inputDataIndex != undefined ? { inputData, transition: \`$[\${inputDataIndex}]\`, name: \`\${$parentName} → \${config.view}\`, view: $, $parent } : []
|
|
122
|
+
]
|
|
123
|
+
)
|
|
124
|
+
`,whenData:`size() > 1`,itemConfig:{when:!0},item:[{view:`block`,className:`root-data`,when:`inputData = ..parent.viewRoot[].data`,content:`badge:"Root data"`},{view:`struct`,data:`inputData`},{view:`block`,className:`data-flow-transition`,content:[{view:`switch`,content:[{when:`transition is (string or undefined)`,content:{view:`context`,data(e){return{content:DZ(e.transition),refs:[]}},content:{view:`source`,data:`{
|
|
125
|
+
...,
|
|
126
|
+
syntax: "jora",
|
|
127
|
+
lineNum: false
|
|
128
|
+
}`}}},{content:{view:`struct`,data:`transition`}}]},{view:`block`,className:`view-name`,content:`text:name`}]}]},AZ={view:`block`,className:`content-section data`,data:`#.view`,content:[{view:`context`,data:`..parent`,content:kZ},{view:`context`,content:{...kZ,limit:!1}},{view:`block`,className:`root-data`,when:`view or viewRoot | data = ([@] + @..parent).viewRoot[].data`,content:`badge:"Root data"`},{view:`struct`,expanded:1,data:`view or viewRoot | data`}]};function jZ(e,t){if(e===null)return!0;for(let n of[`top`,`left`,`width`,`height`])if(e[n]!==t[n])return!0;return!1}var MZ=e=>{let t=!1,n=null,r=null,i=null,a=null,o,s=new Set,c=new Map,l=new Map,u=$(`div`,`cancel-hint view-alert view-alert-warning`),d=$(`div`,{class:`discovery-view-inspector-overlay`,onclick:t=>{if((t.metaKey||t.ctrlKey)&&r){let t=r.view.config.view;g(),e.setPage(`views-showcase`,t);return}_(r&&!i?r:null)}},[u]),f=xZ(()=>{if(!t||i!==null)return;let n=e.view.getViewTree([b.el]),r=new Set([...l.keys()]);(function e(t,n){for(let i of t){if(!i.node||!i.view&&!i.viewRoot){i.children.length&&e(i.children,n);continue}let t=_z(i.node,n),a=l.get(i.node)||null;a===null?(a={el:n.appendChild($(`div`,i.viewRoot?`overlay view-root`:`overlay`)),box:null},i.node.nodeType===1&&(a.el.style.zIndex=getComputedStyle(i.node).zIndex),i.viewRoot&&i.viewRoot.inspectable!==!1&&(a.el.dataset.inspectable=!0),l.set(i.node,a),c.set(a.el,i)):r.delete(i.node),jZ(a.box,t)&&(a.el.style.top=`${t.top}px`,a.el.style.left=`${t.left}px`,a.el.style.width=`${t.width}px`,a.el.style.height=`${t.height}px`,a.box=t),i.children.length&&(i.node.nodeType===1&&(a.el.style.overflow=getComputedStyle(i.node).overflow===`visible`?`visible`:`hidden`),e(i.children,a.el))}})(n,d);for(let e of r)l.get(e).el.remove(),l.delete(e);p()},{maxWait:0,wait:50}),p=()=>{let{x:t,y:n}=yZ.value;y([...e.dom.container.parentNode.elementsFromPoint(t|0,n|0)||[]].find(e=>c.has(e))||null)},m=t=>{(t.key===`Escape`||t.keyCode===27||t.which===27)&&e.inspectMode.set(!1)},h=()=>{t||(t=!0,document.addEventListener(`scroll`,f,$R),document.addEventListener(`keydown`,m,!0),yZ.subscribe(f),o=setInterval(f,500),e.dom.container.append(d),f(),e.inspectMode.set(!0))},g=()=>{t&&(t=!1,clearInterval(o),document.removeEventListener(`scroll`,f,$R),document.removeEventListener(`keydown`,m,!0),yZ.unsubscribe(f),x=!1,delete u.dataset.alt,d.remove(),d.replaceChildren(u),l.clear(),v(),e.inspectMode.set(!1))},_=t=>{if(i=t||null,t){let{innerWidth:e,innerHeight:n}=window,{left:r,top:i,width:o,height:s}=b.el.getBoundingClientRect();b.el.style.top=`${i}px`,b.el.style.left=`${r}px`,b.el.style.right=`${e-(r+o)}px`,b.el.style.bottom=`${n-(i+s)}px`,b.frozen=!0,requestAnimationFrame(()=>{y(l.get(t.node)?.el||null),clearTimeout(a),b.show(),b.freeze()}),delete u.dataset.alt}else x?e.inspectMode.set(!1):(s.clear(),TZ(),v(),f())},v=()=>{n&&n.classList.remove(`hovered`),n=null,r=null,i=null,b.hide()},y=e=>{if(e===n)return;if(n!==null&&n.classList.remove(`hovered`),n=e,e===null){a=setTimeout(v,100);return}e.classList.add(`hovered`);let t=c.get(e)||null;if(t===null){r=null;return}(r===null||t.view!==r.view)&&(r=t,clearTimeout(a),b.show())},b=new e.view.Popup({className:`discovery-inspect-details-popup`,position:`pointer`,hideIfEventOutside:!1,hideOnResize:!1,render(t){let n=i||r,a=[],o=n;for(;o!==null&&(o.view||o.viewRoot);)o!==n&&i!==null&&s.add(o),a.unshift(o),o=o.parent;return e.view.render(t,{view:`context`,modifiers:[EZ(t,{selectTreeViewLeaf:_,detailsSidebarLeafExpanded:s})],content:{view:`context`,modifiers:{view:`block`,className:`toolbar`,content:[{view:`toggle-group`,className:`stack-view-chain`,name:`view`,data:`.({ value: $ })`,value:`=$[-1].value`,toggleConfig:{className:[e=>e.value.viewRoot?`view-root`:!1,e=>e.value.view&&e.value.view.skipped?`skipped`:!1],content:[`text:value | viewRoot.name or view.config.view | is string ?: "ƒn"`]}},{view:`button`,when:i!==null,content:`text:"Close inspector"`,onClick(){e.inspectMode.set(!1)}}]},content:[OZ,{view:`block`,className:[`content`,`data-context`],content:[AZ,{view:`block`,className:`content-section context`,data:`$[-1] | view or viewRoot`,content:{view:`struct`,expanded:1,data:`context`}}]}]}},a,{selectedView:i,host:e})}});e.action.define(`startInspect`,h),e.action.define(`stopInspect`,g),e.inspectMode.subscribeSync(e=>e?h():g());let x=!1},NZ=(e,t)=>({demo:{view:e,text:`Button`,onClick:Function(`return () => alert("Hello world!")`)()},examples:[{title:`Variations`,demo:t.map(e=>`${e}{ text: "${e}" }`)},{title:`Disabled state`,demo:t.map(e=>({view:e,disabled:!0,text:e}))},{title:`Complex content`,demo:{view:`button`,content:[`text:"Example "`,`pill-badge:123`]}},{title:`Button as a link`,demo:{view:`button`,text:`Click me`,href:`#url`,external:!0}},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `text`","- `href`","- `external`"].join(`
|
|
129
|
+
`)},highlightProps:[`data`],demo:{view:e,data:{text:`demo`,href:`#example`,external:!0}}}]}),PZ=`is not array? | {
|
|
130
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
131
|
+
content: undefined,
|
|
132
|
+
disabled: false,
|
|
133
|
+
href,
|
|
134
|
+
external,
|
|
135
|
+
onClick: undefined
|
|
136
|
+
} | overrideProps()`;function FZ(e){function t(t,n,r,i){let{text:a,content:o,disabled:s,href:c,external:l,onClick:u}=n;if(t.classList.add(`view-button`),s?t.disabled=!0:typeof u==`function`?(t.addEventListener(`click`,()=>u(t,r,i)),t.classList.add(`onclick`)):typeof c==`string`&&t.addEventListener(`click`,()=>{let t=$(`a`,{href:c,target:l?`_blank`:``});e.dom.root.append(t),t.click(),t.remove()}),o)return e.view.render(t,o,r,i);t.textContent=a}e.view.define(`button`,t,{tag:`button`,props:PZ,usage:NZ}),e.view.define(`button-primary`,t,{tag:`button`,props:PZ,usage:NZ}),e.view.define(`button-danger`,t,{tag:`button`,props:PZ,usage:NZ}),e.view.define(`button-warning`,t,{tag:`button`,props:PZ,usage:NZ})}var IZ={demo:{view:`checkbox-list`,checkbox:{content:`text`},data:[`one`,`two`,`three`]}};function LZ(e){e.view.define(`checkbox-list`,function(t,n,r,i){let{name:a=`filter`,checkbox:o,checkboxValue:s=`$`,emptyText:c,limit:l,onChange:u,onInit:d}=n,f=new Set;if(c!==!1&&c!==``&&t.setAttribute(`emptyText`,c||`Empty list`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`checkbox`,...o,onInit:(t,n,r,i)=>{t&&f.add(e.query(s,r,i))},onChange:(t,n,r,i)=>{let o=f.size,c=e.query(s,r,i);t?f.add(c):f.delete(c),o!==f.size&&typeof u==`function`&&u([...f],a)}}),r,i,0,e.view.listLimit(l,25)).then(()=>{typeof d==`function`&&d([...f],a)})},{usage:IZ})}var RZ={demo:{view:`checkbox`,content:`text:"checkbox caption"`},examples:[{title:`Checked state`,beforeDemo:"Checked state is set up with `checked` property. Its value can be a query",demo:[{view:`checkbox`,checked:!0,content:`text:"should be checked"`},{view:`checkbox`,checked:`=1 > 5`,content:`text:"shouldn't be checked"`},{view:`checkbox`,checked:`=1 < 5`,content:`text:"should be checked"`}]},{title:`Readonly checkbox`,demo:{view:`checkbox`,readonly:!0,content:`text:"checkbox caption"`}},{title:`On change`,demo:{view:`checkbox`,onChange:Function("return (value, name, data, context) => alert(`Changed to ${value}!`)")(),content:`text:"click me!"`}}]},zZ=`#.props | {
|
|
137
|
+
name: undefined,
|
|
138
|
+
checked: undefined,
|
|
139
|
+
readonly: undefined,
|
|
140
|
+
content: undefined,
|
|
141
|
+
onInit: undefined,
|
|
142
|
+
onChange: undefined
|
|
143
|
+
} | overrideProps() | {
|
|
144
|
+
...,
|
|
145
|
+
checked is truthy,
|
|
146
|
+
readonly is truthy
|
|
147
|
+
}`;function BZ(e){function t(t,n,r,i,a,o){if(t===null)return;let s=a?{...i,[a]:o.checked}:i;return t.innerHTML=``,e.view.render(t,n,r,s)}e.view.define(`checkbox`,function(e,n,r,i){let{name:a,checked:o,readonly:s,content:c,onInit:l,onChange:u}=n,d=e.appendChild($(`input`)),f=c?e.appendChild($(`span`,`view-checkbox__label`)):null;return d.type=`checkbox`,d.checked=o,d.readOnly=s,d.addEventListener(`click`,e=>{s&&e.preventDefault()}),d.addEventListener(`change`,()=>{typeof u==`function`&&(u(d.checked,a,r,i),t(f,c,r,i,a,d))}),typeof l==`function`&&l(d.checked,a,r,i),t(f,c,r,i,a,d)},{tag:`label`,props:zZ,usage:RZ})}var VZ={demo:{view:`content-filter`,data:[`foo`,`bar`,`baz`],content:{view:`list`,data:`.[$ ~= #.filter]`}},examples:[{title:`Using with text-match`,demo:{view:`content-filter`,data:[{name:`foo`},{name:`bar`},{name:`baz`}],name:`customName`,content:{view:`list`,data:`.[name ~= #.customName]`,item:`text-match:{ text: name, match: #.customName }`}}}]};function HZ(e){e.view.define(`content-filter`,function(t,n,r,i){let{name:a=`filter`,type:o=`regexp`,placeholder:s,content:c,onInit:l,onChange:u,debounce:d}=n;return e.view.render(t,{view:`context`,modifiers:{view:`input`,name:a,type:o,placeholder:s||`Filter`,debounce:d},content:{view:`block`,className:`content`,content:c,onInit:l,onChange:u}},r,i)},{usage:VZ})}var UZ={demo:{view:`context`,modifiers:{view:`dropdown`,name:`demo`,value:{foo:`two`,bar:`hello`},resetValue:{foo:`one`,bar:``},caption:"text:`${#.demo.foo} / ${#.demo.bar}`",content:[{view:`select`,name:`foo`,data:[`one`,`two`,`three`,`four`]},{view:`input`,name:`bar`}]},content:[{view:`block`,content:`text:"Modified context (see values in \\"demo\\" section):"`},{view:`struct`,expanded:1,data:`#`}]}};function WZ(e,t){if(!e||!t||typeof e!=`object`||typeof t!=`object`)return e===t;for(let n in e)if(YR(e,n)&&e[n]!==t[n])return!1;for(let n in t)if(YR(t,n)&&e[n]!==t[n])return!1;return!0}function GZ(e){e.view.define(`dropdown`,function(t,n,r,i){function a(e,t){return typeof h==`function`?h(e,t):WZ(e,t)}function o(){return b.innerHTML=``,e.view.render(b,p||`text`,r,{...i,[l||`__self`]:v})}function s(e){v=e,typeof _==`function`&&_(v,l,r,i),y.hide(),o()}function c(t,n){if(x){let r={changed:!a(t,n)};x.innerHTML=``,e.view.render(x,[{view:`button-primary`,disabled:`=not changed`,content:`text:"Apply"`,onClick(e,t,n){s(n)}},{view:`button`,when:()=>u&&!a(u,v),content:`text:"Reset"`,onClick(){s(u)}},{view:`button`,disabled:`=not changed`,content:`text:"Cancel"`,onClick(){y.hide()}}],r,n)}}let{name:l,resetValue:u,value:d,placeholder:f,caption:p,content:m,compare:h,onInit:g,onChange:_}=n,v=`value`in n?d:i[l],y=null,b=t.appendChild(document.createElement(`div`)),x;return f&&(t.dataset.placeholder=f),t.tabIndex=0,t.addEventListener(`click`,()=>{y===null&&(y=new e.view.Popup({className:`view-dropdown-popup`}));let n={...v},a;y.toggle(t,t=>e.view.render(t,[{view:`block`,className:`content`,content:e.view.composeConfig(m,{onInit(e,t){n[t]=e},onChange(e,t){n[t]=e,c(a,n)}})},{view:`block`,className:`confirm`,postRender(e){x=e}}],r,{...i,...v}).then(()=>{a={...n},c(a,n)}))}),b.className=`view-dropdown__caption`,typeof g==`function`&&g(v,l,r,i),o()},{usage:UZ})}function KZ(e,t){try{return RegExp(`((?:`+e+`)+)`,t)}catch{}return RegExp(`((?:`+e.replace(/[\[\]\(\)\?\+\*\{\}\\]/g,`\\$&`)+`)+)`,t)}function qZ(e,t=`i`){return Object.assign(KZ(e,t),{rawSource:e})}var JZ=Function("return (value) => alert(`Changed to ${value}!`)")(),YZ={examples:[{title:`Input with value`,demo:{view:`input`,value:`"value"`}},{title:`Input with placeholder`,demo:{view:`input`,placeholder:`placeholder`}},{title:`Input type number with min and max`,demo:{view:`input`,htmlType:`number`,htmlMin:10,htmlMax:20}},{title:`Input with onChange`,demo:{view:`input`,onChange:JZ}},{title:`Input with onChange debounced`,demo:{view:`input`,onChange:JZ,debounce:300}}]},XZ=`#.props | {
|
|
148
|
+
name,
|
|
149
|
+
value: $ has no 'value' and name is string ? #.context[name] : value | is (string or number) ?: '',
|
|
150
|
+
type ?: 'text',
|
|
151
|
+
placeholder,
|
|
152
|
+
onInit,
|
|
153
|
+
onChange,
|
|
154
|
+
htmlType ?: 'text',
|
|
155
|
+
htmlMin,
|
|
156
|
+
htmlMax,
|
|
157
|
+
htmlStep,
|
|
158
|
+
debounce
|
|
159
|
+
}`;function ZZ(e){let t={regexp:e=>e?qZ(e):null,text:e=>e};e.view.define(`input`,function(e,n,r,i){let{name:a,value:o,type:s,placeholder:c,onInit:l,onChange:u,htmlType:d,htmlMin:f,htmlMax:p,htmlStep:m,debounce:h}=n,g=t[s]||t.text,_=e.appendChild(document.createElement(`input`)),v=o;Number.isFinite(f)&&(_.min=f),Number.isFinite(p)&&(_.max=p),Number.isFinite(m)&&(_.step=m),_.type=d,_.value=v,_.placeholder=[c||``,g===t.text?``:`(`+s+`)`].filter(Boolean).join(` `),_.addEventListener(`input`,xZ(()=>{let e=_.value.trim();v!==e&&(v=e,typeof u==`function`&&u(g(e),a,r,i))},h)),typeof l==`function`&&l(g(_.value.trim()),a,r,i)},{usage:YZ,props:XZ})}var QZ={demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]},examples:[{title:`With limit`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}],limit:2}},{title:`With custom item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}],item:`h1:text`}},{title:`On chage handler`,demo:{view:`menu`,onChange:Function("return (value) => alert(`Changed to ${value.text}!`)")(),data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]}}]};function $Z(e){e.view.define(`menu`,function(t,n,r,i){let{name:a=`filter`,item:o,itemConfig:s,limit:c,emptyText:l,onClick:u,onInit:d,onChange:f}=n;if(l!==!1&&l!==``&&t.setAttribute(`emptyText`,l||`No items`),Array.isArray(r)){let n=this.composeConfig({view:`menu-item`,content:o,onClick:typeof u==`function`?u:typeof f==`function`?e=>f(e,a):void 0},s);return e.view.renderList(t,n,r,i,0,e.view.listLimit(c,25)).then(()=>{typeof d==`function`&&d(r.find(e=>e.selected),a)})}},{usage:QZ})}var eQ={demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`},{text:`three`,href:`#`}]},examples:[{title:`Preselected item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`,selected:!0},{text:`three`,href:`#`}]}},{title:`Disabled item`,demo:{view:`menu`,data:[{text:`one`,href:`#`},{text:`two`,href:`#`,disabled:!0},{text:`three`,href:`#`}]}},{title:`External links`,demo:{view:`menu`,data:[{text:`one`,external:!0,href:`https://github.com/discoveryjs/discovery`},{text:`two`,external:!0,href:`https://github.com/discoveryjs/discovery`},{text:`three`,external:!0,href:`https://github.com/discoveryjs/discovery`}]}}]};function tQ(e){e.view.define(`menu-item`,function(t,n,r,i){let{content:a,onClick:o}=n,{text:s,selected:c=!1,disabled:l=!1,href:u,external:d}=r||{};if(l?t.classList.add(`disabled`):typeof o==`function`?(t.addEventListener(`click`,()=>o(r,i)),t.classList.add(`onclick`)):u&&(t.href=u,t.target=d?`_blank`:``),c&&t.classList.add(`selected`),a)return e.view.render(t,a,r,i);t.textContent=typeof r==`string`?r:s||`Untitled item`},{tag:`a`,usage:eQ})}var nQ={demo:{view:`nav-button`,data:{text:`I am nav button`}},examples:[{title:`With href`,demo:{view:`nav-button`,data:{text:`I am nav button`,href:`#`}}},{title:`External link`,demo:{view:`nav-button`,data:{text:`I am nav button`,external:!0,href:`https://github.com/discoveryjs/discovery`}}},{title:`On click handler`,demo:{view:`nav-button`,data:{text:`I am nav button`},onClick:()=>alert(`changed!`)}}]},rQ=`is not array? | {
|
|
160
|
+
name: undefined,
|
|
161
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
162
|
+
content: undefined,
|
|
163
|
+
disabled: false,
|
|
164
|
+
href,
|
|
165
|
+
external,
|
|
166
|
+
onClick: undefined
|
|
167
|
+
} | overrideProps()`;function iQ(e){e.view.define(`nav-button`,function(t,n,r,i){let{name:a,text:o,content:s,disabled:c,href:l,external:u,onClick:d}=n;if(a&&(t.dataset.name=a),c?t.classList.add(`disabled`):typeof d==`function`?(t.addEventListener(`click`,e=>d(t,r,i,e)),t.classList.add(`onclick`)):l&&(t.href=l,t.target=u?`_blank`:``),s)return e.view.render(t,s,r,i);t.textContent=o},{tag:`a`,props:rQ,usage:nQ})}var aQ={demo:{view:`progress`,progress:.5,content:`text:"Loading..."`},examples:[{title:`With no label (content)`,demo:{view:`progress`,progress:.25}},{title:`Custom color`,demo:{view:`progress`,progress:.85,color:`#bdab77`,content:`text:"Yellow progress"`}}]};function oQ(e){e.view.define(`progress`,function(t,n,r,i){let{content:a,progress:o,color:s}=n;if(t.append($(`div`,{class:`progress`,style:`--progress: ${Math.max(0,Math.min(1,Number(o)))};--color: ${s||`unset`};`})),a){let n=$(`div`,`content`);return t.prepend(n),e.view.render(n,a,r,i)}},{usage:aQ})}var sQ={demo:{view:`select`,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Select with value`,demo:{view:`select`,value:`"three"`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with reset option`,demo:{view:`select`,resetItem:!0,value:`"three"`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with placeholder`,demo:{view:`select`,placeholder:`placeholder`,data:[`one`,`two`,`three`,`four`]}},{title:`Select with onChange`,demo:{view:`select`,onChange:Function("return (value) => alert(`Changed to ${value}!`)")(),data:[`one`,`two`,`three`,`four`]}},{title:`Select with custom options`,demo:{view:`select`,item:`h1:text`,data:[`one`,`two`,`three`,`four`]}}]};function cQ(e){let t=`{ value: $, text: #.selectVariantTextQuery.query($, #) }`,n=new e.view.Popup({className:`view-select-popup`});e.view.define(`select`,function(r,i,a,o){function s(){if(r.innerHTML=``,x!==void 0)return e.view.render(r,e.view.composeConfig({view:`menu-item`,data:t,content:h},g),x,S)}let{name:c,value:l,text:u=`$`,placeholder:d,limit:f,minItemsFilter:p=10,resetItem:m=!1,item:h=`text-match:{ text, match: #.filter }`,itemConfig:g,beforeItems:_,afterItems:v,onInit:y,onChange:b}=i,x=l?e.query(l,a,o):o[c],S={...o,selectMinItemsFilter:p,selectCurrentValue:x,selectVariantTextQuery:u,selectResetItem:m?[{value:void 0,text:``,...m,resetItem:!0}]:[]},C=[];return _&&C.push(e.view.composeConfig(_,{onInit:y,onChange:b})),C.push({view:`context`,data:`.(${t})`,modifiers:{view:`input`,when:`size() >= #.selectMinItemsFilter`,type:`regexp`,name:`filter`,className:`view-select__filter`,placeholder:`Filter`},content:{view:`menu`,className:`view-select__variants`,data:`#.selectResetItem + .[no #.filter or text~=#.filter]`,limit:f,itemConfig:e.view.composeConfig({className:[e=>e.resetItem?`reset-item`:``,e=>e.value===x?`selected`:``]},g),item:h,onClick(e){n.hide(),x!==e.value&&(x=e.value,S={...S,selectCurrentValue:x},s(),typeof b==`function`&&b(e.value,c,e,o))}}}),v&&C.push(e.view.composeConfig(v,{onInit:y,onChange:b})),d&&(r.dataset.placeholder=d),r.tabIndex=0,r.addEventListener(`click`,()=>{n.toggle(r,t=>e.view.render(t,C,a,S).then(()=>(t.querySelector(`.view-select__filter input`)||{focus(){}}).focus()))}),typeof y==`function`&&y(x,c,a,o),s()},{usage:sQ})}var lQ={demo:{view:`tabs`,name:`tabs`,value:`two`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}},examples:[{title:`Value is default text`,demo:{view:`tabs`,name:`tabsValue`,tabs:[`foo`,`bar`,`baz`],content:`struct:#.tabsValue`}},{title:`With before and after content`,demo:{view:`tabs`,name:`example`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],beforeTabs:`text:"<Content before tabs>"`,afterTabs:`text:"<Content after tabs>"`,content:`text:"Selected: " + #.example`}},{title:`On change handler`,demo:{view:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],onChange:Function(`return (value) => alert("changed to " + value)`)(),content:`text:"Selected: " + #.filter`}}]},uQ=`undefined | {
|
|
168
|
+
name,
|
|
169
|
+
value,
|
|
170
|
+
tabs,
|
|
171
|
+
tabConfig,
|
|
172
|
+
content,
|
|
173
|
+
beforeTabs,
|
|
174
|
+
afterTabs,
|
|
175
|
+
onInit,
|
|
176
|
+
onChange
|
|
177
|
+
} | overrideProps() | {
|
|
178
|
+
...,
|
|
179
|
+
name is string ?: 'filter',
|
|
180
|
+
value: value is not undefined ? value :
|
|
181
|
+
name is string and name in #.context ? #.context[name]
|
|
182
|
+
}`;function dQ(e){e.view.define(`tabs`,function(t,n,r,i){async function a(t){let n=y?u:l;if(b===t)return;let a=s||c||o?{...i,[d]:t}:null;b=t,y=!0,Array.isArray(p)&&(h.innerHTML=``,s&&(_.innerHTML=``,await e.view.render(_,s,r,a),h.appendChild(_)),await Promise.all(p.map(t=>e.view.render(h,e.view.composeConfig(t,{active:t.value===b}),r,i))),c&&(v.innerHTML=``,await e.view.render(v,c,r,a),h.appendChild(v))),o&&(g.innerHTML=``,await e.view.render(g,o,r,a)),typeof n==`function`&&n(b,d,r,i)}let{content:o,beforeTabs:s,afterTabs:c,onInit:l,onChange:u}=n,{name:d,value:f,tabs:p,tabConfig:m}=n,h=t.appendChild(document.createElement(`div`)),g=null,_=null,v=null,y=!1,b=NaN;return m=e.view.composeConfig({view:`tab`,onClick:a},m),h.className=`view-tabs-buttons`,s&&(_=document.createElement(`div`),_.className=`view-tabs-buttons-before`),c&&(v=document.createElement(`div`),v.className=`view-tabs-buttons-after`),o&&(g=t.appendChild(document.createElement(`div`)),g.className=`view-tabs-content`),p=Array.isArray(p)?p.map(t=>{let n=typeof t;return(n===`string`||n===`number`||n===`boolean`)&&(t={value:t}),(f===void 0||t.active)&&(f=t.value),e.view.composeConfig(m,t)}):[],a(f)},{usage:lQ,props:uQ})}var fQ=()=>alert(`clicked!`),pQ={demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}},examples:[{title:`Active & disabled tab`,demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`},{value:`two`,text:`Two`,active:!0},{value:`three`,text:`Three`,disabled:!0}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}}},{title:`On click handler`,demo:{view:`tabs`,name:`tabs`,tabs:[{value:`one`,text:`One`,onClick:fQ},{value:`two`,text:`Two`,onClick:fQ},{value:`three`,text:`Three`,onClick:fQ}],content:{view:`switch`,content:[{when:`#.tabs="one"`,content:`text:"One"`},{when:`#.tabs="two"`,content:`text:"Two"`},{when:`#.tabs="three"`,content:`text:"Three"`}]}}}]},mQ=`is not array? | {
|
|
183
|
+
value,
|
|
184
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?,
|
|
185
|
+
content: undefined,
|
|
186
|
+
active: undefined,
|
|
187
|
+
disabled: undefined,
|
|
188
|
+
onClick: undefined
|
|
189
|
+
} | overrideProps() | {
|
|
190
|
+
...,
|
|
191
|
+
text: text is not undefined ? text : value,
|
|
192
|
+
active is truthy,
|
|
193
|
+
disabled is truthy
|
|
194
|
+
}`;function hQ(e){e.view.define(`tab`,function(t,n,r,i){let{value:a,text:o,content:s,active:c,disabled:l,onClick:u}=n;if(l?t.classList.add(`disabled`):typeof u==`function`&&(t.addEventListener(`click`,()=>u(a)),t.classList.add(`onclick`)),c&&t.classList.add(`active`),s)return e.view.render(t,s,r,i);t.textContent=String(o)},{usage:pQ,props:mQ})}var gQ={demo:{view:`context`,modifiers:{view:`toggle-group`,name:`toggleValue`,data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}]},content:{view:`switch`,content:[{when:`#.toggleValue="one"`,content:`text:"One"`},{when:`#.toggleValue="two"`,content:`text:"Two"`},{when:`#.toggleValue="three"`,content:`text:"Three"`}]}},examples:[{title:`With before and after content`,demo:{view:`toggle-group`,data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}],beforeToggles:`text:"<Content before toggles>"`,afterToggles:`text:"<Content after toggles>"`}},{title:`On change handler`,demo:{view:`toggle-group`,name:`example`,onChange:Function(`return (value) => alert("changed to " + value)`)(),data:[{value:`one`,text:`One`},{value:`two`,text:`Two`},{value:`three`,text:`Three`}]}}]};function _Q(e){e.view.define(`toggle`,function(t,n,r,i){let{content:a,disabled:o=!1,onToggle:s,value:c,text:l=String(c).replace(/^./,e=>e.toUpperCase())}=n,{checked:u=!1}=n;if(o?t.classList.add(`disabled`):typeof s==`function`&&(t.addEventListener(`click`,()=>{u=!u,s(u,c)}),t.classList.add(`onclick`)),u&&t.classList.add(`checked`),a)return e.view.render(t,a,r,i);t.textContent=l},{usage:gQ})}function vQ(e){e.view.define(`toggle-group`,function(t,n,r,i){async function a(n,a){let d=h?l:c;g!==a&&(g=a,h=!0,Array.isArray(f)&&(t.innerHTML=``,o&&(p.innerHTML=``,await e.view.render(p,o,r,{...i,[u]:a}),t.appendChild(p)),s&&(m.innerHTML=``,await e.view.render(m,s,r,{...i,[u]:a}),t.appendChild(m)),await Promise.all(f.map((n,a)=>e.view.render(t,e.view.composeConfig(n,{checked:n.value===g}),r[a],i)))),typeof d==`function`&&d(g,u,r,i))}let{beforeToggles:o,afterToggles:s,onInit:c,onChange:l}=n,{name:u,toggleConfig:d}=n,f=[],p=null,m=null,h=!1,g=NaN,_=`value`in n?n.value:u in i?i[u]:void 0;return d=e.view.composeConfig({view:`toggle`,onToggle:a},d),o&&(p=document.createElement(`div`),p.className=`view-toggle-group-before`),s&&(m=document.createElement(`div`),m.className=`view-toggle-group-after`),typeof u!=`string`&&(u=`filter`),Array.isArray(r)&&(f=r.map(t=>{let n=typeof t;return(n===`string`||n===`number`||n===`boolean`)&&(t={value:t}),(_===void 0||t.active)&&(_=t.value),e.view.composeConfig(d,t)})),a(!0,_)},{usage:gQ})}var yQ={beforeDemo:['md:"A block has no its own look. It\'s using for wrapping some content with a `className` (btw `className` is a common property for any view when appropriate)"'],demo:{view:`block`,className:`foo`,content:[`text:"Content inside block"`]}};function bQ(e){e.view.define(`block`,function(t,n,r,i){let{content:a=[],onInit:o,onChange:s}=n,c=typeof o!=`function`&&typeof s!=`function`?a:this.composeConfig(a,{onInit:o,onChange:s});return e.view.render(t,c,r,i)},{usage:yQ})}var xQ={demo:{view:`columns`,data:[`one`,`two`,`three`,`four`],column:`text`}};function SQ(e){e.view.define(`column`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:xQ})}function CQ(e){e.view.define(`columns`,function(t,n,r,i){let{column:a,columnConfig:o,emptyText:s,limit:c}=n;if(s!==!1&&s!==``&&t.setAttribute(`emptyText`,s||`Empty`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`column`,content:a},o),r,i,0,e.view.listLimit(c,25))},{usage:xQ})}var wQ={demo:{view:`expand`,header:`text:"Expand me!"`,content:`text:"Content"`}},TQ=`is not array? | {
|
|
195
|
+
header: undefined,
|
|
196
|
+
content: undefined,
|
|
197
|
+
expanded: false,
|
|
198
|
+
onToggle: undefined
|
|
199
|
+
} | overrideProps() | {
|
|
200
|
+
...,
|
|
201
|
+
expanded.bool()
|
|
202
|
+
}`;function EQ(e){e.view.define(`expand`,function(t,n,r,i){async function a(){t.classList.toggle(`expanded`,o),o?(f=$(`div`,`content`),await e.view.render(f,c,r,i).then(()=>t.appendChild(f))):f!==null&&(f.remove(),f=null)}let{expanded:o,header:s,content:c,onToggle:l}=n,u=t.appendChild($(`div`,`header`)),d=u.appendChild($(`div`,`header-content`)),f=null;return u.appendChild($(`div`,`trigger`)),u.addEventListener(`click`,()=>{o=!o;let e=a();typeof l==`function`&&l(o,{el:t,finish:e,data:r,context:i})}),Promise.all([e.view.render(d,s||`text:"\xA0"`,r,i),a()])},{usage:wQ,props:TQ})}var DQ={demo:{view:`hstack`,content:[`button:{text:"First button"}`,`button-primary:{text:"Second button"}`]}};function OQ(e){e.view.define(`hstack`,function(t,n,r,i){let{content:a=[]}=n;return e.view.render(t,a,r,i)},{usage:DQ})}function kQ(e){e.view.define(`list-item`,function(t,n,r,i){let{content:a=`text`}=n;return e.view.render(t,a,r,i)},{tag:`li`})}var AQ=(e,t)=>({demo:{view:e,data:[`one`,`two`,`three`,`four`]},examples:[{title:`Variations`,demo:{view:`context`,data:[`foo`,`bar`,`baz`],content:t.map(e=>[`header{ content: 'md:${JSON.stringify('`view: \\"'+e+'\\"`')}' }`,e])}},{title:`Configure item's content`,demo:[{view:e,data:[`one`,`two`,`three`,`four`],item:[`text:"<item> "`,{view:`link`,data:`{ href: "#" + $ }`}]}]},{title:`Configure item's config`,demo:{view:e,data:[`one`,`two`,`three`,`four`],itemConfig:{className:`special`},item:{view:`text`,data:`"prefix-" + $`}}}]});function jQ(e){function t(t,n,r,i){let{item:a,itemConfig:o,limit:s,emptyText:c}=n;if(c!==!1&&c!==``&&t.setAttribute(`emptyText`,c||`Empty list`),!Array.isArray(r)&&r&&(r=[r]),Array.isArray(r))return e.view.renderList(t,this.composeConfig({view:`list-item`,content:a},o),r,i,0,e.view.listLimit(s,25))}e.view.define(`list`,t,{usage:AQ}),e.view.define(`inline-list`,t,{usage:AQ}),e.view.define(`comma-list`,t,{usage:AQ}),e.view.define(`ol`,t,{tag:`ol`,usage:AQ}),e.view.define(`ul`,t,{tag:`ul`,usage:AQ})}var MQ=e=>({beforeDemo:[`md:"A special view to be used as the first view in the body of the page. This view stays in place as the page scrolls (although it may move slightly to the top of the page at the start of the scroll), so that the most relevant information and important action elements can remain accessible despite page scrolling."`],demoFixed:100,demo:`${e}:"That's a \\"${e}\\""`,examples:[{title:`Prelude`,demoFixed:150,highlightProps:[`prelude`],demo:{view:e,prelude:[`badge:{ text: "demo" }`,`badge:{ text: "demo", prefix: "prelude", postfix: "postfix" }`],content:`h1:"Header"`}}]});function NQ(e){e.view.define(`page-header`,function(t,n,r,i){let{prelude:a,content:o,onInit:s,onChange:c}=n,l=t.appendChild($(`div`,`view-page-header__prelude`)),u=t.appendChild($(`div`,`view-page-header__content`)),d=e=>typeof s!=`function`&&typeof c!=`function`?e:this.composeConfig(e,{onInit:s,onChange:c});return Promise.all([e.view.render(l,d(a||[]),r,i),e.view.render(u,d(o||`text`),r,i)])},{usage:MQ})}var PQ=[!1,`popup-hover`,`trigger-click`],FQ=300;function IQ(e){return!e||e.getRootNode({composed:!0})===document}function LQ(e,t){return typeof e==`function`&&(e=e(t)),typeof e==`number`?zQ(e):typeof e==`boolean`&&e?FQ:0}function RQ(e,t){e.lastChild!==t&&e.appendChild(t)}function zQ(e,t=0){return Number.isFinite(e)?e:t}function BQ(e){return PQ.includes(e)}function VQ(e){let t=[],n=new Set,r=[],i=new Set,a=null,o=e=>{a===null&&(a=setTimeout(()=>u(e),0))},s=()=>{a!==null&&(clearTimeout(a),a=null)},c=null,l=()=>{c===null&&(c=[e.addHostElEventListener(`mouseenter`,({target:e})=>{for(let t of r){let n=p(t,e),r=n?n.el:e.closest(t.hoverTriggers);r&&(t.hideTimer!==null&&(clearTimeout(t.hideTimer),t.hideTimer=null),r!==t.lastHoverTriggerEl&&((!n||!n.hoverPinned)&&(t.lastHoverTriggerEl=r),n||(t.hoverPinned=!1,t.el.classList.remove(`pinned`),t.show(r))))}},$R),e.addHostElEventListener(`mouseleave`,({target:e})=>{for(let t of r)t.lastHoverTriggerEl===e&&(m(t),t.lastHoverTriggerEl=null,t.hideTimer=setTimeout(t.hide,100))},$R),e.addGlobalEventListener(`scroll`,o,$R),e.addHostElEventListener(`scroll`,e=>{s(),u(e)},$R),e.addGlobalEventListener(`click`,o,!0),e.addHostElEventListener(`click`,e=>{s(),u(e),setTimeout(d,50);for(let t of r)t.hoverPin===`trigger-click`&&t.lastHoverTriggerEl&&t.lastTriggerEl?.contains(e.target)&&(t.lastHoverTriggerEl=null,t.hoverPinned=!0,t.el.classList.add(`pinned`),e.stopPropagation())},!0)])};yZ.subscribe(()=>{for(let e of t)e.position===`pointer`&&!e.hoverPinned&&!e.frozen&&!i.has(e)&&e.updatePosition();for(let e of n){let{showDelayArgs:t}=e;h(e,t?.[0],t?.[1])}}),e.inspectMode.subscribe(e=>e?t.forEach(e=>i.add(e)):i.clear());function u(e){t.slice().forEach(t=>t.hideIfEventOutside(e))}function d(){t.slice().forEach(e=>e.hideOnTriggerHasLeftDocument())}function f(){t.slice().forEach(e=>e.hideOnResize())}function p(e,t){return e.el.contains(t)?e:e.relatedPopups.find(e=>p(e,t))||null}function m(e){e.showDelayTimer!==null&&clearTimeout(e.showDelayTimer),e.showDelayTimer=null,e.showDelayArgs=null,n.delete(e)}function h(e,t,r){e.showDelayTimer!==null&&clearTimeout(e.showDelayTimer),e.showDelayTimer=setTimeout(()=>e.show(t,r,!0),LQ(e.showDelay,t)),e.showDelayArgs=[t,r],n.add(e)}class g{el;showDelayTimer;showDelayArgs;showDelay;#e;lastHoverTriggerEl;render;position;positionMode;pointerOffsetX;pointerOffsetY;hideOnTriggerClick;hoverTriggers;hoverPin;hideIfEventOutsideDisabled;hideOnResizeDisabled;hideTimer;hoverPinned;frozen;lastRenderMarker;constructor(e){let{render:t,showDelay:n=!1,position:i=`trigger`,positionMode:a=`safe`,pointerOffsetX:o,pointerOffsetY:s,hoverTriggers:c,hoverPin:u,hideIfEventOutside:d=!0,hideOnResize:f=!0,hideOnTriggerClick:p=!1,className:m}=e||{};this.el=document.createElement(`div`),this.el.classList.add(`discovery-view-popup`),this.showDelayTimer=null,this.showDelayArgs=null,this.showDelay=n,this.hideTimer=null,this.hide=this.hide.bind(this),this.#e=null,this.lastHoverTriggerEl=null,this.hoverPinned=!1,this.frozen=!1,this.render=t,this.lastRenderMarker=null,this.position=i,this.positionMode=a,this.pointerOffsetX=zQ(o,3),this.pointerOffsetY=zQ(s,3),this.hoverTriggers=c||null,this.hoverPin=BQ(u)?u:!1,this.hideIfEventOutsideDisabled=!d,this.hideOnResizeDisabled=!f,this.hideOnTriggerClick=!!p,m&&this.el.classList.add(m),this.hoverTriggers&&(this.el.classList.add(`show-on-hover`),this.el.dataset.pinMode=this.hoverPin||`none`,r.push(this),l())}get relatedPopups(){return t.filter(e=>this.el.contains(e.lastTriggerEl))}get visible(){return t.includes(this)}get lastTriggerEl(){return this.#e}set lastTriggerEl(e){this.#e!==null&&this.#e.classList.remove(`discovery-view-popup-active`),this.#e=e&&e instanceof Element?e:null,this.#e!==null&&this.#e.classList.add(`discovery-view-popup-active`)}toggle(...e){this.visible?this.hide():this.show(...e)}async show(n,r=this.render,a=!1){if(!this.visible&&!a&&LQ(this.showDelay,n)>0){h(this,n,r);return}let o=e.dom.container;if(i.delete(this),n&&!o.contains(n)){this.hide();return}if(m(this),this.relatedPopups.forEach(e=>e.hide()),this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),this.lastTriggerEl=n||null,this.el.classList.toggle(`inspect`,e.inspectMode.value),e.view.setViewRoot(this.el,`popup`,{config:r}),this.visible||(t.push(this),t.length===1&&window.addEventListener(`resize`,f)),typeof r==`function`){this.el.innerHTML=``;let e=Symbol();if(this.lastRenderMarker=e,requestAnimationFrame(()=>{this.lastRenderMarker===e&&(RQ(o,this.el),this.updatePosition())}),await r(this.el,n,this.hide),this.lastRenderMarker!==e)return;this.lastRenderMarker=null}RQ(o,this.el),this.updatePosition()}updatePosition(){if(!this.visible)return;let t=this.position===`pointer`,n=t?null:this.lastTriggerEl;if(t?this.frozen:!n)return;let r=e.dom.container,i=mz(r.firstChild),a=vz(window,i),{x:o,y:s}=yZ.value,{pointerOffsetX:c,pointerOffsetY:l}=this,u=n?_z(n,r):{left:Math.round(o)-c,right:Math.round(o)+c,top:Math.round(s)-l,bottom:Math.round(s)+l},d=t?u.left:u.right,f=t?u.right:u.left,p=u.top-a.top-3,m=a.bottom-u.bottom-3,h=d-a.left-3,g=a.right-f-3,_=g>=h,v=m>=p;if(v||(this.el.style.maxHeight=p+`px`,this.el.style.top=`auto`,this.el.style.bottom=a.bottom-u.top+`px`,this.el.dataset.vTo=`top`),_||(this.el.style.left=`auto`,this.el.style.right=a.right-d+`px`,this.el.style.maxWidth=h+`px`,this.el.dataset.hTo=`left`),this.positionMode===`natural`&&(!_||!v)){let{height:e,width:t}=_z(this.el);v=e<=m,_=t<=g}v&&(this.el.style.maxHeight=m+`px`,this.el.style.top=u.bottom-a.top+`px`,this.el.style.bottom=`auto`,this.el.dataset.vTo=`bottom`),_&&(this.el.style.left=f-a.left+`px`,this.el.style.right=`auto`,this.el.style.maxWidth=g+`px`,this.el.dataset.hTo=`right`),this.relatedPopups.forEach(e=>e.updatePosition())}freeze(){this.frozen=!0,this.el.classList.add(`frozen`)}unfreeze(){this.frozen=!1,this.el.classList.remove(`frozen`),this.updatePosition()}hide(){this.lastRenderMarker=null,this.hideTimer!==null&&(clearTimeout(this.hideTimer),this.hideTimer=null),m(this),this.visible&&!i.has(this)&&(this.relatedPopups.forEach(e=>e.hide()),t.splice(t.indexOf(this),1),this.lastTriggerEl=null,this.el.remove(),this.unfreeze(),t.length===0&&window.removeEventListener(`resize`,f))}hideIfEventOutside({target:e,type:t}){this.hideIfEventOutsideDisabled||i.has(this)||(!this.lastTriggerEl||!this.lastTriggerEl.contains(e)||this.hideOnTriggerClick&&t===`click`)&&(p(this,e)||this.hide())}hideOnTriggerHasLeftDocument(){(!IQ(this.lastHoverTriggerEl)||!IQ(this.lastTriggerEl))&&this.hide()}hideOnResize(){this.hideOnResizeDisabled||i.has(this)||this.hide()}destroy(){i.delete(this),m(this);let e=r.indexOf(this);e!==-1&&r.splice(e,1),this.hide(),this.el=null,this.lastTriggerEl=null,this.lastHoverTriggerEl=null}}e.view.Popup=g}var HQ={demo:{view:`section`,header:`text:"I am section"`,content:[`text:"content"`]}};function UQ(e){e.view.define(`section`,function(t,n,r,i){let{header:a,content:o=[],onInit:s,onChange:c}=n,l=e=>typeof s!=`function`&&typeof c!=`function`?e:this.composeConfig(e,{onInit:s,onChange:c});return e.view.render(t,[{view:`header`,content:l(a)},l(o)],r,i)},{usage:HQ})}function WQ(e){e.view.define(`toc-section`,function(t,n,r,i){let{header:a,content:o}=n;return e.view.render(t,[{view:`block`,className:`header`,content:a},{view:`block`,className:`content`,content:o}],r,i)},{tag:`section`})}var GQ=(e,t)=>({demo:{view:e,data:`"Alert"`},examples:[{title:`Variations`,demo:t.map(e=>`${e}:"${e}"`)},{title:`Complex content`,demo:{view:e,content:[`h3:"Some header"`,`text:"Hello world!"`]}}]});function KQ(e){function t(t,n,r,i){let{content:a=`text`}=n;return t.classList.add(`view-alert`),e.view.render(t,a,r,i)}e.view.define(`alert`,t,{usage:GQ}),e.view.define(`alert-primary`,t,{usage:GQ}),e.view.define(`alert-success`,t,{usage:GQ}),e.view.define(`alert-danger`,t,{usage:GQ}),e.view.define(`alert-warning`,t,{usage:GQ})}function qQ(){return[performance.timeOrigin.toString(16),(1e4*performance.now()).toString(16),Math.random().toString(16).slice(2)].join(`-`)}var JQ=Symbol(`stop-match`);function YQ(e,t,n=0){let r=n===0?e.search(t):e.slice(n).search(t);return r===-1?null:{offset:n+r,length:RegExp.lastMatch.length}}function XQ(e,t,n){let r=e.indexOf(t,n);return r===-1?null:{offset:r,length:t.length}}function ZQ(e,t,n,r,i=!1){if(!$J(t)&&typeof t!=`string`){n(e,!0);return}let a=String(e);i&&(typeof t==`string`?(a=a.toLowerCase(),t=t.toLowerCase()):t.ignoreCase||(t=new RegExp(t,t.flags+`i`)));let o=0,s=!1;do{let i=s?null:typeof t==`string`?XQ(a,t,o):YQ(a,t,o);if(i===null||i.length===0&&i.offset===o){n(o>0?e.slice(o):e,!0);break}i.length!==0&&(i.offset!==o&&n(e.slice(o,i.offset),!1),s=r(e.substr(i.offset,i.length),JQ)===JQ),o=i.offset+i.length}while(o!==e.length)}function QQ(e){let t=$(`div`,{style:[`position: fixed`,`overflow: hidden`,`font-size: 1px`,`width: 1px`,`height: 1px`,`top: 0`,`left: 0`,`white-space: pre`].join(`;`)});document.body.append(t);try{let n=window.getSelection(),r=document.createRange();t.append(e),r.selectNodeContents(t),n?.removeAllRanges(),n?.addRange(r),document.execCommand(`copy`)}finally{t.remove()}}async function $Q(e){try{if(navigator.clipboard)try{let t=await navigator.permissions.query({name:`clipboard-write`});if(t.state===`granted`||t.state===`prompt`)return navigator.clipboard.writeText(e)}catch(t){if(t instanceof TypeError)return navigator.clipboard.writeText(e)}}catch{}QQ(e)}var e$={demo:{view:`app-header`,name:`My app`,version:`1.2.3`,description:`The best of the best app`},examples:[{title:`Variations`,demo:[`app-header`,`app-header{ name: "Only name" }`,`app-header{ name: "Name and version", version: "1.2.3" }`,`app-header{ name: "Name and description", description: "Some description" }`,`app-header{ name: "Everything set", version: "1.2.3", description: "Very useful description" }`]}]},t$=`is not array? | {
|
|
203
|
+
name: name or "Untitled app",
|
|
204
|
+
icon,
|
|
205
|
+
version,
|
|
206
|
+
description
|
|
207
|
+
} | overrideProps() | {
|
|
208
|
+
...,
|
|
209
|
+
icon is string and $ ~= /\\S/?,
|
|
210
|
+
version is string and $ ~= /\\S/?,
|
|
211
|
+
description is string and $ ~= /\\S/?
|
|
212
|
+
}`;function n$(e){e.view.define(`app-header`,function(e,t){let{name:n,icon:r,version:i,description:a}=t,o=$(`h1`,null,i?[n,$(`span`,`version`,i)]:[n]);r&&e.style.setProperty(`--icon`,/^(?:\.|\/|data:|https?:)/.test(r)?`url(${JSON.stringify(r)})`:r),e.append($(`div`,`icon`),$(`div`,`content`,a?[o,$(`div`,`description`,a)]:[o]))},{props:t$,usage:e$})}function r$(e){e.view.define(`auto-link`,function(t,n,r,i){let{content:a,fallback:o,href:s}=n;if(!r)return;let c=e.resolveValueLinks(r),l=c?(typeof s==`function`?s:e=>e)(c[0].href,r,i):null;return l?e.view.render(t,{view:`link`,content:a},{...c[0],href:l},i):e.view.render(t,o||a||`text`,r,i)},{tag:!1})}var i$=(e,t)=>({demo:{view:e,text:`hello world`},examples:[{title:`Variations`,demo:t.map(e=>`${e}:"${e}"`)},{title:`Displaying content`,beforeDemo:{view:`md`,source:[`There are several ways to specify the main content of a badge:`,"- `content` option – allows to specify any renderable content and has the highest precedence","- `text` option – used when `content` is omitted or falsy; it renders as plain text","- When both `content` and `text` options are omitted, the `data` is used for content:"," - If `data` is a string, a number, or a boolean value, it is used as the `text` value"," - If `data` is an object, the value of `text` property of `data` coerced to a string is used",` - Otherwise, render an undefined`].join(`
|
|
213
|
+
`)},demo:[{view:e,data:`"data"`,text:`text`,content:`text:"RENDER"`},{view:e,data:`"data"`,text:`RENDER`,content:`=undefined`},{view:e,data:`"data"`,content:`=undefined`},{view:e,data:`"data"`,text:`RENDER`},{view:e,data:`"data"`,text:`=undefined`},{view:e,data:`"RENDER"`},{view:e,data:`{ text: "RENDER" }`},{view:e,data:`{}`},{view:e,data:[1,2,3]}]},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `color`","- `textColor`","- `darkColor`","- `darkTextColor`","- `text`","- `href`","- `external`","- `prefix`","- `postfix`"].join(`
|
|
214
|
+
`)},highlightProps:[`data`],demo:{view:e,data:{text:`demo`,href:`#example`}}},{title:`Custom colors`,beforeDemo:{view:`md`,source:[`Data properties to setup a custom colors:`,"* `color` – default background color","* `textColor` – default text color","* `darkColor` – background color in dark mode","* `darkTextColor` – text color in dark mode"].join(`
|
|
215
|
+
`)},demo:{view:e,text:`Colored badge`,color:`rgba(237, 177, 9, 0.35)`,textColor:`orange`,darkColor:`#ffff00`,darkTextColor:`black`}},{title:`As a link`,highlightProps:[`href`,`external`],demo:{view:e,text:`Link to something`,href:`#`,external:!0}},{title:`Using onClick handler`,highlightProps:[`onClick`],demo:{view:e,text:`Show "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}},{title:`Prefix and postfix`,highlightProps:[`prefix`,`postfix`],demo:{view:e,prefix:`prefix`,text:`link`,postfix:`postfix`}},{title:`Complex content`,highlightProps:[`content`],demo:{view:e,content:[`text:"text "`,`link{ href: "#example" }`]}}]}),a$=`is not array? | {
|
|
216
|
+
color,
|
|
217
|
+
textColor,
|
|
218
|
+
darkColor,
|
|
219
|
+
darkTextColor,
|
|
220
|
+
text: #.props has no 'content' ? is (string or number or boolean) ?: text,
|
|
221
|
+
content: undefined,
|
|
222
|
+
href,
|
|
223
|
+
external,
|
|
224
|
+
onClick: undefined,
|
|
225
|
+
prefix,
|
|
226
|
+
postfix
|
|
227
|
+
} | overrideProps()`;function o$(e,t,n){if(!n)return;let r=e.appendChild(document.createElement(`span`));r.className=t,r.textContent=n}function s$(e){function t(e,t,n,r){let{color:i,textColor:a,darkColor:o,darkTextColor:s,text:c,content:l,href:u,external:d,onClick:f,prefix:p,postfix:m}=t,h;return i&&e.style.setProperty(`--discovery-view-badge-color`,i),o&&e.style.setProperty(`--discovery-view-badge-dark-color`,o),a&&e.style.setProperty(`--discovery-view-badge-text-color`,a),s&&e.style.setProperty(`--discovery-view-badge-dark-text-color`,s),u&&(e.href=u),d&&e.setAttribute(`target`,`_blank`),typeof f==`function`&&(e.classList.add(`onclick`),e.addEventListener(`click`,t=>{t.preventDefault(),f(e,n,r)})),o$(e,`prefix`,p),l?h=this.render(e,l,n,r):e.append(document.createTextNode(c)),o$(e,`postfix`,m),h}e.view.define(`badge`,t,{tag:`a`,props:a$,usage:i$}),e.view.define(`pill-badge`,t,{tag:`a`,props:a$,usage:i$})}function c$(e){function t(t,n,r,i){let{content:a=`text`,kind:o}=n;return typeof o==`string`&&/\S/.test(o)&&(t.dataset.kind=o.trim()),e.view.render(t,a,r,i)}e.view.define(`blockquote`,{tag:`blockquote`,render:t,usage:wJ})}var l$=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;Object.hasOwnProperty;function u$(e,t){return typeof e==`string`?(t||(e=e.toLowerCase()),e.replace(l$,``).replace(/ /g,`-`)):``}var d$=(e,t)=>({demo:`${e}:"Header \\"${e}\\""`,examples:[{title:`Variations`,view:t.map(e=>`${e}:"Header \\"${e}\\""`)},{title:`Complex content`,demo:{view:e,content:[`text:"Text "`,`link:{ text: "Link" }`]}},{title:`Using anchor`,demo:[{view:e,anchor:`foo`,content:`text:"Explicit value for an anchor"`},{view:e,anchor:!0,content:`text:"Auto generated anchor based on text content of header"`}]}]});function f$(e){async function t(t,n,r,i){let{content:a,anchor:o=!1}=n;if(t.classList.add(`view-header`),await e.view.render(t,a||`text`,r,i),o){let n=u$(o===!0?t.textContent:String(o)),r=e.encodePageHash(e.pageId,e.pageRef,e.pageParams,n);t.prepend($(`a`,{class:`view-header__anchor`,id:`!anchor:${n}`,href:r}))}}e.view.define(`header`,t,{tag:`h4`,usage:d$}),e.view.define(`h1`,t,{tag:`h1`,usage:d$}),e.view.define(`h2`,t,{tag:`h2`,usage:d$}),e.view.define(`h3`,t,{tag:`h3`,usage:d$}),e.view.define(`h4`,t,{tag:`h4`,usage:d$}),e.view.define(`h5`,t,{tag:`h5`,usage:d$})}var p$={demo:{view:`html`,data:`"<h1>I am inner HTML</h1>"`}};function m$(e){let t=document.createElement(`div`);e.view.define(`html`,function(e,n,r){t.innerHTML=r,e.append(...t.childNodes)},{tag:null,usage:p$})}var h$=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij4KICAgIDxyZWN0IHg9IjY1LjYiIHk9IjI0LjYiIHRyYW5zZm9ybT0ibWF0cml4KDAuOTM5NyAtMC4zNDIgMC4zNDIgMC45Mzk3IC05Ljk0MjYgMzEuODI4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjM5LjMiIGhlaWdodD0iMzkiPjwvcmVjdD4KICAgIDxyZWN0IHg9IjcwLjYiIHk9IjUyLjciIHRyYW5zZm9ybT0ibWF0cml4KC0wLjkzOTcgMC4zNDIgLTAuMzQyIC0wLjkzOTcgMTk0Ljc4NTIgODEuMTIwNCkiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzOS4zIiBoZWlnaHQ9IjEwIj48L3JlY3Q+CiAgICA8cGF0aCBmaWxsPSIjOThCRUQ4IiBkPSJNMTExLjUsNTQuNmwtMS4xLDEuMUw5Ny4xLDE5LjFsMS41LDAuMmM4LDAuOSwxNC43LDYuMiwxNy40LDEzLjdsMCwwQzExOC44LDQwLjQsMTE3LDQ4LjgsMTExLjUsNTQuNnoiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03My41LDcyLjJjLTEuMiwwLTIuNC0wLjgtMi44LTJMNTcuMywzMy41Yy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzNi45LTEzLjRjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTMuMywzNi42YzAuMywwLjcsMC4yLDEuNi0wLjEsMi4zYy0wLjMsMC43LTAuOSwxLjMtMS43LDEuNkw3NC41LDcyQzc0LjIsNzIuMSw3My44LDcyLjIsNzMuNSw3Mi4yek02NCwzNC4zbDExLjMsMzFsMzEuMy0xMS40bC0xMS4zLTMxTDY0LDM0LjN6Ij48L3BhdGg+CiAgICA8cmVjdCB4PSIzNSIgeT0iNDYuNyIgdHJhbnNmb3JtPSJtYXRyaXgoMC45Mzk3IC0wLjM0MiAwLjM0MiAwLjkzOTcgLTE2LjIwMTEgMjAuOTg4KSIgZmlsbD0iI0ZGRkZGRiIgd2lkdGg9IjMyLjgiIGhlaWdodD0iMTkuNSI+PC9yZWN0PgogICAgPHJlY3QgeD0iMzcuMyIgeT0iNTkuOCIgdHJhbnNmb3JtPSJtYXRyaXgoLTAuOTM5NyAwLjM0MiAtMC4zNDIgLTAuOTM5NyAxMjUuNjc2MyAxMDMuMzk0NikiIGZpbGw9IiNDN0Q3RTIiIHdpZHRoPSIzMi44IiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik0zOS40LDc0LjJjLTAuNCwwLTAuOS0wLjEtMS4zLTAuM2MtMC43LTAuMy0xLjMtMC45LTEuNi0xLjdsLTYuNy0xOC4zYy0wLjMtMC43LTAuMi0xLjYsMC4xLTIuM2MwLjMtMC43LDAuOS0xLjMsMS43LTEuNmwzMC44LTExLjJjMC43LTAuMywxLjYtMC4yLDIuMywwLjFjMC43LDAuMywxLjMsMC45LDEuNiwxLjdMNzMsNTljMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhMNDAuNCw3NEM0MCw3NC4xLDM5LjcsNzQuMiwzOS40LDc0LjJ6IE0zNi41LDU0LjdsNC42LDEyLjdsMjUuMi05LjJsLTQuNi0xMi43TDM2LjUsNTQuN3oiPjwvcGF0aD4KICAgIDxwYXRoIGZpbGw9IiM0NTRCNTQiIGQ9Ik03MCwxMTguOWMtMS4yLDAtMi40LTAuNy0yLjgtMS45bC0xNC0zNy4ybC04LjQsMy4xbC0xNy4yLDM0LjRjLTAuNywxLjUtMi41LDIuMS00LDEuM2MtMS41LTAuNy0yLjEtMi41LTEuMy00TDQwLDc5YzAuMy0wLjcsMC45LTEuMiwxLjctMS41TDU0LDczLjFjMS41LTAuNiwzLjMsMC4yLDMuOCwxLjhsMTUsNDBjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjlDNzAuNywxMTguOCw3MC40LDExOC45LDcwLDExOC45eiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjYsODAuMWMtMS4yLDAtMi40LTAuOC0yLjgtMkw2LjMsNjUuOWMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhjMS42LTAuNiwzLjMsMC4yLDMuOCwxLjhsNC40LDEyLjJjMC42LDEuNi0wLjIsMy4zLTEuOCwzLjhDMTQuMyw4MC4xLDE0LDgwLjEsMTMuNiw4MC4xeiI+PC9wYXRoPgogICAgPHBhdGggZmlsbD0iIzQ1NEI1NCIgZD0iTTEzLjIsNzMuM2MtMS4yLDAtMi40LTAuOC0yLjgtMmMtMC42LTEuNiwwLjItMy4zLDEuOC0zLjhMMzUsNTkuMmMxLjYtMC42LDMuMywwLjIsMy44LDEuOGMwLjYsMS42LTAuMiwzLjMtMS44LDMuOGwtMjIuOCw4LjNDMTMuOSw3My4zLDEzLjYsNzMuMywxMy4yLDczLjN6Ij48L3BhdGg+Cjwvc3ZnPgo=`,g$={demo:{view:`image`,src:h$,height:100},examples:[{title:`Src is not defined`,demo:`image`},{title:`Bad url`,demo:`image{ src: "<bad url>" }`}]},_$=`{
|
|
228
|
+
...#.props,
|
|
229
|
+
src: #.props has no 'src' ? imagesrc()
|
|
230
|
+
} | overrideProps()`;function v$(e){e.view.define(`image`,function(e,t){for(let[n,r]of Object.entries(t))r!==void 0&&(e[n]=r);e.onerror=()=>e.classList.add(`error`),e.onload=()=>e.classList.add(`loaded`)},{tag:`img`,props:_$,usage:g$})}var y$={beforeDemo:['md:"Similar to the `image` view but displays as a block with the image centered. The block has a checkered background to highlight image transparency."'],demo:{view:`image-preview`,src:h$,height:100},examples:[{title:`Src is not defined`,demo:`image-preview`},{title:`Bad url`,demo:`image-preview{ src: "<bad url>" }`}]};function b$(e){e.view.define(`image-preview`,function(e,t,n,r){this.render(e,{view:`image`,...t},n,r)},{usage:y$})}var x$={demo:{view:`indicator`,data:{label:`Label`,value:`1234`}},examples:[{title:`Indicator as link`,demo:{view:`indicator`,data:{label:`Label`,value:`4321`,href:`#`}}}]};function S$(e){e.view.define(`indicator`,function(t,n,r,i){let{value:a,label:o}=n,{href:s}=r||{},c=document.createElement(`div`),l=document.createElement(`div`);return c.className=`value`,l.className=`label`,s&&(t.href=s),Promise.all([e.view.render(c,a||`text:value`,r,i),e.view.render(l,o||`text:label`,r,i)]).then(()=>t.append(c,l))},{tag:`a`,usage:x$})}var C$={demo:{view:`link`,text:`I am a link`,href:`#example`},examples:[{title:`Link opened in new tab`,highlightProps:[`external`],demo:{view:`link`,text:`Discovery github`,href:`https://github.com/discoveryjs/discovery`,external:!0}},{title:`Infering text ⇿ href`,highlightProps:[`text`,`href`,`data`],beforeDemo:['md:"When `text` is omitted but `href` is specified, or vice versa, the opposite component is inferred from the specified one"'],demo:[{view:`link`,text:`http://example1.com`},{view:`link`,href:`http://example2.com`},{view:`link`,data:`"http://example3.com"`}]},{title:`Using onClick handler`,highlightProps:[`onClick`],demo:{view:`link`,text:`Show "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}},{title:`Using data as source of options`,beforeDemo:{view:`md`,source:[`The following properties are taken from the data when the appropriate options are not specified for a legacy reasons (is subject to remove in the future):`,"- `text`","- `href`","- `external`"].join(`
|
|
231
|
+
`)},highlightProps:[`data`],demo:{view:`link`,data:{text:`demo`,href:`#example`}}},{title:`Complex content`,highlightProps:[`content`],demo:{view:`link`,href:`#example`,content:[`text:"text "`,`html:"<b>bold</b>"`]}}]},w$=`is not array? | {
|
|
232
|
+
text: #.props.content is undefined ? is string ?: text,
|
|
233
|
+
content: undefined,
|
|
234
|
+
href,
|
|
235
|
+
external,
|
|
236
|
+
onClick: undefined
|
|
237
|
+
} | overrideProps() | {
|
|
238
|
+
$text; $href;
|
|
239
|
+
...,
|
|
240
|
+
text: $text | is not undefined or no $href ?: $href,
|
|
241
|
+
href: $href | is not undefined or no $text ?: $text
|
|
242
|
+
}`;function T$(e){e.view.define(`link`,function(t,n,r,i){let{text:a,content:o,href:s,external:c,onClick:l}=n;if(s&&(t.href=s),c&&t.setAttribute(`target`,`_blank`),typeof l==`function`&&(t.classList.add(`onclick`),t.addEventListener(`click`,e=>{e.preventDefault(),l(t,r,i)})),o)return e.view.render(t,o,r,i);t.textContent=a},{tag:`a`,props:w$,usage:C$})}function E$(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var D$=E$();function O$(e){D$=e}var k$=/[&<>"']/,A$=new RegExp(k$.source,`g`),j$=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,M$=new RegExp(j$.source,`g`),N$={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},P$=e=>N$[e];function F$(e,t){if(t){if(k$.test(e))return e.replace(A$,P$)}else if(j$.test(e))return e.replace(M$,P$);return e}var I$=/(^|[^\[])\^/g;function L$(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(I$,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function R$(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}var z$={exec:()=>null};function B$(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function V$(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function H$(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function U$(e,t,n,r){let i=t.href,a=t.title?F$(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:F$(o)}}function W$(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
|
|
243
|
+
`).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(`
|
|
244
|
+
`)}var G$=class{options;rules;lexer;constructor(e){this.options=e||D$}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:V$(e,`
|
|
245
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=W$(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=V$(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:V$(t[0],`
|
|
246
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=V$(t[0],`
|
|
247
|
+
`).split(`
|
|
248
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
249
|
+
`),c=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
250
|
+
$1`).replace(/^ {0,3}>[ \t]?/gm,``);n=n?`${n}\n${s}`:s,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i[i.length-1];if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
251
|
+
`+e.join(`
|
|
252
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
253
|
+
`+e.join(`
|
|
254
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i[i.length-1].raw.length).split(`
|
|
255
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
256
|
+
`,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
257
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&/^[ \t]*$/.test(l)&&(r+=l+`
|
|
258
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),a=RegExp(`^ {0,${Math.min(3,d-1)}}#`),o=RegExp(`^ {0,${Math.min(3,d-1)}}<(?:[a-z].*>|!--)`,`i`);for(;e;){let f=e.split(`
|
|
259
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `),p=l):p=l.replace(/\t/g,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(/[^ ]/)>=d||!l.trim())s+=`
|
|
260
|
+
`+p.slice(d);else{if(u||c.replace(/\t/g,` `).search(/[^ ]/)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
261
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
262
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:/\n[ \t]*\n[ \t]*$/.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=B$(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
|
|
263
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(B$(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
264
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:F$(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=V$(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=H$(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),U$(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return U$(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=F$(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=F$(t[1]),n=`mailto:`+e):(e=F$(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=F$(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=F$(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:F$(t[0]),{type:`text`,raw:t[0],text:e}}}},K$=/^(?:[ \t]*(?:\n|$))+/,q$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,J$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Y$=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,X$=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Z$=/(?:[*+-]|\d{1,9}[.)])/,Q$=L$(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Z$).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),$$=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,e1=/^[^\n]+/,t1=/(?!\s*\])(?:\\.|[^\[\]\\])+/,n1=L$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,t1).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),r1=L$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Z$).getRegex(),i1=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,a1=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,o1=L$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,a1).replace(`tag`,i1).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),s1=L$($$).replace(`hr`,Y$).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,i1).getRegex(),c1={blockquote:L$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,s1).getRegex(),code:q$,def:n1,fences:J$,heading:X$,hr:Y$,html:o1,lheading:Q$,list:r1,newline:K$,paragraph:s1,table:z$,text:e1},l1=L$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Y$).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,i1).getRegex(),u1={...c1,table:l1,paragraph:L$($$).replace(`hr`,Y$).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,l1).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,i1).getRegex()},d1={...c1,html:L$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,a1).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:z$,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L$($$).replace(`hr`,Y$).replace(`heading`,` *#{1,6} *[^
|
|
265
|
+
]`).replace(`lheading`,Q$).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},f1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,p1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,m1=/^( {2,}|\\)\n(?!\s*$)/,h1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,g1=`\\p{P}\\p{S}`,_1=L$(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,g1).getRegex(),v1=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,y1=L$(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,g1).getRegex(),b1=L$(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,g1).getRegex(),x1=L$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,g1).getRegex(),S1=L$(/\\([punct])/,`gu`).replace(/punct/g,g1).getRegex(),C1=L$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),w1=L$(a1).replace(`(?:-->|$)`,`-->`).getRegex(),T1=L$(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,w1).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),E1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,D1=L$(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,E1).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),O1=L$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,E1).replace(`ref`,t1).getRegex(),k1=L$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,t1).getRegex(),A1={_backpedal:z$,anyPunctuation:S1,autolink:C1,blockSkip:v1,br:m1,code:p1,del:z$,emStrongLDelim:y1,emStrongRDelimAst:b1,emStrongRDelimUnd:x1,escape:f1,link:D1,nolink:k1,punctuation:_1,reflink:O1,reflinkSearch:L$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,O1).replace(`nolink`,k1).getRegex(),tag:T1,text:h1,url:z$},j1={...A1,link:L$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,E1).getRegex(),reflink:L$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,E1).getRegex()},M1={...A1,escape:L$(f1).replace(`])`,`~|])`).getRegex(),url:L$(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},N1={...M1,br:L$(m1).replace(`{2,}`,`*`).getRegex(),text:L$(M1.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},P1={normal:c1,gfm:u1,pedantic:d1},F1={normal:A1,gfm:M1,breaks:N1,pedantic:j1},I1=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||D$,this.options.tokenizer=this.options.tokenizer||new G$,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:P1.normal,inline:F1.normal};this.options.pedantic?(t.block=P1.pedantic,t.inline=F1.pedantic):this.options.gfm&&(t.block=P1.gfm,t.inline=this.options.breaks?F1.breaks:F1.gfm),this.tokenizer.rules=t}static get rules(){return{block:P1,inline:F1}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
266
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic&&(e=e.replace(/\t/g,` `).replace(/^ +$/gm,``));let r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
267
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
268
|
+
`+r.raw,i.text+=`
|
|
269
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
270
|
+
`+r.raw,i.text+=`
|
|
271
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],n&&i?.type===`paragraph`?(i.raw+=`
|
|
272
|
+
`+r.raw,i.text+=`
|
|
273
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
|
|
274
|
+
`+r.raw,i.text+=`
|
|
275
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},L1=class{options;parser;constructor(e){this.options=e||D$}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(/^\S*/)?.[0],i=e.replace(/\n$/,``)+`
|
|
276
|
+
`;return r?`<pre><code class="language-`+F$(r)+`">`+(n?i:F$(i,!0))+`</code></pre>
|
|
277
|
+
`:`<pre><code>`+(n?i:F$(i,!0))+`</code></pre>
|
|
278
|
+
`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>
|
|
279
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
280
|
+
`+r+`</`+i+`>
|
|
281
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
282
|
+
<thead>
|
|
283
|
+
`+t+`</thead>
|
|
284
|
+
`+r+`</table>
|
|
285
|
+
`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=R$(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+t+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n}){let r=R$(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},R1=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},z1=class e{options;renderer;textRenderer;constructor(e){this.options=e||D$,this.options.renderer=this.options.renderer||new L1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new R1}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
286
|
+
`+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},B1=class{options;block;constructor(e){this.options=e||D$}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?I1.lex:I1.lexInline}provideParser(){return this.block?z1.parse:z1.parseInline}},V1=class{defaults=E$();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=z1;Renderer=L1;TextRenderer=R1;Lexer=I1;Tokenizer=G$;Hooks=B1;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new L1(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new G$(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new B1;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=B1.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return I1.lex(e,t??this.defaults)}parser(e,t){return z1.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?I1.lex:I1.lexInline,s=i.hooks?i.hooks.provideParser():e?z1.parse:z1.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
287
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+F$(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},H1=new V1;function U1(e,t){return H1.parse(e,t)}U1.options=U1.setOptions=function(e){return H1.setOptions(e),U1.defaults=H1.defaults,O$(U1.defaults),U1},U1.getDefaults=E$,U1.defaults=D$,U1.use=function(...e){return H1.use(...e),U1.defaults=H1.defaults,O$(U1.defaults),U1},U1.walkTokens=function(e,t){return H1.walkTokens(e,t)},U1.parseInline=H1.parseInline,U1.Parser=z1,U1.parser=z1.parse,U1.Renderer=L1,U1.TextRenderer=R1,U1.Lexer=I1,U1.lexer=I1.lex,U1.Tokenizer=G$,U1.Hooks=B1,U1.parse=U1,U1.options,U1.setOptions,U1.use,U1.walkTokens,U1.parseInline,z1.parse,I1.lex;var W1=class extends L1{heading({tokens:e,depth:t,text:n}){let{discoveryjs:{host:r,useAnchors:i}}=this.options,a=u$(n.replace(/<!--.*?-->/g,``)),o=``;if(i){let e=r.encodePageHash(r.pageId,r.pageRef,r.pageParams,a);o=`<a class="view-header__anchor" id="!anchor:${tz(a)}" href="${e}"></a>`}return`<h${t} class="view-header view-h${t}" data-slug="${a}">${o}${this.parser.parseInline(e)}</h${t}>
|
|
288
|
+
`}blockquote({tokens:e}){let t=this.parser.parse(e),n=null,r=t.match(/^(<p>)?\[!([a-z]+)\]\s*(<\/p>)?\n/i);return r&&(n=r[2],t=(r[3]?``:r[1]||``)+t.slice(r[0].length)),`<blockquote class="view-blockquote"${n?` data-kind=${JSON.stringify(n.toLowerCase())}`:``}>${t}</blockquote>`}code({text:e,lang:t}){let{discoveryjs:{codes:n}}=this.options;return`<code class="discoveryjs-code" data-id="${n.push({syntax:t,source:e})-1}"></code>`}link({tokens:e,href:t,title:n}){let r=this.parser.parseInline(e);if(t===null)return r;let i=`<a class="view-link md-rendered-link" href="`+tz(t)+`"`;return n&&(i+=` title="`+tz(n)+`"`),i+=`>`+r+`</a>`,i}checkbox({checked:e}){return`<label class="view-checkbox"><input type="checkbox" disabled`+(e?` checked`:``)+`/></label> `}list({items:e,ordered:t,start:n}){let r=t?`ol`:`ul`;return`<${r} class="view-${r}"${t&&n!==1?` start="${n}"`:``}>
|
|
289
|
+
`+e.map(this.listitem,this).join(`
|
|
290
|
+
`)+`
|
|
291
|
+
</${r}>
|
|
292
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});if(e.loose){let t=e.tokens[0];t?.type===`paragraph`?(t.text=n+t.text,Array.isArray(t.tokens)&&t.tokens[0]?.type===`text`&&(t.tokens[0].text=n+t.tokens[0].text)):e.tokens.unshift({type:`text`,raw:n,text:n})}else t+=n}return`<li class="view-list-item${e.task?` check-list-item`:``}">${t}${this.parser.parse(e.tokens,!!e.loose)}</li>
|
|
293
|
+
`}table({header:e,rows:t}){let n=t.map(e=>`<tr class="view-table-row">`+e.map(this.tablecell,this).join(``)+`</tr>`).join(`
|
|
294
|
+
`);return`<table class="view-table">
|
|
295
|
+
<thead>
|
|
296
|
+
`+e.map(this.tablecell,this).join(``)+`
|
|
297
|
+
</thead>
|
|
298
|
+
`+(n?`<tbody>
|
|
299
|
+
`+n+`
|
|
300
|
+
</tbody>
|
|
301
|
+
`:``)+`</table>
|
|
302
|
+
`}tablecell({tokens:e,header:t,align:n}){let r=t?`th`:`td`;return`<${r} class="${t?`view-table-header-cell`:`view-table-cell`}"${n?` align="${n}"`:``}>`+this.parser.parseInline(e)+`</${r}>
|
|
303
|
+
`}},G1={demo:{view:`markdown`,source:`# Markdown example
|
|
304
|
+
|
|
305
|
+
> NOTE: The \`markdown\` view is based on [marked](https://github.com/markedjs/marked) package
|
|
306
|
+
|
|
307
|
+
Markdown is good because:
|
|
308
|
+
* You'll get **formatted** *text* with _no tags_
|
|
309
|
+
* It's much simpler than \`HTML\`
|
|
310
|
+
|
|
311
|
+
\`\`\`html
|
|
312
|
+
<b>bold</b><i>italic</i>
|
|
313
|
+
\`\`\`
|
|
314
|
+
[Read more](https://guides.github.com/features/mastering-markdown/)`},examples:[{title:`Inline config`,demo:'markdown{ source: "**Hello** `world`!" }'},{title:`Shorthand syntax`,beforeDemo:['md:"You can use `md` as an alias for `markdown` with a string as data. That\'s a **shortest** definition for a marked text"'],demo:'md:"**Hello** `world`!"'},{title:`Array of strings as a source`,beforeDemo:['md:"Array of strings might be passed as a value for `source` property which is useful for a long sources\\n> NOTE: This doesn\'t work a source passed via data"'],demo:{view:`markdown`,source:[`Array`,`of`,"`strings`"]}},{title:`Interpolation`,beforeDemo:['md:"Interpolation can be used almost anywhere in a markdown to embed the result of a jora query into resulting HTML. Just place a jora query between `{{`{{`}}` and `{{`}`+`}`}}`:"'],demo:{view:`md`,source:["Simple evaluation: 2 + 2 = `{{ 2 + 2 }}`",``,`Markdown view has {{ #.options.usage.examples.size() }} examples`]}},{title:`Disable anchors for headers`,highlightProps:[`anchors`],beforeDemo:`Hover a header to see a chain icon on the left side of header when anchors are enabled:`,demo:[{view:`markdown`,source:`## header with default settings`},{view:`markdown`,anchors:!1,source:`## header with disabled anchor`}]},{title:`Sections prelude and postlude`,highlightProps:[`sectionPrelude`,`sectionPostlude`],demo:{view:`markdown`,source:`Section without a header
|
|
315
|
+
|
|
316
|
+
## Header level 2
|
|
317
|
+
|
|
318
|
+
Section 1
|
|
319
|
+
|
|
320
|
+
### Header level 3
|
|
321
|
+
|
|
322
|
+
Section 2
|
|
323
|
+
|
|
324
|
+
## Header level 2
|
|
325
|
+
|
|
326
|
+
Section 3`,sectionPrelude:`struct:#.section`,sectionPostlude:{view:`link`,href:`#top`,text:`Scroll to top ↑`}}},{title:`Configuration for code blocks`,highlightProps:[`codeConfig`],beforeDemo:['md:"Use `codeConfig` to specify any settings for code blocks available for `source` view."'],demo:{view:`markdown`,source:`# Header 1
|
|
327
|
+
|
|
328
|
+
\`\`\`js
|
|
329
|
+
console.log("Hello world")
|
|
330
|
+
\`\`\`
|
|
331
|
+
|
|
332
|
+
## Header 2
|
|
333
|
+
|
|
334
|
+
text
|
|
335
|
+
|
|
336
|
+
## Header 3
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
\`\`\`jora
|
|
341
|
+
foo.bar.baz
|
|
342
|
+
\`\`\``,codeConfig:{prelude:{view:`block`,content:[`badge:syntax`,`text:"Length: " + #.sourceViewProps.source.size()`]},postlude:`struct:#.section`,actionButtons:[{view:`button`,text:`Say "Hello world"`,onClick:Function(`return () => alert("Hello world!")`)()}]}}},{title:`Showcase`,demo:{view:`markdown`,source:`# Header level 1
|
|
343
|
+
## Header level 2
|
|
344
|
+
### Header level 3
|
|
345
|
+
#### Header level 4
|
|
346
|
+
##### Header level 5
|
|
347
|
+
* One
|
|
348
|
+
* Two
|
|
349
|
+
* Three
|
|
350
|
+
|
|
351
|
+
4. Four
|
|
352
|
+
5. Five
|
|
353
|
+
6. Six
|
|
354
|
+
- [{{ true }}] Task 1
|
|
355
|
+
- [x] Task 2
|
|
356
|
+
|
|
357
|
+
Interpolation in text: 2 + 2 = \`{{ 2 + 2 }}\`, or in attribute: [link](#dummy-link/{{"exam" + "ple"}} "{{ "example" + " title" }}")
|
|
358
|
+
|
|
359
|
+
Paragraph **bold** __bold__ *italic* _italic_ ~line-through~ \`code\` [link](#href)
|
|
360
|
+
|
|
361
|
+
>Blockquote
|
|
362
|
+
> > Line 2
|
|
363
|
+
|
|
364
|
+
> [!NOTE]
|
|
365
|
+
> Useful information that users should know, even when skimming content.
|
|
366
|
+
|
|
367
|
+
> [!TIP]
|
|
368
|
+
> Helpful advice for doing things better or more easily.
|
|
369
|
+
|
|
370
|
+
> [!IMPORTANT]
|
|
371
|
+
> Key information users need to know to achieve their goal.
|
|
372
|
+
|
|
373
|
+
> [!WARNING]
|
|
374
|
+
> Urgent info that needs immediate user attention to avoid problems.
|
|
375
|
+
|
|
376
|
+
> [!CAUTION]
|
|
377
|
+
> Advises about risks or negative outcomes of certain actions.
|
|
378
|
+
|
|
379
|
+
\`\`\`js
|
|
380
|
+
var some = "code";
|
|
381
|
+
\`\`\`
|
|
382
|
+
|
|
383
|
+
foo | bar
|
|
384
|
+
----|-----
|
|
385
|
+
1 | A
|
|
386
|
+
2 | C
|
|
387
|
+
3 | E`.split(/\n/)}}]};function K1(e,t){let{nodeValue:n}=e,r=n.replace(/{{(\d+)}}/gs,(e,n)=>t[n]);r!==n&&(e.nodeValue=r)}function q1(e,t){for(let n of e.childNodes)switch(n.nodeType){case document.ELEMENT_NODE:if(!n.classList.contains(`view-source`)){q1(n,t);for(let e of n.attributes)K1(e,t)}break;case document.TEXT_NODE:K1(n,t)}}function J1(e){let t=new Map,n={after:e.prepend.bind(e)},r={next:null,data:{sectionIdx:0,slug:null,text:null,href:null}};t.set(n,r);for(let i of[...e.querySelectorAll(`:scope > :is(h1, h2, h3, h4, h5, h6)`)]){i===e.firstElementChild&&(t.delete(n),n=i,r=null);let a=i.querySelector(`:scope > a[id^="!anchor:"]`),o={next:null,data:{sectionIdx:t.size,slug:i.dataset.slug,text:i.textContent.trim(),href:a?.hash}};t.set(i,o),r&&(r.next=i),r=o}return{sectionByHeaderEl:t,findSectionByEl(r){let i=t.get(n);for(;r!==null&&r!==e;){if(t.has(r)){i=t.get(r);break}r=r.previousSibling||r.parentNode}return i?.data||null}}}var Y1=`is not array? | {
|
|
388
|
+
source: #.props has no 'source' ? is (string or array) ?,
|
|
389
|
+
anchors: true,
|
|
390
|
+
sectionPrelude: undefined,
|
|
391
|
+
sectionPostlude: undefined,
|
|
392
|
+
codeConfig: undefined
|
|
393
|
+
} | overrideProps()`;function X1(e){let t=new V1().setOptions({smartLists:!0,renderer:new W1});function n(n,r,i,a){let o=new Map,s=[],c=[],{anchors:l=!0,sectionPrelude:u,sectionPostlude:d}=r,{source:f,codeConfig:p}=r;if(Array.isArray(f)&&(f=f.join(`
|
|
394
|
+
`)),f=f.replace(/{{(.+?)}}/gs,(e,t)=>(t=t.trim(),o.has(t)||o.set(t,o.size),`{{${o.get(t)}}}`)),n.classList.add(`view-markdown`),n.innerHTML=t.parse(f,{discoveryjs:{host:e,useAnchors:l,codes:s}}),o.size>0){let t=Array(o.size);for(let[n,r]of o.entries())try{t[r]=e.query(n,i,a)}catch(t){e.logger.error(`Interpolation query error in markdown:`,t.message)}q1(n,t)}for(let e of n.querySelectorAll(`.md-rendered-link`))e.getAttribute(`href`).startsWith(`#`)||e.setAttribute(`target`,`_blank`);let{sectionByHeaderEl:m,findSectionByEl:h}=s.length||u||d?J1(n):{sectionByHeaderEl:new Map,findSectionByEl:()=>null};p=typeof p==`object`?{view:`source`,...p}:p||`source`;for(let e of[...n.querySelectorAll(`.discoveryjs-code`)]){let t=h(e),n=document.createDocumentFragment(),{syntax:r,source:i}=s[e.dataset.id];c.push(this.render(n,p,{syntax:r,source:i},{...a,section:t}).then(()=>e.replaceWith(n)))}if(u||d){let e=(e,t,n)=>{let r=document.createDocumentFragment();c.push(this.render(r,e,i,{...a,section:t.data}).then(()=>n(r)))};for(let[t,r]of m)u&&e(u,r,e=>t.after(e)),d&&e(d,r,e=>r.next?r.next.before(e):n.append(e))}return Promise.all(c)}e.view.define(`markdown`,n,{props:Y1,usage:G1}),e.view.define(`md`,n,{props:Y1,usage:G1})}var Z1=o(((e,t)=>{function n(e,t){switch(e.charCodeAt(t)){default:return 0;case 10:return 1;case 13:return t+1<e.length&&e.charCodeAt(t+1)===10?2:1}}t.exports={newLineLength:n}})),Q1=o(((e,t)=>{var{newLineLength:n}=Z1();t.exports=(e,t)=>{let r=1,i=0;for(let a=0;a<e.length;a++){let o=n(e,a);o!==0&&(t(i,a+o,r++),i=a+o,a+=o-1)}t(i,e.length,r++)}})),$1=o(((e,t)=>{var{newLineLength:n}=Z1();t.exports=(e,t)=>{let r=1,i=0;for(let a=0;a<e.length;a++){let o=n(e,a);o!==0&&(t(i,a,r++),i=a+o,a+=o-1)}t(i,e.length,r++)}})),e0=o(((e,t)=>{t.exports=function(e){if(e instanceof RegExp){let t=e.flags.indexOf(`g`)===-1?e.flags+`g`:e.flags,n=new RegExp(e,t);return function(e,t){let r;for(;r=n.exec(e);)t(r.index,r.index+r[0].length)}}return e=String(e),function(t,n){let r=-1;for(;r=t.indexOf(e,r+1),r!==-1;)n(r,r+e.length)}}})),t0=o(((e,t)=>{var{newLineLength:n}=Z1();t.exports=(e,t)=>{let r=1;for(let i=0;i<e.length;i++){let a=n(e,i);a!==0&&(t(i,i+a,r++),i+=a-1)}}})),n0=o(((e,t)=>{t.exports={lines:Q1(),lineContents:$1(),matches:e0(),newlines:t0()}})),r0=o(((e,t)=>{function n(e){return r.call(null,e)}function r(e){let t=this===globalThis?{}:this||{},n={};return Object.assign(n,t,e,{fork:r.bind(n),ranges:Object.assign({},t.ranges,e&&e.ranges)}),typeof n.createHook!=`function`&&(n.createHook=e=>e()),n}function i(e){let t=Object.assign({},this);for(let r in e){let i=e[r];if(i&&typeof i==`object`){if(hasOwnProperty.call(t,r)){let n=t[r];t[r]=n&&typeof n.fork==`function`?n.fork(e[r]):n}else t[r]=n(e[r])}}return t.fork=i.bind(t),t}t.exports={createPrinter:n,forkPrinter:r,forkPrinterSet:i}})),i0=o(((e,t)=>{t.exports=r0().createPrinter()})),a0=o(((e,t)=>{var{createPrinter:n}=r0();t.exports=n({print:e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)})})),o0=o(((e,t)=>{var{forkPrinterSet:n}=r0();t.exports=n.call({},{noop:i0(),html:a0(),tty:i0()})})),s0=o(((e,t)=>{t.exports=function(e,t){let n=[];return t.forEach(({generate:t,marker:r})=>t(e,(e,t,i)=>n.push({type:r,start:e,end:t,data:i}))),n}})),c0=o(((e,t)=>{var n=()=>``,r=function(){};function i(e,t){return typeof e==`function`?e:t||r}t.exports=function(e,t,r){let a=i(r.print,e=>e),o=Object.assign(Object.defineProperties(Object.create(null),{offset:{get:()=>f},line:{get:()=>p},column:{get:()=>m},start:{get:()=>c.start},end:{get:()=>c.end},data:{get:()=>c.data}}),i(r.createContext)()),s=[],c={start:0,end:e.length},l=r.ranges||{},u=[],d=1/0,f=0,p=1,m=1,h=``;h+=i(r.open,n)(o),l=[].concat(Object.getOwnPropertyNames(l),Object.getOwnPropertySymbols(l)).reduce((e,t)=>{let o=l[t];return typeof o==`function`&&(l[t]=o=r.createHook(o)),o&&(u.push(t),e[t]={open:i(o.open,n),close:i(o.close,n),print:i(o.print,a)}),e},{}),t=t.slice().sort((e,t)=>e.start-t.start||t.end-e.end||u.indexOf(e.type)-u.indexOf(t.type));let g=e=>l[(c=s[e]).type].open(o)||``,_=e=>l[(c=s[e]).type].close(o)||``,v=t=>{if(f!==t){let n=e.substring(f,t),r=s.length?l[s[s.length-1].type].print:a;for(let n=f;n<t;n++){let t=e.charCodeAt(n);t===10||t===13&&(n>=e.length||e.charCodeAt(n+1)!==10)?(p++,m=1):m++}h+=r(n,o),f=t}},y=e=>{for(;d<=e;){v(d);for(let e=s.length-1;e>=0&&s[e].end===d;e--)h+=_(e),s.pop();d=1/0;for(let e=0;e<s.length;e++)s[e].end<d&&(d=s[e].end)}};for(let e=0;e<t.length;e++){let n=t[e],r=0;if(l.hasOwnProperty(n.type)!==!1&&!(n.start>n.end||!Number.isFinite(n.start)||!Number.isFinite(n.end))){for(y(n.start),v(n.start),r=0;r<s.length;r++)if(s[r].end<n.end){for(let e=s.length-1;e>=r;e--)h+=_(e);break}for(s.splice(r,0,n);r<s.length;r++)h+=g(r);n.end<d&&(d=n.end)}}y(e.length),v(e.length);for(let e=s.length-1;e>=0;e--)h+=_(e);return h+=i(r.close,n)(o)||``,h}})),l0=o(((e,t)=>{var n=n0(),r=o0(),i=s0(),a=c0();function o(e,t){return{marker:e,generate:t}}function s(e,t){let n={};for(let r in t)n[r]={ranges:{[e]:t[r]}};return n}function c(e,t,n){let l=(o,s)=>{let c=t[s||n]||r.noop;return a(o,i(o,e),c)};return Object.assign(l,{print:l,generateRanges(t){return i(t,e)},use(r,i){let a=Symbol(r.name),u=r.ranges||r,d=Array.isArray(u)?(e,t)=>u.forEach(e=>t(...e)):u;return typeof d!=`function`||(i||=r.printer,!i)?l:c(e.concat(o(a,d)),t.fork(s(a,i)),n)},printer(n){return c(e,t,n)}})}function l(e,t,n){let i=c([],n||r,t);return Array.isArray(e)&&(i=e.reduce((e,t)=>Array.isArray(t)?e.use(...t):e.use(t),i)),i}t.exports=Object.assign(l,{gen:n,printer:Object.assign((...e)=>l().printer(...e),r),use(...e){return l().use(...e)}})})),u0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(sz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`css`,function(t,n){var r=n.inline;n.propertyKeywords||(n=e.resolveMode(`text/css`));var i=t.indentUnit,a=n.tokenHooks,o=n.documentTypes||{},s=n.mediaTypes||{},c=n.mediaFeatures||{},l=n.mediaValueKeywords||{},u=n.propertyKeywords||{},d=n.nonStandardPropertyKeywords||{},f=n.fontProperties||{},p=n.counterDescriptors||{},m=n.colorKeywords||{},h=n.valueKeywords||{},g=n.allowNested,_=n.lineComment,v=n.supportsAtComponent===!0,y=t.highlightNonStandardPropertyKeywords!==!1,b,x;function S(e,t){return b=t,e}function C(e,t){var n=e.next();if(a[n]){var r=a[n](e,t);if(r!==!1)return r}if(n==`@`)return e.eatWhile(/[\w\\\-]/),S(`def`,e.current());if(n==`=`||(n==`~`||n==`|`)&&e.eat(`=`))return S(null,`compare`);if(n==`"`||n==`'`)return t.tokenize=w(n),t.tokenize(e,t);if(n==`#`)return e.eatWhile(/[\w\\\-]/),S(`atom`,`hash`);if(n==`!`)return e.match(/^\s*\w*/),S(`keyword`,`important`);if(/\d/.test(n)||n==`.`&&e.eat(/\d/))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(n===`-`){if(/[\d.]/.test(e.peek()))return e.eatWhile(/[\w.%]/),S(`number`,`unit`);if(e.match(/^-[\w\\\-]*/))return e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?S(`variable-2`,`variable-definition`):S(`variable-2`,`variable`);if(e.match(/^\w+-/))return S(`meta`,`meta`)}else if(/[,+>*\/]/.test(n))return S(null,`select-op`);else if(n==`.`&&e.match(/^-?[_a-z][_a-z0-9-]*/i))return S(`qualifier`,`qualifier`);else if(/[:;{}\[\]\(\)]/.test(n))return S(null,n);else if(e.match(/^[\w-.]+(?=\()/))return/^(url(-prefix)?|domain|regexp)$/i.test(e.current())&&(t.tokenize=T),S(`variable callee`,`variable`);else if(/[\w\\\-]/.test(n))return e.eatWhile(/[\w\\\-]/),S(`property`,`word`);else return S(null,null)}function w(e){return function(t,n){for(var r=!1,i;(i=t.next())!=null;){if(i==e&&!r){e==`)`&&t.backUp(1);break}r=!r&&i==`\\`}return(i==e||!r&&e!=`)`)&&(n.tokenize=null),S(`string`,`string`)}}function T(e,t){return e.next(),t.tokenize=e.match(/^\s*[\"\')]/,!1)?null:w(`)`),S(null,`(`)}function E(e,t,n){this.type=e,this.indent=t,this.prev=n}function D(e,t,n,r){return e.context=new E(n,t.indentation()+(r===!1?0:i),e.context),n}function O(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function k(e,t,n){return M[n.context.type](e,t,n)}function A(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return k(e,t,n)}function j(e){var t=e.current().toLowerCase();x=h.hasOwnProperty(t)?`atom`:m.hasOwnProperty(t)?`keyword`:`variable`}var M={};return M.top=function(e,t,n){if(e==`{`)return D(n,t,`block`);if(e==`}`&&n.context.prev)return O(n);if(v&&/@component/i.test(e))return D(n,t,`atComponentBlock`);if(/^@(-moz-)?document$/i.test(e))return D(n,t,`documentTypes`);if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return D(n,t,`atBlock`);if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,`restricted_atBlock_before`;if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return`keyframes`;if(e&&e.charAt(0)==`@`)return D(n,t,`at`);if(e==`hash`)x=`builtin`;else if(e==`word`)x=`tag`;else if(e==`variable-definition`)return`maybeprop`;else if(e==`interpolation`)return D(n,t,`interpolation`);else if(e==`:`)return`pseudo`;else if(g&&e==`(`)return D(n,t,`parens`);return n.context.type},M.block=function(e,t,n){if(e==`word`){var r=t.current().toLowerCase();return u.hasOwnProperty(r)?(x=`property`,`maybeprop`):d.hasOwnProperty(r)?(x=y?`string-2`:`property`,`maybeprop`):g?(x=t.match(/^\s*:(?:\s|$)/,!1)?`property`:`tag`,`block`):(x+=` error`,`maybeprop`)}return e==`meta`?`block`:!g&&(e==`hash`||e==`qualifier`)?(x=`error`,`block`):M.top(e,t,n)},M.maybeprop=function(e,t,n){return e==`:`?D(n,t,`prop`):k(e,t,n)},M.prop=function(e,t,n){if(e==`;`)return O(n);if(e==`{`&&g)return D(n,t,`propBlock`);if(e==`}`||e==`{`)return A(e,t,n);if(e==`(`)return D(n,t,`parens`);if(e==`hash`&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t.current()))x+=` error`;else if(e==`word`)j(t);else if(e==`interpolation`)return D(n,t,`interpolation`);return`prop`},M.propBlock=function(e,t,n){return e==`}`?O(n):e==`word`?(x=`property`,`maybeprop`):n.context.type},M.parens=function(e,t,n){return e==`{`||e==`}`?A(e,t,n):e==`)`?O(n):e==`(`?D(n,t,`parens`):e==`interpolation`?D(n,t,`interpolation`):(e==`word`&&j(t),`parens`)},M.pseudo=function(e,t,n){return e==`meta`?`pseudo`:e==`word`?(x=`variable-3`,n.context.type):k(e,t,n)},M.documentTypes=function(e,t,n){return e==`word`&&o.hasOwnProperty(t.current())?(x=`tag`,n.context.type):M.atBlock(e,t,n)},M.atBlock=function(e,t,n){if(e==`(`)return D(n,t,`atBlock_parens`);if(e==`}`||e==`;`)return A(e,t,n);if(e==`{`)return O(n)&&D(n,t,g?`block`:`top`);if(e==`interpolation`)return D(n,t,`interpolation`);if(e==`word`){var r=t.current().toLowerCase();x=r==`only`||r==`not`||r==`and`||r==`or`?`keyword`:s.hasOwnProperty(r)?`attribute`:c.hasOwnProperty(r)?`property`:l.hasOwnProperty(r)?`keyword`:u.hasOwnProperty(r)?`property`:d.hasOwnProperty(r)?y?`string-2`:`property`:h.hasOwnProperty(r)?`atom`:m.hasOwnProperty(r)?`keyword`:`error`}return n.context.type},M.atComponentBlock=function(e,t,n){return e==`}`?A(e,t,n):e==`{`?O(n)&&D(n,t,g?`block`:`top`,!1):(e==`word`&&(x=`error`),n.context.type)},M.atBlock_parens=function(e,t,n){return e==`)`?O(n):e==`{`||e==`}`?A(e,t,n,2):M.atBlock(e,t,n)},M.restricted_atBlock_before=function(e,t,n){return e==`{`?D(n,t,`restricted_atBlock`):e==`word`&&n.stateArg==`@counter-style`?(x=`variable`,`restricted_atBlock_before`):k(e,t,n)},M.restricted_atBlock=function(e,t,n){return e==`}`?(n.stateArg=null,O(n)):e==`word`?(x=n.stateArg==`@font-face`&&!f.hasOwnProperty(t.current().toLowerCase())||n.stateArg==`@counter-style`&&!p.hasOwnProperty(t.current().toLowerCase())?`error`:`property`,`maybeprop`):`restricted_atBlock`},M.keyframes=function(e,t,n){return e==`word`?(x=`variable`,`keyframes`):e==`{`?D(n,t,`top`):k(e,t,n)},M.at=function(e,t,n){return e==`;`?O(n):e==`{`||e==`}`?A(e,t,n):(e==`word`?x=`tag`:e==`hash`&&(x=`builtin`),`at`)},M.interpolation=function(e,t,n){return e==`}`?O(n):e==`{`||e==`;`?A(e,t,n):(e==`word`?x=`variable`:e!=`variable`&&e!=`(`&&e!=`)`&&(x=`error`),`interpolation`)},{startState:function(e){return{tokenize:null,state:r?`block`:`top`,stateArg:null,context:new E(r?`block`:`top`,e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||C)(e,t);return n&&typeof n==`object`&&(b=n[1],n=n[0]),x=n,b!=`comment`&&(t.state=M[t.state](b,e,t)),x},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),a=n.indent;return n.type==`prop`&&(r==`}`||r==`)`)&&(n=n.prev),n.prev&&(r==`}`&&(n.type==`block`||n.type==`top`||n.type==`interpolation`||n.type==`restricted_atBlock`)?(n=n.prev,a=n.indent):(r==`)`&&(n.type==`parens`||n.type==`atBlock_parens`)||r==`{`&&(n.type==`at`||n.type==`atBlock`))&&(a=Math.max(0,n.indent-i))),a},electricChars:`}`,blockCommentStart:`/*`,blockCommentEnd:`*/`,blockCommentContinue:` * `,lineComment:_,fold:`brace`}});function t(e){for(var t={},n=0;n<e.length;++n)t[e[n].toLowerCase()]=!0;return t}var n=[`domain`,`regexp`,`url`,`url-prefix`],r=t(n),i=[`all`,`aural`,`braille`,`handheld`,`print`,`projection`,`screen`,`tty`,`tv`,`embossed`],a=t(i),o=`width.min-width.max-width.height.min-height.max-height.device-width.min-device-width.max-device-width.device-height.min-device-height.max-device-height.aspect-ratio.min-aspect-ratio.max-aspect-ratio.device-aspect-ratio.min-device-aspect-ratio.max-device-aspect-ratio.color.min-color.max-color.color-index.min-color-index.max-color-index.monochrome.min-monochrome.max-monochrome.resolution.min-resolution.max-resolution.scan.grid.orientation.device-pixel-ratio.min-device-pixel-ratio.max-device-pixel-ratio.pointer.any-pointer.hover.any-hover.prefers-color-scheme.dynamic-range.video-dynamic-range`.split(`.`),s=t(o),c=[`landscape`,`portrait`,`none`,`coarse`,`fine`,`on-demand`,`hover`,`interlace`,`progressive`,`dark`,`light`,`standard`,`high`],l=t(c),u=`align-content.align-items.align-self.alignment-adjust.alignment-baseline.all.anchor-point.animation.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-timing-function.appearance.azimuth.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.binding.bleed.block-size.bookmark-label.bookmark-level.bookmark-state.bookmark-target.border.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-decoration-break.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.color.color-profile.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.content.counter-increment.counter-reset.crop.cue.cue-after.cue-before.cursor.direction.display.dominant-baseline.drop-initial-after-adjust.drop-initial-after-align.drop-initial-before-adjust.drop-initial-before-align.drop-initial-size.drop-initial-value.elevation.empty-cells.fit.fit-content.fit-position.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.float-offset.flow-from.flow-into.font.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-size.font-size-adjust.font-stretch.font-style.font-synthesis.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.gap.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-gap.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-gap.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphens.icon.image-orientation.image-rendering.image-resolution.inline-box-align.inset.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.left.letter-spacing.line-break.line-height.line-height-step.line-stacking.line-stacking-ruby.line-stacking-shift.line-stacking-strategy.list-style.list-style-image.list-style-position.list-style-type.margin.margin-bottom.margin-left.margin-right.margin-top.marks.marquee-direction.marquee-loop.marquee-play-count.marquee-speed.marquee-style.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.move-to.nav-down.nav-index.nav-left.nav-right.nav-up.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-style.overflow-wrap.overflow-x.overflow-y.padding.padding-bottom.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.page-policy.pause.pause-after.pause-before.perspective.perspective-origin.pitch.pitch-range.place-content.place-items.place-self.play-during.position.presentation-level.punctuation-trim.quotes.region-break-after.region-break-before.region-break-inside.region-fragment.rendering-intent.resize.rest.rest-after.rest-before.richness.right.rotate.rotation.rotation-point.row-gap.ruby-align.ruby-overhang.ruby-position.ruby-span.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-type.shape-image-threshold.shape-inside.shape-margin.shape-outside.size.speak.speak-as.speak-header.speak-numeral.speak-punctuation.speech-rate.stress.string-set.tab-size.table-layout.target.target-name.target-new.target-position.text-align.text-align-last.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-height.text-indent.text-justify.text-orientation.text-outline.text-overflow.text-rendering.text-shadow.text-size-adjust.text-space-collapse.text-transform.text-underline-position.text-wrap.top.touch-action.transform.transform-origin.transform-style.transition.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-select.vertical-align.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.volume.white-space.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.z-index.clip-path.clip-rule.mask.enable-background.filter.flood-color.flood-opacity.lighting-color.stop-color.stop-opacity.pointer-events.color-interpolation.color-interpolation-filters.color-rendering.fill.fill-opacity.fill-rule.image-rendering.marker.marker-end.marker-mid.marker-start.paint-order.shape-rendering.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.text-rendering.baseline-shift.dominant-baseline.glyph-orientation-horizontal.glyph-orientation-vertical.text-anchor.writing-mode`.split(`.`),d=t(u),f=`accent-color.aspect-ratio.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.content-visibility.margin-block.margin-block-end.margin-block-start.margin-inline.margin-inline-end.margin-inline-start.overflow-anchor.overscroll-behavior.padding-block.padding-block-end.padding-block-start.padding-inline.padding-inline-end.padding-inline-start.scroll-snap-stop.scrollbar-3d-light-color.scrollbar-arrow-color.scrollbar-base-color.scrollbar-dark-shadow-color.scrollbar-face-color.scrollbar-highlight-color.scrollbar-shadow-color.scrollbar-track-color.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.shape-inside.zoom`.split(`.`),p=t(f),m=t([`font-display`,`font-family`,`src`,`unicode-range`,`font-variant`,`font-feature-settings`,`font-stretch`,`font-weight`,`font-style`]),h=t([`additive-symbols`,`fallback`,`negative`,`pad`,`prefix`,`range`,`speak-as`,`suffix`,`symbols`,`system`]),g=`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkgrey.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkslategrey.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dimgrey.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightgrey.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightslategrey.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.slategrey.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`),_=t(g),v=`above.absolute.activeborder.additive.activecaption.afar.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.amharic.amharic-abegede.antialiased.appworkspace.arabic-indic.armenian.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.binary.bengali.blink.block.block-axis.blur.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.brightness.bullets.button.buttonface.buttonhighlight.buttonshadow.buttontext.calc.cambodian.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.cjk-earthly-branch.cjk-heavenly-stem.cjk-ideographic.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.conic-gradient.contain.content.contents.content-box.context-menu.continuous.contrast.copy.counter.counters.cover.crop.cross.crosshair.cubic-bezier.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.devanagari.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.drop-shadow.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic.ethiopic-abegede.ethiopic-abegede-am-et.ethiopic-abegede-gez.ethiopic-abegede-ti-er.ethiopic-abegede-ti-et.ethiopic-halehame-aa-er.ethiopic-halehame-aa-et.ethiopic-halehame-am-et.ethiopic-halehame-gez.ethiopic-halehame-om-et.ethiopic-halehame-sid-et.ethiopic-halehame-so-et.ethiopic-halehame-ti-er.ethiopic-halehame-ti-et.ethiopic-halehame-tig.ethiopic-numeric.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.georgian.grayscale.graytext.grid.groove.gujarati.gurmukhi.hand.hangul.hangul-consonant.hard-light.hebrew.help.hidden.hide.higher.highlight.highlighttext.hiragana.hiragana-iroha.horizontal.hsl.hsla.hue.hue-rotate.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.japanese-formal.japanese-informal.justify.kannada.katakana.katakana-iroha.keep-all.khmer.korean-hangul-formal.korean-hanja-formal.korean-hanja-informal.landscape.lao.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-alpha.lower-armenian.lower-greek.lower-hexadecimal.lower-latin.lower-norwegian.lower-roman.lowercase.ltr.luminosity.malayalam.manipulation.match.matrix.matrix3d.media-play-button.media-slider.media-sliderthumb.media-volume-slider.media-volume-sliderthumb.medium.menu.menulist.menulist-button.menutext.message-box.middle.min-intrinsic.mix.mongolian.monospace.move.multiple.multiple_mask_images.multiply.myanmar.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.octal.opacity.open-quote.optimizeLegibility.optimizeSpeed.oriya.oromo.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.persian.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeating-conic-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturate.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.searchfield.searchfield-cancel-button.searchfield-decoration.searchfield-results-button.searchfield-results-decoration.self-start.self-end.semi-condensed.semi-expanded.separate.sepia.serif.show.sidama.simp-chinese-formal.simp-chinese-informal.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.somali.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.square-button.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.tamil.telugu.text.text-bottom.text-top.textarea.textfield.thai.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.tibetan.tigre.tigrinya-er.tigrinya-er-abegede.tigrinya-et.tigrinya-et-abegede.to.top.trad-chinese-formal.trad-chinese-informal.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-alpha.upper-armenian.upper-greek.upper-hexadecimal.upper-latin.upper-norwegian.upper-roman.uppercase.urdu.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`),y=t(v),b=n.concat(i).concat(o).concat(c).concat(u).concat(f).concat(g).concat(v);e.registerHelper(`hintWords`,`css`,b);function x(e,t){for(var n=!1,r;(r=e.next())!=null;){if(n&&r==`/`){t.tokenize=null;break}n=r==`*`}return[`comment`,`comment`]}e.defineMIME(`text/css`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`}),e.defineMIME(`text/x-scss`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},":":function(e){return e.match(/^\s*\{/,!1)?[null,null]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`]},"#":function(e){return e.eat(`{`)?[null,`interpolation`]:!1}},name:`css`,helperType:`scss`}),e.defineMIME(`text/x-less`,{mediaTypes:a,mediaFeatures:s,mediaValueKeywords:l,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:y,fontProperties:m,allowNested:!0,lineComment:`//`,tokenHooks:{"/":function(e,t){return e.eat(`/`)?(e.skipToEnd(),[`comment`,`comment`]):e.eat(`*`)?(t.tokenize=x,x(e,t)):[`operator`,`operator`]},"@":function(e){return e.eat(`{`)?[null,`interpolation`]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?[`variable-2`,`variable-definition`]:[`variable-2`,`variable`])},"&":function(){return[`atom`,`atom`]}},name:`css`,helperType:`less`}),e.defineMIME(`text/x-gss`,{documentTypes:r,mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:h,colorKeywords:_,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return e.eat(`*`)?(t.tokenize=x,x(e,t)):!1}},name:`css`,helperType:`gss`})})})),d0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(sz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode(`xml`,function(r,i){var a=r.indentUnit,o={},s=i.htmlMode?t:n;for(var c in s)o[c]=s[c];for(var c in i)o[c]=i[c];var l,u;function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();return r==`<`?e.eat(`!`)?e.eat(`[`)?e.match(`CDATA[`)?n(m(`atom`,`]]>`)):null:e.match(`--`)?n(m(`comment`,`-->`)):e.match(`DOCTYPE`,!0,!0)?(e.eatWhile(/[\w\._\-]/),n(h(1))):null:e.eat(`?`)?(e.eatWhile(/[\w\._\-]/),t.tokenize=m(`meta`,`?>`),`meta`):(l=e.eat(`/`)?`closeTag`:`openTag`,t.tokenize=f,`tag bracket`):r==`&`?(e.eat(`#`)?e.eat(`x`)?e.eatWhile(/[a-fA-F\d]/)&&e.eat(`;`):e.eatWhile(/[\d]/)&&e.eat(`;`):e.eatWhile(/[\w\.\-:]/)&&e.eat(`;`))?`atom`:`error`:(e.eatWhile(/[^&<]/),null)}d.isInText=!0;function f(e,t){var n=e.next();if(n==`>`||n==`/`&&e.eat(`>`))return t.tokenize=d,l=n==`>`?`endTag`:`selfcloseTag`,`tag bracket`;if(n==`=`)return l=`equals`,null;if(n==`<`){t.tokenize=d,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+` tag error`:`tag error`}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),`word`)}function p(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=f;break}return`string`};return t.isInAttribute=!0,t}function m(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function h(e){return function(t,n){for(var r;(r=t.next())!=null;)if(r==`<`)return n.tokenize=h(e+1),n.tokenize(t,n);else if(r==`>`){if(e==1){n.tokenize=d;break}return n.tokenize=h(e-1),n.tokenize(t,n)}return`meta`}}function g(e){return e&&e.toLowerCase()}function _(e,t,n){this.prev=e.context,this.tagName=t||``,this.indent=e.indented,this.startOfLine=n,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function v(e){e.context&&=e.context.prev}function y(e,t){for(var n;;){if(!e.context||(n=e.context.tagName,!o.contextGrabbers.hasOwnProperty(g(n))||!o.contextGrabbers[g(n)].hasOwnProperty(g(t))))return;v(e)}}function b(e,t,n){return e==`openTag`?(n.tagStart=t.column(),x):e==`closeTag`?S:b}function x(e,t,n){return e==`word`?(n.tagName=t.current(),u=`tag`,T):o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,T(e,t,n)):(u=`error`,x)}function S(e,t,n){if(e==`word`){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&v(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(u=`tag`,C):(u=`tag error`,w)}return o.allowMissingTagName&&e==`endTag`?(u=`tag bracket`,C(e,t,n)):(u=`error`,w)}function C(e,t,n){return e==`endTag`?(v(n),b):(u=`error`,C)}function w(e,t,n){return u=`error`,C(e,t,n)}function T(e,t,n){if(e==`word`)return u=`attribute`,E;if(e==`endTag`||e==`selfcloseTag`){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e==`selfcloseTag`||o.autoSelfClosers.hasOwnProperty(g(r))?y(n,r):(y(n,r),n.context=new _(n,r,i==n.indented)),b}return u=`error`,T}function E(e,t,n){return e==`equals`?D:(o.allowMissing||(u=`error`),T(e,t,n))}function D(e,t,n){return e==`string`?O:e==`word`&&o.allowUnquoted?(u=`string`,T):(u=`error`,T(e,t,n))}function O(e,t,n){return e==`string`?O:T(e,t,n)}return{startState:function(e){var t={tokenize:d,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;l=null;var n=t.tokenize(e,t);return(n||l)&&n!=`comment`&&(u=null,t.state=t.state(l||n,e,t),u&&(n=u==`error`?n+` error`:u)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag===!1?t.tagStart+a*(o.multilineTagIndentFactor||1):t.tagStart+t.tagName.length+2;if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;i;)if(i.tagName==s[2]){i=i.prev;break}else if(o.implicitlyClosed.hasOwnProperty(g(i.tagName)))i=i.prev;else break;else if(s)for(;i;){var c=o.contextGrabbers[g(i.tagName)];if(c&&c.hasOwnProperty(g(s[2])))i=i.prev;else break}for(;i&&i.prev&&!i.startOfLine;)i=i.prev;return i?i.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:`<!--`,blockCommentEnd:`-->`,configuration:o.htmlMode?`html`:`xml`,helperType:o.htmlMode?`html`:`xml`,skipAttribute:function(e){e.state==D&&(e.state=T)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:e.type==`closeTag`}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}}),e.defineMIME(`text/xml`,`xml`),e.defineMIME(`application/xml`,`xml`),e.mimeModes.hasOwnProperty(`text/html`)||e.defineMIME(`text/html`,{name:`xml`,htmlMode:!0})})})),f0=o(((e,t)=>{(function(n){typeof e==`object`&&typeof t==`object`?n(sz()):typeof define==`function`&&define.amd?define([`../../lib/codemirror`],n):n(CodeMirror)})(function(e){e.defineMode(`diff`,function(){var e={"+":`positive`,"-":`negative`,"@":`meta`};return{token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||n===0)return t.skipToEnd(),(`error `+(e[t.string.charAt(0)]||``)).replace(/ $/,``);var r=e[t.peek()]||t.skipToEnd();return n===-1?t.skipToEnd():t.pos=n,r}}}),e.defineMIME(`text/x-diff`,`diff`)})})),p0=l(l0(),1);u0(),d0(),f0();var m0='let name = "world";\n\nconsole.log(`Hello, ${name}!`);',h0=Function(`return num => num + 5`)(),g0=Function(`return () => alert("Hello world!")`)(),_0=`/src/views/text/source.js`,v0=`diff --git a${_0} b${_0}
|
|
395
|
+
index 302b02e..62ea1be 100644
|
|
396
|
+
--- a${_0}
|
|
397
|
+
+++ b${_0}
|
|
398
|
+
@@ -18,7 +18,8 @@ CodeMirror.modeToMime = {
|
|
399
|
+
html: 'text/html',
|
|
400
|
+
css: 'text/css',
|
|
401
|
+
scss: 'text/x-scss',
|
|
402
|
+
- less: 'text/x-less'
|
|
403
|
+
+ less: 'text/x-less',
|
|
404
|
+
+ diff: 'text/x-diff'
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
function codeMirrorHighlight(modespec, host) {`;function y0(){let e=new Set,t=new Map,n=e=>{let n=cz.default.resolveMode(e);return[...t.keys()].find(e=>hX(e,n))||(t.set(n,{name:new Set,mime:new Set}),n)};for(let[r,i]of Object.entries(cz.default.modeToMime)){let a=t.get(n(i));a.mime.add(i),a.name.add(r),e.add(r)}for(let[r,i]of Object.entries(cz.default.mimeModes)){let a=t.get(n(r));a.mime.add(r),typeof i==`string`&&(a.name.add(i),e.add(i))}for(let[n]of Object.entries(cz.default.modes))if(!e.has(n)){let e=cz.default.modes[n];t.has(e)||t.set(e,{name:new Set,mime:[]}),t.get(e).name.add(n)}return[...t.values()].map(e=>({name:[...e.name],mime:[...e.mime]}))}var b0={demo:{view:`source`,syntax:`js`,source:m0},examples:[{title:`Supported syntaxes`,beforeDemo:['md:"Following values (for both `name` and `mime`) are supported for `syntax` option:"',`html:"<br>"`,{view:`table`,data:y0,cols:{name:{content:`comma-list:name`},mime:{content:`comma-list:mime`}}},`html:"<br>"`,`md:"More syntaxes may be added via \`import 'codemirror/mode/[name]/[name]';\`"`],source:!1},{title:`Diff syntax example`,demo:{view:`source`,syntax:`diff`,source:v0}},{title:`Max content size for syntax highlight`,highlightProps:[`maxSourceSizeToHighlight`],beforeDemo:['md:"By default a syntax highlighing is not appling to a source longer than 250Kb. Option `maxSourceSizeToHighlight` is using to change max size of source to be syntax highlighted."'],demo:{view:`source`,source:m0,syntax:`js`,maxSourceSizeToHighlight:4}},{title:`Custom line numbers`,highlightProps:[`lineNum`],demo:[{view:`source`,source:m0,syntax:`js`,lineNum:h0},{view:`source`,source:m0,syntax:`js`,lineNum:`==> $ + 12345`}]},{title:`Hide line numbers`,highlightProps:[`lineNum`],beforeDemo:['md:"Pass falsy value to `lineNum` option to hide line numbers:"'],demo:{view:`source`,source:m0,syntax:`js`,lineNum:!1}},{title:`Customise copy source button`,beforeDemo:['md:"By default, the `source` view includes a \\"copy to clipboard\\" button. To customize its behavior use the `actionCopySource` option, which accepts the following values:\\n- `true` (default) – displays a button that copies the entire source to the clipboard;\\n- A function `({ source, syntax, lineNum, refs, ... }) => string` – displays a button that calls the provided function on click to determine the text to copy;\\n- Anything else – hides the copy button, i.e. the button is not rendered."'],highlightProps:[`actionCopySource`],demo:[{view:`source`,actionCopySource:`==> source[0:10]`,source:`// In this example, the copy button copies only the first 10 characters of the source`},{view:`source`,actionCopySource:!1,source:`// This example demonstrates how to disable the default copy button`}]},{title:`Additional action buttons`,highlightProps:[`actionButtons`],demo:{view:`source`,actionButtons:[{view:`button`,content:`text:"Say \\"Hello world\\""`,onClick:g0}],source:m0,syntax:`js`}},{title:`Prelude and postlude slots`,highlightProps:[`prelude`,`postlude`],demo:{view:`source`,prelude:[`text:"Prelude:"`,`struct:{ data: $, context: # }`],postlude:[`text:"Postlude:"`,`struct:{ data: $, context: # }`],source:m0,syntax:`js`}},{title:`Highlight ranges`,highlightProps:[`ranges`],beforeDemo:{view:`md`,source:["The `ranges` option (formerly `refs`) allows highlighting specific parts of the source text or turning them into links. The `ranges` value must be an array of objects with the following fields:",`
|
|
408
|
+
`,"- `range` (required) - an array of two numbers representing the start and end offsets of the span","- `className` - class name(s) for the wrapping element. This can be a string (a space-separated list of class names) or an array of strings. Predefined class names include `def`, `ref`, `global-ref`, and `error`, each specifying a particular style for the span.","- `href` - when specified, the range becomes a link (`<a>`), otherwise, the range is a regular span (`<span>`)","- `tooltip` - config for a [tooltip](#views-showcase&!anchor=tooltips), similar to tooltips in other views","- `marker` - a value added to the wrapping element as a `data-marker` attribute"]},demo:{view:`source`,source:`let span = "def + ref + global-ref + error";
|
|
409
|
+
let link = "def + ref + global-ref + error";
|
|
410
|
+
|
|
411
|
+
// span with tooltip`,syntax:`js`,ranges:[{range:[4,8]},{range:[12,15],className:`def`},{range:[18,21],className:`ref`},{range:[24,34],className:`global-ref`},{range:[37,42],className:`error`},{range:[49,53],href:`#`},{range:[57,60],href:`#`,className:`def`},{range:[63,66],href:`#`,className:`ref`},{range:[69,79],href:`#`,className:`global-ref`},{range:[82,87],href:`#`,className:`error`},{range:[104,111],href:`#example`,tooltip:{position:`trigger`,content:"text:`Link to ${href}`"}}]}},{title:`Marks`,highlightProps:[`marks`],beforeDemo:{view:`md`,source:["The `marks` option allows injecting visual or text marks at specific points in the source text. The `marks` value must be an array of objects with the following fields:",`
|
|
412
|
+
`,"- `offset` (required) - the offset in the source where the mark is injected.","- `kind` - the type of mark, which can be one of the following: `span` (default), `dot`, `self` (self value), `nested` (nested value), `total` (total value), or `none`","- `className` - class name(s) for the wrapping element. This can be a string (a space-separated list of class names) or an array of strings. Predefined class names include `def`, `ref`, `global-ref`, `error`, and `inactive`, each specifying a particular style for the mark.","- `href` - when specified, the mark becomes a link (`<a>`), otherwise, it is a regular span (`<span>`)","- `content` - view config for content (e.g., `'text:\"hello\"'` or `{ view: 'name', ... }`). If not specified, `kind` is ignored and defaults to `dot` (since content is optional for marks of type `dot`)","- `prefix` (ignored when `kind` is `dot`) - text to display before the content of mark, styled with a dimmed color ","- `postfix` (ignored when `kind` is `dot`) - text to display after the content of mark, styled with a dimmed color","- `tooltip` - config for a [tooltip](#views-showcase&!anchor=tooltips), similar to tooltips in other views","- `marker` - a value added to the wrapping element as a `data-marker` attribute"]},demo:{view:`source`,source:`let span = "def + ref + global-ref + error";
|
|
413
|
+
let link = "def + ref + global-ref + error";
|
|
414
|
+
|
|
415
|
+
// kinds: self nested total none
|
|
416
|
+
// kind="dot": default def ref global-ref error inactive
|
|
417
|
+
// kind="dot" with tooltip:
|
|
418
|
+
// kind="dot" with href:
|
|
419
|
+
// mark with tooltip`,syntax:`js`,marks:[{offset:4},{offset:4,kind:`dot`,content:`text:"dot with text"`},{offset:4,content:`text:"mark"`},{offset:12,className:`def`,content:`text:"def"`},{offset:18,className:`ref`,content:`text:"ref"`},{offset:24,className:`global-ref`,content:`text:"global-ref"`},{offset:37,className:`error`,content:`text:"error"`},{offset:49,href:`#`},{offset:49,href:`#`,kind:`dot`,content:`text:"dot with text"`},{offset:49,href:`#`,content:`text:"link"`},{offset:57,href:`#`,className:`def`,content:`text:"def"`},{offset:63,href:`#`,className:`ref`,content:`text:"ref"`},{offset:69,href:`#`,className:`global-ref`,content:`text:"global-def"`},{offset:82,href:`#`,className:`error`,content:`text:"error"`},{offset:101,kind:`self`,content:`text:"123"`,href:`#`,postfix:`ms`},{offset:106,kind:`nested`,content:`text:"123"`,postfix:`ms`},{offset:113,kind:`total`,content:`text:"123"`,postfix:`ms`},{offset:119,kind:`none`,content:`text:"none"`},{offset:123,kind:`none`,content:`text:"⚠️"`},{offset:123,kind:`none`,content:`text:"none"`,prefix:`prefix`,postfix:` postfix`,href:`#test`},{offset:139,kind:`dot`},{offset:147,kind:`dot`,className:`def`},{offset:151,kind:`dot`,className:`ref`},{offset:155,kind:`dot`,className:`global-ref`},{offset:166,kind:`dot`,className:`error`},{offset:172,kind:`dot`,className:`inactive`},...[``,`def`,`ref`,`global-ref`,`error`,`inactive`].map(e=>({offset:209,kind:`dot`,className:e,tooltip:`text:`+JSON.stringify(e||`default`)})),...[``,`def`,`ref`,`global-ref`,`error`,`inactive`].map(e=>({offset:235,kind:`dot`,className:e,href:`#`+(e||`default`)})),{offset:256,href:`#example`,content:`text:"show tooltip"`,tooltip:{position:`trigger`,content:"text:`Link to ${href}`"}}]}}]};cz.default.modeToMime={js:`application/javascript`,ts:`application/typescript`,typescript:`application/typescript`,json:`application/json`,html:`text/html`,css:`text/css`,scss:`text/x-scss`,less:`text/x-less`};function x0(e,t){let n=cz.default.getMode(cz.default.defaults,{name:cz.default.modeToMime[e]||e,isDiscoveryViewDefined:e=>t.view.isDefined(e)||t.textView.isDefined(e)});return(e,t)=>{let r=cz.default.startState(n),i=e.split(/(\n|\r\n?)/),a=0;for(let e=0;e<i.length;e++){if(e%2==0){let o=new cz.default.StringStream(i[e],4,{lookAhead:t=>i[e+t],baseToken:function(){}});for(;!o.eol();){let e=n.token(o,r);e&&t(a+o.start,a+o.pos,e),o.start=o.pos}}a+=i[e].length}}}function S0(e,t){let n=e&&e.className,r=Array.isArray(n)?n.join(` `):typeof n==`string`&&n,i=t&&r?[t,r].join(` `):t||r||``;return i?` class="${i}"`:``}function C0(e,t=`spotlight`){return`${S0(e,t)}${e.marker?` data-marker="${e.marker}"`:``}${typeof e.tooltipId==`number`?` data-tooltip-id="${e.tooltipId}"`:``}`}function w0(e,t=`mark`){let n=e.prefix??([`self`,`nested`,`total`].includes(e.kind)?e.kind[0].toUpperCase():void 0),r=e.postfix??void 0;return C0(e,t)+` data-render-id=${e.renderId}${e.kind?` data-kind="${e.kind}"`:``}${n===void 0?``:` data-prefix="${tz(String(n))}"`}${r===void 0?``:` data-postfix="${tz(String(r))}"`}`}var T0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${C0(e,`spotlight`)}>`;case`span`:case`spotlight`:return`<span${C0(e,`spotlight`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:case`spotlight`:return`</span>`}}}},E0={html:{open({data:e}){switch(e.type){case`link`:return`<a href=${JSON.stringify(e.href)}${w0(e,`mark`)}>`;case`span`:return`<span${w0(e,`mark`)}>`}},close({data:e}){switch(e.type){case`link`:return`</a>`;case`span`:return`</span>`}}}},D0=`is not array? | {
|
|
420
|
+
source: #.props has no 'source' ? is string ?: content is string ? content : source,
|
|
421
|
+
syntax,
|
|
422
|
+
lineNum is function ?: is not undefined ? bool() : true,
|
|
423
|
+
ranges: #.props.refs or refs | is array ?: undefined,
|
|
424
|
+
marks is array ?: null,
|
|
425
|
+
maxSourceSizeToHighlight is number ?: 250 * 1024, // 250Kb
|
|
426
|
+
actionButtons: undefined,
|
|
427
|
+
actionCopySource is undefined ? true,
|
|
428
|
+
prelude: undefined,
|
|
429
|
+
postlude: undefined
|
|
430
|
+
} | overrideProps()`;function O0(e){e.view.define(`source`,async function(t,n,r,i){let a=t.appendChild($(`div`,`view-source__prelude`)),o=t.appendChild($(`div`,`view-source__content`)),s=t.appendChild($(`div`,`view-source__postlude`)),c=new Map,l=new Map,u=[],d=[],{source:f,syntax:p,lineNum:m=!0,ranges:h,marks:g,maxSourceSizeToHighlight:_,actionButtons:v,actionCopySource:y,prelude:b,postlude:x}=n,S=typeof r==`string`?{source:r}:r,C={...i,sourceViewProps:{source:f,syntax:p,lineNum:m,ranges:h,marks:g,maxSourceSizeToHighlight:_}};if(typeof f!=`string`)return;f.length<_&&d.push([x0(p,e),{html:{open({data:e}){return`<span class="token `+e+`">`},close(){return`</span>`}}}]),Array.isArray(h)&&d.push([(t,r)=>h.forEach(t=>{if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.ranges, must be an object`,{props:n,entry:t});return}let i=t.type?t.type===`spotlight`?`span`:t.type:t.href?`link`:`span`,a=t.range,o;if(![`link`,`span`].includes(i)){e.logger.warn(`Bad type "${i}" of an entry in "source" view props.ranges`,{props:n,ref:t});return}if(!a){e.logger.warn(`Missed range for an entry in "source" view props.ranges`,{props:n,entry:t});return}t.tooltip&&c.set(o=c.size,t),r(t.range[0],t.range[1],{...t,type:i,tooltipId:o})}),T0]),Array.isArray(g)&&d.push([(t,r)=>g.forEach(t=>{if(!t||typeof t!=`object`){e.logger.warn(`Bad value for an entry in "source" view props.mark, must be an object`,{props:n,mark:t});return}let i=t.content?!t.kind||[`dot`,`self`,`nested`,`total`,`none`].includes(t.kind)?t.kind||`span`:void 0:`dot`,a=typeof t.offset==`number`&&isFinite(t.offset)?Math.max(0,Math.round(t.offset)):void 0,o;if(typeof i!=`string`){e.logger.warn(`Bad "kind" value for an entry in "source" view props.marks`,{props:n,mark:t});return}if(typeof a!=`number`){e.logger.warn(`Bad "offset" value for an entry in "source" view props.marks`,{props:n,mark:t});return}t.tooltip&&c.set(o=c.size,t);let s={...t,type:typeof t.href==`string`?`link`:`span`,kind:i,renderId:l.size,tooltipId:o};l.set(s.renderId,s),r(a,a,s)}),E0]);let w=typeof m==`function`?m:e=>e+1;if(o.innerHTML=(m?`<div class="view-source__lines">`+f.split(/\r\n?|\n/g).map((e,t)=>`<span>`+w(t)+`</span>`).join(``)+`</div>`:``)+`<div class="view-source__source">${(0,p0.default)(d,`html`)(f)}</div>`,l.size)for(let e of o.querySelectorAll(`.mark[data-render-id]`)){let t=l.get(Number(e.dataset.renderId));t.content&&u.push(this.render(e,t.content,t,C))}let T=$(`div`,`view-source__action-buttons`),E=y===!0?({source:e})=>e:typeof y==`function`?y:null,D=typeof E==`function`?{view:`button`,className:`copy`,content:[],async onClick(e){clearTimeout(e.copiedTimer),await $Q(String(E(C.sourceViewProps))),e.classList.add(`copied`),e.copiedTimer=setTimeout(()=>e.classList.remove(`copied`),1250)}}:null;o.prepend(T),await e.view.render(T,[v,D],S,C);for(let e of o.querySelectorAll(`:scope [data-tooltip-id]`)){let t=c.get(Number(e.dataset.tooltipId));delete e.dataset.tooltipId,this.tooltip(e,t.tooltip,t,i)}b&&await e.view.render(a,b,S,C),x&&await e.view.render(s,x,S,C),u.length&&await Promise.all(u)},{props:D0,usage:b0,tag:`pre`})}var k0={demo:{view:`text`,data:`"Hello world!"`},examples:[{title:`Shorthand usage`,view:`text:"Hello world!"`}]},A0=`{
|
|
431
|
+
text: #.props has no 'text'?
|
|
432
|
+
} | overrideProps()`;function j0(e){e.view.define(`text`,function(e,{text:t}){e.appendChild(document.createTextNode(String(t)))},{tag:!1,props:A0,usage:k0})}var M0=[`char`,`word`,`wordws`,`sentence`,`line`],N0=[`both`,`added`,`removed`],P0=`The sun is shining brightly. Birds are singing in the trees.`,F0=`The quick brown fox jumps over the lazy dog. It lands softly and runs away.
|
|
433
|
+
`+P0,I0=`A quick brown fox jumped over a lazy dog. It landed softly, then ran away.
|
|
434
|
+
`+P0,L0={demo:{view:`text-diff`,before:`Hello world!`,after:`Hello Discovery.js!`},examples:[{title:`Types`,demoData:M0.map(e=>({type:e,before:F0,after:I0})),demo:{view:`table`,cols:[{header:`Type`,content:[`text:type`,{view:`text`,when:`type="wordws"`,text:` (default)`}]},{header:`Preview`,content:`text-diff{ type }`}]}},{title:`Delta kinds`,demoData:N0.map(e=>({delta:e,before:F0,after:I0})),demo:{view:`table`,cols:[{header:`Type`,content:[`text:delta`,{view:`text`,when:`delta="both"`,text:` (default)`}]},{header:`Preview`,content:`text-diff{ delta }`}]}}]},R0=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},z0=new class extends R0{};function B0(e,t,n){return z0.diff(e,t,n)}function V0(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function H0(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function U0(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function W0(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function G0(e,t){return U0(e,t,``)}function K0(e,t){return W0(e,t,``)}function q0(e,t){return t.slice(0,J0(e,t))}function J0(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Y0(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function X0(e,t){if(t)return Q0(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Z0(e,t){if(t)return Q0(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Q0(e,t){if(!t)return[Z0(e),X0(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Y0(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var $0=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,e2=RegExp(`[${$0}]+|\\s+|[^${$0}]`,`ug`),t2=new class extends R0{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Y0(e,r)}else n=e.match(e2)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&r2(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&r2(n,i,r,null,t.intlSegmenter),e}};function n2(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?a2(e,t,n):t2.diff(e,t,n)}function r2(e,t,n,r,i){if(t&&n){let[a,o]=Q0(t.value,i),[s,c]=Q0(n.value,i);if(e){let r=V0(a,s);e.value=W0(e.value,s,r),t.value=G0(t.value,r),n.value=G0(n.value,r)}if(r){let e=H0(o,c);r.value=U0(r.value,c,e),t.value=K0(t.value,e),n.value=K0(n.value,e)}}else if(n){if(e){let e=Z0(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Z0(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Z0(r.value,i),[a,o]=Q0(t.value,i),s=V0(n,a);t.value=G0(t.value,s);let c=H0(G0(n,s),o);t.value=K0(t.value,c),r.value=U0(r.value,n,c),e.value=W0(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Z0(r.value,i),n=q0(X0(t.value,i),e);t.value=K0(t.value,n)}else if(e){let n=q0(X0(e.value,i),Z0(t.value,i));t.value=G0(t.value,n)}}var i2=new class extends R0{tokenize(e){let t=RegExp(`(\\r?\\n)|[${$0}]+|[^\\S\\n\\r]+|[^${$0}]`,`ug`);return e.match(t)||[]}};function a2(e,t,n){return i2.diff(e,t,n)}var o2=new class extends R0{constructor(){super(...arguments),this.tokenize=c2}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
435
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
436
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
437
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
438
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function s2(e,t,n){return o2.diff(e,t,n)}function c2(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
439
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function l2(e){return e==`.`||e==`!`||e==`?`}var u2=new class extends R0{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(l2(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}};function d2(e,t,n){return u2.diff(e,t,n)}new class extends R0{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends R0{constructor(){super(...arguments),this.tokenize=c2}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(f2(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function f2(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=f2(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=f2(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends R0{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var p2={char:B0,word:n2,wordws:a2,sentence:d2,line:s2},m2=`is not array? | {
|
|
440
|
+
before,
|
|
441
|
+
after,
|
|
442
|
+
delta: undefined,
|
|
443
|
+
type: undefined
|
|
444
|
+
} | overrideProps() | {
|
|
445
|
+
before is string ?: '',
|
|
446
|
+
after is string ?: '',
|
|
447
|
+
delta | $ in ['added', 'removed', 'both'] ?: 'both',
|
|
448
|
+
type | $ in ${JSON.stringify(Object.keys(p2))} ?: 'wordws'
|
|
449
|
+
}`;function h2(e){e.view.define(`text-diff`,function(e,t){let{type:n,before:r,after:i,delta:a}=t,o=p2[n](r,i),s=a===`both`||a===`added`,c=a===`both`||a===`removed`;for(let{added:t,removed:n,value:r}of o){let i=e;if(t||n){if(t?!s:!c)continue;i=e.appendChild($(`span`,t?`added`:`removed`))}i.append(r)}},{props:m2,usage:L0})}var g2={demo:{view:`text-match`,data:{text:`I am matched text or a text with matches!`,match:/match/}},examples:[{title:`Raw string as match`,demo:{view:`text-match`,data:{text:`I am matched text or a text with matches!`,match:`match`}}},{title:`Using with a link`,demo:{view:`link`,data:{href:`#`},content:`text-match:{ text: "Test link", match: /\\w+/i }`}},{title:`Various configurations`,demo:{view:`table`,cols:[{header:`text-match`,content:`text-match`},{header:`Config`,content:`struct`}],data:[null,{},{},{match:`test`},{match:`Test`},{match:`test`,ignoreCase:!0},{match:`Test`,ignoreCase:!0},{match:/test/},{match:/test/g},{match:/test/i},{match:/test/,ignoreCase:!0},{match:/test/g,ignoreCase:!0}].map((e,t)=>t>1?{text:`test Test`,...e}:e)}}]},_2=$(`span`,`view-text-match`),v2=`is not array? | {
|
|
450
|
+
text: #.props has no 'text' ? text,
|
|
451
|
+
match,
|
|
452
|
+
ignoreCase: ignoreCase or false
|
|
453
|
+
} | overrideProps()`;function y2(e){e.view.define(`text-match`,function(e,t){let{text:n,match:r,ignoreCase:i}=t;ZQ(String(n),r,t=>e.append(t),t=>e.appendChild(_2.cloneNode()).append(t),i)},{tag:!1,props:v2,usage:g2})}var b2={demo:{view:`text-numeric`,data:'"Like a `text` view but adds a thousands separator to integer part of numbers, e.g. 12345678 or 12345.67890"'},examples:[{title:`Shorthand usage`,view:`text-numeric:1234567`}]},x2=`{
|
|
454
|
+
text: #.props has no 'text'?
|
|
455
|
+
} | overrideProps()`;function S2(e){e.view.define(`text-numeric`,function(e,{text:t}){e.innerHTML=nz(t)},{tag:`span`,props:x2,usage:b2})}var C2={beforeDemo:['md:"A non-visual view used to group views, manage their visibility, or explicitly define data and context for nested views. In the example, the `context` view sets up specific data and context, allowing nested views (`content`) to utilize these shared definitions directly:"'],demo:{view:`context`,data:{name:`World`,age:`1000 years`},context:`{ ...#, greeting: "Hello" }`,content:["text:`${#.greeting}, ${name}!`",`table`]},examples:[{title:`Using with modifiers`,demo:{view:`context`,modifiers:[`h2:"Modifiers"`,{view:`input`,name:`inputValue`},{view:`select`,name:`selectValue`,data:[`foo`,`bar`,`baz`]}],content:[`h2:"Values"`,`struct{ expanded: 1, data: # }`]}}]},w2=`#.props | {
|
|
456
|
+
modifiers is array ?: is truthy ? [$] : [],
|
|
457
|
+
content,
|
|
458
|
+
proxy.bool(),
|
|
459
|
+
onInit,
|
|
460
|
+
onChange
|
|
461
|
+
}`;function T2(e){e.view.define(`context`,async function(t,n,r,i){let{modifiers:a=[],content:o=[],proxy:s,onInit:c,onChange:l}=n,u=i,d=null,f=!1;await this.render(t,this.composeConfig(a,{onInit:g,onChange:g}),r,i);let p=t.appendChild(document.createComment(`{ view: "context" } content start`)),m=t.appendChild(document.createComment(`{ view: "context" } content end`));s&&(c||l)&&(o=this.composeConfig(o,{onInit:c,onChange:l})),f=!0,await h();async function h(){let t=m.previousSibling;for(;t&&t!==p;)t=t.previousSibling,t.nextSibling.remove();let n=d=document.createDocumentFragment();await e.view.render(n,o,r,u),n===d&&(e.view.adoptFragment(n,p),p.after(n),d=null)}function g(e,t){t&&(!YR(u,t)||u[t]!==e)&&(u={...u,[t]:e},f?(h(),s&&typeof l==`function`&&l(e,t)):typeof c==`function`&&c(e,t))}},{tag:!1,props:w2,usage:C2})}var E2={beforeDemo:['md:"A non-visual view that conditionally renders a single matching section from the provided content. It sequentially evaluates each item\'s `when` expression and renders the content of the first truthy condition. If an item has no `when` property, its condition defaults to truthy, enabling unconditional rendering, often used as a fallback or default content."'],demo:{view:`switch`,content:[{when:`expr`,content:'text:"Renders when `expr` is truthy"'},{content:'text:"Renders when all other `when` conditions are falsy"'}]},examples:[{title:`Using with context and a modifier`,demo:{view:`context`,modifiers:{view:`tabs`,tabs:[`foo`,`bar`,`baz`],name:`section`},content:{view:`switch`,content:[{when:`#.section="foo"`,content:'text:"Content for `foo`"'},{when:`#.section="bar"`,content:'text:"Content for `bar`"'},{content:'text:"No content is found for `" + #.section + "`"'}]}}}]};function D2(e){e.view.define(`switch`,function(t,n,r,i){let{content:a}=n,o=`alert-warning:"No case choosen"`;if(Array.isArray(a))for(let t=0;t<a.length;t++){let n=a[t];if(n&&e.queryBool(n.when||!0,r,i)){o=`data`in n?{view:`context`,data:n.data,content:n.content}:n.content;break}}return e.view.render(t,o,r,i)},{tag:!1,usage:E2})}var O2={beforeDemo:['md:"The `text-render` view renders data as text using the `Model#textView` API. For a full list of available text views, refer to the [`text`](#views-showcase&render=text) section."'],demo:{view:`text-render`,content:[`text:"hello!"`,{view:`ul`,data:[1,2,3,4],item:`text:"item #" + $`},{view:`table`,data:[{name:`foo`,size:1e3},{name:`bar`,size:123},{name:`baz`,size:34555}]}]}};function k2(e){e.view.define(`text-render`,async function(t,n,r,i){let{content:a}=n,o=await e.textView.render(`block`,a,r,i);t.append(e.textView.serialize(o).text)},{tag:`pre`,usage:O2}),e.view.define(`text-render-tree`,async function(t,n,r,i){let{content:a,expanded:o=2}=n,s=await e.textView.render(`block`,a,r,i);return this.render(t,{view:`struct`,expanded:o},e.textView.cleanUpRenderTree(s))},{tag:!1})}function A2(e,t,n){for(let r in e){if(!YR(e,r))continue;let i;n.dictMode?(i=n.dictMode,i.count++,i.keys.add(r)):n.properties.has(r)?(i=n.properties.get(r),i.count++):(i={count:1,map:Object.create(null)},n.properties.set(r,i)),j2(e[r],t-1,i.map)}}function j2(e,t,n=Object.create(null)){let r=e===null?`null`:ZJ(e)?`array`:QJ(e)?`set`:typeof e;switch(r){default:r in n||(n[r]=new Map),n[r].set(e,(n[r].get(e)||0)+1);break;case`object`:`object`in n||(n.object=new Map,n.object.count=0,n.object.properties=t?new Map:null,n.object.dictMode=null,n.object.sortKeys=!1),n.object.count++,n.object.has(e)?n.object.set(e,n.object.get(e)+1):(n.object.set(e,1),t&&A2(e,t,n.object));break;case`array`:`array`in n||(n.array=new Map,n.array.count=0,n.array.map=Object.create(null)),n.array.count++,n.array.set(e,(n.array.get(e)||0)+1);for(let r=0;r<e.length;r++)j2(e[r],t,n.array.map);break;case`set`:`set`in n||(n.set=new Map,n.set.count++,n.set.map=Object.create(null)),n.set.count++,n.set.set(e,(n.set.get(e)||0)+1);for(let r of e)j2(r,t,n.set.map)}return n}var M2=[`rgba(83,211,75,0.75)`,`rgba(241,235,44,0.75)`,`rgba(244,152,99,0.75)`,`rgba(148,99,244,0.75)`,`rgba(44,132,241,0.75)`,`rgba(233,117,117,0.75)`,`rgba(85,187,155,0.75)`,`rgba(151,147,99,0.75)`,`rgba(216,107,196,0.75)`,`rgba(108,204,227,0.75)`,`rgba(164,164,164,0.75)`],N2=[`null`,`undefined`,`string`,`number`,`bigint`,`boolean`,`symbol`,`function`,`array`,`set`,`object`];function P2(e,t,n,r,i=[],a=``,o=null){Object.keys(t).sort((e,t)=>N2.indexOf(e)-N2.indexOf(t)).forEach((s,c,l)=>{switch(c>0&&e.append(` | `),s){default:{let a=e.appendChild($(`span`,`type`,s));n.set(a,{type:`type`,context:r,path:i,stat:t,name:s});break}case`object`:{let c=t[s],{properties:u,dictMode:d,sortKeys:f}=c;if(u===null){n.set(e.appendChild($(`span`,`expand`,`{…}`)),{type:`expand`,context:r,path:i,stat:t,map:t[s],offset:a});break}if(u.size===0){e.appendChild($(`span`,`object`,`{}`));break}let p=c.size,m=d?[[`[key]`,d]]:[...u.entries()],h=a+` `,g=e.appendChild($(`span`,`object`,[`{`,$(`span`,{"data-action":`collapse`})])),_=$(`div`,{class:`object-entries`,style:`--object-entries-offset: ${a.length}`});u.size>1&&(g.appendChild($(`span`,{title:`Toggle dictionary mode (collapse all the values in a single signature)`,"data-action":`dict-mode`,"data-enabled":d!==null})),m.some(([e],t)=>t!==0&&e<m[t-1][0])&&g.appendChild($(`span`,{title:`Toggle keys sorting`,"data-action":`sort-keys`,"data-enabled":f})),f&&m.sort(([e],[t])=>e<t?-1:+(e>t))),n.set(g,{type:`shape`,context:r,path:i,map:t[s],offset:a}),(p>1||l.length>1||o!==null&&Object.keys(o).length>1)&&(g.appendChild($(`span`,`count`)).dataset.value=String(p));for(let[e,{count:a,map:o}]of m){let s=$(`span`,`property`,[e]);n.set(s,{type:`property`,context:r,path:i,stat:t,name:e,map:o}),_.append(h),_.append(s),a!==p&&d===null&&s.append($(`span`,`optional`,`?`)),_.append(`: `),P2(_,o,n,r,i.concat(d?`*`:e),h),_.append(`;
|
|
462
|
+
`)}g.append(_),g.append(a,`}`);break}case`array`:e.append(`[`),P2(e,t[s].map,n,r,i,a),e.append(`]`);break;case`set`:e.append(`Set(`),P2(e,t[s].map,n,r,i,a),e.append(`)`)}})}function F2(e,t){return e.toFixed(t).replace(/\.?0+$/,``)}function I2(e){return[Math.cos(2*Math.PI*e),Math.sin(2*Math.PI*e)]}function L2(e){let t=0;return[`<svg viewBox="-1 -1 2 2" class="pie">`,...e.map(e=>{let[n,r]=I2(t),[i,a]=I2(t+=e.percent),o=+(e.percent>.5);return`<path d="${[`M ${n} ${r}`,`A 1 1 0 ${o} 1 ${i} ${a}`,`L 0 0`].join(` `)}" fill="${e.color}" stroke="black" stroke-width=".0025"/>`}),`</svg>`].join(`
|
|
463
|
+
`)}function R2(e){let t=0;for(let n in e)e[n].forEach(e=>t+=e);return t}function z2(e){let t=Object.create(null);for(let n in e)t[n]=0,e[n].forEach(e=>t[n]+=e);return t}function B2(e,t,n){let{context:r,path:i,stat:a,name:o}=t,s=a.object,{map:c,count:l}=s.dictMode||s.properties.get(o),u=s.dictMode?s.dictMode.count:s.size,d={name:o,path:n.pathToQuery(i),total:u,count:l,percent:F2(100*l/u,1)+`%`};n.view.render(e,[{view:`block`,when:`path`,className:`path`,content:`text:path`},{view:`h1`,className:`property`,content:[`text:name`,{view:`html`,when:`count != total`,data:`"<span class=\\"usage-stat optional\\">" + (
|
|
464
|
+
"(in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> objects, <span class=\\"num\\">" + percent + "</span>)"
|
|
465
|
+
) + "</span>"`}]}],d,r),V2(e,{context:r,map:c,count:l},n)}function V2(e,{context:t,map:n,count:r},i){let a=z2(n),o=[],s=N2.filter(e=>e in n);Object.entries(a).sort(([,e],[,t])=>t-e).forEach(([e,t],n)=>{o.push({name:tz(e),count:t,percent:t/r,percent100:F2(100*t/r,1),color:M2[n]})}),i.view.render(e,{view:`block`,when:`typeStat.size() > 1`,data:`typeStat`,className:`pie-stat`,content:[{view:`block`,content:{view:`html`,data:L2}},{view:`block`,content:[`html:"<span class=\\"list-header\\">Types usage:</span>"`,{view:`list`,item:`html:
|
|
466
|
+
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
|
467
|
+
"<span class=\\"caption\\">" + name + "</span>" +
|
|
468
|
+
"<span class=\\"times\\"> × " + count + " (" + percent100 + "%)</span>"
|
|
469
|
+
`}]}]},o,t),s.forEach(r=>H2(e,{context:t,name:r,stat:n},i))}function H2(e,t,n){let r=t.context,i=t.stat[t.name],a=R2(t.stat),o=[],s=[],c;switch(t.name){case`number`:{let e=[],n=0,r=0,a=0,s=1/0,l=-1/0;i.forEach((t,i)=>{e.push({count:t,value:i}),n+=i*t,r+=t,t>1&&a++,i<s&&(s=i),i>l&&(l=i)}),c={type:t.name,count:r,distinct:i.size,duplicated:a,min:s,max:l,sum:n,avg:F2(n/r,3),values:e.sort((e,t)=>t.count-e.count||e.value-t.value)},c.distinct>1&&o.push({view:`block`,className:`overview-stat`,content:`html:
|
|
470
|
+
"range: (min) <span class=\\"num\\">" + min + "</span> ... " +
|
|
471
|
+
"<span class=\\"num\\">" + max + "</span> (max), " +
|
|
472
|
+
"avg: <span class=\\"num\\">" + avg + "</span>"
|
|
473
|
+
`});break}default:{let e=[],n=0,r=0;i.forEach((t,i)=>{e.push({count:t,value:i}),n+=t,t>1&&r++}),c={type:t.name,count:n,distinct:i.size,duplicated:r,values:t.name===`object`||t.name===`array`||t.name===`set`?e.sort((e,t)=>t.count-e.count):e.sort((e,t)=>t.count-e.count||e.value>t.value||-(e.value<t.value))};break}}if(t.name!==`undefined`&&t.name!==`null`){if(o.unshift({view:`block`,className:`overview-stat`,content:[`html:"<span class=\\"num\\">" + count + "</span> " + (count > 1 ? "values, " : "value")`,{view:`switch`,when:`count > 1`,content:[{when:`distinct = 1`,content:`text:"a single unique value:"`},{when:`distinct = count`,content:`text:"all unique, no duplicates"`},{content:[`html:"<span class=\\"num\\">" + distinct + "</span> unique, "`,`html:duplicated = distinct ? "all occur more than once" : "<span class=\\"num\\">" + duplicated + "</span> occur more than once"`]}]}]}),c.values.length>1&&c.duplicated&&t.name!==`object`&&t.name!==`set`&&t.name!==`array`){let e=[],t=c.values.length===10?10:Math.min(9,c.values.length),r=0;for(let n=0;n<t;n++){let{count:t,value:i}=c.values[n];r+=t,e.push({name:tz(String(i)),count:t,percent:t/c.count,percent100:F2(100*t/c.count,1),color:M2[n]})}if(e.length){let t=c.count-r;t>0&&e.push({name:`...`,count:t,percent:t/c.count,percent100:F2(100*t/c.count,1),color:M2[e.length]}),s.push({view:`button`,className:`group`,when:`#.actions | queryAcceptChanges and querySubquery`,onClick(e,t,r){let i=t.path?[...t.path]:[],a=i.pop(),o=n.pathToQuery(i),s=r.rootData;r.actions.queryAcceptChanges(s)&&r.actions.querySubquery(`${o}${o?`.group(`:`group(`}=>${n.pathToQuery([a])}).sort(value.size() desc)`,s)}}),o.push({view:`block`,className:`pie-stat`,data:e,content:[{view:`block`,content:{view:`html`,data:L2}},{view:`block`,content:[`html:"<span class=\\"list-header\\">Dominators:</span>"`,{view:`list`,item:`html:
|
|
474
|
+
"<span class=\\"dot\\" style=\\"--size: 10px; background-color: " + color + "\\"></span> " +
|
|
475
|
+
"<span class=\\"caption\\" title=\\"" + name + "\\">" + name + "</span>" +
|
|
476
|
+
"<span class=\\"times\\"> × " + count + " (" + percent100 + "%)</span>"
|
|
477
|
+
`}]}]})}}c.values.length>1?(t.name===`number`||t.name===`string`)&&o.push({view:`content-filter`,name:`filter`,data:`values.sort(value ascN)`,content:{view:t.name===`string`?`list`:`menu`,className:`struct-list`,data:`.[no #.filter or value~=#.filter]`,emptyText:`Nothing matched`,item:[t.name===`string`?{view:`struct`,data:`value`,match:`=#.filter`}:{view:`block`,className:`caption`,content:`text-match:{ text: value, match: #.filter }`},{view:`block`,when:`count > 1`,className:`count`,content:`text:" × " + count`}]}}):(t.name===`number`||t.name===`string`||t.name===`boolean`)&&o.push({view:`struct`,data:`values[].value`}),t.name===`object`&&o.push({view:`list`,className:`struct-list`,data:`values`,item:[`struct:value`,{view:`block`,when:`count > 1`,className:`count`,content:`text:" × " + count`}]}),(t.name===`array`||t.name===`set`)&&Object.keys(i.map).length&&o.push({view:`block`,className:t.name===`array`?`array-types`:`set-types`,postRender(e){V2(e,{...i,context:r},n)}})}n.view.render(e,[{view:`block`,when:`path`,className:`path`,data:e=>n.pathToQuery(e.path),content:`text`},{view:`block`,className:`signature-action-buttons`,content:s},{view:`h1`,className:`type`,content:[`text:name`,`html:"<span class=\\"usage-stat\\">" + (
|
|
478
|
+
count = total
|
|
479
|
+
? "only this type is used"
|
|
480
|
+
: "used in <span class=\\"num\\">" + count + "</span> of <span class=\\"num\\">" + total + "</span> cases (<span class=\\"num\\">" + percent + "</span>)"
|
|
481
|
+
) + "</span>"`]},...o],{...c,name:t.name,path:t.path,total:a,percent:F2(100*c.count/a,1)+`%`},r)}var U2={beforeDemo:['md:"The `signature` view is used to output a type definition for current data using TypeScript like style:"'],demo:{view:`signature`,expanded:!0}};function W2(e){let t=new WeakMap;e.addHostElEventListener(`click`,({target:e})=>{let n=`expand`,r=e.closest(`
|
|
482
|
+
.view-signature .expand,
|
|
483
|
+
.view-signature [data-action]
|
|
484
|
+
`);if(!r)return;r.dataset.action&&(n=r.dataset.action,r=r.parentNode);let i=t.get(r);if(i){let{context:e,path:a,stat:o,map:s,offset:c}=i,l=document.createDocumentFragment();switch(n){case`sort-keys`:s.sortKeys=!s.sortKeys;break;case`dict-mode`:if(s.dictMode)s.dictMode=null;else{let e=s.dictMode={keys:new Set,count:0,map:Object.create(null)};s.forEach((t,n)=>{for(let t in n)YR(n,t)&&(e.keys.add(t),e.count++,j2(n[t],1,e.map))})}break;default:s.properties===null?(s.properties=new Map,s.forEach((e,t)=>A2(t,1,s))):s.properties=null}P2(l,{object:s},t,e,a,c,o),r.replaceWith(l)}},!1),new e.view.Popup({className:`signature-details`,hoverPin:`trigger-click`,hoverTriggers:`
|
|
485
|
+
.view-signature .property,
|
|
486
|
+
.view-signature .type
|
|
487
|
+
`,render(n,r){let i=t.get(r);switch(i.type){case`property`:return B2(n,i,e);case`type`:return H2(n,i,e)}}}),e.view.define(`signature`,function(e,n,r,i){let{expanded:a,path:o}=n,s=j2(r,a),c=Array.isArray(o)?o:void 0,l=`rootData`in n?n.rootData:!c||c.length===0?r:void 0;P2(e,s,t,{...i,rootData:l},c)},{usage:U2})}var G2=/^(?:https?:)?\/\/(?:[a-z0-9\-]+(?:\.[a-z0-9\-]+)+|\d+(?:\.\d+){3})(?:\:\d+)?(?:\/\S*?)?$/i;function K2(e,t){return`<span class="${e}">${t}</span>`}function q2(e){return K2(`more`,`\u2026 ${nz(e)} more`)}function J2(e){return tz(Y2(e))}function Y2(e){return/[^\x20\x21\x23-\x5B\x5D-\uD799]/.test(e)?JSON.stringify(e).slice(1,-1):e}function X2(e,t,n){switch(typeof e){case`boolean`:case`undefined`:return K2(`keyword`,String(e));case`number`:case`bigint`:return K2(`number`,nz(e));case`symbol`:return K2(`symbol`,String(e));case`function`:return`ƒn`;case`string`:{let r=e.length,i=t?n.maxCompactStringLength:n.maxStringLength,a=r>i+n.allowedExcessStringLength,o=``,s=``,c=``;if(a){if(n.match){let t=[],r=i>30?10:5,a=i-r,l=0,u=-1;if(ZQ(e,n.match,e=>{l+=e.length},(e,n)=>{if(u===-1&&(u=l+a),l<u&&t.push({start:l,end:l+e.length}),l+=e.length,l>u)return n}),t.length>0){let n=t[0].start,a=i;if(n!==0){let t=Y2(e.slice(0,n));if(n>r){let e=r-2;s=K2(`more prefix`,``),o=t.slice(-e),a-=r}else o=t}for(let n=0;n<t.length&&a>0;n++){let{start:r,end:i}=t[n],s=Math.min(i-r,a);if(o+=K2(`match`,J2(e.slice(r,r+s))),a-=s,a>0){let r=n+1>=t.length,s=r?e.length:t[n+1].start,l=Math.min(s-i,a);if(r){let t=e.length-(i+l);t>0&&(c=K2(`more suffix`,nz(t)))}l>0&&(o+=J2(e.slice(i,i+l)),a-=l)}}}}o===``&&(o=J2(e.slice(0,i)),c=K2(`more suffix`,nz(r-i)))}else n.match?ZQ(e,n.match,e=>{o+=J2(e)},e=>{o+=K2(`match`,J2(e))}):o=J2(e);return K2(`string`,!t&&(e[0]===`h`||e[0]===`/`)&&G2.test(e)?`"${s}<a href="${tz(e)}" target="_blank">${o}</a>${c}"`:`"${s}${o}${c}"`)}case`object`:{if(e===null)return K2(`keyword`,`null`);if(ZJ(e)){let t=e.length,r=n.limitCollapsed===!1||n.limitCollapsed>t?t:n.limitCollapsed,i=Array.from({length:r},(t,r)=>X2(e[r],!0,n));return t>r&&i.push(`${q2(t-r)} `),`[${i.join(`, `)}]`}if(iY(e))return`<span class="error-value"><span class="error-value__name">${tz(e.name)}</span>`+(t?``:`<span class="error-value__message">${tz(e.message)}</span>`)+`</span>`;switch(JR(e)){case`[object Set]`:{let t=e.size,r=n.limitCollapsed===!1||n.limitCollapsed>t?t:n.limitCollapsed,i=e.values(),a=Array.from({length:r},()=>X2(i.next().value,!0,n));return t>r&&a.push(`${q2(t-r)} `),`[${a.join(`, `)}]`}case`[object Date]`:return K2(`date`,String(e));case`[object RegExp]`:return K2(`regexp`,String(e))}if(t&&n.limitCompactObjectEntries===0){for(let t in e)if(YR(e,t))return`{…}`;return`{}`}let r=t?n.limitCompactObjectEntries===!1?1/0:n.limitCompactObjectEntries:n.limitCollapsed===!1?1/0:n.limitCollapsed,i=[],a=0;for(let t in e)if(YR(e,t)){if(a<r){let r=tz(t.length>n.maxCompactPropertyLength?t.slice(0,n.maxCompactPropertyLength)+`…`:t);i.push(`${K2(`property`,r)}: ${X2(e[t],!0,n)}`)}a++}return a>r&&i.push(q2(a-r)),i.length?`{ ${i.join(`, `)} }`:`{}`}default:return`unknown type "${typeof e}"`}}var Z2=(e,t,n,r,i,a,o)=>({target:s})=>{let c=`expand`,l=s.closest(`
|
|
488
|
+
.view-struct.struct-expand,
|
|
489
|
+
.view-struct .struct-expand-value,
|
|
490
|
+
.view-struct .struct-action-button
|
|
491
|
+
`);if(l)switch(l.dataset.action&&(c=l.dataset.action),c){case`expand`:l.classList.contains(`struct-expand`)&&(l=l.lastChild),e(l,0),n(),l.parentNode.classList.add(`struct-expanded-value`),i.has(l.parentNode)&&l.parentNode.classList.remove(`struct-expand`);break;case`collapse`:l=l.parentNode,t(l),n(),l.parentNode.classList.remove(`struct-expanded-value`),l.classList.remove(`view-as-table`),i.has(l.parentNode)&&l.parentNode.classList.add(`struct-expand`);break;case`show-signature`:o.show(l);break;case`value-actions`:a.show(l);break;case`toggle-sort-keys`:e(l.parentNode,0,l.parentNode.classList.toggle(`sort-keys`)),n();break;case`toggle-string-mode`:{l=l.parentNode;let e=l.classList.toggle(`string-value-as-text`);for(let t=l.querySelector(`.string-text`).firstChild;t!==null;t=t.nextSibling){let n=t.nodeType===3?t:t.firstChild,r=n.nodeValue;if(e)r.indexOf(`\\`)!==-1&&(n.nodeValue=JSON.parse(`"${r}"`));else{let e=Y2(r);e!==r&&(n.nodeValue=e)}}break}case`toggle-view-as-table`:l=l.parentNode,l.classList.toggle(`view-as-table`)?r(l):l.querySelector(`:scope > .view-table`)?.remove()}};function Q2(e){return e?`, `+nz(e)+` bytes`:``}function $2(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function e4(e,t,n,r){return new e.view.Popup({className:`view-struct-actions-popup`,render(i,a,o){let s=a.parentNode,c=t.get(s),l=[];if(typeof c==`string`)l=[{text:`Copy as quoted string`,action:()=>$Q(JSON.stringify(c))},{text:`Copy as unquoted string`,action:()=>$Q(JSON.stringify(c).slice(1,-1))},{text:`Copy a value (unescaped)`,action:()=>$Q(c)}];else{let t=e.pathToQuery(r(s)),i=1073741824,a=!1,o=!1,u=0,d=0;try{let{bytes:e,spaceBytes:t,circular:n}=vK(c,{space:4});n.length?(a=`Converting circular structure to JSON`,o=`Converting circular structure to JSON`):(u=e-t,d=e+2,u>i&&(o=`Resulting JSON is over 1 Gb`),d>i&&(a=`Resulting JSON is over 1 Gb`))}catch(e){o=a=/Maximum call stack size|too much recursion/i.test(e.message)?`Too much nested structure`:e.message}if(o&&=`Can't be copied: `+o,a&&=`Can't be copied: `+a,t){l.push({text:`Copy path:`,notes:tz(t),action:()=>$Q(t)});let r=$2(n.get(s));e.action.has(`queryAcceptChanges`)&&e.action.call(`queryAcceptChanges`,r)&&(e.action.has(`querySubquery`)&&l.push({groupStart:!0,text:`Create a subquery from the path`,action:()=>e.action.call(`querySubquery`,t,r)}),e.action.has(`queryAppend`)&&l.push({text:`Append path to current query`,action:()=>e.action.call(`queryAppend`,t,r)}))}l.push({groupStart:!0,text:`Copy as JSON`,notes:`(formatted${Q2(d)})`,error:a,disabled:!!a,action:()=>$Q(JSON.stringify(c,null,4))}),l.push({text:`Copy as JSON`,notes:`(compact${Q2(u)})`,error:o,disabled:!!o,action:()=>$Q(JSON.stringify(c))})}e.view.render(i,{view:`menu`,onClick(e){o(),e.action()},itemConfig:{className:`=groupStart ? "group-start" : null`},item:[`html:text`,{view:`block`,when:`notes`,className:`notes`,content:`html:notes`},{view:`block`,when:`error`,className:`error`,content:`text:error`}]},l)}})}var t4=[`none`,`default`,`badge`],n4=new WeakMap;function r4(e,t){return Array.isArray(e)?Array.isArray(t)?e.concat(t):e:t}function i4(e){return Array.isArray(e)&&e.length>0?e.map(e=>typeof e==`string`||typeof e==`function`?{query:e}:e):!1}function a4(e){if(typeof e==`string`&&e.length>64){let t=XY(e);if(t!==null)return{place:`before`,style:`badge`,text:`image`,imageContent:t,tooltip:{className:`view-struct_image-preview-tooltip`,content:"image-preview{ src: #.config.imageContent | `data:image/${type},${content}` }"}}}}function o4(e){return i4([...[...e.objectMarkers.values].map(({name:e,lookup:t})=>(n,r)=>{let i=t(n,!0);if(i!==null&&i.object!==r.host)return{place:`before`,style:`badge`,text:e,href:i.href}}),a4])}function s4(e,t){return r4(t,i4(e))}function c4(e){return t4.includes(e)}function l4(e){let t=Date.now()+8,n=0;for(;n<e.length&&!(Date.now()>t);n++){let{el:t,config:r,renderer:i,data:a,context:o}=e[n],{place:s=`after`,className:c,text:l,icon:u,href:d,external:f,tooltip:p}=r,m=c4(r.style)?r.style:s===`before`?`none`:`default`,h=l===void 0?typeof r==`object`?``:String(r):String(l),g=h!==``,_=[`value-annotation`,`style-`+m,s===`before`?`before`:`after`,g?`has-text`:``,c||``].join(` `),v=$(d?`a`:`span`,{class:_,href:typeof d==`string`?d:void 0,target:f?`_blank`:void 0});if(g&&(/\d{4}/.test(h)?v.innerHTML=nz(h):v.append(h)),typeof u==`string`&&(v.classList.add(`icon`),/^[a-z_$][a-z0-9_$-]*$/i.test(u)?v.classList.add(`icon-`+u):v.style.setProperty(`--annotation-image`,`url("${u}")`)),p&&i.tooltip(v,p,a,{...o,config:r}),s===`before`)t.before(v);else{let e=t.parentNode,n=n4.get(t);n===void 0&&(n4.set(t,n=$(`span`,`value-annotations`)),e.classList.contains(`struct-expanded-value`)?t.querySelector(`:scope > .value-size, :scope > .string-length`)?.after(n):e.append(n)),n.append(v)}}e.splice(0,n)}var u4={level_1:{level_2_1:{level_3_1:{level_4_1:{}},level_3_2:2,level_3_3:3,level_3_4:4,level_3_5:5,level_3_6:6},level_2_2:[{foo:1,bar:2},{foo:3}],level_2_3:3,level_2_4:4,level_2_5:5,level_2_6:6},level_1_2:2,level_1_3:3,level_1_4:4,level_1_5:5,level_1_6:6,level_1_7:7},d4={beforeDemo:[`md:"View to display the structure of any value. This is the simplest yet powerful way to enable data exploration."`],demo:{view:`struct`,data:{foo:`bar`,baz:[1,2,3]}},examples:[{title:`Default expanded depth`,highlightProps:[`expanded`],beforeDemo:['md:"By default `struct` view is collapsed in one line. The `expanded` option is using to specify an initial expanded depth. A value for the option can be a boolean (`false` → `0`, `true` → `1`) or a positive number."'],demoData:u4,demo:[`badge:"Default (expanded option is not used)"`,{view:`struct`},`badge:"expanded = true"`,{view:`struct`,expanded:!0},`badge:"expanded = 2"`,{view:`struct`,expanded:2}]},{title:`Annotations`,highlightProps:[`annotations`],beforeDemo:[{view:`md`,source:[`Clarity of data can be improved by adding annotations. An annotation is special marker before or after a value which displaying for expanded objects and arrays only.`,`Any number of annotations can be applied to a single value.`,``,"Annotations are adding with `annotations` option which should contain an array of strings (jora queries) and functions to compute an annotation config. An annotation config is an object with following fields:","```ts",`type AnnotationConfig = {`,` place?: "before" | "after"; // the placement of an annotation, "after" is by default`,` style?: "none" | "badge" | "default"; // appereance of annotation, "default" is by default`,` className?: string; // a class to add to an annotation element`,` text?: any; // text content of an annotation element`,` icon?: string; // name of icon or url to an image`,` href?: string; // annotation is a link and that's an URL`," external?: boolean; // open a link in new tab, make sence when `href` is specified only",` tooltip?: TooltipConfig; // configuration for a tooltip, the same as for any view`,`}`,"```",``,'An annotation is not displayed (not rendered) when computed annotation config is a falsy value. Any other value (truthy, but not an object) is used as value for `text` option, i.e. `"example"` is the same as `{ text: "example" }`.',``,"In addition to a string or function, an object can be used as an element of `annotations` array","* `query` – a string (jora query) or a function to compute an annotation config","* `debug` (optional) - when truthy a debug information is output to the console; when value is a string, it's used in debug message"]}],demoData:{items:[{id:1,value:`example`},{id:2,value:`bar`},{id:3,value:`baz`}],"annotation styles":[`none`,`default`,`badge`]},demo:{view:`struct`,expanded:3,annotations:[`#.key = "items" ? { place: "before", style: "badge", text: "view as table", tooltip: "table" } : null`,`$ ~= /az/ and "Value has 'az' substring!"`,`$ in ["none", "default", "badge"] and { style: $, place: "before", text: $ + " before" }`,`$ in ["none", "default", "badge"] and { style: $, text: $ + " after" }`]}},{title:`Limit number of array elements and object entries`,beforeDemo:{view:`md`,source:[`The following options define the maximum number of elements in array or entries in object:`,"* `limit` (default: `50`) – max number of elements/entries for expanded array/object","* `limitCollapsed` (default: `4`) – max of elements/entries for collapsed array/object","* `limitCompactObjectEntries` (default: `0`) – max number of entries in a object which appears in a collapsed array or object",``,"> Use `false` for any of these options to disable a limitation"]},highlightProps:[`limit`,`limitCollapsed`,`limitCompactObjectEntries`],demoData:u4,demo:{view:`struct`,limit:4,limitCollapsed:1,expanded:2}},{title:`Maximum length for strings`,beforeDemo:{view:`md`,source:[`The following options define the maximum string length in various cases:`,"* `maxStringLength` (default: `150`) – max string length when a host value is expanded","* `maxCompactStringLength` (default: `40`) – max of string length when a host value is collapsed",'* `allowedExcessStringLength` (default: `10`) – allowed excess in length before a string will be cut and \\"N more\\" label will be added',"* `maxPropertyLength` (default: `Infinity`) – max of property name length","* `maxCompactPropertyLength` (default: `35`) – max of property name length in collapsed objects",``,"> Expand and collapse `level2` branch to see difference in a value presentation"]},highlightProps:[`maxStringLength`,`maxCompactStringLength`,`allowedExcessStringLength`,`maxPropertyLength`,`maxCompactPropertyLength`],demo:{view:`struct`,maxStringLength:30,maxCompactStringLength:10,allowedExcessStringLength:5,maxPropertyLength:30,maxCompactPropertyLength:15,expanded:1},demoData:{stringsInExpandedObject:`Quite a long string value Quite a long string value`,string_34_chars:`String with 34 chars length demo x`,string_35_chars:`String with 35 chars length demo xx`,string_36_chars:`String with 36 chars length demo xxx`,very_very_very_very_very_very_very_very_very_very_long_property_name:`a property name should be truncated due to settings, but will not be by default`,level2:{stringsInCollapsedObject:`Quite a long string value Quite a long string value`,string_14_chars:`Short string x`,string_15_chars:`Short string xx`,string_16_chars:`Short string xxx`}}}]},f4={get collapse(){return $(`span`,{class:`struct-action-button struct-collapse-value`,"data-action":`collapse`})},get signature(){return $(`span`,{class:`struct-action-button show-signature`,"data-action":`show-signature`})},get actions(){return $(`span`,{class:`struct-action-button`,title:`Value actions`,"data-action":`value-actions`})},get stringMode(){return $(`span`,{class:`struct-action-button`,title:`Toggle string show mode`,"data-action":`toggle-string-mode`})},get viewAsTable(){return $(`span`,{class:`struct-action-button`,title:`Toggle view as table`,"data-action":`toggle-view-as-table`})},get sortKeys(){return $(`span`,{class:`struct-action-button`,title:`Toggle key sorting`,"data-action":`toggle-sort-keys`})}},p4=QR(`"`,f4.collapse,f4.actions,f4.stringMode,$(`span`,`string-length`),$(`span`,`string-text-wrapper`,[$(`span`,`string-text`)]),`"`),m4=QR(`[`,f4.collapse,f4.signature,f4.actions,f4.viewAsTable,$(`span`,`value-size`),`]`),h4=QR(`{`,f4.collapse,f4.signature,f4.actions,f4.viewAsTable,f4.sortKeys,$(`span`,`value-size`),`}`),g4=$(`div`,`entry-line`),_4=$(`span`,`value`),v4=$(`span`,`match`),y4=$(`span`,`label`,[`\xA0\xA0\xA0\xA0`,$(`span`,`property`),`:\xA0`]);function b4(e){for(;e.parent!==null;)e=e.parent;return e.host[``]}function x4(e,t,n,r,i){return new e.view.Popup({className:`view-struct-signature-popup`,hoverPin:`popup-hover`,hoverTriggers:`.view-struct .show-signature`,showDelay:50,render(a,o){let s=o.parentNode,c=t.get(s),l=n.get(s),u=r.get(s)||{};a.classList.add(`computing`),setTimeout(()=>{e.view.render(a,{view:`signature`,expanded:2,rootData:b4(l),path:i(s)},c,u.context).then(()=>a.classList.remove(`computing`))},16)}})}var S4=50,C4=4,w4=0,T4=150,E4=40,D4=10,O4=1/0,k4=35;function A4(e,t){return typeof e==`number`&&isFinite(e)&&e>=1?parseInt(e,10):t}function j4(e,t){if(typeof e==`string`)return e.length>t.maxStringLength||/[\r\n\f\t]/.test(e);if(ZJ(e))return e.length>0;if(typeof e==`object`&&e)switch(JR(e)){case`[object Set]`:return e.size>0;case`[object Object]`:for(let t in e)if(YR(e,t))return!0}return!1}function M4(e){return!(typeof e==`string`||XJ(e)||ZJ(e)&&e.every(e=>typeof e==`number`))}function N4(e,t){e.appendChild(document.createTextNode(t))}function P4(e,t,n){t>1&&(e.lastElementChild.innerHTML=nz(t)+` `+n)}function F4(e,t,n){t.length<2||t.every(([e],n)=>n===0||e>t[n-1][0])?e.querySelector(`[data-action="toggle-sort-keys"]`).remove():n&&t.sort(([e],[t])=>e<t?-1:+(e>t))}function I4(e,t,n){let r=y4.cloneNode(!0),i=t.length>n?t.slice(0,n)+`…`:t;N4(r.firstElementChild,i),e.appendChild(r)}function L4(e){function t(e){let t=f.get(e),n=u.get(e);e.classList.add(`struct-expand-value`),e.innerHTML=X2(n,!1,t),e.annotationsEl&&e.parentNode.append(e.annotationsEl)}function n(e,t,n){let a=u.get(e);if(e.classList.remove(`struct-expand-value`),typeof a==`string`){let t=f.get(e),n=p4.cloneNode(!0),r=n.lastChild.previousSibling,i=r.firstChild,o=r.previousSibling,c=Y2(a);o.innerHTML=`length: ${nz(c.length)} chars`,t.match?ZQ(a,t.match,e=>i.append(JSON.stringify(e).slice(1,-1)),e=>i.appendChild(v4.cloneNode()).append(JSON.stringify(e).slice(1,-1))):N4(i,c),e.replaceChildren(n),s(e,o)}else if(ZJ(a)||QJ(a)){let n=d.get(e),o=f.get(e),c=typeof a.size==`number`?a.size:a.length;e.replaceChildren(m4.cloneNode(!0)),P4(e,c,`elements`),s(e,e.lastElementChild),i(e,e.lastChild,a.values(),c,(e,i,s)=>{s>0&&s%10==9&&(e.dataset.index=s+1),r(e,i,t,o,Object.freeze({parent:n,host:a,key:s,index:s}))},0,o.limit)}else{let o=d.get(e),c=f.get(e),l=Object.entries(a);e.replaceChildren(h4.cloneNode(!0)),P4(e,l.length,`entries`),s(e,e.lastElementChild),F4(e,l,n),i(e,e.lastChild,l.values(),l.length,(e,[n,i],s)=>{s>0&&s%10==9&&(e.dataset.index=s+1),I4(e,n,c.maxPropertyLength),r(e,i,t,c,Object.freeze({parent:o,host:a,key:n,index:s}))},0,c.limit)}}function r(e,t,r,i,a){let o=j4(t,i),s=_4.cloneNode(!0);u.set(s,t),d.set(s,a),f.set(s,i),o&&M4(t)&&r?(e.classList.add(`struct-expanded-value`),n(s,r-1)):(o&&s.classList.add(`struct-expand-value`),s.innerHTML=X2(t,!1,i)),c(s,t,i,a),e.appendChild(s)}function i(t,n,r,a,o,s=0,c=S4){c===!1&&(c=1/0);let l=document.createDocumentFragment(),u=a-1,d=0;for(;d<c;d++,s++){let{done:e,value:t}=r.next();if(e)break;let n=g4.cloneNode(!0);o(n,t,s),s!==u&&N4(n,`,`),l.appendChild(n)}t.insertBefore(l,n),e.view.maybeMoreButtons(t,n,a,s,c,(e,s)=>i(t,n,r,a,o,e,s))}function a(t){let n=f.get(t),r=u.get(t);!ZJ(r)&&!QJ(r)&&(r=Object.entries(r).map(([e,t])=>({"[key]":e,"[value]":t}))),e.view.render(t,`table`,r,n.context),t.append(t.lastChild.previousSibling)}function o(e){let t=[],n=d.get(e);for(;n!==null&&n.parent!==null;)t.unshift(n.key),n=n.parent;return t}function s(e,t){e.annotationsEl&&t.after(e.annotationsEl)}function c(t,n,r,i){if(r.annotations.length){for(let a of r.annotations)try{let{query:o,debug:s}=a,c={...i,context:r.context},l=e.query(o,n,c);s&&e.logger.info(`Compute struct view annotation${typeof s==`string`?` "${s}"`:``}:`,{data:n,context:c,query:o,queryResult:l}),l&&m.push(l.tooltip?{el:t,config:l,renderer:r.renderer,data:n,context:c}:{el:t,config:l})}catch(t){e.logger.error(t.message)}l()}}function l(){_===null&&m.length&&(_=Promise.resolve().then(()=>{_=null,l4(m),m.length&&l()}))}let u=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakSet,m=[],h=o4(e),g=h,_=null,v=Z2(n,t,l,a,p,e4(e,u,d,o),x4(e,u,d,f,o));return e.addHostElEventListener(`click`,v,!1),e.legacyPrepare||e.action.define(`setStructViewAnnotations`,e=>{g=r4(h,i4(e))}),e.view.define(`struct`,function(t,n,i,a){let{annotations:o,match:s,expanded:c,limit:u,limitCollapsed:d,limitCompactObjectEntries:f,maxStringLength:m,maxCompactStringLength:h,allowedExcessStringLength:_,maxPropertyLength:v,maxCompactPropertyLength:y}=n,b=s4(o,e.legacyPrepare?e.annotations:g),x={renderer:this,context:a,annotations:b||[],match:$J(s)||typeof s==`string`?s:null,limit:e.view.listLimit(u,S4),limitCollapsed:e.view.listLimit(d,C4),limitCompactObjectEntries:e.view.listLimit(f,w4),maxStringLength:A4(m,T4),maxCompactStringLength:A4(h,E4),allowedExcessStringLength:A4(_,D4),maxPropertyLength:A4(v,O4),maxCompactPropertyLength:A4(y,k4)};p.add(t),r(t,i,c,x,{parent:null,host:{"":i},key:``,index:0}),l(),(!c||!M4(i))&&j4(i,x)&&t.classList.add(`struct-expand`)},{usage:d4}),()=>{document.removeEventListener(`click`,v,!1)}}var R4=[{name:`Alice`,age:34,occupation:`Engineer`},{name:`Bob`,age:42,occupation:`Doctor`},{name:`Charlie`,age:9,occupation:`Student`},{name:`David`,age:50,occupation:`Doctor`},{name:`Eve`,age:15,occupation:`Engineer`}],z4={beforeDemo:[`md:"A view to display tabular data, usually an array of objects. When no column setup is provided, it infers columns from all keys of objects in the input data and auto-detects sorting for scalar values."`],demo:{view:`table`},demoData:[{foo:1,bar:`bar`,baz:`zab`},{foo:2,baz:`xyz`},{foo:3,bar:`qux`,baz:`baz`},{foo:4,bar:`aaa`,baz:`abc`}],examples:[{title:`Columns setup`,beforeDemo:{view:`md`,source:["To set up columns, the `cols` property is used. When an array of objects is used for `cols`, it specifies the exact set of columns. Each object contains a configuration for the `table-cell` view with additional properties that apply at the table level:\n","- `header` – a text or config for the column header\n","- `footer` – a config for the footer cell\n","- `sorting` – a sorting function or query for the column\n"]},highlightProps:[`cols`,`header`,`footer`,`sorting`],demo:{view:`table`,cols:[{header:`Name`,sorting:`name asc`,data:`name`,footer:`text:"Total:"`},{header:`Age`,headerClassName:`age`,className:`number`,content:`text:age + " y.o."`,footer:{data:`size()`}}]},demoData:R4},{title:`Adjastments of infered columns`,beforeDemo:{view:`md`,source:["In cases where adjustments are needed for inferred columns, an object can be used for the `cols` option, where each key is the name of a property from the objects:",`- If a key is missing from the inferred columns, a new column is added with the specified configuration.`,`- If a key matches one of the inferred columns:`," - If the specified configuration is falsy (i.e., `null`, `undefined`, or `false`), then the column is omitted.",` - Otherwise, options from the specified configuration override properties of the inferred configuration.`,``,"> When specified configuration is a string, it expands into object `{ content: value }`.",`The default inferred configuration:`,"```js",`{`,` header: key,`," sorting: `$[${JSON.stringify(key)}] ascN`,",` view: "table-cell",`,` data: value => value?.[key]`,`}`,"```"].join(`
|
|
492
|
+
`)},afterDemo:[`struct:#.id.pageLink(#.page, #.params)`],highlightProps:[`cols`],demo:{view:`table`,cols:{age:`text:age + " y.o."`,occupation:!1,extraColumn:{header:`Extra column`,content:`text:age >= 21 ? "Adult" : "Child"`}}},demoData:R4},{title:`Sorting`,beforeDemo:{view:`md`,source:['To specify a sorting function, use the `sorting` property in the column options. When a value for `sorting` is set, the column becomes sortable, allowing users to toggle sorting by clicking the column header. The value can be a function `(a, b) => number` or a string representing a jora query that returns a [comparator function](https://discoveryjs.github.io/jora/#article:jora-syntax-functions&!anchor=comparator-functions) (e.g., "name asc, complex.expression desc"), otherwise the value ignores. The function should take two rows\' data (`a` and `b`) and return a negative number if `a` is less than `b`, a positive number if `a` is greater than `b`, or zero otherwise.',``,"> The `table` view automatically displays a sorting direction indicator (icon) on a column when a comparator function returns `<= 0` or `>= 0` for each pair of consecutive rows.",``,"> Note: A sorting (comparator) function has no access to the table's context, so any attempt to access context (`#`) values within a comparator function produced by a query will return `undefined`.",``,"The `table` view attempts to infer a sorting function for a column when the `sorting` option is not explicitly specified, by executing the following steps:","- Use `data` if it is a string or function to extract column values from row data; otherwise, use the row's data.",'- If `content` is a string formatted as `"view-name:query"`, use the `query` to extract a value from the previous step.',' > To prevent sorting inference from the `content` value, specify content in another format, often by wrapping it in an array, e.g., `{ content: "text:name" }` → `{ content: ["text:name"] }`.',`- If any condition is met, construct a sorting (comparator) function.`," > If neither `data` nor `content` options meet the conditions, a sorting function cannot be inferred, and the column becomes non-sortable.",``,`> Note: When inferring a comparator function, the when, whenData, and contentWhen options are not considered for now. If these options are needed to affect sorting, an explicit sorting function should be specified.`].join(`
|
|
493
|
+
`)},highlightProps:[`sorting`,`data`,`content`],demo:{view:`table`,cols:[{header:`Sorting from data`,data:`name`},{header:`Sorting from content`,content:`text:age`},{header:`Sorting from data&content`,data:`{ name, age }`,content:"text:`${age} ${name}`"},{header:`Explicit sorting`,sorting:`name asc, age desc`,content:["text:`${name} ${age}`"]}]},demoData:R4},{title:`Displaying non-object values`,beforeDemo:['md:"When input data (an array) contains non-object values, such values are display using `struct` view in a single cell spanning all the columns"'],highlightProps:[`data`,`valueCol`],demo:[`h3:"Table with non-object values"`,{view:`table`,data:[123,`string`,null,{foo:1,bar:2},[1,2,3]]},`h3:"Enforce displaying of a [value] column"`,{view:`table`,valueCol:!0}],demoData:R4},{title:`Setup cell display`,beforeDemo:{view:`md`,source:["To manage cell display, the following options are available in the `cols` setting:","- `colWhen` (similar to `when` and `whenData` options) allows disabling column rendering based on the table's data.","- `when` and `whenData` apply to `table-cell` and behave the same way as they do for any view, to disabling rendering of the cell itself.","- `contentWhen` (similar to `when` and `whenData` options) allows disabling cell content rendering based on the cell's data.","- `colSpan` allows setting a relevant attribute for a table cell. (Note: subsequent cells should be disabled using `when` or `whenData`).","- `align` specifies text alignment, supported values `'left'`, `'center'` and `'right'`"].join(`
|
|
494
|
+
`)},highlightProps:[`contentWhen`,`colWhen`,`colSpan`,`when`],demo:{view:`table`,data:`.({ name, age, fare: age > 21 ? "Full" : age > 12 ? "Half" })`,cols:{name:{contentWhen:`$ != "Bob"`},age:{colWhen:`size() > 10`},fare:{colSpan:`=fare ? 1 : 2`,content:{data:`fare`,view:`switch`,content:[{when:`$`,content:`text`},{content:`text:"Not applicable"`}]}},price:{when:`fare`,data:`fare = "Full" ? 50 : 25`,content:`text:"$" + $`}}},demoData:R4},{title:`Cell details`,beforeDemo:{view:`md`,source:["Table cells can display an additional detail view of their content when clicked. Clicking the same cell again, or a different cell with details, will hide the view. To enable and customize the detail view, use the `details` option.",``,"By default, if the `details` option is not explicitly defined, it will automatically activate for cells containing an object or a non-empty array, as long as no custom `content` is specified. In this case, a default `struct` view will be used to display the data.",``,"You can control the visibility of detail views using the `detailsWhen` option. This option accepts a function that checks the cell's data and disables the details view if the function returns a falsy value."]},highlightProps:[`details`,`detailsWhen`],demo:{view:`table`,cols:[{header:`Group`,data:`group`},{header:`Default`,data:`peoples`},{header:`Custom details`,data:`peoples`,details:[`h2:"Custom detail views"`,`table`]},{header:`Disable default details`,data:`peoples`,details:!1},{header:`Conditional details`,data:`peoples`,detailsWhen:`size() > 2`}]},demoData:[{group:`Kids`,max:21},{group:`Adults`,min:21},{group:`All`}].map(({group:e,min:t=0,max:n=100})=>({group:e,peoples:R4.filter(e=>e.age>t&&e.age<n)}))},{title:`Setup header cell display`,beforeDemo:{view:`md`,source:["A setup for header cells is simple as a setting up a string. However, a value for header can be a query string (i.e. `'=query'`), a config object or content views."]},highlightProps:[`header`],demoData:R4,demo:{view:`table`,cols:[{header:`just a text`},{header:`=occupation has "Doctor" ? "Has doctor" : "-"`},{header:{className:`foo`,content:[`text-numeric:123456`],tooltip:"text:`Rows: ${size()}`"}},{header:{text:`text via config`}}]}},{title:`Setup footer cell display`,beforeDemo:{view:`md`,source:[`A setup for footer cell is similar to a [regular cell](#!setup-cell-display), the same set of options are supported: .`,``,"When value for the `footer` is an object without a `view` property, it's interpreted as a footer config. Otherwise, it is treated as footer cell content, equivalent to passing `{ content: value }`."]},highlightProps:[`footer`],demoData:R4,demo:{view:`table`,cols:{name:{footer:`text:"Raw data"`},age:{footer:{colSpan:2}}}}},{title:`Setup header and footer display`,beforeDemo:{view:`md`,source:["You can use the `headerWhen` and `footerWhen` options to conditionally disable the rendering of the header and footer, respectively. The footer also is not rendering when no any footer cell is defined."]},highlightProps:[`headerWhen`,`footerWhen`],demoData:R4,demo:[`h2:"No header and footer"`,{view:`table`,headerWhen:!1,footerWhen:`size() > 10`,cols:{name:{footer:`text:"footer"`}}},`h2:"With header and footer"`,{view:`table`,cols:{name:{footer:`text:"footer"`}}}]}]};function B4(e,t){return{header:e,sorting:`${t} ascN`,view:`table-cell`,data:t}}function V4(e,t,n){let r=``,i=``;if(`data`in e&&e.data!==void 0)switch(typeof e.data){case`string`:i=`(${e.data||`$`})`;break;case`function`:r=`$dataQuery;`,i=`$dataQuery(#)`;break;default:r=`$dataQuery;`,i=`$dataQuery`}if(typeof e.content==`string`){let n=e.content.indexOf(`:`),r=e.content.slice(0,n);if(n===-1||!t.view.has(r))return;let a=e.content.slice(n+1);a&&(i=i?`(${i} | ${a})`:`(${a})`)}return i?t.query(`${r} ${i} ascN`,{dataQuery:e.data},n):!1}function H4(e,t,n){return typeof t==`string`&&(t={content:t}),YR(t,`content`)||YR(t,`data`)?{header:e,view:`table-cell`,...t}:{...B4(e,n),...t}}function U4(e){return Array.isArray(e)?e.length:e}function W4(e,t,n){if(typeof n!=`function`)return 0;let r=0;try{for(let e=1,i=U4(t[0]);e<t.length;e++){let a=U4(t[e]),o=Math.sign(n(i,a));if(o){if(r&&o!==r)return!1;r=o}i=a}}catch(t){return e.logger.error(`Error on column order detection in table view`,t),0}return-r||0}function G4(e){let t=e.queryFn(`is not object`);e.view.define(`table`,function(n,r,i,a){let{rows:o,cols:s,rowConfig:c,valueCol:l=!1,headerWhen:u=!0,footerWhen:d=!0,limit:f}=r,p;`rows`in r||(o=i),QJ(o)&&(o=[...o]),ZJ(o)||(o=o?[o]:[]);let m=o,h=$(`tbody`),g=$(`tbody`,{class:`view-table-more-buttons`}),_=g.appendChild($(`tr`)).appendChild($(`td`)),v=()=>{if(!e.query(u,i,a))return;let t=s.map(e=>e.header),r=s.map(t=>YR(t,`sorting`)?e.query(t.sorting,null,a):V4(t,e,a));return this.render(n,{view:`table-header`,cols:t,sortings:r,getRowsOrder:t=>W4(e,m,t),setSorting(e,t){if(typeof e==`function`){let n=o.slice().sort(e);t&&n.reverse(),b(n)}else b(o)}},i,a)},y=()=>{let t=s.map(e=>e.footer);if(e.query(d,i,a)&&t.some(e=>e!==void 0))return this.render(n,{view:`table-footer`,cols:t},i,a)},b=async t=>(m=t,h.innerHTML=``,_.innerHTML=``,n.append(h,g),e.view.renderList(h,p,m,{...a,cols:s},0,e.view.listLimit(f,25),{moreContainer:_,onSliceRender:e=>e===0&&g.remove()}));if(Array.isArray(s))s=s.map((t,n)=>typeof t==`string`?B4(t,e.pathToQuery([t])):{header:`col`+n,view:`table-cell`,...t});else{let n=new Set,r=s&&typeof s==`object`?s:{};s=[];for(let e of o)if(t(e))l=!0;else for(let t of Object.keys(e))n.add(t);for(let e of Object.keys(r))r[e]?n.add(e):n.delete(e);for(let t of n)s.push(YR(r,t)?H4(t,r[t],e.pathToQuery([t])):B4(t,e.pathToQuery([t])))}return l&&s.unshift({header:`[value]`,view:`table-cell`,sorting:`$ ascN`,colSpan:`=is not object ? #.cols.size() : 1`,content:`=is not object ? "struct"`,details:`=is object ? "struct"`}),s=s.filter(t=>!YR(t,`colWhen`)||e.queryBool(t.colWhen,i,a)),_.colSpan=s.length,p=this.composeConfig({view:`table-row`,cols:l?`=is not object ? [#.cols[]] : #.cols`:`=#.cols`},c),Promise.all([v(),b(o),y()])},{tag:`table`,usage:z4})}function K4(e,t,n){return e?r=>{r===`asc`?n(e,!0):r===`desc`&&!t?n():n(e)}:null}function q4(e){e.view.define(`table-header`,async function(e,t,n,r){let{cols:i,sortings:a,getRowsOrder:o,setSorting:s}=t,c=e.appendChild($(`tr`)),l=[],u=(e,t)=>{s(e,t);for(let e of c.children){let t=o(l[e.cellIndex]);e.classList.toggle(`asc`,t===1),e.classList.toggle(`desc`,t===-1)}};return Promise.all(i.map((e,t)=>{let i=a[t],s=o(i),d=s===0?null:i;return l.push(d),this.render(c,this.composeConfig({view:`table-header-cell`,initSorting:s,nextSorting:K4(d,s,u)},eY(e)?Array.isArray(e)||`view`in e?{content:e}:e:{text:e}),n,r)}))},{tag:`thead`})}function J4(e){e.view.define(`table-header-cell`,function(t,n,r,i){let{content:a,text:o,initSorting:s,nextSorting:c}=n;if(typeof c==`function`&&(t.classList.add(`sortable`),t.addEventListener(`click`,()=>c(t.classList.contains(`asc`)?`asc`:t.classList.contains(`desc`)?`desc`:`none`))),s&&t.classList.add(s>0?`asc`:`desc`),a)return e.view.render(t,a,r,i);t.textContent=o??``},{tag:`th`})}function Y4(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r];i!==void 0&&n.push({index:r,config:t({view:`table-footer-cell`},eY(i)&&typeof i.view!=`string`?i:{content:i})})}return n}function X4(e){e.view.define(`table-footer`,async function(t,n,r,i){let{cols:a}=n,o=Y4(a,this.composeConfig),s=t.appendChild($(`tr`)),c=o.map(()=>QR()),l=await Promise.allSettled(o.map(({config:e},t)=>this.render(c[t],e,r,i))),u=()=>$(`td`,{class:`view-table-footer-cell`}),d=0,f=0;l.forEach((t,n)=>{let{index:r,config:i}=o[n],a=c[n].firstChild;if(t.status===`rejected`)e.view.renderError(s.appendChild(a=u()),t.reason,i),f++;else if(!a)s.append(a=u());else if(a.nodeType!==1||a.tagName!==`TD`){if(a.nodeType===8&&!a.nextSibling)return;if(a.classList?.contains?.(`discovery-buildin-view-render-error`)){let e=a;s.appendChild(a=u()).append(e),f++}else e.view.renderError(s.appendChild(a=u()),`non <td> element`,i),f++}else if(s.append(a),f++,d>r){let e=a.previousElementSibling;e.colSpan=r-e.cellIndex}else for(let e=r-d;e>0;e--)a.before(u());d=r+a.colSpan}),f===0&&t.classList.add(`no-cells-with-content`);for(let e=a.length-d;e>0;e--)s.append(u())},{tag:`tfoot`})}var Z4={view:`struct`,expanded:1},Q4=[`left`,`center`,`right`];function $4(e,t){let n=String(t);if(e.classList.add(`number`),!Number.isFinite(t)){e.classList.add(`keyword`),e.textContent=n;return}n.length>3?e.innerHTML=nz(n,!1):e.textContent=n}function e3(e,t,n){if(Array.isArray(t)||ArrayBuffer.isView(t)){t.length>0&&$4(e,t.length);return}if(n){e.classList.add(`complex`);for(let n in t)if(YR(t,n)){e.textContent=`{…}`;return}e.textContent=`{}`;return}if(t!==void 0){if(typeof t==`number`){$4(e,t);return}(t===null||t===!1||t===!0)&&e.classList.add(`keyword`),e.textContent=String(t)}}function t3(e,t,n,r,i){return()=>{let a=t.parentNode,o=a.parentNode,s=Array.from(o.querySelectorAll(`.view-table-cell.details-expanded`)).find(e=>e.parentNode.parentNode===o),c=null;if(s){let e=s.parentNode;if(s.classList.remove(`details-expanded`),s===t){a.nextSibling.remove();return}e===a?(c=a.nextSibling.firstChild,c.innerHTML=``):e.nextSibling.remove()}c===null&&(c=a.parentNode.insertBefore(document.createElement(`tr`),a.nextSibling).appendChild(document.createElement(`td`)),c.parentNode.className=`view-table-cell-details-row`,c.className=`view-cell-details-content`,c.colSpan=1e3),t.classList.add(`details-expanded`),e.view.render(c,n||Z4,r,i)}}function n3(e,t){typeof t==`string`&&Q4.includes(t)&&e.classList.add(`align-${t}`)}function r3(e){e.view.define(`table-footer-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0,details:s,detailsWhen:c=!0,colSpan:l,align:u}=n,d=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(t.classList.add(`view-table-cell`),typeof l==`number`&&l>1&&(t.colSpan=l),e.queryBool(o,r,i)){if(n3(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,t3(e,t,s,r,i))),a)return e.view.render(t,a,r,i);e3(t,r,d)}},{tag:`td`})}function i3(e){e.view.define(`table-row`,function(t,n,r,i){let{cols:a}=n;if(Array.isArray(a))return Promise.all(a.map((n,a)=>e.view.render(t,n,r,{...i,colIndex:a})))},{tag:`tr`})}function a3(e){e.view.define(`table-cell`,function(t,n,r,i){let{content:a,contentWhen:o=!0,details:s,detailsWhen:c=!0,colSpan:l,align:u}=n,d=!a&&r!==null&&(Array.isArray(r)?r.length>0:typeof r==`object`)&&!(r instanceof RegExp);if(typeof l==`number`&&l>1&&(t.colSpan=l),e.queryBool(o,r,i)){if(n3(t,u),(s||s===void 0&&d)&&e.queryBool(c,r,i)&&(t.classList.add(`details`),t.addEventListener(`click`,t3(e,t,s,r,i))),a)return e.view.render(t,a,r,i);e3(t,r,d)}},{tag:`td`})}var o3=()=>alert(`toggled!`),s3=([e,...t],n=``)=>{let r=[];for(let i=0;i<e;i++){let e=n+`.`+(i+1);r.push({title:e,children:t.length?s3(t,e):null})}return r},c3={demo:{view:`tree`,item:`text:text`,data:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},examples:[{title:`Expanded tree`,highlightProps:[`expanded`],demo:{view:`tree`,item:`text:text`,expanded:999},demoData:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},{title:`With empty text`,highlightProps:[`emptyText`],demo:{view:`tree`,emptyText:`This tree is empty`,data:null}},{title:`With toggle handler`,highlightProps:[`onToggle`],demo:{view:`tree`,item:`text:text`,onToggle:o3},demoData:{text:`Root`,children:[{text:`Child`},{text:`Another child`,children:[{text:`Lvl 2 child`},{text:`Lvl 2 child`}]}]}},{title:`limitLines`,highlightProps:[`limitLines`],demoData:s3([5,3,3]),demo:{view:`tree`,item:`text:title`,limitLines:7}}]};function l3(e){function t(n,r,i,a,o,s){return s===!1&&(s=i.length),n.classList.add(`incomplete`),i.slice(o,o+s).reduce((t,n)=>t.then(()=>{let{container:t,itemConfig:i}=r;return e.view.render(t,e.view.composeConfig(i,{expanded:n.expanded,last:n.last,hasChildren:n.hasChildren,children:n.children}),n.data,a).then(()=>{if(n.expanded&&n.hasChildren){let n=t.lastChild.querySelector(`.view-tree-leaf-children`);n.classList.add(`incomplete`),r={container:n,itemConfig:e.view.composeConfig(i,i.itemConfig),prev:r}}else for(;n.shift--;)r.container.classList.remove(`incomplete`),r=r.prev})}),Promise.resolve()).then(()=>e.view.maybeMoreButtons(n,null,i.length,o+s,s,(e,o)=>t(n,r,i,a,e,o))||n.classList.remove(`incomplete`))}function n(t,n,r,i){function a(t,r,i,c=0){t.forEach((t,l,u)=>{let d=e.query(i.children,t,n),f=Array.isArray(d)&&d.length>0,p=l===u.length-1,m=s.has(t)?0:typeof r==`function`?r(t,n):r;s.add(t),o.push({data:t,expanded:m,last:p,hasChildren:f,children:m?null:i.children,shift:p&&(!m||!f)?c+1:0}),f&&m&&a(d,typeof r==`number`?r-1:r,e.view.composeConfig(i,i.itemConfig),p?c+1:0)})}let o=[],s=new Set;return a(t,i,r),o}e.view.define(`tree`,function(r,i,a,o){let{children:s=`children`,item:c=`text`,itemConfig:l,collapsible:u,emptyText:d,onToggle:f}=i,{expanded:p,limit:m,limitLines:h=!0}=i;if(d!==!1&&d!==``&&r.setAttribute(`emptyText`,d||`Empty tree`),!Array.isArray(a)&&a&&(a=[a]),Array.isArray(a)){if(m=e.view.listLimit(m,25),h=e.view.listLimit(h,25),p=typeof p==`function`?p:e.view.listLimit(p,1),h){let e=n(a,o,this.composeConfig({children:s},l),p);return t(r,{container:r,itemConfig:this.composeConfig({view:`tree-leaf`,itemConfig:l,content:c,collapsible:u,onToggle:f},l)},e,o,0,h)}return this.renderList(r,this.composeConfig({view:`tree-leaf`,itemConfig:l,content:c,collapsible:u,expanded:p,children:s,limit:m,onToggle:f},l),a,o,0,m)}},{tag:`ul`,usage:c3})}var u3=`#.props | {
|
|
495
|
+
$items: children.query(@, #.context) | is array?;
|
|
496
|
+
|
|
497
|
+
itemConfig,
|
|
498
|
+
content is not undefined ?: 'text',
|
|
499
|
+
collapsible is not undefined ?: true,
|
|
500
|
+
onToggle,
|
|
501
|
+
expanded,
|
|
502
|
+
last,
|
|
503
|
+
hasChildren: hasChildren or $items.size() > 0,
|
|
504
|
+
children,
|
|
505
|
+
$items,
|
|
506
|
+
limit: limit | $ = false or is int ?: 25
|
|
507
|
+
}`;function d3(e){let t=new WeakMap;e.addHostElEventListener(`click`,({target:e})=>{let n=e.closest(`.view-tree-leaf-toggle`);if(n){let e=t.get(n),r=!n.parentNode.classList.toggle(`collapsed`);typeof e.render==`function`&&e.render(),typeof e.onToggle==`function`&&e.onToggle(r,n.parentNode,e.data,e.context)}},!1),e.view.define(`tree-leaf`,async function(e,n,r,i){let{expanded:a,hasChildren:o,children:s,items:c,content:l,itemConfig:u,collapsible:d,last:f,limit:p,onToggle:m}=n,h=e.appendChild($(`span`,`view-tree-leaf-toggle`)),g=e.appendChild($(`span`,`view-tree-leaf-content`));if(f&&e.classList.add(`last`),d||e.classList.add(`non-collapsible`),await this.render(g,l,r,i),o){let n=e.appendChild($(`ul`,`view-tree-leaf-children`)),o={data:r,context:i,onToggle:m,render:null},f=(e,t)=>(typeof t==`number`&&t--,this.renderList(n,this.composeConfig({view:`tree-leaf`,expanded:t,itemConfig:u,content:l,collapsible:d,children:s,limit:p,onToggle:m},u),e,i,0,this.listLimit(p,25)));e.classList.add(`has-children`),t.set(h,o),(typeof a==`function`?a(r,i):a)?c&&await f(c,a):(e.classList.add(`collapsed`),c&&(o.render=()=>{o.render=null,f(c,a||1)}))}},{tag:`li`,props:u3})}var f3=s({alerts:()=>KQ,appHeader:()=>n$,autoLink:()=>r$,badges:()=>s$,block:()=>bQ,blockquote:()=>c$,button:()=>FZ,checkbox:()=>BZ,checkboxList:()=>LZ,column:()=>SQ,columns:()=>CQ,contentFilter:()=>HZ,context:()=>T2,dropdown:()=>GZ,editors:()=>Mz,expand:()=>EQ,headers:()=>f$,hstack:()=>OQ,html:()=>m$,image:()=>v$,imagePreview:()=>b$,indicator:()=>S$,input:()=>ZZ,link:()=>T$,listItem:()=>kQ,lists:()=>jQ,markdown:()=>X1,menu:()=>$Z,menuItem:()=>tQ,navButton:()=>iQ,pageHeader:()=>NQ,popup:()=>VQ,progressbar:()=>oQ,section:()=>UQ,select:()=>cQ,signature:()=>W2,source:()=>O0,struct:()=>L4,switchView:()=>D2,tab:()=>hQ,table:()=>G4,tableCell:()=>a3,tableFooter:()=>X4,tableFooterCell:()=>r3,tableHeader:()=>q4,tableHeaderCell:()=>J4,tableRow:()=>i3,tabs:()=>dQ,text:()=>j0,textDiff:()=>h2,textMatch:()=>y2,textNumeric:()=>S2,textRender:()=>k2,tocSection:()=>WQ,toggle:()=>_Q,toggleGroup:()=>vQ,tree:()=>l3,treeItem:()=>d3});function p3(e){e.page.define(`default`,{view:`switch`,content:[{when:`no #.datasets`,content:`preset/welcome-block`},{content:[`page-header{ content: "h1:#.name" }`,{view:`struct`,expanded:1}]}]}),e.preset.define(`welcome-block`,{view:`block`,className:`welcome-block`,data:`#.model`,content:[`app-header`,{view:`block`,className:`upload-data`,when:`#.actions.uploadFile`,content:[`preset/upload`,{view:`block`,className:`upload-notes`,content:`html:name + " is a server-less application that securely opens and analyzes your data directly on your device,<br>ensuring all processing is done locally without transmitting your data elsewhere."`}]}]})}function m3(e){e.page.define(`not-found`,['alert-warning:"Page `" + name + "` not found"'])}function h3(e,t=``){return typeof e==`string`?e:t}var g3=[`query`,`graph`,`view`,`viewEditorHidden`,`title`,`dzen`,`noedit`],_3=[`q`,`graph`,`v`,`vh`,`title`,`dzen`,`noedit`];function v3(e){let{query:t,graph:n,view:r,viewEditorHidden:i,title:a,dzen:o,noedit:s,...c}=typeof e==`string`?{query:e}:e,l=[];o&&l.push([`dzen`]),s&&l.push([`noedit`]),a&&l.push([`title`,a]),t&&l.push([`q`,RY(t)]),n&&l.push([`graph`,RY(JSON.stringify(n))]),typeof r==`string`&&l.push(r?[`v`,RY(r)]:[`v`]),i&&l.push([`vh`]);for(let[e,t]of Object.keys(c||{}).sort())g3.includes(e)||l.push([e,e.endsWith(`-b64`)&&typeof t==`string`?RY(t):t]);return l}function y3(e){let t=Object.fromEntries(e),n={title:h3(t.title),query:BY(h3(t.q)),graph:JSON.parse(BY(h3(t.graph))||`null`),view:`v`in t?BY(h3(t.v)):void 0,viewEditorHidden:`vh`in t,dzen:`dzen`in t,noedit:`noedit`in t};for(let[e,r]of Object.entries(t))_3.includes(e)||(n[e]=e.endsWith(`-b64`)&&typeof r==`string`?BY(r):t[e]);return n}function b3(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!g3.includes(e)))}function x3(e,t,...n){for(let r of Object.keys(e))if(e[r]!==t[r]&&!n.includes(r))return!1;for(let r of Object.keys(t))if(e[r]!==t[r]&&!n.includes(r))return!1;return!0}function S3(e,t={}){let n={...e,params:b3(e.params)};return!x3(t,n,`params`,`actions`)||!x3(t.params,n.params)||!x3(t.actions,n.actions)?n:t}function C3(e){return e&&typeof e==`object`&&`params`in e?e.params:{}}function w3(e){return e.replace(/\\/g,`\\\\`).replace(/\t/g,`\\t`).replace(/\r/g,`\\r`).replace(/\n/g,`\\n`).replace(/'/g,`\\'`)}function T3(e){return`{
|
|
508
|
+
${Object.keys(e).reduce((t,n)=>typeof e[n]==`string`?t.concat(` ${n}: '${w3(e[n])}'`):(n===`graph`||typeof e[n]==`boolean`)&&e[n]?t.concat(` ${n}: ${JSON.stringify(e[n])}`):t,[]).join(`,
|
|
509
|
+
`)}
|
|
510
|
+
}`}function E3(e){if(e&&(typeof e==`number`||typeof e==`string`)){let t=new Date(e);return isNaN(Number(t))?null:t}return e instanceof Date?e:null}function D3(e){let t=E3(e);return t?t.toISOString().replace(/^(\d{4})-(\d{2})-(\d{2})T([\d:]+).*/,`$3/$2/$1 $4 UTC`):null}function O3(e,t){let n,r,i,a,o=new e.view.Popup({render:(t,n,r)=>e.view.render(t,{view:`menu`,data:()=>[{text:`Copy page permalink`,disabled:!e.action.has(`permalink`),action:async()=>$Q(await e.action.call(`permalink`,e.pageHash))},{text:`Copy page hash`,action:()=>$Q(e.pageHash)},{text:`Copy page as JSON`,action:()=>$Q(T3(e.pageParams))}],onClick(e){r(),e.action()}})}),s=$(`div`,`discovery-actions`,[a=$(`button`,{class:`edit-mode discovery-hidden-in-dzen`,title:`Toggle edit mode`,onclick(){this.blur(),t({noedit:!e.pageParams.noedit})}}),$(`button`,{class:`share`,title:`Sharing`,onclick(){this.blur(),o.show(this)}}),$(`button`,{class:`toggle-fullscreen`,title:`Toggle full page mode`,onclick(){this.blur(),t({dzen:!e.pageParams.dzen})}})]),c=e=>{e.parentNode.dataset.title=e.value||e.placeholder};return{el:[s,$(`div`,`discovery-header`,[$(`div`,{class:`discovery-header-text`,"data-title":`\xA0`},[n=$(`input`,{class:`discovery-hidden-in-dzen`,placeholder:`Untitled discovery`,oninput(){c(this)},onchange(){c(this),t({title:this.value},!0)},onkeypress(e){e.key===`Enter`&&this.blur()}}),$(`span`,`timestamp`,[r=$(`span`,null,` `),i=$(`span`)])])])],render(e,t){let{title:o,noedit:s}=C3(t),l=D3(t?.datasets?.[0]?.resource?.createdAt);n.value=o||``,c(n),a.classList.toggle(`disabled`,s),r.innerText=l?`Data collected at `+l+` | `:``,i.innerText=`Rendered at `+D3(new Date)}}}function k3(e,t,n){return e.length?`${e.length} ${e.length===1?t:n}`:`empty`}function A3(e,t,n){return Math.min(n,Math.max(e,t))}function j3(e){return Array.isArray(e)?`Array (${k3(e,`element`,`elements`)})`:e&&typeof e==`object`?`Object (${k3(Object.keys(e),`entry`,`entries`)})`:`Scalar (${e===null?`null`:typeof e})`}function M3(e){return $(`span`,`num-delim-wrapper`,nz(e))}function N3(e,t){let n=document.createElementNS(`http://www.w3.org/2000/svg`,e);if(t)for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}function P3(e,t,n){Array.isArray(t)||(t=[]);let r=t.map(e=>({type:e.resource?.type||`unknown`,name:e.resource?.name||`unknown`}));if(mX(r,n))return n;e.replaceChildren();for(let t of r)e.appendChild($(`div`,`dataset`,[$(`span`,`dataset__type`,t.type),$(`span`,`dataset__name`,t.name)]));return r}function F3(e,t,n,r){function i(){return e.appendChild($(`div`,`query-graph-layer`))}function a(){return $(`div`,{class:`query-graph-node`,tabindex:-1,"data-action":`select`},[$(`div`,`query-graph-node__dot`),$(`div`,`query-graph-node__label`)])}function o(e,t,n){let r=e.lastElementChild,{label:i,text:a}=s(n);e.dataset.path=t.join(` `),r.classList.toggle(`has-label`,i),r.textContent=a}function s(e){if(e.label)return{label:!0,text:e.label};let{query:t}=e;if(typeof t==`string`){let e=t.match(/^\s*\/\/![ \t]*(\S.*)/);return e?{label:!0,text:e[1].trim()}:{label:!1,text:t.trim()}}return{label:!1,text:``}}function c(e,t,s,m,h){Array.isArray(h)||(h=[]),e||(u.push(e=i()),d.set(e,[]),f.push(0),u.length===1&&e.append($(`button`,{class:`view-button`,tabindex:-1,"data-action":`new-root-node`},`+`)));let g=h.length===1,_=h.length>1,v=d.get(e)?.shift()||e.appendChild(a()),y=f[m.length-1],b={parent:s,children:[],node:t,nodeEl:v,layerIndex:m.length-1,layerPos:y,layerOptPos:y};if(l.push(b),f[m.length-1]++,o(v,m,g?{...t,...r}:t),v.classList.toggle(`target`,g),v.classList.toggle(`current`,_),n.view.attachTooltip(v,{className:`query-graph-tooltip`,hideOnTriggerClick:!0,content:g?`badge:"Current query"`:{view:`source`,syntax:`=query | trim() ? "jora" : false`,source:`=query | trim() ?: "<empty query>"`,actionCopySource:!1,lineNum:!1}},{query:t.query}),Array.isArray(t.children))for(let n=0;n<t.children.length;n++){let r=c(e.nextSibling,t.children[n],b,m.concat(n),h[1]===n?h.slice(1):[]);b.children.push(r),p.push([v.lastChild,r.nodeEl])}return b}let l=[],u=[...e.querySelectorAll(`:scope > .query-graph-layer`)],d=u.reduce((e,t)=>e.set(t,[...t.querySelectorAll(`:scope > .query-graph-node`)]),new Map),f=Array(d.size).fill(0),p=[],m=e.querySelector(`:scope > svg`)||e.appendChild(N3(`svg`));for(let e=0;e<t.children.length;e++)c(u[0],t.children[e],null,[e],t.current[0]===e?t.current:[]);for(let e of d.values())for(let t of e)t.remove();let h=f.reduce((e,t)=>Math.max(e,t)),g=f.map(()=>0);for(let e of l){let{parent:t}=e;if(t){let n=t.node.children?.length||1,r=g[e.layerIndex],i=h-(f[e.layerIndex]-e.layerPos),a=A3(t.layerPos-Math.floor((n-1)/2),r,i);if(e.children.length>0&&r>0){let t=A3(e.children[0].layerPos,Math.max(a,g[e.layerIndex+1]),i);a+=A3(t-a,0,2)}e.layerPos=a}e.nodeEl.style.setProperty(`--pad`,String(e.layerPos-g[e.layerIndex])),g[e.layerIndex]=e.layerPos+1}requestAnimationFrame(()=>{let t=parseInt(getComputedStyle(e).gap),n=[],r=[];for(let[e,i]of p){let a=_z(e,m),o=_z(i,m),s=a.right+2,c=Math.max(o.left-t-10,s),l=a.top+a.height/2,u=o.left-3,d=o.top+o.height/2,f=(u-c)/3,p=i.classList.contains(`current`)||i.classList.contains(`target`),h=l===d?N3(`line`,{stroke:`#888`,x1:s,y1:l,x2:u,y2:d}):N3(`path`,{stroke:`#888`,fill:`none`,d:`M ${s} ${l} H ${c} C ${c+2*f} ${l} ${u-2*f} ${d} ${u} ${d}`});p?(r.push(h),h.classList.add(`current`)):n.push(h)}m.replaceChildren(...n,...r)})}function I3(e){let t={current:Array.isArray(e.current)?e.current:[],children:Array.isArray(e.children)?e.children:[]};return t.current.length===0&&t.current.push(0),t.children.length===0&&t.children.push({}),t}function L3(e,t){let n=[],r=e;for(let e=0;e<t.length;e++)r=r.children?.[t[e]]||{},n.push(r);return n}function R3(e,t,n={}){let r=e.indexOf(t);if(r!==-1){let t=r+1;return e.splice(t,0,n),t}return e.push({})-1}function z3(e,t){let n=e.view.QueryEditor,r={},i,a=NaN,o=!1,s=NaN,c,l,u=I3({}),d,f=[],p=null,m=[],h=[],g=null,_=[],v,y,b=new n((t,n,r,i)=>v.checked?e.querySuggestions(t,n,r,i):null).on(`change`,(n,r)=>{y.checked&&(r.origin!==`setValue`&&(h=h.slice(),e.cancelScheduledRender()),p&&=(p.clear(),null),t({query:n},!0))}),x=e.getQueryEngineInfo(),S=$(`div`,`query-graph-actions`),C=$(`div`,`buttons`),w=$(`div`,`query-input`),T=$(`div`,`query-input-details`),E=$(`div`,`data-query-result`),D=$(`div`,`data-query-result-details`),O=$(`div`,`query-datasets`),k=$(`div`,`query-graph`),A=$(`div`,`query-path`),j=$(`div`,`form query-editor-form`,[O,k,A,$(`div`,`query-editor`,[b.el])]);b.inputPanelEl.append(S,w,T,$(`a`,{class:`view-link query-engine`,href:x.link,target:`_blank`},[`${x.name} ${x.version||``}`])),b.outputPanelEl.append(E,C,D);let M=e=>({position:`trigger`,className:`hint-tooltip`,showDelay:!0,content:{view:`context`,data:typeof e==`function`?e:()=>e,content:`md`}});function ee(e=``){N(({nextGraph:t,last:n})=>(Array.isArray(n.children)||(n.children=[]),n.query=c,n.view=l,t.current.push(n.children.push({})-1),{query:e,view:void 0,graph:t}))}e.view.render(S,[{view:`button`,className:`subquery`,tooltip:M(`Create a new query for a result of current one`),onClick:ee},{view:`button`,className:`stash`,tooltip:M(()=>u.current.length<2?`Stash current query and create a new empty root query`:`Stash current query and create a new empty query for current parent`),onClick(){N(({nextGraph:e,last:t,preLast:n})=>{let r=n.children||[];return t.query=c,t.view=l,e.current[e.current.length-1]=R3(r,t),{query:``,view:void 0,graph:e}})}},{view:`button`,className:`clone`,tooltip:M(`Clone current query`),onClick(){N(({nextGraph:e,last:t,preLast:n})=>{let r=n.children||[];return t.query=c,t.view=l,e.current[e.current.length-1]=R3(r,t),{graph:e}})}},{view:`button`,className:`delete`,tooltip:M(`Delete current query and all the descendants`),onClick(){N(({nextGraph:e,last:t,preLast:n})=>{let r=n.children?.indexOf(t)??-1,i=n.query,a=n.view;if(n.children?.splice(r,1),n.children?.length||(n.children=void 0),e.current.pop(),e.current.length===0){let t=Math.max(0,Math.min(r-1,(e.children?.length||0)-1));e.current.push(t),i=e.children?.[t]?.query}return{query:i,view:a,graph:e}})}}]),C.append($(`label`,{class:`view-checkbox suggestions`,tabindex:0},[v=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange(){b.focus(),b.cm.showHint()}}),$(`span`,`view-checkbox__label`,`suggestions`)]),$(`label`,{class:`view-checkbox live-update`,tabindex:0},[y=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange({target:e}){b.focus(),e.checked&&t({query:b.getValue()},!0)}}),$(`span`,`view-checkbox__label`,`process on input`)])),e.view.attachTooltip(v.parentNode,M(()=>v.checked?`Query suggestions enabled<br>(click to disable)`:`Query suggestions disabled<br>(click to enable)`)),e.view.attachTooltip(y.parentNode,M(()=>y.checked?`Auto-perform query enabled<br>(click to disable)`:`Auto-perform query disabled<br>(click to enable)`)),e.view.render(C,{view:`button-primary`,content:`text:"Process"`,onClick:()=>{m=m.slice(0,u.current.length-1),t({query:b.getValue()},!0),e.scheduleRender(`page`)}}),A.addEventListener(`click`,({target:e})=>{let t=e.closest(`.query-path > *`),n=[...A.children].indexOf(t);n!==-1&&N(({nextGraph:e,currentPath:t,last:r})=>(r.query=c,e.current=e.current.slice(0,n+1),{query:t[n+1].query,graph:e}))}),k.addEventListener(`click`,({target:e})=>{let t=e.closest(`[data-action]`);if(k.contains(t))switch(t?.dataset.action){case`new-root-node`:N(({nextGraph:e,last:t})=>(t.query=c,t.view=l,e.current=[e.children.push({})-1],{query:``,view:void 0,graph:e}));break;case`select`:let{path:e}=t.dataset;typeof e==`string`&&e!==u.current.join(` `)&&N(({nextGraph:t,last:n})=>{let r=e.split(` `).map(Number),i=L3(t,r),a=i[i.length-1],o=a.query,s=a.view;return a.query=void 0,a.view=void 0,n.query=c,n.view=l,t.current=r,{query:o,view:s,graph:t}},!1)}});function te(e,n=!0,r=!1){t(e,r),n&&setTimeout(()=>{b.focus(),b.cm.setCursor(b.cm.lineCount(),0)},0)}function N(e,t=!0){let n=JSON.parse(JSON.stringify(u)),r=[n,...L3(n,n.current)],i=r[r.length-1],a=r[r.length-2];te(e({nextGraph:n,currentPath:r,last:i,preLast:a}),t)}function ne(e){w.innerHTML=``,w.append($(`div`,{class:`query-input-data`,tabindex:-1,onclick(){i=i===`data`?void 0:`data`,re(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`input`},[`@`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:M3(j3(e.data))]),$(`div`,{class:`query-input-context`,tabindex:-1,onclick(){i=i===`context`?void 0:`context`,re(e)}},[$(`span`,{class:`query-input-variable`,"data-name":`context`},[`#`]),e.state===`awaiting`?`Computing...`:e.state===`canceled`?`Not available (undefined)`:M3(j3(e.context))])),re(e)}function re(t){if(b.inputPanelEl.classList.toggle(`details-expanded`,i!==void 0),w.dataset.details=i,i){let n=t.state!==`awaiting`&&t.state!==`canceled`?t[i]:NaN;n!==a&&(a=n,t.state===`awaiting`?T.textContent=`<div class="state-message">Computing...</div>`:t.state===`canceled`?T.innerHTML=`<div class="state-message">Not available because one of ancestor queries failed<div>`:(T.innerHTML=``,e.view.render(T,[{view:`struct`,expanded:1}],a)))}else a=NaN,T.innerHTML=``}function ie(e,t,n){let r=[$(`span`,`query-output-message`,Array.isArray(n)?n:[n])];t&&r.unshift($(`span`,`query-output-prelude`,[t])),E.replaceChildren($(`div`,{class:`query-result-data`+(e.state===`failed`?` error`:``),tabindex:-1,onclick(){o=!o,P(e)}},r))}function ae(e){switch(e.state){case`canceled`:b.setValue(e.query),ie(e,`Result`,`Not available`);break;case`awaiting`:b.setValue(e.query),ie(e,null,`Awaiting...`);break;case`computing`:b.setValue(e.query,e.data,e.context),ie(e,null,`Computing...`);break;case`successful`:b.setValue(e.query,e.data,e.context),ie(e,`Result`,[M3(j3(e.computed)),` in `,M3(Math.floor(e.duration)),`ms`]);break;case`failed`:{let{error:t}=e,n=t?.details?.loc?.range,r=b.cm.doc;if(t&&Array.isArray(n)&&n.length===2){let[i,a]=n;p=t.details?.token===`EOF`||i===a||e.query[i]===`
|
|
511
|
+
`?r.setBookmark(r.posFromIndex(i),{widget:$(`span`,`discovery-editor-error`,` `)}):r.markText(r.posFromIndex(i),r.posFromIndex(a),{className:`discovery-editor-error`})}b.setValue(e.query,e.data,e.context),ie(e,`Error`,[t?.message.split(/\n/)[0].replace(/^(Parse error|Bad input).+/s,`Parse error`)||`Error`]);break}}P(e)}function P(t){if(b.outputPanelEl.classList.toggle(`details-expanded`,o),o){let n=t.state!==`awaiting`&&t.state!==`canceled`&&t.state!==`computing`?t.error||t.computed:NaN;if(n!==s)switch(s=n,t.state){case`awaiting`:D.innerHTML=`<div class="state-message">Awaiting for all of ancestor queries done<div>`;break;case`canceled`:D.innerHTML=`<div class="state-message">Not available because one of ancestor queries failed<div>`;break;case`failed`:D.innerHTML=`<div class="discovery-error query-error">`+tz(t.error?.message||``)+`</div>`;break;case`successful`:D.innerHTML=``,e.view.render(D,{view:`struct`,expanded:1},s)}}else s=NaN,D.innerHTML=``}function F(e){let t=k.querySelector(`[data-path="${e.path}"]`);t&&(t.dataset.state=e.state),e===g&&(ne(e),ae(e))}function I(t,n,r,i,a=e=>{setTimeout(e,1)}){if(t!==h)return Promise.reject(`Computation plan is canceled`);for(let o=n,s=!1;o<t.length;o++){let n=t[o];if(n.state===`awaiting`&&(n.state=`computing`),s?n.state=`canceled`:n.state===`failed`&&(s=!0),n.state!==`computing`){if(r=n.computed,i=n.context,F(n),n===g)return Promise.resolve(n);continue}return new Promise((s,c)=>{n.data=r,n.context=i,F(n),a(()=>{if(t!==h)return Promise.reject(`Computation plan is canceled`);let a=Date.now();try{n.computed=e.query(n.query,n.data,n.context),n.state=`successful`}catch(e){n.error=e,n.state=`failed`}n.duration=Date.now()-a,setTimeout(()=>I(t,o,r,i).then(s,c),1)})})}return Promise.reject(`No target computation found`)}function oe(e,t,n,r){let i=e.current,a=L3(e,i),o=[],s=null;for(let e=0,l=Math.min(i.length,r.length);e<l;e++){let l=r[e],u=e===i.length-1?c:a[e].query||``;if(!Object.is(l.query,u)||!Object.is(l.data,t)||!Object.is(l.context,n))break;o.push(l),l.path=i.slice(0,e+1).join(` `),t=l.computed,s=l.error}for(let e=o.length;e<i.length;e++){let t=e===i.length-1?c:a[e].query||``,n=r[e]={state:s?`canceled`:`awaiting`,path:i.slice(0,e+1).join(` `),query:t||``,data:void 0,context:void 0,computed:void 0,error:null,duration:0};r[e]=n,o.push(n)}return o}function se(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function L(e,t,n){let r=oe(e,t,n,m),i=r[r.length-1],a=!se(h,r),o=!se(_,e.current);h=r,_=e.current,i!==g&&(g=i,F(i));let s=I(h,0,t,n,e=>requestAnimationFrame(()=>setTimeout(e,1)));if(a||o){let e=new Map(r.map(({path:e,state:t})=>[e,t]));for(let t of k.querySelectorAll(`[data-path]`)){let n=t,r=n.dataset.state,i=e.get(n.dataset.path);r!==i&&(typeof i==`string`?n.dataset.state=i:delete n.dataset.state)}let t=document.createComment(``);k.replaceWith(t),t.replaceWith(k)}return g!==i&&(g=i,F(g)),s}return{el:j,createSubquery:ee,appendToQuery(e){te({query:typeof c==`string`&&c.trimRight()!==``?c.replace(/(\n[ \t]*)*$/,()=>`
|
|
512
|
+
| `+e):e},!0,!0)},perform(t,n){let i=S3(n,d),a=C3(n),o=a.query,s=a.view,p=I3({...a.graph||r});return S.classList.toggle(`root`,p.current.length<2),f=P3(O,i.datasets||[],f),F3(k,p,e,{query:o,view:s}),u=p,d=i,c=o,l=s,L(u,t,i)}}}function B3(e){return!!(e&&e.nodeType===Node.TEXT_NODE)}function V3(e,t=`
|
|
513
|
+
`){let n=``;for(let r of e.childNodes)!B3(r)&&r.previousSibling&&!B3(r.previousSibling)&&(n+=t),n+=H3(r,t);return n}function H3(e,t=`
|
|
514
|
+
`){switch(e.nodeType){case Node.ELEMENT_NODE:let[n,r=``]=e.cloneNode().outerHTML.split(/(?=<\/[^>]+>$)/);return n+(e.firstChild&&!B3(e.firstChild)?t+` `:``)+V3(e,t+` `)+(e.lastChild&&!B3(e.lastChild)?t:``)+r;case Node.TEXT_NODE:return e.nodeValue;case Node.COMMENT_NODE:return`<!--`+e.nodeValue+`-->`;case Node.DOCUMENT_FRAGMENT_NODE:return V3(e,t)}return``}function U3(e,t){let n=[],r=[...Array.isArray(e.highlight)?e.highlight:e.highlight?[e.highlight]:[]];Array.isArray(e.highlightProps)&&r.push(`(")?(?:${e.highlightProps.join(`|`)})\\1(?=:)`);for(let e of r){let r=new RegExp(e,`gm`),i=null;for(;i=r.exec(t);)n.push({range:[i.index,i.index+i[0].length]})}return n}var W3=e=>(t,n)=>{let r=n.params?.render===`text`?`text`:`web`,i=[...e.view.values],a=[...e.textView.values];return{...n,render:r,views:{webViews:i,textViews:a,selected:r===`text`?a:i}}};function G3(e){let t={view:`context`,modifiers:[{view:`switch`,when:`beforeDemo`,content:[{when:({beforeDemo:e})=>typeof e==`string`,content:`html:"<p>" + beforeDemo + "</p>"`},{content:{view:`render`,config:`beforeDemo`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}}]},{view:`block`,when:`demo or view`,className:`usage-render`,postRender(e,{onInit:t},{demoFixed:n},r){n&&(e.classList.add(`demo-fixed`),e.style.height=n+`px`),e.dataset.renderType=r.render,t(e,`root`)},content:{view:`render`,config:`demo or view | #.render != "text" ?: [{ view: "text-render", content: $ }, { view: "text-render-tree", when: false, content: $ }]`,data:`demoData`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}},{view:`switch`,when:`afterDemo`,content:[{when:({afterDemo:e})=>typeof e==`string`,content:`html:"<p>" + afterDemo + "</p>"`},{content:{view:`render`,config:`afterDemo`,context:`{ __demoContext: true, ...(viewDef | { name, group, options }) }`}}]}],content:{view:`tabs`,when:`source != false`,className:`usage-sources`,name:`code`,tabs:[{value:`config`,text:`Config (JS)`},{value:`config-json`,text:`Config (JSON)`},{value:`html`,text:`Rendered HTML`}],content:{view:`switch`,content:[{when:`#.code="config"`,content:[{view:`expand`,when:`"demoData" in $`,header:`text:"Input data"`,content:{view:`struct`,expanded:2,data:`demoData`}},{view:`source`,className:`first-tab`,data:e=>{let t=jY(e.demo||e.view);return{syntax:`discovery-view`,content:t,refs:U3(e,t)}}}]},{when:`#.code="config-json"`,content:[{view:`expand`,when:`"demoData" in $`,header:`text:"Input data"`,content:{view:`struct`,expanded:2,data:`demoData`}},{view:`source`,data:e=>{let t=JSON.stringify(e.demo||e.view,null,4);return{syntax:`json`,content:t,refs:U3(e,t)}}}]},{when:`#.code="html"`,content:{view:`source`,data:(e,t)=>({syntax:`html`,content:V3(t.root)})}}]}}};return{view:`block`,className:`discovery-view-usage`,context:W3(e),data({name:e,options:t},n){let r=n.views.selected.filter(e=>e.options.usage===t.usage).map(e=>e.name);return r.includes(e)||r.unshift(e),n.viewDef={demo:{view:e,data:`"`+e+`"`},...typeof t.usage==`function`?t.usage(e,r):Array.isArray(t.usage)?{examples:t.usage}:t.usage,name:e,group:r,options:t}},content:[`h1:name`,t,{view:`list`,data:`examples`,whenData:!0,itemConfig:{className:`usage-section`},item:[`h2{ anchor: true, data: title }`,t]}]}}var K3=`{
|
|
515
|
+
view: 'struct',
|
|
516
|
+
expanded: 1
|
|
517
|
+
}`,q3=[{name:`Table`,content:jY({view:`table`})},{name:`Auto-link list`,content:jY({view:`ol`,item:`auto-link`})},{name:`Signature`,content:jY({view:`signature`,expanded:2})},{name:`Text render`,content:jY({view:`text-render`,content:[`table`]})}];function J3(e,t,n){return $(`div`,{class:`discovery-editor-tab`,onclick:()=>n({view:t})},e||`Untitled preset`)}function Y3(e,t){let n=e.view.ViewEditor,r=q3,i={},a,o,s,c,l,u=new n().on(`change`,e=>l.checked&&t({view:e},!0)),d=$(`div`,`buttons`),f=$(`div`,`form view-editor-form`,[$(`div`,`view-editor-form-header`,[$(`div`,`discovery-editor-tabs view-mode`,c=[`Default`,`Custom`].map(e=>$(`div`,{class:`discovery-editor-tab`,"data-mode":e.toLowerCase(),onclick(){this.classList.contains(`active`)?t({viewEditorHidden:!f.classList.contains(`hide-editor`)},!0):t({view:e===`Default`?void 0:K3,viewEditorHidden:!1},!0)}},e===`Custom`?[e,$(`span`,`show-view-editor-toggle`)]:e))),$(`div`,`discovery-editor-tabs presets`,r.map(({name:e,content:n})=>J3(e,n,t))),$(`div`,`view-editor-form-header-links`,`<a href="#views-showcase" class="view-link">Views showcase</a>`)]),$(`div`,`view-editor-form-content`,[$(`button`,{class:`view-button formatting`,title:`Prettify (input should be a JSON)`,onclick(){u.focus();try{let e=u.getValue().trim();t({view:jY(Function(`return 0,`+e)())})}catch(t){e.logger.error(`View editor prettify failed:`,t)}}}),u.el,$(`div`,`editor-toolbar`,[a=$(`div`,`view-expand`,[$(`div`,{class:`header`,onclick(){a.classList.toggle(`expanded`),s.classList.toggle(`visible`)}},[o=$(`div`,`header-content`),$(`div`,`trigger`)]),s=$(`div`,`view-editor-view-list`)]),$(`label`,`view-checkbox`,[l=$(`input`,{class:`live-update`,type:`checkbox`,checked:!0,onchange(){this.checked&&t({view:u.getValue()},!0)}}),$(`span`,`view-checkbox__label`,`build on input`)]),d])])]);e.view.render(d,{view:`button-primary`,content:`text:"Build"`,onClick(){i={},t({view:u.getValue()},!0),e.scheduleRender(`page`)}}),new e.view.Popup({className:`view-editor-view-list-hint`,hoverTriggers:`.view-editor-view-list .item.with-usage`,render(t,n){e.view.render(t,G3(e),e.view.get(n?.textContent),{})}}),o.textContent=`Available ${[...e.view.entries].filter(([,e])=>e.options.usage).length} views`;let p=()=>s.innerHTML=`<a href="#views-showcase" class="view-link">Views showcase</a><br><br>`+[...e.view.entries].sort().map(([e,t])=>`<div><a class="item view-link${t.options.usage?` with-usage`:``}" ${t.options.usage?`href="#views-showcase:`+e+`"`:``}>${e}</a></div>`).join(``);return p(),e.view.on(`define`,xZ(p,100)),{el:f,render(t,n,r){let a=S3(n,i.context),o=C3(n),s=typeof o.view==`string`?`custom`:`default`,l=s==="default"||o.viewEditorHidden===!0,d=o.view,p=null;if(u.setValue(d),f.classList.toggle(`hide-editor`,l),c.forEach(e=>e.classList.toggle(`active`,e.dataset.mode===s)),!d&&s==="default"&&(d=K3),i.view!==d||i.data!==t||i.context!==a){r.innerHTML=``;try{p=Function(`return `+(d?`0,`+d:`null`))(),e.view.render(r,p,t,a)}catch(t){e.view.render(r,n=>{n.className=`discovery-error render-error`,n.innerHTML=tz(String(t))+`<br>(see details in console)`,e.logger.error(t)})}i={data:t,context:a,view:d}}}}}function X3(e){function t(t,n){return e.setPageParams({...e.pageParams,...t},n)}function n(){if(o!==null)return o;let n=O3(e,t),r=z3(e,t),i=Y3(e,t),a=$(`div`,{class:`discovery-editor discovery-hidden-in-dzen`,hidden:!0},[r.el,i.el]),s=$(`div`,`discovery-render-content`);return o={header:n,queryEditor:r,viewEditor:i,discoverEditorEl:a,discoverContentEl:s,layout:[...n.el,a,s]}}function r(e){return e===s}function i(e,t){r(t)&&n().queryEditor.createSubquery(e)}function a(e,t){r(t)&&n().queryEditor.appendToQuery(e)}let o=null,s=NaN;e.on(`pageStateChange`,t=>{e.pageId!==t.id&&(e.pageId===e.discoveryPageId?(e.action.define(`queryAcceptChanges`,r),e.action.define(`querySubquery`,i),e.action.define(`queryAppend`,a)):(e.action.revoke(`queryAcceptChanges`),e.action.revoke(`querySubquery`),e.action.revoke(`queryAppend`)))}),e.page.define(`discovery`,function(e,t,r){let{header:i,queryEditor:a,viewEditor:o,discoverEditorEl:c,discoverContentEl:l}=n();c.hidden=r?.params.noedit,i.render(t,r),s=NaN,a.perform(t,r).then(e=>{if(e.error){o.el.hidden=!0,l.hidden=!0;return}s=e.computed,o.el.hidden=!1,l.hidden=!1,o.render(s,r,l)},()=>{})},{reuseEl:!0,init(e){n().layout.forEach(t=>e.appendChild(t))},encodeParams:v3,decodeParams:y3})}var Z3=`
|
|
518
|
+
## Working with views
|
|
519
|
+
|
|
520
|
+
In Discovery.js, presentations are organized as a tree of views. Views are defined using object notation, where the \`view\` property specifies the type, and additional properties allow further customization.
|
|
521
|
+
|
|
522
|
+
\`\`\`discovery-view
|
|
523
|
+
{
|
|
524
|
+
view: "view-name"
|
|
525
|
+
}
|
|
526
|
+
\`\`\`
|
|
527
|
+
|
|
528
|
+
A view definition takes \`data\` and \`context\` values, which can be used to define properties and control rendering. Views can transform data and context (using the \`data\` and \`context\` properties) for use by the view and its descendant views, enabling clear data flow. Views are rendered by calling the render method:
|
|
529
|
+
|
|
530
|
+
\`\`\`js
|
|
531
|
+
discovery.render(containerEl, viewDefinition, data, context)
|
|
532
|
+
\`\`\`
|
|
533
|
+
|
|
534
|
+
Discovery.js is designed to be declarative. For dynamic calculations or event handling, [jora](https://discoveryjs.github.io/jora/) queries are preferred over JavaScript functions.
|
|
535
|
+
|
|
536
|
+
Each view can use the following properties:
|
|
537
|
+
|
|
538
|
+
- \`view\` (required) — Specifies the view type.
|
|
539
|
+
- \`when\` — Controls whether the view should be rendered. Evaluated before \`data\` transformation.
|
|
540
|
+
- \`context\` — Transforms the input context for the view and its nested views.
|
|
541
|
+
- \`data\` — Transforms the input data for the view and its nested views.
|
|
542
|
+
- \`whenData\` — Controls rendering based on the computed \`data\`. Evaluated after \`context\` and \`data\` are set.
|
|
543
|
+
- \`className\` — Adds CSS class name(s) to the root element of the view (see [ClassName](#!classname)).
|
|
544
|
+
- \`postRender\` — A function executed after rendering the view but before placing it in the DOM.
|
|
545
|
+
- \`tooltip\` — Sets up a tooltip for the view (only applicable to views with a container element, see [Tooltips](#!tooltips)).
|
|
546
|
+
|
|
547
|
+
The sequence of property evaluation during rendering (view render lifecycle):
|
|
548
|
+
|
|
549
|
+
\`\`\`
|
|
550
|
+
[start] render(data, context)
|
|
551
|
+
\\ | |
|
|
552
|
+
* when() | | stop rendering when value is falsy
|
|
553
|
+
|\\ | |
|
|
554
|
+
| * context() ------------|-----* (async) replace \`context\` with new value
|
|
555
|
+
| \\ | |
|
|
556
|
+
| * data() -------------* | (async) replace \`data\` with new value
|
|
557
|
+
| \\ | |
|
|
558
|
+
| * whenData() | | stop rendering when value is falsy
|
|
559
|
+
| |\\ | |
|
|
560
|
+
| | * (render) | | (async) main render logic
|
|
561
|
+
| | \\ | |
|
|
562
|
+
| | * postRender() | | do something once (render) is done
|
|
563
|
+
| | \\ | |
|
|
564
|
+
| | * className() | | compute className and apply to root element
|
|
565
|
+
| | \\ V V
|
|
566
|
+
+-----+-----> * [finish render]
|
|
567
|
+
\`\`\`
|
|
568
|
+
|
|
569
|
+
- \`context\` and \`data\` — Modify the flow of context or data based on the provided value:
|
|
570
|
+
- **String** — Treated as a jora query, and its result is used.
|
|
571
|
+
- **Function** (\`fn(data, context)\`) — The result of the function invocation is used.
|
|
572
|
+
- **Other values** — Directly used as a new value for data or context.
|
|
573
|
+
- \`when\` and \`whenData\` — Determine if a view should be rendered:
|
|
574
|
+
- **String** — Treated as a jora query.
|
|
575
|
+
- \`true\` — Evaluated as an empty query, meaning the data itself is tested for truthiness.
|
|
576
|
+
- \`undefined\` — Treated as not specified, allowing rendering.
|
|
577
|
+
- **Function** (\`fn(data, context)\`) or other values — Evaluated for truthiness.
|
|
578
|
+
> Note: In jora, empty arrays and objects with no own keys are falsy, unlike JavaScript where they are truthy.
|
|
579
|
+
|
|
580
|
+
\`\`\`discovery-view
|
|
581
|
+
{
|
|
582
|
+
view: 'list',
|
|
583
|
+
data: 'some.list.sort(name asc)', // Fetch an array for the list view, based on current data
|
|
584
|
+
whenData: 'size() > 0', // Check if the array has elements, skip rendering if empty
|
|
585
|
+
item: 'text:name' // Render each element as text, displaying the name
|
|
586
|
+
}
|
|
587
|
+
\`\`\`
|
|
588
|
+
|
|
589
|
+
## Computable property values
|
|
590
|
+
|
|
591
|
+
If a property starts with \`=\`, it indicates a jora query used to compute the property's value before a rendering.
|
|
592
|
+
|
|
593
|
+
\`\`\`discovery-view
|
|
594
|
+
{
|
|
595
|
+
view: 'list',
|
|
596
|
+
limit: '=size() <= 12 ? false : 10' // Dynamically computes the limit based on flow data
|
|
597
|
+
}
|
|
598
|
+
\`\`\`
|
|
599
|
+
|
|
600
|
+
> To pass a literal string that starts with \`=\`, use a query like \`'="=some string"'\`.
|
|
601
|
+
|
|
602
|
+
## Shorthand notations
|
|
603
|
+
|
|
604
|
+
Discovery.js supports shorthand notations for defining views, making the configuration more concise:
|
|
605
|
+
|
|
606
|
+
| Shorthand notation | Expanded form |
|
|
607
|
+
| --------------------------------------- | -------------------------------------------------- |
|
|
608
|
+
| \`'name'\` | \`{ view: 'name' }\` |
|
|
609
|
+
| \`'name:<query>'\` | \`{ view: 'name', data: '<query>' }\` |
|
|
610
|
+
| \`'name{ foo: size() / 2, bar: "qux" }'\` | \`{ view: 'name', foo: '=size() / 2', bar: 'qux' }\` |
|
|
611
|
+
|
|
612
|
+
## Lists of views
|
|
613
|
+
|
|
614
|
+
Multiple views can be combined into a list using an array:
|
|
615
|
+
|
|
616
|
+
\`\`\`discovery-view
|
|
617
|
+
{
|
|
618
|
+
view: 'list',
|
|
619
|
+
item: [ // render two views as a content of a list item
|
|
620
|
+
'text:name',
|
|
621
|
+
{ view: 'badge', data: 'something.size()' }
|
|
622
|
+
]
|
|
623
|
+
}
|
|
624
|
+
\`\`\`
|
|
625
|
+
|
|
626
|
+
## ClassName
|
|
627
|
+
|
|
628
|
+
The \`className\` property uses a sequence of transformations to convert its input into a final array of class names. This process can start from different input forms — such as a jora query, a function, a string, or an array — and move through each step until a definitive result is obtained. At each stage, the current value is examined and transformed if applicable; if not, the process continues to the next step:
|
|
629
|
+
|
|
630
|
+
1. **Jora Query (String Starting with \`=\`)**
|
|
631
|
+
If the initial value begins with \`=\`, it is treated as a jora query and compiled into a function. That function is then processed as described in the next step.
|
|
632
|
+
|
|
633
|
+
\`\`\`discovery-view
|
|
634
|
+
{
|
|
635
|
+
view: "text",
|
|
636
|
+
className: "=isValid ? 'valid' : 'invalid'"
|
|
637
|
+
}
|
|
638
|
+
\`\`\`
|
|
639
|
+
<br>
|
|
640
|
+
|
|
641
|
+
2. **Function**
|
|
642
|
+
Once a function is available (either provided directly or obtained from a jora query) it is called with \`(data, context)\`. The return value can be a string or an array, otherwise discarded.
|
|
643
|
+
|
|
644
|
+
\`\`\`discovery-view
|
|
645
|
+
{
|
|
646
|
+
view: "text",
|
|
647
|
+
className: (data, context) => data.flag ? "highlighted" : null
|
|
648
|
+
}
|
|
649
|
+
\`\`\`
|
|
650
|
+
<br>
|
|
651
|
+
|
|
652
|
+
3. **String**
|
|
653
|
+
Any string (obtained from the previous steps or provided directly) is trimmed and split by whitespace to produce an array of class names, excluding empty entries.
|
|
654
|
+
|
|
655
|
+
\`\`\`discovery-view
|
|
656
|
+
{
|
|
657
|
+
view: "text",
|
|
658
|
+
className: "primary emphasized"
|
|
659
|
+
}
|
|
660
|
+
\`\`\`
|
|
661
|
+
<br>
|
|
662
|
+
|
|
663
|
+
4. **Array**
|
|
664
|
+
When the value is or becomes an array, each element is processed:
|
|
665
|
+
- If an element is a function, it is called with \`(data, context)\` and its result replaces the function.
|
|
666
|
+
- All falsy or empty results are removed.
|
|
667
|
+
|
|
668
|
+
\`\`\`discovery-view
|
|
669
|
+
{
|
|
670
|
+
view: "text",
|
|
671
|
+
className: [
|
|
672
|
+
"base-class",
|
|
673
|
+
data => data.error && "error-indicator",
|
|
674
|
+
""
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
\`\`\`
|
|
678
|
+
|
|
679
|
+
If \`data.error\` is true, this may result in \`class="base-class error-indicator"\`. If \`data.error\` is false, the array would become \`["base-class", false, ""]\`, and after filtering out falsy and empty values, it results in \`class="base-class"\`.
|
|
680
|
+
|
|
681
|
+
If, after all steps, there are no valid class names, the \`class\` attribute is not applied. This cascading process ensures any initial input — jora query, function, string, or array — is consistently transformed into a meaningful final list of class names.
|
|
682
|
+
|
|
683
|
+
## Tooltips
|
|
684
|
+
|
|
685
|
+
Tooltips can be configured using a simple view definition or an object with additional settings. When the \`tooltip\` value is a view definition, it becomes the \`content\` of the tooltip.
|
|
686
|
+
|
|
687
|
+
\`\`\`discovery-view
|
|
688
|
+
{
|
|
689
|
+
view: 'button',
|
|
690
|
+
tooltip: 'md:"Some **content**"'
|
|
691
|
+
}
|
|
692
|
+
\`\`\`
|
|
693
|
+
|
|
694
|
+
\`\`\`discovery-view
|
|
695
|
+
{
|
|
696
|
+
view: 'button',
|
|
697
|
+
tooltip: {
|
|
698
|
+
position: 'trigger',
|
|
699
|
+
content: 'md:"Some **content**"'
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
\`\`\`
|
|
703
|
+
|
|
704
|
+
| Tooltip value | Normalized tooltip config |
|
|
705
|
+
| --------------------------------- | ---------------------------------------------- |
|
|
706
|
+
| \`'shorthand-view-notation'\` | \`{ content: 'shorthand-view-notation' }\` |
|
|
707
|
+
| \`{ view: 'name', ... }\` | \`{ content: { view: 'name', ... } }\` |
|
|
708
|
+
| \`['view', { view: 'name', ... }]\` | \`{ content: ['view', { view: 'name', ... }] }\` |
|
|
709
|
+
|
|
710
|
+
Tooltip options:
|
|
711
|
+
|
|
712
|
+
- \`className\` — Additional class names for the tooltip element.
|
|
713
|
+
- \`position\` — Where the tooltip is positioned. Options are \`'trigger'\` or \`'pointer'\` (default).
|
|
714
|
+
- \`positionMode\` — Positioning mode. Options are \`'natural'\` (default) or \`'safe'\`.
|
|
715
|
+
- \`pointerOffsetX\` — Horizontal offset from the pointer (default: 3).
|
|
716
|
+
- \`pointerOffsetY\` — Vertical offset from the pointer (default: 3).
|
|
717
|
+
- \`hideOnTriggerClick\` – Hide the tooltip when click a trigger element.
|
|
718
|
+
- \`showDelay\` — Delay before showing the tooltip. Options are \`true\` (300ms, default), \`false\` (0ms), a number, or a function that returns a boolean or numeric value.
|
|
719
|
+
- \`content\` — View configuration for tooltip content.
|
|
720
|
+
`,Q3=`
|
|
721
|
+
## Working with text views
|
|
722
|
+
|
|
723
|
+
Text views in Discovery.js adhere to the same underlying principles as standard web-based views but are simplified due to the constraints of textual representation (e.g., lack of interactivity and styling).
|
|
724
|
+
|
|
725
|
+
Text views are managed through the \`Model#textView\` interface, enabling text rendering for any model type (\`Model\`, \`ViewModel\`, \`ScriptModel\`, etc.):
|
|
726
|
+
|
|
727
|
+
\`\`\`js
|
|
728
|
+
model.textView.define('text-view-name', render);
|
|
729
|
+
// ...
|
|
730
|
+
const renderTree = model.textView.render(null, 'text-view-name:...', data, context);
|
|
731
|
+
const { text } = model.textView.serialize(renderTree);
|
|
732
|
+
|
|
733
|
+
console.log(text);
|
|
734
|
+
\`\`\`
|
|
735
|
+
|
|
736
|
+
Each text view supports a limited set of properties compared to regular views, but these retain the same semantics:
|
|
737
|
+
|
|
738
|
+
- \`view\` (required) — Specifies the view type.
|
|
739
|
+
- \`when\` — Controls whether the view should be rendered. Evaluated before \`data\` transformation.
|
|
740
|
+
- \`context\` — Transforms the input context for the view and its nested views.
|
|
741
|
+
- \`data\` — Transforms the input data for the view and its nested views.
|
|
742
|
+
- \`whenData\` — Controls rendering based on the computed \`data\`. Evaluated after \`context\` and \`data\` are set.
|
|
743
|
+
|
|
744
|
+
## Layout model
|
|
745
|
+
|
|
746
|
+
The text renderer builds a render tree composed of **box nodes** and **text nodes**.
|
|
747
|
+
|
|
748
|
+
- **Text nodes**: Represent direct text strings. Their values can include newline characters.
|
|
749
|
+
- **Box nodes**: Define the layout of their content and can optionally render a "border" around it. The content is generated by rendering child nodes, which can be a mix of box and text nodes. Box nodes support several display types:
|
|
750
|
+
- \`inline\` — Inserts its content lines as-is.
|
|
751
|
+
- \`inline-block\` — Ensures that whitespace is added before and after its content to prevent merging with adjacent boxes. If the content spans multiple lines, subsequent lines align with the first line.
|
|
752
|
+
- \`line\` — Places the box's content on a new line within its parent box.
|
|
753
|
+
- \`block\` — Similar to \`line\`, but also adds an extra empty line before and after the content when needed.
|
|
754
|
+
|
|
755
|
+
\`\`\`render:text
|
|
756
|
+
[
|
|
757
|
+
'text:"…text…"',
|
|
758
|
+
'inline:"<inline\\\\nwith multi-line\\\\ntext...>"',
|
|
759
|
+
'text:"…text…"',
|
|
760
|
+
'inline-block:"<inline-block\\\\nwith multi-line\\\\ntext...>"',
|
|
761
|
+
'text:"…text…"',
|
|
762
|
+
'line:"<line\\\\nwith multi-line\\\\ntext...>"',
|
|
763
|
+
'text:"…text…"',
|
|
764
|
+
'block:"<block\\\\nwith multi-line\\\\ntext...>"',
|
|
765
|
+
'text:"…text…"'
|
|
766
|
+
]
|
|
767
|
+
\`\`\`
|
|
768
|
+
|
|
769
|
+
## Box border
|
|
770
|
+
|
|
771
|
+
A box border is an optional decorative frame that can be drawn around a box node’s content. Although termed a "border", its appearance is highly customizable and might not resemble a traditional border. A border can consist of up to four sides – top, right, bottom, and left – and by default, boxes have no border.
|
|
772
|
+
|
|
773
|
+
There are slight differences in how vertical (left and right) and horizontal (top and bottom) borders are defined, though the corresponding pairs behave similarly.
|
|
774
|
+
|
|
775
|
+
### Vertical sides (left and right)
|
|
776
|
+
|
|
777
|
+
Left and right borders specify the characters to be prepended or appended to each line of the box’s content, effectively drawing vertical lines along the sides. The value for these borders can be defined in several ways:
|
|
778
|
+
|
|
779
|
+
- **Falsy value:** A falsy value (e.g., \`null\`, empty string) means no border is drawn.
|
|
780
|
+
- **String:** A static string that is added to the beginning (for \`left\`) or end (for \`right\`) of each line. For the \`right\` border, lines are padded with spaces to ensure consistent line lengths.
|
|
781
|
+
- **Function:** A function with the signature \`(index, total) => string | undefined\` for fine-tuned control. This allows different characters for the first, middle, and last lines. For example:
|
|
782
|
+
|
|
783
|
+
\`\`\`js
|
|
784
|
+
const leftBorder = (index, total) =>
|
|
785
|
+
total === 1 ? '[' :
|
|
786
|
+
index === 0 ? '⎡' :
|
|
787
|
+
index + 1 === total ? '⎣' : '⎢';
|
|
788
|
+
\`\`\`
|
|
789
|
+
|
|
790
|
+
If the function returns strings of varying lengths, they are padded with spaces (from the start for \`left\` and from the end for \`right\`) to equalize their lengths.
|
|
791
|
+
- **Array of strings:** An array of 1 to 4 strings representing \`start\`, \`middle\`, \`end\`, and \`single\` cases, respectively. For example:
|
|
792
|
+
|
|
793
|
+
\`\`\`js
|
|
794
|
+
const leftBorder = ['⎡', '⎢', '⎣', '['];
|
|
795
|
+
\`\`\`
|
|
796
|
+
|
|
797
|
+
This form is equivalent to a function that selects the appropriate border based on the line index and total number of lines:
|
|
798
|
+
|
|
799
|
+
\`\`\`ts
|
|
800
|
+
function borderLR(start: string, mid = start, end = mid, single = start) {
|
|
801
|
+
return (idx: number, total: number) =>
|
|
802
|
+
total === 1 ? single : idx === 0 ? start : idx + 1 === total ? end : mid;
|
|
803
|
+
}
|
|
804
|
+
\`\`\`
|
|
805
|
+
|
|
806
|
+
### Horizontal Sides (top and bottom)
|
|
807
|
+
|
|
808
|
+
Top and bottom borders define the first and last lines of the box after the left and right borders have been applied. Their value can be set in one of the following ways:
|
|
809
|
+
|
|
810
|
+
- **Falsy value:** No border is drawn if the value is falsy.
|
|
811
|
+
- **String:** A static string that is repeated to achieve the required total length (\`midLen + leftLen + rightLen\`).
|
|
812
|
+
- **Function:** A function with the signature \`(midLen, leftLen, rightLen) => string | undefined\` that returns a string. If the returned string is non-empty, it is truncated to match the total length. For example:
|
|
813
|
+
|
|
814
|
+
\`\`\`js
|
|
815
|
+
const topBorder = (midLength, leftLen, rightLen) =>
|
|
816
|
+
\`\${<}\${''.padEnd(midLength + leftLen + rightLen, '-')}\${>}\`;
|
|
817
|
+
\`\`\`
|
|
818
|
+
|
|
819
|
+
- **Array of strings:** An array of 1 to 3 strings representing \`start\`, \`middle\`, and \`end\` segments. This is equivalent to a function that constructs the border by concatenating the start, a repeated middle, and the end string. For example:
|
|
820
|
+
|
|
821
|
+
\`\`\`js
|
|
822
|
+
const topBorder = ['<', '-', '>'];
|
|
823
|
+
\`\`\`
|
|
824
|
+
|
|
825
|
+
This form is equivalent to a call the function:
|
|
826
|
+
|
|
827
|
+
\`\`\`ts
|
|
828
|
+
function borderTB(start: string, mid = start, end = mid) {
|
|
829
|
+
return (m: number, l: number, r: number) =>
|
|
830
|
+
\`\${start}\${''.padStart(m + l + r - start.length - end.length, mid)}\${end}\`;
|
|
831
|
+
}
|
|
832
|
+
\`\`\`
|
|
833
|
+
|
|
834
|
+
### Using borders in views
|
|
835
|
+
|
|
836
|
+
Most view definitions include a preset border that cannot be modified. However, any content can be wrapped in a basic box view (\`inline\`, \`inline-block\`, \`line\`, or \`block\`) to add a border.
|
|
837
|
+
|
|
838
|
+
For example, a full border definition using array notation for sides:
|
|
839
|
+
|
|
840
|
+
\`\`\`render:text
|
|
841
|
+
{
|
|
842
|
+
view: 'inline-list',
|
|
843
|
+
data: [1, 2, 3, 4, 5],
|
|
844
|
+
item: {
|
|
845
|
+
view: 'inline-block',
|
|
846
|
+
data: '$seq:=>?[...$ - 1 | $seq(), "line " + $]:[];$seq().join("\\\\n")',
|
|
847
|
+
border: {
|
|
848
|
+
top: ['←', '-', '→'],
|
|
849
|
+
left: ['↑ ', '|', '↓', '[ '],
|
|
850
|
+
right: [' ↑', '|', '↓', ' ]'],
|
|
851
|
+
bottom: ['←', '-', '→']
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
\`\`\`
|
|
856
|
+
|
|
857
|
+
Borders can also be specified in a compact array notation following the TRBL (top, right, bottom, left) order, similar to CSS:
|
|
858
|
+
|
|
859
|
+
\`\`\`render:text
|
|
860
|
+
{
|
|
861
|
+
view: 'block',
|
|
862
|
+
border: ['T', 'R', 'B', 'L'],
|
|
863
|
+
content: 'text:" \\\\n "'
|
|
864
|
+
}
|
|
865
|
+
\`\`\`
|
|
866
|
+
|
|
867
|
+
If the bottom border element is undefined, it inherits the top border value (if defined). Similarly, if the left border is undefined while the right border is specified, the left border adopts the right border value. This mechanism allows you to define vertical and horizontal borders with just two elements.
|
|
868
|
+
|
|
869
|
+
\`\`\`render:text
|
|
870
|
+
{
|
|
871
|
+
view: 'block',
|
|
872
|
+
border: ['-', '|'],
|
|
873
|
+
content: 'text:" \\\\n "'
|
|
874
|
+
}
|
|
875
|
+
\`\`\`
|
|
876
|
+
|
|
877
|
+
The following example demonstrates the difference between \`undefined\` and a falsy value (such as \`null\`):
|
|
878
|
+
|
|
879
|
+
\`\`\`render:text
|
|
880
|
+
{
|
|
881
|
+
view: 'block',
|
|
882
|
+
border: [['+', '-', '+'], '|', undefined, null],
|
|
883
|
+
content: 'text:" \\\\n "'
|
|
884
|
+
}
|
|
885
|
+
\`\`\`
|
|
886
|
+
|
|
887
|
+
Each element in the concise notation accepts any value applicable for a side in object notation, i.e. a string, a function or array of strings.
|
|
888
|
+
`,$3={view:`switch`,content:[{when:`syntax="render:text"`,content:{view:`block`,className:`view-render`,content:[{view:`block`,className:`view-render__source`,content:`source{ syntax: "discovery-view", source }`},{view:`block`,className:`view-render__result`,data:e=>({...e,config:{view:e.syntax===`render:text`?`text-render`:`context`,content:Function(`return `+e.source)()}}),content:`render{ config }`}]}},{content:`source`}]};function e6(e){e.on(`pageAnchorChange`,t=>{if(e.pageId===`views-showcase`&&t&&!e.pageAnchor){let t=e.dom.content.querySelector(`.page-views-showcase > .content`);t&&(t.scrollTop=0)}}),e.page.define(`views-showcase`,{view:`context`,context:W3(e),data:`#.views.selected`,modifiers:[{view:`block`,className:`sidebar`,content:[{view:`block`,className:`sidebar-header`,content:[{view:`link`,className:`="index-page-link" + (#.id ? " view-selected" : "")`,href:`="".pageLink(#.page, #.params.render |? { render: $ })`,text:`Intro`},{view:`context`,content:{view:`toggle-group`,className:`render-toggle`,beforeToggles:`text:"Render:"`,value:`=#.render`,onChange(t){e.setPageParams(t===`text`?{render:`text`}:{})},data:[{value:`web`},{value:`text`}]}}]},{view:`content-filter`,content:{view:`menu`,name:`view`,limit:!1,emptyText:`Nothing matched`,item:`text-match:{ text: name, match: #.filter }`,itemConfig:{postRender(e,t,n){e.dataset.name=n.name}},context:(t,n)=>({...n,selectedViewId:e.pageRef}),data:`
|
|
889
|
+
.[name ~= #.filter]
|
|
890
|
+
.sort(name asc)
|
|
891
|
+
.({ ..., disabled: no options.usage, selected: name = #.selectedViewId })
|
|
892
|
+
`}}]}],content:{view:`block`,className:`content`,data:`$[=> name=(#.view.name or #.id)]`,content:{view:`switch`,context(t,n){return e.overridePageHashStateWithAnchor({ref:t?.name,anchor:e.pageRef===(t?.name||null)?e.pageAnchor:null}),e.cancelScheduledRender(),setTimeout(()=>{let n=e.dom.root.querySelector(`article > .view-block.sidebar .index-page-link`),r=e.dom.root.querySelector(`article > .view-block.sidebar > .view-content-filter > .content`);n&&n.classList.toggle(`view-selected`,e.pageRef),r&&(r.querySelector(`:scope .view-menu-item.selected`)?.classList?.remove(`selected`),r.querySelector(`:scope .view-menu-item[data-name=${CSS.escape(t?.name)}]`)?.classList?.add(`selected`))},50),{...n,id:e.pageRef}},content:[{when:`no $ and #.id`,content:`alert-warning:"View \\"" + #.id + "\\" not found"`},{when:`no $`,content:[`h1:#.render = "text" ? "Model's text views" : "Model's views"`,`alert:"← Select a view to get details"`,{view:`markdown`,when:`#.render = "web"`,source:Z3,codeConfig:$3},{view:`markdown`,when:`#.render = "text"`,source:Q3,codeConfig:$3}]},{content:[G3(e)]}]}}},{sidebar:!1})}var t6=s({default:()=>p3,discovery:()=>X3,notFound:()=>m3,viewsShowcase:()=>e6}),n6=[`nav`,`sidebar`,`page`],r6=()=>{},i6=e=>e,a6=e=>Object.fromEntries(e);function o6(e,t,n){n?e.dataset[t]=n:delete e.dataset[t]}function s6(e,t,n,r){let i=e.page.get(t)?.options;return i!==void 0&&YR(i,n)?i[n]:r}function c6(e,t,n,r){let i=s6(e,t,n,r);return typeof i==`function`?i:r}var l6=class extends xX{compact;colorScheme;inspectMode;view;nav;preset;page;#e;#t;defaultPageId;discoveryPageId;reportToDiscoveryRedirect;pageId;pageRef;pageParams;pageAnchor;pageHash;dom;queryExtensions;constructor(e){let{container:t,styles:n,extensions:r,logLevel:i,compact:a,darkmode:o=`light-only`,darkmodePersistent:s=!1,colorScheme:c=o,colorSchemePersistent:l=s,defaultPage:u,defaultPageId:d,discoveryPageId:f,reportToDiscoveryRedirect:p=!0,inspector:m=!1}=e||{};super({...e,logLevel:i||`perf`,extensions:void 0}),(`darkmode`in e||`darkmodePersistent`in e)&&this.logger.warn(`ViewModel "darkmode" option is deprecated, use "colorScheme" instead`),this.compact=!!a,this.colorScheme=new BX(c,l),this.inspectMode=new rz(!1),this.initDom(n),this.view=new mZ(this),this.nav=new HX(this),this.preset=new vZ(this.view),this.page=new _Z(this,this.view),this.#e=new Set,this.#t=16,this.defaultPageId=d||`default`,this.discoveryPageId=f||`discovery`,this.reportToDiscoveryRedirect=!!p,this.pageId=this.defaultPageId,this.pageRef=null,this.pageParams={},this.pageAnchor=null,this.pageHash=this.encodePageHash(this.pageId,this.pageRef,this.pageParams,this.pageAnchor),this.apply(f3),this.apply(t6),u&&this.page.define(this.defaultPageId,u),m&&this.apply(MZ),this.apply(r),this.setPageHash(this.pageHash),this.setContainer(t),this.scheduleRender();for(let{name:e,page:t}of this.objectMarkers.values)t&&!this.page.isDefined(t)&&this.logger.error(`Page reference "${t}" in object marker "${e}" doesn't exist`)}initRenderTriggers(){this.on(`context`,()=>this.scheduleRender()),this.on(`unloadData`,()=>this.scheduleRender()),this.on(`pageStateChange`,()=>this.scheduleRender(`nav`,`page`)),this.on(`pageAnchorChange`,()=>this.applyPageAnchor()),this.action.on(`define`,()=>this.scheduleRender(`nav`,`page`)).on(`revoke`,()=>this.scheduleRender(`nav`,`page`)),this.page.on(`define`,e=>{this.pageId===e&&(this.setPageHash(this.pageHash),this.scheduleRender(`page`))})}async setData(e,t){let{render:n=!0}=t||{};await super.setData(e,t),n&&this.scheduleRender()}async setDataProgress(e,t,n){let{dataset:r,progressbar:i}=n||{};this.cancelScheduledRender(),this.emit(`startSetData`,(...e)=>i?.subscribeSync(...e)||(()=>{})),await i?.setState({stage:`prepare`}),await this.setData(e,{dataset:r,setPrepareWorkTitle:i?.setStateStep.bind(i),render:!1}),await i?.setState({stage:`initui`}),this.scheduleRender(),await Promise.all([!this.dom.wrapper.parentNode||this.dom.ready,this.enforceScheduledRenders()]),i?.finish()}initDom(e){let t=$(`div`,`discovery`),n=t.attachShadow({mode:`open`}),r=n.appendChild($(`div`)),i=$(`article`),a=$(`div`,`discovery-nav discovery-hidden-in-dzen`),o=$(`nav`,`discovery-sidebar discovery-hidden-in-dzen`),s=$(`main`,`discovery-content`,[i]),c=SX(n,this.info.icon?e?.concat(`.discovery-root{--discovery-app-icon:url(${JSON.stringify(this.info.icon)}`):e);this.dom={ready:c,wrapper:t,root:n,container:r,nav:a,sidebar:o,content:s,pageContent:i,detachColorScheme:this.colorScheme.subscribe(e=>r.classList.toggle(`discovery-root-darkmode`,e===`dark`),!0)},r.classList.add(`discovery-root`,`discovery`),r.append(a,o,s),n.addEventListener(`click`,e=>{let t=e.target?.closest(`a`);t&&!t.getAttribute(`target`)&&t.origin===location.origin&&t.pathname===location.pathname&&(e.preventDefault(),e.stopPropagation(),t.classList.contains(`ignore-href`)||this.setPageHash(t.hash)||this.applyPageAnchor())},!0)}setContainer(e){e instanceof HTMLElement?e.append(this.dom.wrapper):this.dom.wrapper.remove()}disposeDom(){typeof this.dom.detachColorScheme==`function`&&(this.dom.detachColorScheme(),this.dom.detachColorScheme=null),this.dom.container.remove(),this.dom=null}addGlobalEventListener(e,t,n){return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}addHostElEventListener(e,t,n){let r=this.dom.container;return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}scheduleRender(...e){let t=!1;e.length===0&&(t=!0,e=[...n6]);for(let t of e)this.#e.add(t);this.#e.timer&&clearTimeout(this.#e.timer),this.#e.timer=setTimeout(()=>this.enforceScheduledRenders(),this.#t),this.logger.debug(`Scheduled renders: ${[...this.#e].join(`, `)} (requested: ${t?`all`:e.join(`, `)})`)}async enforceScheduledRenders(){let e=[...this.#e];this.logger.debug(`Enforce scheduled renders: ${e.join(`, `)||`none`}`),this.cancelScheduledRender();for(let t of e)switch(t){case`nav`:await this.renderNav();break;case`sidebar`:await this.renderSidebar();break;case`page`:await this.renderPage()}this.initRenderTriggers!==r6&&(this.initRenderTriggers(),this.initRenderTriggers=r6,this.#t=0)}cancelScheduledRender(e){let t=[...this.#e];e?this.#e.delete(e):this.#e.clear(),this.#e.size===0&&this.#e.timer&&(clearTimeout(this.#e.timer),this.#e.timer=null),this.#e.size!==t.length&&this.logger.debug(`Canceled renders: ${t.join(`, `)}`)}getRenderContext(){return{page:this.pageId,id:this.pageRef,params:this.pageParams,...this.getContext()}}renderNav(){return this.cancelScheduledRender(`nav`),this.nav.render(this.dom.nav,this.data,this.getRenderContext())}renderSidebar(){if(this.cancelScheduledRender(`sidebar`),this.hasDatasets()&&this.view.isDefined(`sidebar`)){let e=Date.now(),t=this.data,n=this.getRenderContext();return this.view.setViewRoot(this.dom.sidebar,`sidebar`,{data:t,context:n}),this.dom.sidebar.innerHTML=``,this.view.render(this.dom.sidebar,`sidebar`,t,n).finally(()=>this.logger.perf(`Sidebar rendered in ${Date.now()-e}ms`))}}encodePageHash(e,t=null,n,r=null){let i=e||this.defaultPageId,a=c6(this,e,`encodeParams`,i6)(n||{});return super.encodePageHash(i===this.defaultPageId?``:i,t,a,r)}decodePageHash(e){let{pageId:t,pageRef:n,pageParams:r,pageAnchor:i}=super.decodePageHash(e,e=>c6(this,e||this.defaultPageId,`decodeParams`,a6));return{pageId:t||this.defaultPageId,pageRef:n,pageParams:r,pageAnchor:i}}setPageHashState(e={},t=!1){return this.setPageHashStateWithAnchor({...e,anchor:null},t)}overridePageHashState(e,t=!1){return this.setPageHashState({...this.getPageHashState(),...e},t)}getPageHashState(){return{id:this.pageId,ref:this.pageRef,params:this.pageParams}}setPageHashStateWithAnchor(e,t=!1){let{id:n=null,ref:r=null,params:i={},anchor:a=null}=e;return this.setPageHash(this.encodePageHash(n||this.defaultPageId,r,i,a),t)}overridePageHashStateWithAnchor(e,t=!1){return this.setPageHashStateWithAnchor({...this.getPageHashStateWithAnchor(),...e},t)}getPageHashStateWithAnchor(){return{...this.getPageHashState(),anchor:this.pageAnchor}}setPage(e,t,n,r=!1){return this.setPageHashState({id:e,ref:t,params:n},r)}setPageRef(e=null,t=!1){return this.overridePageHashStateWithAnchor({ref:e},t)}setPageParams(e,t=!1){return this.overridePageHashStateWithAnchor({params:e},t)}setPageAnchor(e,t=!1){return this.overridePageHashStateWithAnchor({anchor:e},t)}setPageHash(e,t=!1){e.startsWith(`#`)||(e=`#`+e),e.startsWith(`#!`)&&(e=this.stripAnchorFromHash(this.pageHash)+(e.length>2?`&!anchor=`+e.slice(2):``));let{pageId:n,pageRef:r,pageParams:i,pageAnchor:a}=this.decodePageHash(e);if(this.reportToDiscoveryRedirect&&n===`report`&&this.discoveryPageId!==`report`&&setTimeout(()=>this.pageId===`report`&&this.setPageHashStateWithAnchor({id:this.discoveryPageId,ref:r,params:i,anchor:a},!0)),this.pageId!==n||this.pageRef!==r||!mX(this.pageParams,i)){let e=this.getPageHashState();this.pageId=n,this.pageRef=r,this.pageParams=i,this.emit(`pageStateChange`,e)}if(a!==this.pageAnchor){let e=this.pageAnchor;this.pageAnchor=a,this.emit(`pageAnchorChange`,e)}return e!==this.pageHash&&(this.pageHash=e,this.emit(`pageHashChange`,t),!0)}applyPageAnchor(e=!1){let t=this.dom.pageContent;if(this.pageAnchor){let e=t.querySelector(`#`+CSS.escape(`!anchor:`+this.pageAnchor));if(e){let n=t.querySelector(`.view-page-header`);e.style.scrollMargin=n?n.offsetHeight+`px`:``,e.scrollIntoView(!0)}}else e||(this.dom.content.scrollTop=0)}renderPage(){this.cancelScheduledRender(`page`);let{data:e,pageId:t,pageParams:n,compact:r}=this,i=this.getRenderContext();this.logger.debug(`Start page "${t}" rendering...`);let a=Date.now(),{pageEl:o,renderState:s,config:c}=this.page.render(this.dom.pageContent,t,e,i);return this.view.setViewRoot(o,`Page: ${t}`,{inspectable:!1,config:c,data:e,context:i}),this.dom.pageContent=o,o6(this.dom.container,`page`,t),o6(this.dom.container,`dzen`,!!n.dzen),o6(this.dom.container,`compact`,!!r),s.then(async()=>{await this.dom.ready,this.applyPageAnchor(!0)}).catch(e=>{this.logger.error(`Page "${t}" render error:`,e)}),s.finally(()=>{this.logger.perf(`Page "${t}" render done in ${Date.now()-a}ms`)})}};Object.assign(d6(),{setup:d6});var u6=e=>/^\./.test(e);function d6(e){return e={accept:`application/json,application/jsonxl,.json,.jsonxl`,useAcceptForFilePicker:!1,dragdrop:!0,clipboard:!1,...e},function(t){let n=!!e.useAcceptForFilePicker,r=!!e.dragdrop,i=!!e.clipboard,a=String(e.accept),o=a.split(`,`);r&&(t.dom.container.addEventListener(`drop`,e=>{t.loadDataFromEvent(e)},!0),t.dom.container.addEventListener(`dragover`,e=>{e.stopPropagation(),e.preventDefault()},!0),document.addEventListener(`paste`,e=>{let{files:n}=e.clipboardData||{files:[]};n?.length>0&&t.loadDataFromEvent(e)})),t.preset.define(`upload`,[{view:`button-primary`,text:'=`Open file${#.actions.uploadFile.fileExtensions |? " (" + join(", ") + ")" : "" | size() > 1 and size() <= 17 ?: "…"}`',onClick:`=#.actions.uploadFile`},{view:`context`,when:`#.actions.uploadDataFromClipboard`,content:[`html:"<span style=\\"color: #888; padding: 0 1ex\\"> or </span>"`,{view:`button`,text:`Paste from clipboard`,onClick:`=#.actions.uploadDataFromClipboard`}]},{view:`context`,when:`#.actions.uploadFile.dragdrop`,content:[`html:"<span style=\\"color: #888; padding: 0 1ex\\"> or </span>"`,`text:"drop a file on the page"`]}]),t.action.define(`unloadData`,()=>{t.unloadData()}),t.action.define(`uploadFile`,Object.assign(()=>{$(`input`,{type:`file`,accept:n?a:void 0,onchange:e=>t.loadDataFromEvent(e)}).click()},{fileExtensions:o.filter(e=>u6(e)),mimeTypes:o.filter(e=>!u6(e)),dragdrop:r,clipboard:i})),i&&t.action.define(`uploadDataFromClipboard`,async()=>{let e=await navigator.clipboard.readText();t.loadDataFromStream(new Blob([e]).stream())})}}Object.assign(g6(),{setup:g6});var f6=()=>{},p6=[`primary`,`secondary`,`menu`],m6=[`insert`,`prepend`,`append`,`before`,`after`,`replace`,`remove`];function h6(e,t,n){let r=Array.isArray(n)?n:[];return JSON.parse(JSON.stringify(e),(e,n)=>typeof n==`string`&&r.includes(n)?()=>t(`navMethod`,n):n)}function g6(e){let t=e?.hostId||qQ(),n=e?.postponeMessages,r=typeof e?.onNotify==`function`?e.onNotify:()=>{};return function(e){let i=null,a=f6,o=t=>{i?.finish(),i=null,t&&e.logger.debug(`Cancel chunked data load from host with error:`,t)},s=window.parent,c=new Map,l=(e,n)=>{let r={from:`discoveryjs-app`,id:t,type:e,payload:n};s.postMessage(r,`*`)},u=e=>{a=()=>{e!==null&&(a=f6,e())}},d=t=>{e.trackLoadDataProgress(t).catch(()=>{})},f=({data:n})=>{let{id:a,type:s,payload:u}=n||{};if(a===t)switch(s){case`notification`:{let{name:e,details:t}=u;r(e,t);break}case`defineAction`:{let t=u;e.action.define(t,(...e)=>new Promise((n,r)=>{let i=qQ();c.set(i,{resolve:n,reject:r}),setTimeout(()=>{c.delete(i),r(Error(`Timeout`))},3e4),l(`action`,{callId:i,name:t,args:e})}));break}case`actionResult`:{let{callId:t}=u;if(!c.has(t)){e.logger.error(`[Discovery.js] Unknown action call id "${t}"`);break}let{resolve:n,reject:r}=c.get(t);`error`in u?r(u.error):n(u.value);break}case`setPageHash`:{let{replace:t,hash:n}=u||{};e.setPageHash(n||``,t||!1);break}case`setPageHashState`:{let{replace:t,id:n,ref:r,params:i}=u||{};e.setPageHashState({id:n,ref:r,params:i},t);break}case`setPageHashStateWithAnchor`:{let{replace:t,id:n,ref:r,params:i,anchor:a}=u||{};e.setPageHashStateWithAnchor({id:n,ref:r,params:i,anchor:a},t);break}case`setPage`:{let{replace:t,id:n,ref:r,params:i}=u||{};e.setPage(n,r,i,t);break}case`setPageRef`:{let{replace:t,ref:n}=u||{};e.setPageRef(n,t);break}case`setPageParams`:{let{replace:t,params:n}=u||{};e.setPageParams(n,t);break}case`setPageAnchor`:{let{replace:t,anchor:n}=u||{};e.setPageAnchor(n,t);break}case`setColorSchemeState`:{let t=u;if(!NX.includes(t)){e.logger.warn(`Wrong value for colorScheme "${t}", supported values: ${NX.map(e=>JSON.stringify(e)).join(`, `)}`);break}e.colorScheme.set(t);break}case`setRouterPreventLocationUpdate`:e.action.call(`setPreventLocationUpdate`,!!u);break;case`changeNavButtons`:{let{section:t=`primary`,action:n=`unknown`}=u;if(!p6.includes(t)){e.logger.warn(`Wrong value for nav button place "${t}", supported values: ${p6.map(e=>JSON.stringify(e)).join(`, `)}`);break}switch(u.action){case`insert`:{let{name:n,position:r,config:i,commands:a}=u;e.nav[t].insert(h6(i,l,a),r,n);break}case`prepend`:case`append`:{let{config:n,commands:r}=u;e.nav[t][u.action](h6(n,l,r));break}case`before`:case`after`:case`replace`:{let{name:n,config:r,commands:i}=u;e.nav[t][u.action](n,h6(r,l,i));break}case`remove`:{let{name:n}=u;e.nav[t].remove(n);break}default:e.logger.warn(`Wrong value for nav button action "${n}", supported values: ${m6.map(e=>JSON.stringify(e)).join(`, `)}`)}break}case`unloadData`:o(),e.unloadData();break;case`dataStream`:{let{stream:e,resource:t}=u;o(),d(Lq(e,{resource:t}));break}case`startChunkedDataUpload`:{let{acceptToken:e,resource:t}=u;o(),i=Object.assign(Vq({resource:t}),{acceptToken:e}),d(i);break}case`cancelChunkedDataUpload`:{let{acceptToken:e,error:t}=u;i?.acceptToken===e&&o(t)}case`dataChunk`:{let{acceptToken:t}=u;if(i===null){e.logger.warn(`Loading data is not inited`);break}if(i.acceptToken!==t){e.logger.warn(`Bad accept token`);break}`value`in u&&u.value!==void 0&&i.push(u.value),`done`in u&&u.done&&o();break}default:e.logger.warn(`Got a post-message addressed to discovery app but with unknown "${s}" type`)}};s!==window&&(e.on(`pageHashChange`,t=>{l(`pageHashChanged`,{replace:t,hash:e.pageHash||`#`,id:e.pageId,ref:e.pageRef,params:e.pageParams,anchor:e.pageAnchor})}),e.on(`startLoadData`,e=>{a(),u(e(e=>l(`loadingState`,e)))}),e.on(`startSetData`,e=>{a(),u(e(e=>l(`loadingState`,e)))}),e.on(`data`,()=>{l(`data`,null)}),e.on(`unloadData`,()=>{a(),l(`unloadData`,null)}),e.colorScheme.subscribe((e,t)=>l(`colorSchemeChanged`,{state:t,value:zX(t)})),Array.isArray(n)&&Promise.resolve().then(()=>{for(let e of n)f({data:e})}),addEventListener(`message`,f,!1),addEventListener(`unload`,()=>l(`destroy`,null),!1),l(`ready`,{page:{hash:e.pageHash||`#`,id:e.pageId,ref:e.pageRef,params:e.pageParams,anchor:e.pageAnchor},colorScheme:{state:e.colorScheme.state,value:e.colorScheme.serializedValue}}))}}var _6=`.view-button{box-sizing:border-box;color:var(--discovery-view-button-color);background-color:var(--discovery-view-button-background-color);border:1px solid var(--discovery-view-button-border-color);font-family:inherit;font-size:inherit;text-align:center;cursor:pointer;--discovery-view-button-color:var(--discovery-color);--discovery-view-button-background-color:#ffffff1a;--discovery-view-button-border-color:#7f7f7f66;--discovery-view-button-hover-background-color:#dddddd4d;--discovery-view-button-hover-border-color:#aaa9;--discovery-view-button-active-background-color:#83838340;--discovery-view-button-active-border-color:var(--discovery-view-button-border-color);--discovery-view-button-focus-background-color:var(--discovery-view-button-background-color);--discovery-view-button-focus-border-color:#80808099;border-radius:3px;outline:none;margin:0;padding:8px 12px;line-height:1.2;display:inline-block;position:relative}.view-button:empty:before{content:"";float:left}.view-button:focus-visible{background-color:var(--discovery-view-button-focus-background-color);border-color:var(--discovery-view-button-focus-border-color);z-index:1;box-shadow:0 0 1px 3px #0af3}.view-button:hover,.view-button.discovery-view-popup-active{background-color:var(--discovery-view-button-hover-background-color);border-color:var(--discovery-view-button-hover-border-color)}.view-button:active{background-color:var(--discovery-view-button-active-background-color);border-color:var(--discovery-view-button-active-border-color)}.view-button[disabled]{opacity:.5;pointer-events:none;cursor:default}.view-button+.view-button{margin-left:1ex}.view-button-primary{--discovery-view-button-color:white;--discovery-view-button-background-color:#0af;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#009cf0;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#008ee0;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-primary{--discovery-view-button-color:#fffd;--discovery-view-button-background-color:#006aa3e6;--discovery-view-button-hover-background-color:#0074b3e6;--discovery-view-button-active-background-color:#006aa3d0}.view-button-danger{--discovery-view-button-color:white;--discovery-view-button-background-color:#ff6163;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#f05456;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#e34449;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-danger{--discovery-view-button-color:#fffd;--discovery-view-button-background-color:#c32224bf;--discovery-view-button-hover-background-color:#d02528bf;--discovery-view-button-active-background-color:#c32224a6}.view-button-warning{--discovery-view-button-color:#000000d6;--discovery-view-button-background-color:#ffcf21;--discovery-view-button-border-color:transparent;--discovery-view-button-hover-background-color:#fcbd00;--discovery-view-button-hover-border-color:transparent;--discovery-view-button-active-background-color:#f7ad00;--discovery-view-button-focus-border-color:transparent}.discovery-root-darkmode .view-button-warning{--discovery-view-button-color:#eeee;--discovery-view-button-background-color:#ffd40199;--discovery-view-button-hover-background-color:#ffd91aa6;--discovery-view-button-active-background-color:#ffd4018e}.view-checkbox-list>.view-checkbox{display:block}.view-checkbox{--discovery-checkbox-size:max(1em, 14px);padding-left:var(--discovery-checkbox-size)}.view-checkbox>input{appearance:none;content:"";font-size:inherit;box-sizing:border-box;height:var(--discovery-checkbox-size);width:var(--discovery-checkbox-size);margin:0;margin-left:calc(-1 * var(--discovery-checkbox-size));background-color:#fff3;background-position:50%;background-repeat:no-repeat;background-size:calc(.57 * var(--discovery-checkbox-size));border:1px solid #97a2aca6;border-radius:3px;outline:none;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;display:inline-block;position:relative;top:2px}.view-checkbox>input:checked{background-color:#0079e8ad;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 8 8\\">%0A <path fill=\\"%23fff\\" d=\\"M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z\\"/>%0A</svg>%0A");border-color:#0000}.view-checkbox>input:focus-visible{box-shadow:0 0 1px 3px #0af3}.view-checkbox>input:focus-visible:not(:checked){border-color:#008dffbf}.view-checkbox>input:active{background-color:#198bec99;border-color:#0000}.view-checkbox>input[readonly],.view-checkbox>input:disabled{box-shadow:none;background-color:#a5a5a54d;border-color:#a5a5a51a}.view-checkbox__label{margin-left:5px;margin-right:15px}.view-content-filter>.view-input{margin-bottom:1em;line-height:1}.view-content-filter>.view-input input{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path fill=\\"rgba(150, 150, 150, 0.65)\\" d=\\"M 21 3 C 11.601563 3 4 10.601563 4 20 C 4 29.398438 11.601563 37 21 37 C 24.355469 37 27.460938 36.015625 30.09375 34.34375 L 42.375 46.625 L 46.625 42.375 L 34.5 30.28125 C 36.679688 27.421875 38 23.878906 38 20 C 38 10.601563 30.398438 3 21 3 Z M 21 7 C 28.199219 7 34 12.800781 34 20 C 34 27.199219 28.199219 33 21 33 C 13.800781 33 8 27.199219 8 20 C 8 12.800781 13.800781 7 21 7 Z \\"></path>%0A</svg>%0A");background-position:100%;background-repeat:no-repeat;background-size:32px 16px;padding-right:30px}.view-content-filter>.content{flex:1;overflow:auto}.view-content-filter>.content .view-list:before{padding:5px 10px;display:block}.view-dropdown{box-sizing:border-box;min-width:10ex;max-width:100%;color:var(--discovery-color);background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;outline:none;flex-shrink:0;align-items:center;padding-right:1.2em;line-height:1.2;display:inline-flex;position:relative;overflow:hidden}.view-dropdown:after{content:"";color:#999;pointer-events:none;cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 28 28\\">%0A <path fill=\\"%23888\\" d=\\"M19,15.9393398 L24.4696699,10.4696699 C24.7625631,10.1767767 25.2374369,10.1767767 25.5303301,10.4696699 C25.8232233,10.7625631 25.8232233,11.2374369 25.5303301,11.5303301 L19.5303301,17.5303301 C19.2374369,17.8232233 18.7625631,17.8232233 18.4696699,17.5303301 L12.4696699,11.5303301 C12.1767767,11.2374369 12.1767767,10.7625631 12.4696699,10.4696699 C12.7625631,10.1767767 13.2374369,10.1767767 13.5303301,10.4696699 L19,15.9393398 Z\\" />%0A</svg>%0A");background-position:50%;background-size:1em;flex-shrink:0;align-items:center;width:1em;height:1em;display:flex;position:absolute;right:7px}.view-dropdown.discovery-view-popup-active,.view-dropdown:focus{z-index:1;border-color:#80808099;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-dropdown:hover{background-color:#dddddd4d;border-color:#aaa9}.view-dropdown:active{background-color:#83838340}.view-dropdown__caption{padding:8px 8px 8px 12px}.view-dropdown:not([data-placeholder]):empty .view-dropdown__caption:before{content:"|";visibility:hidden;padding:8px 0}.view-dropdown[data-placeholder]:empty .view-dropdown__caption:before{content:attr(data-placeholder);visibility:visible;color:#bbb;padding:8px 8px 8px 12px}.view-dropdown>*{pointer-events:none}.discovery-view-popup.view-dropdown-popup{flex-direction:column;display:flex;overflow:hidden}.discovery-view-popup.view-dropdown-popup>.content{flex-direction:column;flex:1;gap:5px;padding:8px;display:flex;overflow:hidden scroll}.discovery-view-popup.view-dropdown-popup>.confirm{text-align:right;background-color:#0003;padding:8px;font-size:80%}.discovery-view-popup.view-dropdown-popup>.confirm .view-button{padding-top:4px;padding-bottom:4px}.view-input input{box-sizing:border-box;width:100%;font-family:inherit;font-size:inherit;color:var(--discovery-color);background-color:#ffffff0d;border:1px solid #99999980;border-radius:3px;outline:0;margin:0;padding:8px 12px;line-height:1.2;position:relative}.view-input input:hover{border-color:#999999bf}.view-input input:focus{z-index:1;border-color:#00aaffa6;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-menu-item{color:inherit;cursor:pointer;padding:4px 12px;text-decoration:none;display:block}.view-menu-item:empty:before{content:"";float:left}.view-menu-item:hover,.view-menu-item.discovery-view-popup-active{background:#83838340}.view-menu-item.selected{cursor:default;background:#b2ddf84d}.view-menu-item.disabled{opacity:.65;pointer-events:none;background:0 0}.view-menu-item:not(.onclick):not([href]){pointer-events:none}.view-menu:empty:before{content:attr(emptyText);color:#888;padding:4px 12px;display:block}.view-menu>.more-buttons{margin:2px 12px 8px}.view-nav-button{vertical-align:top;color:#444;cursor:pointer;background-color:#9b9b9b26;outline:none;min-height:1.6em;padding:5px 15px 6px;font-size:12px;text-decoration:none;display:inline-block}.view-nav-button:hover,.view-nav-button:focus,.view-nav-button.discovery-view-popup-active{color:#000;background-color:#9797974d}.view-nav-button+.view-nav-button{margin-left:1px}.view-nav-button.disabled,.view-nav-button:not(.onclick):not([href]){pointer-events:none}.discovery-root-darkmode .view-nav-button{color:inherit}.view-progress{z-index:1;pointer-events:none;max-width:300px}.view-progress.skip-fast-track{transition:opacity .25s var(--appearance-delay,.5s);will-change:opacity;contain:paint}@starting-style{.view-progress.skip-fast-track{opacity:0}}.view-progress.skip-fast-track.done:not(.error){display:none}.view-progress>.progress{content:"";box-sizing:border-box;background:#c6c6c64d;border-radius:2px;height:3px;margin-top:4px;display:block;position:relative;overflow:hidden}.view-progress>.progress:before{content:"";width:100%;height:100%;transform:scaleX(var(--progress,0));transform-origin:0;background-color:var(--color,#1f7ec5);display:block;position:absolute;top:0;left:0}.view-progress>.content.main-secondary{white-space:nowrap;gap:1ex;display:flex}.view-progress>.content>.secondary{text-overflow:ellipsis;color:#888;flex:1;overflow:hidden}.view-select{box-sizing:border-box;min-width:10ex;max-width:100%;color:var(--discovery-color);background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;outline:none;flex-shrink:0;align-items:center;padding-right:1.2em;line-height:1.2;display:inline-flex;position:relative;overflow:hidden}.view-select:after{content:"";color:#999;pointer-events:none;cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 28 28\\">%0A <path fill=\\"%23888\\" d=\\"M19,15.9393398 L24.4696699,10.4696699 C24.7625631,10.1767767 25.2374369,10.1767767 25.5303301,10.4696699 C25.8232233,10.7625631 25.8232233,11.2374369 25.5303301,11.5303301 L19.5303301,17.5303301 C19.2374369,17.8232233 18.7625631,17.8232233 18.4696699,17.5303301 L12.4696699,11.5303301 C12.1767767,11.2374369 12.1767767,10.7625631 12.4696699,10.4696699 C12.7625631,10.1767767 13.2374369,10.1767767 13.5303301,10.4696699 L19,15.9393398 Z\\" />%0A</svg>%0A");background-position:50%;background-size:1em;flex-shrink:0;align-items:center;width:1em;height:1em;display:flex;position:absolute;right:7px}.view-select.discovery-view-popup-active,.view-select:focus{z-index:1;border-color:#80808099;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33}.view-select:hover{background-color:#dddddd4d;border-color:#aaa9}.view-select:active{background-color:#83838340}.view-select .view-menu-item{padding-top:8px;padding-bottom:8px;padding-right:8px}.view-select:empty:not([data-placeholder]):before{content:"|";visibility:hidden;padding:8px 0}.view-select:empty[data-placeholder]:before{content:attr(data-placeholder);visibility:visible;opacity:.3;padding:8px 8px 8px 12px}.view-select>*{pointer-events:none}.discovery-view-popup.view-select-popup{flex-direction:column;display:flex;overflow:hidden}.discovery-view-popup.view-select-popup>.view-select__variants{flex-direction:column;flex:1;min-width:100%;display:flex;overflow:auto}.discovery-view-popup.view-select-popup>.view-select__variants:not(:last-child){border-bottom:1px solid #cacacaa6}.discovery-view-popup.view-select-popup>.view-select__filter{border-bottom:1px solid #cacacaa6;margin:0}.discovery-view-popup.view-select-popup>:not(.view-tabs)+.view-select__filter{border-top:1px solid #cacacaa6}.discovery-view-popup.view-select-popup>.view-select__filter input,.discovery-view-popup.view-select-popup>.view-select__filter input:focus{box-shadow:none;border:none;outline:none}.discovery-view-popup.view-select-popup .reset-item{color:#aaa}.discovery-view-popup.view-select-popup .reset-item:empty:before{content:"(nothing selected)";visibility:visible}.view-tab{border-bottom:var(--discovery-view-tabs-border);cursor:pointer;white-space:nowrap;text-transform:capitalize;padding:3px 11px;font-size:13px;display:inline-block;position:relative}.view-tab.active{z-index:10;cursor:default;border-bottom:none;padding-bottom:4px}.view-tab.active:before{content:"";z-index:-1;border:var(--discovery-view-tabs-border);pointer-events:none;border-bottom:none;border-radius:5px 5px 0 0;position:absolute;inset:0}.view-tab.disabled{color:#aaa}.view-tab.disabled,.view-tab:not(.onclick){pointer-events:none}.view-tabs-buttons{--discovery-view-tabs-border:1px solid #aaa6;flex-wrap:wrap;align-items:flex-end;margin-top:2px;display:flex}.view-tabs-buttons:before,.view-tabs-buttons:after{content:"";border-bottom:var(--discovery-view-tabs-border);width:6px}.view-tabs-buttons:after{flex:1}.view-tabs-buttons-before,.view-tabs-buttons-after{border-bottom:var(--discovery-view-tabs-border);color:#888;padding:0 6px 3px;font-size:13px}.view-tabs-content{overflow:auto}.view-toggle-group{flex-wrap:wrap;align-items:baseline;display:inline-flex}.view-toggle-group-before{padding-right:1ex}.view-toggle-group-after{order:1000;padding-left:1ex}.view-toggle-group .view-toggle+.view-toggle{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:1px}.view-toggle-group .view-toggle:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.view-toggle{cursor:pointer;white-space:nowrap;background:#c8c8c833;border-radius:4px;padding:3px 12px;font-size:13px;display:inline-block;position:relative}.view-toggle:hover{background-color:#4ebbff33}.view-toggle.checked{cursor:default;background-color:#4ebbff4d}.view-toggle.disabled{color:#aaa}.view-toggle.disabled,.view-toggle:not(.onclick){pointer-events:none}.CodeMirror{color:#000;direction:ltr;height:300px;font-family:monospace}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{white-space:nowrap;background-color:#f7f7f7;border-right:1px solid #ddd}.CodeMirror-linenumber{text-align:right;color:#999;white-space:nowrap;min-width:20px;padding:0 3px 0 5px}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;width:auto;border:0!important}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span::-moz-selection{background:0 0}.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:#0000}@keyframes blink{50%{background-color:#0000}}.cm-tab{-webkit-text-decoration:inherit;text-decoration:inherit;display:inline-block}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute;top:0;bottom:0}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{background:#fff;position:relative;overflow:hidden}.CodeMirror-scroll{z-index:0;outline:none;height:100%;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;position:relative;overflow:scroll!important}.CodeMirror-sizer{border-right:50px solid #0000;position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{z-index:6;outline:none;display:none;position:absolute}.CodeMirror-vscrollbar{top:0;right:0;overflow:hidden scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow:scroll hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{z-index:3;min-height:100%;position:absolute;top:0;left:0}.CodeMirror-gutter{white-space:normal;vertical-align:top;height:100%;margin-bottom:-50px;display:inline-block}.CodeMirror-gutter-wrapper{z-index:4;position:absolute;background:0 0!important;border:none!important}.CodeMirror-gutter-background{z-index:4;position:absolute;top:0;bottom:0}.CodeMirror-gutter-elt{cursor:default;z-index:4;position:absolute}.CodeMirror-gutter-wrapper ::selection{background-color:#0000}.CodeMirror-gutter-wrapper ::selection{background-color:#0000}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{font-family:inherit;font-size:inherit;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual;background:0 0;border-width:0;border-radius:0;margin:0;position:relative;overflow:visible}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{z-index:0;position:absolute;inset:0}.CodeMirror-linewidget{z-index:2;padding:.1px;position:relative}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{box-sizing:content-box}.CodeMirror-measure{visibility:hidden;width:100%;height:0;position:absolute;overflow:hidden}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;z-index:3;position:relative}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection{background:#d7d4f0}.CodeMirror-line>span::selection{background:#d7d4f0}.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection{background:#d7d4f0}.CodeMirror-line>span::-moz-selection{background:#d7d4f0}.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:0 0}.cm-s-neo.CodeMirror{color:#2e383c;background-color:#fff;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{background-color:#0000;border:none;border-right:10px solid #0000}.cm-s-neo .CodeMirror-linenumber{color:#e0e2e5;padding:0}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{z-index:1;background:#9b9da25e;border:0;width:auto}.discovery-view-editor-hints-popup{z-index:1000;box-sizing:border-box;color:#000;min-width:200px;max-height:20em;font-family:var(--discovery-monospace-font-family);background:#fff;border:1px solid #b0b0b0a6;border-radius:2px;margin:0;padding:0;font-size:12px;line-height:18px;list-style:none;position:absolute;overflow:hidden auto;box-shadow:2px 3px 5px #0003}.discovery-root-darkmode .discovery-view-editor-hints-popup{color:#ccc;background:#323232}.discovery-view-editor-hint{white-space:pre;cursor:pointer;align-items:baseline;margin:0;padding:2px 6px;display:flex}.discovery-view-editor-hint:hover{background-color:#b4b4b433}.discovery-view-editor-hint .name{flex:1}.discovery-view-editor-hint .match{color:#06c}.discovery-root-darkmode .discovery-view-editor-hints-popup .discovery-view-editor-hint .match{color:#4d8bca}.discovery-view-editor-hint.active{background:#0af3}.discovery-view-editor-hint:before{content:"?";aspect-ratio:1;color:#888;text-align:center;border:1px solid;border-radius:3px;place-self:center;height:1em;margin-left:-2px;margin-right:4px;padding:2px;font-size:8px;line-height:1;display:inline-block}.discovery-view-editor-hint.type-variable:before{content:"$"}.discovery-view-editor-hint.type-property:before{content:"P"}.discovery-view-editor-hint.type-value:before{content:"V"}.discovery-view-editor-hint.type-method:before{content:"M"}.discovery-view-editor-hint.type-assertion:before{content:"A"}.discovery-view-editor{--editor-border-color:#7c7c7ca6;border:1px solid var(--editor-border-color);background-color:var(--discovery-background-color);border-radius:3px;flex-direction:column;margin-bottom:5px;display:flex}.discovery-view-editor:focus-within{--editor-border-color:#008dffbf;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33!important}.discovery-view-editor .discovery-view-editor__input-panel{order:0}.discovery-view-editor .discovery-view-editor__output-panel{order:2}.discovery-view-editor .CodeMirror{height:auto;font-family:var(--discovery-monospace-font-family);background-color:var(--discovery-input-bg-color);order:1;padding:2px 8px;font-size:12px;transition:background-color .25s ease-in,color .25s ease-in;overflow-y:hidden!important}.discovery-root-darkmode .discovery-view-editor .CodeMirror{color:#d1c7c3}.discovery-view-editor .CodeMirror-scroll{cursor:text;height:auto;min-height:6.5em;overflow-y:hidden!important}.discovery-view-editor.empty-value:not(:focus-within) .CodeMirror .CodeMirror-lines>div[role=presentation]:before{content:attr(data-placeholder);color:#666;position:absolute}.discovery-view-editor .CodeMirror .CodeMirror-line,.discovery-view-editor .CodeMirror .CodeMirror-line-like{padding:0}.discovery-view-editor .CodeMirror-cursor{border-left:1px solid var(--discovery-color,black);background:0 0}.discovery-view-editor .CodeMirror-focused .CodeMirror-selected{background-color:#00aaff38}.discovery-view-editor .CodeMirror-selected{background-color:#7e7e7e4d}.discovery-view-editor .CodeMirror .cm-comment{color:var(--discovery-fmt-comment-color)}.discovery-view-editor .CodeMirror .cm-keyword{color:var(--discovery-fmt-keyword-color)}.discovery-view-editor .CodeMirror .cm-property{color:var(--discovery-fmt-property-color)}.discovery-view-editor .CodeMirror .cm-atom{color:var(--discovery-fmt-atom-color)}.discovery-view-editor .CodeMirror .cm-number{color:var(--discovery-fmt-number-color)}.discovery-view-editor .CodeMirror .cm-type{color:var(--discovery-fmt-type-color)}.discovery-view-editor .CodeMirror .cm-node,.discovery-view-editor .CodeMirror .cm-tag{color:#9c3328}.discovery-view-editor .CodeMirror .cm-string,.discovery-view-editor .CodeMirror .cm-string-2{color:var(--discovery-fmt-string-color)}.discovery-view-editor .CodeMirror .cm-variable,.discovery-view-editor .CodeMirror .cm-variable-2,.discovery-view-editor .CodeMirror .cm-def,.discovery-view-editor .CodeMirror .cm-qualifier{color:var(--discovery-fmt-variable-color)}.discovery-view-editor .CodeMirror .cm-discovery-view-name{background-color:var(--discovery-fmt-string-highlight-color);border-bottom:1px dashed}.view-inline-list>.view-list-item,.view-comma-list>.view-list-item{list-style:none;display:inline-block}.view-comma-list>.view-list-item>*{margin-right:0}.view-comma-list>.view-list-item:after{content:", ";white-space:pre}.view-comma-list>.view-list-item:last-child:after{content:""}.view-list{list-style:none;display:block}.view-ul,.view-ol{margin:0;padding-left:0}.view-ul:not(:empty),.view-ol:not(:empty){padding-left:20px}:is(.view-list,.view-ul,.view-ol)+:is(.view-list,.view-ul,.view-ol),.view-list-item>:is(.view-list,.view-ul,.view-ol){margin-top:0;margin-bottom:2px}.view-inline-list,.view-comma-list{display:inline-block}.view-list:empty:before,.view-inline-list:empty:before,.view-ul:empty:before,.view-ol:empty:before{content:attr(emptyText);color:#888}.view-alert{color:#383d41;background-color:#8b8f9740;background-clip:padding-box;border:1px solid #989da566;border-radius:.25rem;margin-bottom:1rem;padding:.75rem 1.25rem;position:relative}.discovery-root-darkmode .view-alert{color:var(--discovery-color)}.view-alert:last-child{margin-bottom:0}.view-alert>:first-child{margin-top:0}.page>.view-alert:first-child,.page>.view-alert-success:first-child,.page>.view-alert-danger:first-child,.page>.view-alert-warning:first-child{margin-top:15px}.view-alert-primary{color:#004085;background-color:#3397ff40;border-color:#4da2ff66}.discovery-root-darkmode .view-alert-primary{color:#6a96c6}.view-alert-success{color:#155724;background-color:#53b76b40;border-color:#69c07d66}.discovery-root-darkmode .view-alert-success{color:#5fab70}.view-alert-danger{color:#721c24;background-color:#e35f6b40;border-color:#e6707d66}.discovery-root-darkmode .view-alert-danger{color:#c7888e}.view-alert-warning{color:#856404;background-color:#ffcf3740;border-color:#ffd45266}.discovery-root-darkmode .view-alert-warning{color:#bdab77}.view-app-header{align-items:center;gap:10px;display:flex}.view-app-header:not(:last-child){margin-bottom:30px}.view-app-header .icon{--icon:var(--discovery-app-icon);float:left;aspect-ratio:1;vertical-align:middle;background:50% no-repeat;background-image:var(--icon,var(--discovery-app-icon));background-color:#f4f4f4;background-size:48px;border-radius:3px;width:48px;padding:4px;line-height:1;display:inline-block}.discovery-root-darkmode .view-app-header .icon{background-color:#2b2b2b}.view-app-header h1{margin:0;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-size:30px;font-weight:200;line-height:31px}.view-app-header .version{vertical-align:top;opacity:.4;margin-left:1ex;font-size:12px;line-height:18px;display:inline-block}.view-app-header .version:hover{opacity:.75}.view-app-header .description{color:#aaa;font-size:12px;line-height:19px}.view-badge,.view-pill-badge{--discovery-view-badge-color:#87878733;--discovery-view-badge-text-color:var(--discovery-color);text-shadow:1px 1px #ffffff59;background:var(--discovery-view-badge-color);color:var(--discovery-view-badge-text-color);white-space:nowrap;border-radius:3px;margin-right:1ex;padding:1px 6px 3px;font-size:85%;text-decoration:none}.view-pill-badge{border-radius:9px}.discovery-root-darkmode .view-badge,.discovery-root-darkmode .view-pill-badge{background:var(--discovery-view-badge-dark-color,var(--discovery-view-badge-color));color:var(--discovery-view-badge-dark-text-color,var(--discovery-view-badge-text-color));text-shadow:1px 1px #0000001a}.view-badge[href]:hover,.view-badge.onclick:hover,.view-pill-badge[href]:hover,.view-pill-badge.onclick:hover{color:var(--discovery-color);cursor:pointer;background-image:linear-gradient(#0000001a,#0000001a)}.view-badge>.prefix{background-color:#0000001f;border-radius:3px 0 0 3px;margin:-1px 6px -3px -6px;padding:1px 6px 3px}.view-badge>.postfix{background-color:#0000001f;border-radius:0 3px 3px 0;margin:-1px -6px -3px 6px;padding:1px 6px 3px}.view-pill-badge>.prefix{background-color:#0000001f;border-radius:8px 0 0 8px;margin:-1px 6px -3px -6px;padding:1px 6px 3px}.view-pill-badge>.postfix{background-color:#0000001f;border-radius:0 8px 8px 0;margin:-1px -6px -3px 6px;padding:1px 6px 3px}.discovery-buildin-view-tooltip .view-badge,.discovery-buildin-view-tooltip .view-pill-badge{margin:0 0 3px -5px;padding-top:0;padding-bottom:1px;line-height:19px;display:inline-block}.view-blockquote{border-left:.25em solid var(--color,#bfc5c580);margin:1px 0;padding:0 0 0 1em}.view-blockquote:not([data-kind]){color:#6a737d}.discovery-root-darkmode .view-blockquote:not([data-kind]){color:#808993}.view-blockquote[data-kind]{padding-top:.4em;padding-bottom:.4em}.view-blockquote[data-kind]:before{content:var(--blockquote-title-text,attr(data-kind));background-image:var(--blockquote-title-icon);color:var(--blockquote-title-color);text-transform:capitalize;background-position:0;background-repeat:no-repeat;background-size:1.1em;margin-bottom:.2em;padding-left:calc(1em + .9ex);display:block}.view-blockquote[data-kind=note]{--color:#1f6feb;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%234493f8\\">%0A <path d=\\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\\"/>%0A</svg>%0A");--blockquote-title-color:#4493f8}.view-blockquote[data-kind=tip]{--color:#238636;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%233fb950\\">%0A <path d=\\"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z\\"/>%0A</svg>%0A");--blockquote-title-color:#3fb950}.view-blockquote[data-kind=important]{--color:#8957e5;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23ab7df8\\">%0A <path d=\\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\\"/>%0A</svg>%0A");--blockquote-title-color:#ab7df8}.view-blockquote[data-kind=warning]{--color:#9e6a03;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23d29922\\">%0A <path d=\\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\\"/>%0A</svg>%0A");--blockquote-title-color:#d29922}.view-blockquote[data-kind=caution]{--color:#da3633;--blockquote-title-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23f85149\\">%0A <path d=\\"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\\"/>%0A</svg>%0A");--blockquote-title-color:#f85149}.view-header{font-size:120%;font-weight:400;position:relative}.view-header>.view-header__anchor{text-align:center;width:22px;color:inherit;opacity:0;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" fill=\\"%23888\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1.002 1.002 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4.018 4.018 0 0 1-.128-1.287z\\"/>%0A <path d=\\"M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243L6.586 4.672z\\"/>%0A</svg>%0A") 50%/20px no-repeat content-box content-box;margin-left:-22px;padding-top:2px;font-weight:400;transition:opacity .25s;display:inline-block;position:absolute}.view-header:hover>.view-header__anchor{opacity:1}.view-header>.view-header__anchor:before{content:"§";visibility:hidden;width:0;display:inline-block}.view-h1{margin:.812em 0 .65em;font-size:220%;font-weight:400}.view-h2{margin:.78em 0;font-size:150%;font-weight:400}.view-h3{margin:.73em 0;font-size:135%;font-weight:400}.view-h4{margin:.73em 0;font-size:120%;font-weight:400}.view-h5{margin:.68em 0;font-size:110%;font-weight:400}.view-link{color:var(--discovery-link-color,#09d);text-decoration-skip:ink;-webkit-text-decoration-color:var(--discovery-link-underline-color,#09d6);text-decoration-color:var(--discovery-link-underline-color,#09d6)}.view-link.onclick{cursor:pointer;text-decoration-line:underline}.view-link:hover{color:var(--discovery-link-hover-color,#07b);text-decoration-color:currentColor}.view-image{background:50%/20px no-repeat}.view-image:not(.error):not(.loaded){background-color:#8d8d8d4d;transition:background-color 1ms ease-in .125s}@starting-style{.view-image:not(.error):not(.loaded){background-color:#0000}}.view-image.error,.view-image:not([src]){background-color:#8d46464d;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" fill=\\"%23888\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M6.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z\\"/>%0A <path d=\\"M2.002 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2h-12zm12 1a1 1 0 0 1 1 1v6.5l-3.777-1.947a.5.5 0 0 0-.577.093l-3.71 3.71-2.66-1.772a.5.5 0 0 0-.63.062L1.002 12V3a1 1 0 0 1 1-1h12z\\"/>%0A</svg>%0A");width:32px;height:32px}.discovery-root-darkmode .view-image{opacity:.85}.view-image-preview{--image-preview-bg-color:#77777720;background-image:repeating-conic-gradient(transparent 0% 25%,var(--image-preview-bg-color) 0% 50%);background-position:0 0,10px 10px;background-size:20px 20px;background-attachment:fixed;justify-content:center;padding:16px;display:flex}.view-image-preview .view-image{opacity:1}.view-indicator{text-align:center;background:#b5b5b526;flex-direction:column;justify-content:center;width:150px;height:100px;margin:0 1px 1px 0;text-decoration:none;display:inline-flex}.view-indicator[href]:hover{background:#a5a5a54d}.view-indicator>.value{color:#666;font-size:40px;line-height:1.2}.view-indicator[href]>.value{color:#1f7ec5}.view-indicator>.label{color:#888;box-sizing:border-box;white-space:nowrap;text-overflow:ellipsis;padding:0 8px;font-size:14px;overflow:hidden}.view-markdown:first-child>:first-child{margin-top:0}.view-markdown:last-child>:last-child{margin-bottom:0}.view-markdown :is(p,blockquote,ul,ol,dl,pre,code){margin:0}.view-markdown :is(p,blockquote,ul,ol,dl,table,pre):not(:first-child){margin-top:15px}.view-markdown :is(ul,ol)+:is(ul,ol),.view-markdown li>:is(ul,ol){margin-top:0!important}.view-markdown code{font-family:var(--discovery-monospace-font-family);background-color:#d2dce633;border-radius:3px;padding:.2em .4em;font-size:90%}.discovery-root-darkmode .view-markdown blockquote code{background-color:#747e8833}.view-markdown kbd{--border-color:#ddd;--bg-color:#f8f8f8;font-family:var(--discovery-monospace-font-family);border:1px solid var(--border-color,#888);box-shadow:0 -1px var(--border-color,#888) inset;background-color:var(--bg-color);border-radius:6px;padding:.15em .4em;font-size:90%}.discovery-root-darkmode .view-markdown kbd{--border-color:#484848;--bg-color:#181818}.view-markdown sup{vertical-align:top}.view-markdown sub{vertical-align:bottom}.view-markdown pre:not(.view-source){font-family:var(--discovery-monospace-font-family);word-break:normal;background-color:#9b9b9b1a;border-radius:3px;font-size:90%;line-height:1.25;overflow:auto}.view-markdown pre:not(.view-source) code{text-shadow:none;color:inherit;background:0 0;border-radius:0;padding:0;font-family:inherit;font-size:100%}.view-markdown .check-list-item{list-style:none}.view-markdown .check-list-item>.view-checkbox:first-child{width:20px;margin-left:-20px}.view-source{color:var(--discovery-color);font-family:var(--discovery-font-family);white-space:normal;tab-size:4;background-color:#cdcdcd1a;border-radius:3px;grid-template:"prelude""content"1fr"postlude";margin:0;font-size:12px;line-height:1.6;display:grid}.view-source+.view-source{margin-top:1px}.view-source__prelude{border-top-left-radius:inherit;border-top-right-radius:inherit;grid-area:prelude;overflow:hidden}.view-source__postlude{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;grid-area:postlude;overflow:hidden}.view-source__content{white-space:pre;grid-area:content;align-items:flex-start;padding:8px;display:flex;position:relative;overflow:auto}.view-source__action-buttons{font-family:var(--discovery-font-family);order:2;gap:4px;margin-bottom:-8px;margin-left:1ex;font-size:12px;line-height:1.6;display:flex;position:sticky;top:0;right:0;translate:3px -3px}.view-source__action-buttons .view-button{opacity:.25;margin:0;padding:4px 6px;line-height:14px;transition:opacity .5s}.view-source__content:hover>.view-source__action-buttons .view-button{opacity:1;transition-duration:.25s}.view-source__action-buttons .view-button.copied{opacity:1}.view-source__action-buttons .view-button.copy:before{content:"";vertical-align:top;visibility:visible;background-color:currentColor;width:12px;height:12px;transition:scale .1s .25s,opacity .1s .25s;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M3.5 2a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-12a.5.5 0 0 0-.5-.5H12a.5.5 0 0 1 0-1h.5A1.5 1.5 0 0 1 14 2.5v12a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 14.5v-12A1.5 1.5 0 0 1 3.5 1H4a.5.5 0 0 1 0 1h-.5Z\\"/>%0A <path d=\\"M10 .5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5.5.5 0 0 0-.5.5V2a.5.5 0 0 0 .5.5h5A.5.5 0 0 0 11 2v-.5a.5.5 0 0 0-.5-.5.5.5 0 0 1-.5-.5Z\\"/>%0A</svg>%0A") 50%/12px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M3.5 2a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5v-12a.5.5 0 0 0-.5-.5H12a.5.5 0 0 1 0-1h.5A1.5 1.5 0 0 1 14 2.5v12a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 14.5v-12A1.5 1.5 0 0 1 3.5 1H4a.5.5 0 0 1 0 1h-.5Z\\"/>%0A <path d=\\"M10 .5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5.5.5 0 0 1-.5.5.5.5 0 0 0-.5.5V2a.5.5 0 0 0 .5.5h5A.5.5 0 0 0 11 2v-.5a.5.5 0 0 0-.5-.5.5.5 0 0 1-.5-.5Z\\"/>%0A</svg>%0A") 50%/12px no-repeat}.view-source__action-buttons .view-button:after{content:"";vertical-align:top;background-color:#6a9c11;width:12px;height:12px;margin-left:-12px;transition:scale .1s .25s,opacity .1s .25s;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\\"/>%0A</svg>%0A") 50%/16px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" width=\\"16\\" height=\\"16\\" fill=\\"%23000\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425a.247.247 0 0 1 .02-.022Z\\"/>%0A</svg>%0A") 50%/16px no-repeat}.view-source__action-buttons .view-button.copied:before,.view-source__action-buttons .view-button:not(.copied):after{opacity:0;transition-duration:.2s;transition-delay:0s;scale:0}.view-source__lines{float:left;text-align:right;color:#969696a6;min-width:3ex;font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);border-right:1px solid #aaa6;margin-right:1.5ex;padding-right:1ex}.view-source__lines>span{display:block}.view-source__source{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);flex-grow:1}.view-source__source .spotlight,.view-source__source .mark{--bg-color:var(--lightningcss-light,#f5e69a)var(--lightningcss-dark,#515143);--color:var(--lightningcss-light,#948634)var(--lightningcss-dark,#bdb06a);background:#f5e69a;background:var(--bg-color);color:var(--color);background-image:linear-gradient(90deg,var(--lightningcss-light,#fafafa80)var(--lightningcss-dark,#0000),var(--lightningcss-light,#fafafa80)var(--lightningcss-dark,#0000));margin:0 -1px;padding:1px 1px 2px}.view-source__source .mark{font-family:var(--discovery-font-family);border:.5px solid;border-color:color-mix(in srgb,currentColor 65%,var(--bg-color));background-color:var(--lightningcss-light,#e4e4e4)var(--lightningcss-dark,#2b2b2b);background-clip:padding-box;border-radius:4px;margin-left:0;margin-right:2px;padding:3px .35em;font-size:83%;line-height:1;text-decoration-thickness:1px;display:inline-block}.view-source__source .mark[data-kind=none]{color:var(--discovery-color);background-clip:border-box;border-color:#0000}.view-source__source .mark[data-kind=dot]:before{--dot-color:var(--color);content:"";vertical-align:middle;background-color:color-mix(in srgb,var(--dot-color) 85%,var(--discovery-background-color));border-radius:4px;margin:-2px 4px 0 1px;padding:4px;font-size:0;display:inline-block}.view-source__source .mark[data-kind=dot]:empty{background-color:#0000;border:none;padding-left:1px;padding-right:1px}.view-source__source .mark[data-kind=dot]:empty:before{margin-right:1px}.view-source__source .mark[data-kind=self]{--color:var(--lightningcss-light,#4c934c)var(--lightningcss-dark,#6eae6e)}.view-source__source .mark[data-kind=nested]{--color:var(--lightningcss-light,#96944d)var(--lightningcss-dark,#aead6e)}.view-source__source .mark[data-kind=total]{--color:var(--lightningcss-light,#9580bf)var(--lightningcss-dark,#aa92da)}.view-source__source .mark[data-prefix]:not([data-kind=dot]):before{content:attr(data-prefix);color:color-mix(in srgb,currentColor 50%,var(--bg-color));padding:0 3px 0 1px;display:inline-block}.view-source__source .mark[data-postfix]:not([data-kind=dot]):after{content:attr(data-postfix);color:color-mix(in srgb,currentColor 50%,var(--bg-color));display:inline-block}.view-source__source .mark.inactive{--color:#888}.view-source__source .spotlight.error,.view-source__source .mark.error{--bg-color:var(--lightningcss-light,#ffc9c9)var(--lightningcss-dark,#603c3c);--color:var(--lightningcss-light,#bb6665)var(--lightningcss-dark,#ed9e9d)}.view-source__source .spotlight.def,.view-source__source .mark.def{--bg-color:var(--lightningcss-light,#d3e7fb)var(--lightningcss-dark,#3a5066);--color:var(--lightningcss-light,#668fb8)var(--lightningcss-dark,#8cbae7)}.view-source__source .spotlight.ref,.view-source__source .mark.ref{--bg-color:var(--lightningcss-light,#cee99b)var(--lightningcss-dark,#415220);--color:var(--lightningcss-light,#7a9a3b)var(--lightningcss-dark,#95ca2c)}.view-source__source .spotlight.global-ref,.view-source__source .mark.global-ref{--bg-color:var(--lightningcss-light,#ffd8a3)var(--lightningcss-dark,#61492a);--color:var(--lightningcss-light,#9a7f59)var(--lightningcss-dark,#d8b381)}.view-source__source a.spotlight,.view-source__source a.mark{-webkit-text-decoration-color:color-mix(in srgb,currentcolor 45%,transparent);text-decoration-color:color-mix(in srgb,currentcolor 45%,transparent);text-underline-offset:1.5px;position:relative}.view-source__source a.spotlight:hover,.view-source__source a.mark:hover{-webkit-text-decoration-color:color-mix(in srgb,currentcolor 75%,transparent);text-decoration-color:color-mix(in srgb,currentcolor 75%,transparent);background-image:linear-gradient(90deg,var(--lightningcss-light,#0000)var(--lightningcss-dark,#35353580),var(--lightningcss-light,#0000)var(--lightningcss-dark,#35353580))}.view-source__source a.mark:hover,.view-source__source .mark.discovery-view-has-tooltip:hover{border-color:currentColor}.view-source__source a.mark[data-kind=dot]:empty:before,.view-source__source .mark.discovery-view-has-tooltip[data-kind=dot]:empty:before{outline:1px solid color-mix(in srgb,var(--dot-color) 45%,transparent);outline-offset:1px}.view-source__source a.mark[data-kind=dot]:hover:before,.view-source__source .mark.discovery-view-has-tooltip[data-kind=dot]:hover:before{outline-color:var(--dot-color)}.view-source__source .spotlight-ignore{background:#ddd repeating-linear-gradient(-45deg,#0000,#0000 6px,#e17d001a 6px 12px,#0000 12px)}.view-source__source .token{background:0 0}.view-source__source .spotlight .token{color:inherit!important}.view-source__source .token.comment,.view-source__source .token.prolog,.view-source__source .token.doctype,.view-source__source .token.cdata,.view-source__source .token.quote{color:var(--discovery-fmt-comment-color)}.view-source__source .token.punctuation{color:var(--discovery-fmt-punctuation-color)}.view-source__source .token.namespace{opacity:.7}.view-source__source .token.boolean,.view-source__source .token.atom{color:var(--discovery-fmt-atom-color)}.view-source__source .token.number{color:var(--discovery-fmt-number-color)}.view-source__source .token.selector,.view-source__source .token.attr-value,.view-source__source .token.string,.view-source__source .token.string-2,.view-source__source .token.char,.view-source__source .token.builtin,.view-source__source .token.inserted{color:var(--discovery-fmt-string-color)}.view-source__source .token.property,.view-source__source .token.tag,.view-source__source .token.constant,.view-source__source .token.symbol,.view-source__source .token.deleted,.view-source__source .token.header{color:var(--discovery-fmt-property-color)}.view-source__source .token.regex,.view-source__source .token.important,.view-source__source .token.def,.view-source__source .token.variable,.view-source__source .token.variable-2{color:var(--discovery-fmt-variable-color)}.view-source__source .token.keyword,.view-source__source .token.atrule,.view-source__source .token.link,.view-source__source .token.url{color:var(--discovery-fmt-keyword-color)}.view-source__source .token.qualifier,.view-source__source .token.function,.view-source__source .token.attribute,.view-source__source .token.attr-name,.view-source__source .token.class-name{color:var(--discovery-fmt-qualifier-color)}.view-source__source .token.entity{color:var(--discovery-fmt-entity-color)}.view-source__source .token.image,.view-source__source .token.type{color:var(--discovery-fmt-type-color)}.view-source__source .token.meta{color:var(--discovery-fmt-meta-color)}.view-source__source .token.negative{color:var(--discovery-fmt-negative-color);background-color:color-mix(in srgb,currentcolor 10%,transparent);padding:1px 0}.view-source__source .token.positive{color:var(--discovery-fmt-positive-color);background-color:color-mix(in srgb,currentcolor 10%,transparent);padding:1px 0}.view-source__source .token.discovery-view-name{background-color:var(--discovery-fmt-string-highlight-color);box-shadow:0 0 0 1px var(--discovery-fmt-string-highlight-color);color:#6a9c11}.view-text-diff{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);white-space:pre-wrap;word-break:break-word;display:inline-block}.view-text-diff .added{background-color:color-mix(in srgb,#92da92 70%,var(--discovery-background-color));color:#000000bf;padding:1.5px 0}.view-text-diff .removed{background-color:color-mix(in srgb,#de6666 65%,var(--discovery-background-color));color:#000000bf;padding:1.5px 0}.view-text-match{background:#ffe80538;border-bottom:2px solid #d5be0fcc;line-height:1.2}.view-text-numeric .num-delim{padding-left:.14em}.view-text-render{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5)}.view-column{min-width:150px;padding-right:40px}.view-column:last-child{padding-right:0}.view-columns{flex-wrap:wrap;display:flex}.view-columns:empty:before{content:attr(emptyText);color:#888}.view-list>.view-list-item>.view-expand{margin-bottom:1px}.view-expand+.view-expand{margin-top:1px}.view-list>.view-list-item:not(:last-child)>.view-expand.expanded{margin-bottom:4px}.view-expand.expanded+.view-expand{margin-top:4px}.view-expand>.header{--discovery-view-expand-trigger-size:22px;background-color:#c0c0c02d;background-color:color-mix(in srgb,var(--discovery-background-color),silver 17.5%);cursor:pointer;margin-left:calc(var(--discovery-view-expand-trigger-size) + 1px);font-size:12px;display:flex}.view-expand.trigger-outside>.header{margin-left:0}.view-expand>.header:hover{background-color:#a5a5a54d;background-color:color-mix(in srgb,var(--discovery-background-color),#a5a5a5 30%)}.view-expand>.header>.header-content{text-overflow:ellipsis;pointer-events:none;flex:1;padding:2px 8px;overflow:hidden}.view-expand>.header>.trigger{width:var(--discovery-view-expand-trigger-size,20px);margin-left:calc(-1 * var(--discovery-view-expand-trigger-size) - 1px);text-align:center;background-color:inherit;background-image:linear-gradient(#96969626,#96969626);order:-1}.view-expand>.header>.trigger:before{vertical-align:middle;content:"";background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;width:12px;height:100%;transition:transform .15s ease-in;display:inline-block;transform:rotate(-90deg)}.view-expand.expanded>.header>.trigger:before{transform:rotate(0)}.view-hstack{flex-wrap:wrap;gap:20px 40px;display:flex}.view-hstack>*{min-width:240px}.view-page-header{z-index:100;padding:23px var(--discovery-page-padding-right) 6px var(--discovery-page-padding-left);margin:calc(-1 * var(--discovery-page-padding-top)) calc(-1 * var(--discovery-page-padding-right)) 20px calc(-1 * var(--discovery-page-padding-left));background-color:#ffffffeb;transition:background-color .25s ease-in;position:sticky;top:-15px;left:0}.discovery-root-darkmode .view-page-header{background-color:#242424eb}.page_overscrolled>.view-page-header{transition-property:background-color,box-shadow;box-shadow:0 0 3px #0003}.discovery-root-darkmode .page_overscrolled>.view-page-header{box-shadow:0 0 3px #00000080}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.view-page-header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .view-page-header{background-color:#242424cc}}.view-page-header:before{content:"x";visibility:hidden;float:right;width:var(--discovery-nav-width,200px);margin-left:10px}.view-page-header__prelude .view-badge,.view-page-header__prelude .view-pill-badge{padding:3px 8px;display:inline-block}.view-page-header__prelude .view-badge .prefix,.view-page-header__prelude .view-badge .postfix,.view-page-header__prelude .view-pill-badge .prefix,.view-page-header__prelude .view-pill-badge .postfix{margin:-3px 6px -3px -8px;padding:5px 8px 6px}.view-page-header__prelude .view-badge .postfix,.view-page-header__prelude .view-pill-badge .postfix{margin:-3px -8px -3px 6px;padding:5px 8px 6px}.view-page-header .view-header{margin:0}.view-toc-section>.header{z-index:1;text-transform:capitalize;background-color:#fafafaeb;border:1px solid #5553;border-width:1px 0;margin:0 0 -1px;padding:9px 12px;font-size:14px;line-height:1;transition:background-color .25s ease-in;position:sticky;top:0}.discovery-root-darkmode .view-toc-section>.header{background-color:#323232eb;border-color:#00000040}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.view-toc-section>.header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fafafacc}.discovery-root-darkmode .view-toc-section>.header{background-color:#323232cc;border-color:#00000040}}.view-toc-section>.header .view-badge,.view-toc-section>.header .view-pill-badge{text-transform:none;margin-left:4px;margin-right:0;font-weight:400}.view-toc-section>.content{white-space:nowrap;padding:8px 0 8px 12px}.discovery-view-popup{box-sizing:border-box;z-index:300;background-color:var(--discovery-background-color);border:1px solid #b0b0b0a6;min-width:200px;min-height:20px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in;position:fixed;overflow:hidden auto;box-shadow:3px 3px 18px #0003}.discovery-view-popup.inspect{z-index:2002}.discovery-view-popup.show-on-hover:not([data-pin-mode=popup-hover]):not(.pinned){pointer-events:none}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click]:before,.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click]:after{content:"Click to pin this popup";visibility:hidden;z-index:100;background-color:var(--discovery-background-color);color:#888;text-align:center;background-image:linear-gradient(#0000000d,#0000000d);padding:2px 8px;font-size:10px;display:block;left:0;right:0}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click][data-v-to=top]:before{visibility:visible;position:absolute;bottom:0}.discovery-view-popup:not(.pinned)[data-pin-mode=trigger-click][data-v-to=bottom]:after{visibility:visible;position:absolute;top:0}.view-section{margin-bottom:30px}.view-signature [data-action]{vertical-align:middle;color:#aaa6;cursor:pointer;background-color:#c3c3c30d;border:.85px solid #8d8d8d26;border-radius:3px;margin-top:max(1px - .333333em,-4px);margin-left:.222222em;padding:min(.333333em,5px) min(3px + .333333em,8px);font-size:.75em;line-height:1;display:inline-block}.discovery-root-darkmode .view-signature [data-action]{--discovery-view-signature-hover-color:#aaa;--discovery-view-signature-toggle-color:#72b372}.view-signature [data-action][data-enabled=true],.view-signature [data-action][data-enabled=true]:hover{color:var(--discovery-view-signature-toggle-color,#333);background:#97df9740;border-color:#89b18966}.view-signature [data-action=collapse]:before{content:"–"}.view-signature [data-action=dict-mode]:before{content:"dict"}.view-signature [data-action=sort-keys]:before{content:"keys ↓"}.view-signature [data-action]:hover{color:var(--discovery-view-signature-hover-color,#333);background:#bbbbbb40;border-color:#89898966}.discovery-view-popup.signature-details{min-width:340px;padding:10px}.discovery-view-popup.signature-details>*{max-width:450px}.discovery-view-popup.signature-details .signature-action-buttons{float:right;clear:both;z-index:1;margin-top:2px;position:relative}.discovery-view-popup.signature-details .signature-action-buttons .view-button{padding:0}.discovery-view-popup.signature-details .signature-action-buttons .view-button:after{content:"";vertical-align:top;aspect-ratio:1;opacity:.85;background-color:currentColor;width:23px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A") 50%/14px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A") 50%/14px no-repeat}.discovery-view-popup.signature-details .signature-action-buttons .group:after{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path d=\\"M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2z\\"/>%0A <path d=\\"M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8m0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5m-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0M4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0m0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0\\"/>%0A</svg>%0A")}.discovery-view-popup.signature-details .path{color:var(--discovery-fmt-property-color);opacity:.8;margin-bottom:-2px;font-size:12px;position:relative;top:-4px}.discovery-view-popup.signature-details .view-h1{margin:20px 0 15px;font-size:180%;line-height:1}.discovery-view-popup.signature-details .view-h1.property{color:var(--discovery-fmt-property-color)}.discovery-view-popup.signature-details .view-h1.type{color:var(--discovery-fmt-type-color);margin-bottom:8px}.discovery-view-popup.signature-details :is(.path,.signature-action-buttons)+.view-h1,.discovery-view-popup.signature-details .view-h1:first-child{margin-top:0}.discovery-view-popup.signature-details .view-h1:last-child{margin-bottom:0}.discovery-view-popup.signature-details .usage-stat{color:#aaa;padding:0 2ex 0 1ex;font-size:12px;font-weight:400;display:inline-block}.discovery-view-popup.signature-details .usage-stat.optional:before{content:"optional ";color:var(--discovery-fmt-flag-color)}.discovery-view-popup.signature-details .num{color:var(--discovery-fmt-atom-color)}.discovery-view-popup.signature-details .pie-stat{align-items:center;margin:10px 0;display:flex}.discovery-view-popup.signature-details .pie-stat .list-header{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .pie-stat>.view-block:last-child{padding-right:10px;overflow:hidden}.discovery-view-popup.signature-details .pie-stat .view-list-item{white-space:nowrap;align-items:baseline;display:flex}.discovery-view-popup.signature-details .pie-stat .dot{min-width:var(--size);height:var(--size);border-radius:50%;display:inline-block}.discovery-view-popup.signature-details .pie-stat .caption{text-overflow:ellipsis;margin:0 5px;overflow:hidden}.discovery-view-popup.signature-details .pie-stat .caption:empty:before{content:"empty string";color:#888;background:#b4b4b433;border-radius:3px;padding:2px 4px 3px;font-size:11px}.discovery-view-popup.signature-details .pie-stat .times{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .pie-stat .pie{height:var(--size,100px);width:var(--size,100px);border-radius:50%;margin:0 20px 0 10px;transform:rotate(-90deg)}.discovery-view-popup.signature-details .overview-stat{color:#aaa;font-size:12px}.discovery-view-popup.signature-details .overview-stat+.view-content-filter{margin-top:8px}.discovery-view-popup.signature-details .view-content-filter>.view-input{margin-bottom:4px}.discovery-view-popup.signature-details .view-menu-item{align-items:baseline;display:flex}.discovery-view-popup.signature-details .view-menu-item>.caption{flex:1}.discovery-view-popup.signature-details .view-menu-item>.caption:empty:before{content:"[empty string]";color:#888}.discovery-view-popup.signature-details .view-menu-item>.count{color:#aaa;font-size:11px}.discovery-view-popup.signature-details .struct-list>.view-list-item{position:relative}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct{overflow:hidden}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct.struct-expanded-value{overflow-x:auto}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.value:not(.struct-expanded-value)>.string:only-child{white-space:normal;word-break:break-all}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.value>.string-text-wrapper{margin-left:4px;padding-left:6px;overflow-x:auto}.discovery-view-popup.signature-details .struct-list>.view-list-item>.view-struct>.string-value-as-text .string-text{white-space:pre;display:inline-block}.discovery-view-popup.signature-details .struct-list>.view-list-item>.count{color:#aaa;background:var(--discovery-background-color);opacity:.9;border-radius:3px 0 0 3px;padding:0 4px 1px;font-size:11px;position:absolute;top:7px;right:0}.discovery-view-popup.signature-details .array-types,.discovery-view-popup.signature-details .set-types{border-left:2px solid #0070b2cc;margin-top:4px;padding:8px 0 8px 12px}.discovery-view-popup.signature-details .array-types:before,.discovery-view-popup.signature-details .set-types:before{float:left;color:#fff;background:#0070b2cc;padding:2px 4px;font-size:10px;line-height:12px;display:block;position:relative;top:-8px;left:-12px}.discovery-view-popup.signature-details .array-types:before{content:"Array value types"}.discovery-view-popup.signature-details .set-types:before{content:"Set value types"}.view-signature{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);white-space:pre;background:#cdcdcd1a;margin:1px 0;padding:7px 32px 7px 8px;position:relative;overflow:auto}.discovery-view-popup .view-signature{background:0 0}.view-signature .expand{margin:0 -2px;padding:2px}.view-signature .expand:hover{color:var(--discovery-fmt-hover-color);cursor:pointer;background-color:#bbbbbb40;border-radius:4px}.view-signature .count{vertical-align:middle;color:#99999980;padding-bottom:2px;padding-left:6px;font-size:.916em;line-height:1;display:inline-block}.view-signature .count:before{content:attr(data-value)}.view-signature .count:hover{color:inherit}.view-signature .object-entries{background-image:linear-gradient(#bbbbbb26,#bbbbbb26);background-size:1px calc(100% - 3px);background-position:calc(3px + 1.15ex * var(--object-entries-offset,0)) 1px;background-repeat:no-repeat;background-attachment:local;background-origin:content-box}.view-signature .property{color:var(--discovery-fmt-property-color);cursor:pointer;margin:0 -2px;padding:2px}.view-signature .property.discovery-view-popup-active,.view-signature .property:hover{background-color:#aaa3}.view-signature .optional{color:var(--discovery-fmt-flag-color);padding-left:2px}.view-signature .type{color:var(--discovery-fmt-type-color);cursor:pointer;margin:0 -2px;padding:2px}.view-signature .type.discovery-view-popup-active,.view-signature .type:hover{background-color:#aaa3}.view-signature .type.discovery-view-popup-active{z-index:1;position:relative}.view-struct .entry-line{white-space:nowrap;padding-left:4ch}.view-struct .entry-line[data-index]:before{content:attr(data-index);border-left:1px solid #bbbbbb26;border-color:color-mix(in srgb,color-mix(in srgb,var(--discovery-background-color),#cdcdcd 10%),#bbb 15%);transform-origin:0 0;color:#99999959;padding-top:4px;padding-bottom:4px;padding-left:4px;font-size:10px;line-height:10px;position:absolute;transform:translate(-26px,18px)rotate(-90deg)}.view-struct .label{margin-left:-4ch}.view-struct .property{color:var(--discovery-fmt-property-color)}.view-struct .value{white-space:normal;vertical-align:top}.view-struct .keyword{color:var(--discovery-fmt-atom-color)}.view-struct .value>.number{color:var(--discovery-fmt-number-color)}.view-struct .value>.number .num-delim{padding-left:2px}.view-struct .value>.string,.view-struct .value>.string a{color:var(--discovery-fmt-string-color);-webkit-text-decoration-color:var(--discovery-fmt-string-underline-color);text-decoration-color:var(--discovery-fmt-string-underline-color);white-space:pre}.view-struct .value>.string a:hover{color:var(--discovery-fmt-string-hover-color);text-decoration-color:currentColor}.view-struct .value>.regexp{color:var(--discovery-fmt-string-color);white-space:pre}.view-struct .value-size,.view-struct .string-length{vertical-align:middle;color:#99999980;padding-bottom:2px;padding-left:6px;font-size:.916em;line-height:1;display:inline-block}.view-struct .value-size:hover,.view-struct .string-length:hover{color:inherit}.view-struct .value-size>.num-delim,.view-struct .string-length>.num-delim{padding-left:2px}.view-struct .string-text-wrapper{padding:4px 4px 4px 5.5ex;display:block}.view-struct .string-text{white-space:pre-wrap;background:var(--discovery-fmt-string-highlight-color);color:var(--discovery-fmt-string-color);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:2px 4px 1.5px;display:inline}.view-struct .string-value-as-text .string-text{white-space:pre-wrap;color:var(--discovery-fmt-color);background:#9191911a;padding-top:0;padding-bottom:0;display:block}.view-struct .view-as-table>.entry-line,.view-struct .view-as-table>.more-buttons{display:none}.view-struct .more{color:#7f7f7fcc;white-space:nowrap}.view-struct .more>.num-delim{padding-left:2px}.view-struct .string>.more.suffix{margin:0 1px 0 3px}.view-struct .string>.more.suffix:before{content:"…";padding-right:calc(1ch - 4px)}.view-struct .string>.more.suffix:after{content:" more"}.view-struct .string>.more.prefix{padding:0 .6ch 0 .4ch}.view-struct .string>.more.prefix:after{content:"…"}.view-struct .value>.more-buttons{padding-left:4ch}.view-struct .string>.match,.view-struct .string-text>.match{background-color:var(--lightningcss-light,#f5e69a)var(--lightningcss-dark,#565638);border-bottom:1px solid var(--lightningcss-light,#0000)var(--lightningcss-dark,#a7a73b);padding-top:1px}.view-struct .error-value{vertical-align:text-top;--bg-color:var(--lightningcss-light,#ffe0e0)var(--lightningcss-dark,#622b29);background-color:var(--bg-color);color:var(--lightningcss-light,#d23b3b)var(--lightningcss-dark,color-mix(in srgb,#a00 25%,var(--discovery-color)));border:1px solid var(--lightningcss-light,#f8c1c1)var(--lightningcss-dark,#0004);border-radius:3px;margin-top:-1px;font-size:84%;line-height:1.5;display:inline-block}.view-struct .error-value__name{vertical-align:top;padding:0 4px}.view-struct .error-value__message{background-color:var(--lightningcss-light,#fff1f1)var(--lightningcss-dark,#443232);padding:0 4px;display:inline-block}.view-struct .value>.view-table{font-family:var(--discovery-font-family);background-color:var(--discovery-background-color);color:var(--discovery-color);margin-top:2px;margin-left:4ch;margin-right:4px;padding:0 1px 1px}.view-struct .value>.view-table .more-buttons{margin:2px 5px 4px}.view-struct .struct-action-button{vertical-align:middle;color:#aaa6;cursor:pointer;background-color:#c3c3c30d;border:.85px solid #8d8d8d26;border-radius:3px;margin-top:max(1px - .333333em,-4px);margin-left:.222222em;padding:min(.333333em,5px) min(3px + .333333em,8px);font-size:.75em;line-height:1;display:inline-block}.discovery-root-darkmode .view-struct .struct-action-button{--discovery-view-struct-hover-color:#aaa;--discovery-view-struct-toggle-color:#72b372}.view-struct .struct-action-button:hover,.view-struct .discovery-view-popup-active{color:var(--discovery-view-struct-hover-color,#333);background-color:#bbbbbb40;border-color:#89898966}.view-struct .sort-keys>.struct-action-button[data-action=toggle-sort-keys],.view-struct .string-value-as-text>.struct-action-button[data-action=toggle-string-mode],.view-struct .view-as-table>.struct-action-button[data-action=toggle-view-as-table]{color:var(--discovery-view-struct-toggle-color,#686);background-color:#97df9740;border-color:#89b18966}.view-struct .struct-action-button[data-action=show-signature]{cursor:default}@media (hover:none),(hover:on-demand){.view-struct .struct-action-button{color:#333;background-color:#fff;border-color:#64646433;padding:3px 20px}.discovery-root-darkmode .view-struct .struct-action-button{color:#aaa;background-color:#50505080}.view-struct .struct-action-button[data-action=show-signature]{cursor:pointer}}.discovery-view-popup:not(.discovery-inspect-details-popup) .view-struct .struct-action-button[data-action=show-signature],.view-struct .view-as-table>.struct-action-button[data-action=toggle-sort-keys]{display:none}.view-struct .struct-action-button[data-action=collapse]:before{content:"–"}.view-struct .struct-action-button[data-action=show-signature]:before{content:"𝕊"}.view-struct .struct-action-button[data-action=value-actions]:before{content:"ƒ"}.view-struct .struct-action-button[data-action=toggle-sort-keys]:before{content:"keys ↓"}.view-struct .struct-action-button[data-action=toggle-string-mode]:before{content:"as text"}.view-struct .struct-action-button[data-action=toggle-view-as-table]:before{content:"as table"}.discovery-view-popup.view-struct-actions-popup .notes{color:#666;display:inline}.discovery-view-popup.view-struct-actions-popup .notes:before{content:" "}.view-struct .value-annotations{margin-left:6px}.view-struct .value+.value-annotations{margin-left:1.5ex}.view-struct .value-annotation{vertical-align:middle;color:#aaa;border-radius:3px;margin-top:-.166667em;padding:0 .4em;font-size:.85em;line-height:1.6;display:inline-block}.view-struct .value-annotation+.value-annotation{margin-left:2px}.view-struct .value-annotation[href]:focus-visible{background-color:#bbbbbb40;outline:none;box-shadow:0 0 0 3px #bbbbbb40}.view-struct .value-annotation.icon:before{content:"";vertical-align:text-bottom;background:var(--annotation-image, ) var(--annotation-image-position,50% center) no-repeat;background-size:var(--annotation-image-size,14px);width:14px;height:14px;display:inline-block}.view-struct .value-annotation.icon.has-text:before{margin-right:var(--annotation-image-margin,2px)}.view-struct .value-annotation.before+.value{margin-left:2px}.view-struct .value-annotation.style-none,.view-struct .value-annotation.style-default{--annotation-bg-gradient-from:white;--annotation-bg-gradient-to:#fff0}.discovery-root-darkmode .view-struct .value-annotation.style-default{--annotation-bg-gradient-from:#21212180;--annotation-bg-gradient-to:#21212100}.view-struct .value-annotation.before.style-default{background:linear-gradient(to left,var(--annotation-bg-gradient-from),var(--annotation-bg-gradient-to));border-right:1px solid}.view-struct .value-annotation.after.style-default{background:linear-gradient(to right,var(--annotation-bg-gradient-from),var(--annotation-bg-gradient-to));border-left:1px solid}.view-struct .value-annotation.style-badge{color:#999;-webkit-user-select:none;user-select:none;background-color:#9b9b9b26;border-radius:3px;text-decoration:none}.view-struct .value-annotation.style-badge.discovery-view-has-tooltip:hover{box-shadow:0 0 0 .5px #888}.view-struct .value-annotation.style-badge[href]{background-color:#379be629}.view-struct .value-annotation.style-badge[href]:hover{color:#89a0bd;-webkit-text-decoration:underline #89a0bd88;text-decoration:underline #89a0bd88}.view-struct .value-annotation .num-delim{padding-left:2px}.view-struct_image-preview-tooltip{padding:0!important}.view-struct_image-preview-tooltip .view-image-preview{min-width:160px}.view-struct{font-family:var(--discovery-monospace-font-family);font-size:var(--discovery-monospace-font-size,12px);line-height:var(--discovery-monospace-line-height,1.5);color:var(--discovery-fmt-color);white-space:nowrap;background-color:#cdcdcd1a;margin:1px 0;padding:7px 8px;position:relative;overflow:auto}.view-struct.struct-expand{cursor:pointer}.view-struct .struct-expand-value{vertical-align:top;cursor:pointer;border-radius:4px;display:inline-block;white-space:nowrap!important}.view-struct.struct-expand:hover,.view-struct.struct-expanded-value .struct-expand-value:hover{color:var(--discovery-fmt-hover-color);background-color:#bbbbbb40}.view-struct.struct-expanded-value,.view-struct .struct-expanded-value{background-image:linear-gradient(#bbbbbb26,#bbbbbb26);background-position:3px 18px;background-repeat:no-repeat;background-size:1px calc(100% - 36px);background-attachment:local;background-origin:content-box}.discovery-view-popup.view-struct-actions-popup .error{color:#d61f1fc4;text-shadow:.2px 0 .3px #fffc;font-size:11px}.discovery-root-darkmode .discovery-view-popup.view-struct-actions-popup .error{color:#e66;text-shadow:none}.discovery-view-popup.view-struct-actions-popup .num-delim{padding-left:3px}.discovery-view-popup.view-struct-actions-popup .view-menu-item+.view-menu-item.group-start:not(:first-child){border-top:1px solid #8888}.discovery-view-popup.view-struct-signature-popup.computing{padding:8px;line-height:1px;animation:.5s linear forwards view-struct-signature-computing}@keyframes view-struct-signature-computing{0%{opacity:0}}.discovery-view-popup.view-struct-signature-popup.computing:before{--color:#f6f61cb5;content:"";vertical-align:top;border:2px solid var(--color);clip-path:inset(0 0 50% 50%);border-radius:50%;width:10px;height:10px;animation:.65s linear infinite forwards view-struct-signature-computing-spinner;display:inline-block}@keyframes view-struct-signature-computing-spinner{to{rotate:360deg}}.view-table-cell{padding:var(--table-cell-padding-top) var(--table-cell-padding-right) var(--table-cell-padding-bottom) var(--table-cell-padding-left);vertical-align:top;height:19px}.view-table-cell.number{text-align:right}.view-table-cell .num-delim{padding-left:2px}.view-table-cell.complex,.view-table-cell.keyword{color:#888}.view-table-cell.align-left{text-align:left}.view-table-cell.align-center{text-align:center}.view-table-cell.align-right{text-align:right}.view-table-cell.details{background-clip:padding-box;padding-left:14px;position:relative}.view-table-cell.details:before{content:".";color:#0000;opacity:.5;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:9px;width:9px;transition:transform .12s ease-in,opacity .12s ease-in;display:inline-block;position:absolute;top:3px;left:3px;transform:rotate(-90deg)}.view-table-cell.details:hover{cursor:pointer;background-color:#b4b4b433}.view-table-cell.details-expanded{background-image:linear-gradient(#0000,#aaa3),linear-gradient(#0000,#aaa3);background-position:0 0,100% 0;background-repeat:no-repeat;background-size:1px 100%;border-bottom:none!important}.view-table-cell.details-expanded:hover{background-color:#b4b4b433}.view-table-cell.details.details-expanded:before{opacity:1;transform:rotate(0)}.view-table-cell-details-row>.view-cell-details-content{border:1px solid #aaaaaa40;border-top:none;padding:1px}.view-table-cell-details-row>.view-cell-details-content>:first-child{margin-top:0!important}.view-table-cell-details-row>.view-cell-details-content>:last-child{margin-bottom:0!important}.view-table-cell>.view-struct,.view-table-cell>.view-struct:hover{margin:calc(-1*max(calc(var(--table-cell-padding-top) - 1px),0px)) calc(-1*max(calc(var(--table-cell-padding-right) - 1px),0px)) calc(-1 * var(--table-cell-padding-bottom)) calc(-1 * var(--table-cell-padding-left));padding:var(--table-cell-padding-top) var(--table-cell-padding-right) max(calc(var(--table-cell-padding-bottom) - 1px),0px) var(--table-cell-padding-left)}.view-table-cell>.view-struct{background-color:#0000}.view-table-header{z-index:1;position:sticky;top:0}.view-table-header-cell{padding:var(--table-cell-padding-top) var(--table-cell-padding-right) var(--table-cell-padding-bottom) var(--table-cell-padding-left);border:solid var(--discovery-background-color);text-align:left;background:#8d8d8d26 right 1px center no-repeat;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 15%);background-size:16px;background-clip:padding-box;border-width:1px 1px 1px 0;font-weight:400}.view-table-header-cell:last-child{border-right:none}.view-table-header-cell.sortable{cursor:pointer;background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"rgba(153, 153, 153, 0.4)\\" d=\\"M86,11.21192l-64.03808,64.03808h128.07617zM86,26.41308l38.08692,38.08692h-76.17383zM21.96192,86l64.03808,64.03808l64.03808,-64.03808zM47.91308,96.75h76.17383l-38.08692,38.08692z\\"/>%0A</svg>%0A");padding-right:18px}.view-table-header-cell.sortable:not(.asc):not(.desc){background-position:right 2px center;background-size:14px}.view-table-header-cell.sortable.asc{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z\\"/>%0A</svg>%0A")}.view-table-header-cell.sortable.desc{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" preserveAspectRatio=\\"xMidYMid meet\\">%0A <path fill=\\"%23888\\" d=\\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\\" />%0A</svg>%0A")}.view-table-header-cell.sortable:hover{background-color:#8d8d8d4d;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 30%)}.view-table-footer.no-cells-with-content{display:none}.view-table-footer-cell{padding:var(--table-cell-padding-top) max(calc(var(--table-cell-padding-right) - 1px),0px) var(--table-cell-padding-bottom) var(--table-cell-padding-left);border:solid var(--discovery-background-color);color:#888;background-color:color-mix(in srgb,var(--discovery-background-color),#8d8d8d 8%);background-clip:padding-box;border-width:1px 1px 1px 0;border-top-color:#0000}.view-table-footer-cell:last-child{border-right:0}.view-table{--table-cell-padding-top:2px;--table-cell-padding-right:8px;--table-cell-padding-bottom:2px;--table-cell-padding-left:8px;border-spacing:0;font-size:12px;line-height:19px}.view-table>tbody>.view-table-row:not(:last-child)>td,.view-table>tbody:not(:last-child)>.view-table-row:last-child>td,.view-table>.view-table-more-buttons:not(:last-child)>tr>td:not(:empty){border-bottom:1px solid #aaa3}.view-table>tbody.view-table-more-buttons>tr>td>.more-buttons{margin-bottom:2px}.view-table>tbody.view-table-more-buttons>tr>td:empty{padding:0}.view-table-cell-details-row>.view-cell-details-content>.view-table:first-child{margin-top:-1px!important}.view-tree-leaf{--view-leaf-lines-offset:0;background-image:linear-gradient(90deg,#99999980,#99999980),linear-gradient(90deg,#99999980,#99999980);background-size:1px calc(1em - 7px * var(--view-leaf-lines-offset,0)),1px 100%;background-position:5px top,5px calc(1em + 6px * var(--view-leaf-lines-offset,0));background-repeat:no-repeat;grid-template-columns:20px auto;grid-template-areas:"toggle content""toggle children";display:grid;position:relative}.view-tree-leaf.has-children:not(.non-collapsible),.view-tree-leaf.has-children.collapsed{--view-leaf-lines-offset:1}.view-tree-leaf.last,:not(.incomplete)>.view-tree-leaf:last-child{background-image:linear-gradient(90deg,#99999980,#99999980)}.view-tree-leaf-toggle{visibility:hidden;text-align:center;color:#7f7f7fcc;cursor:pointer;border:1px solid;border-radius:2px;grid-area:toggle;width:9px;height:9px;margin-top:-3px;margin-right:9px;font-size:10px;line-height:8px;display:inline-block;position:relative;top:1em}.view-tree-leaf-toggle:hover{color:gray}.view-tree-leaf.has-children>.view-tree-leaf-toggle{visibility:visible}.view-tree-leaf.non-collapsible:not(.collapsed)>.view-tree-leaf-toggle{visibility:hidden}.view-tree-leaf-toggle:before{content:"–"}.view-tree-leaf.collapsed>.view-tree-leaf-toggle:before{content:"+"}.view-tree-leaf-toggle:after{content:"";visibility:visible;pointer-events:none;background-color:#99999980;height:1px;position:absolute;top:4px;left:5px;right:-6px}.view-tree-leaf.has-children:not(.non-collapsible)>.view-tree-leaf-toggle:after,.view-tree-leaf.has-children.collapsed>.view-tree-leaf-toggle:after{left:11px}.view-tree-leaf-content{grid-area:content;display:inline-block}.view-tree-leaf-content:before{content:"";float:left}.view-tree-leaf-content:empty:before{content:"<empty>";color:#888}.view-tree-leaf-children{grid-area:children;margin:0;padding:0;list-style:none}.view-tree-leaf.collapsed>.view-tree-leaf-children{display:none}.view-tree{margin:0;padding:0;font-size:13px;line-height:24px;list-style:none}.view-tree:empty:before{content:attr(emptyText);color:#888}.more-buttons{flex-wrap:wrap;gap:5px;margin-top:2px;display:flex}.more-buttons .more-button{vertical-align:top;color:var(--discovery-color,black);min-height:0;font-size:11px;line-height:12px;font-family:var(--discovery-ui-font-family);cursor:pointer;background-color:#ffffff1a;border:1px solid #7f7f7f66;border-radius:3px;margin:0;padding:4px 8px}@supports not (gap:5px){.more-buttons{margin-top:0}.more-buttons .more-button{margin-top:4px;margin-right:5px}}.more-buttons .more-button:hover,.more-buttons .more-button:active,.more-buttons .more-button:focus{background-color:#dddddd4d;border-color:#aaa9;outline:none}.more-buttons .more-button:active{background-color:#83838340;border-color:#7f7f7f66}.page-default h1.no-data-loaded{margin-top:0}.page-default h1.no-data-loaded:before{vertical-align:middle;content:"";background:var(--discovery-app-icon) no-repeat center;background-size:42px;width:42px;height:42px;margin-right:10px;display:inline-block;position:relative;top:-5px}.welcome-block{margin-top:-10px}.welcome-block .upload-data{background-color:#00000008;border:1px dashed #a8a8a8;border-radius:7px;max-width:620px;margin-top:1.5em;margin-left:-13px;padding:12px}.discovery-root-darkmode .welcome-block .upload-data{background-color:#00000014;border-color:#555}.welcome-block .upload-notes{color:#aaa;padding:10px 0 0 3px;font-size:82%}.page-discovery>.discovery-header{z-index:100;padding:22px calc(210px + var(--discovery-page-padding-right)) 7px var(--discovery-page-padding-left);padding:22px calc(var(--discovery-page-padding-right) + 6px + max(42px * 3,var(--discovery-nav-width,0px))) 7px var(--discovery-page-padding-left);margin:0 calc(-1 * var(--discovery-page-padding-right)) 18px calc(-1 * var(--discovery-page-padding-left));background-color:#ffffffeb;flex-direction:row;line-height:1.2;transition:background-color .25s ease-in;display:flex;position:sticky;top:-2px}.discovery-root-darkmode .page-discovery>.discovery-header{background-color:#242424eb}.page-discovery.page_overscrolled>.discovery-header{transition-property:background-color,box-shadow;box-shadow:0 0 3px #0003}.discovery-root-darkmode .page-discovery.page_overscrolled>.discovery-header{box-shadow:0 0 3px #00000080}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.page-discovery>.discovery-header{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .page-discovery>.discovery-header{background-color:#242424cc}}.page-discovery>.discovery-header .discovery-header-text{flex:1;font-size:220%;position:relative}.page-discovery>.discovery-header .discovery-header-text:before{content:attr(data-title);white-space:pre}.page-discovery>.discovery-header .discovery-header-text:focus-within:before{visibility:hidden}.page-discovery>.discovery-header .discovery-header-text input{font:inherit;color:inherit;opacity:.0001;background-color:#0000;border:1px solid #0000;border-bottom-color:#aaa;width:100%;margin:-1px;padding:0;transition:box-shadow .15s ease-out;position:absolute;top:0;left:0}.page-discovery>.discovery-header .discovery-header-text input:hover,.page-discovery>.discovery-header .discovery-header-text input:focus{opacity:1}.page-discovery>.discovery-header .discovery-header-text input:focus{border-bottom-color:#0af;outline:0;box-shadow:0 3px #0af3!important}.page-discovery>.discovery-header .discovery-header-text .timestamp{color:#99999980;margin-top:4px;font-size:10px;display:block}.page-discovery>.discovery-actions{z-index:101;pointer-events:none;justify-content:flex-end;margin-top:19px;margin-bottom:-61px;transition:top .25s;display:flex;position:sticky;top:34px}.page-discovery>.discovery-actions button{text-indent:-500px;cursor:pointer;opacity:.5;pointer-events:auto;background:50% no-repeat;border:none;border-radius:5px;outline:none;width:42px;height:42px;overflow:hidden}.page-discovery>.discovery-actions button.discovery-view-popup-active,.page-discovery>.discovery-actions button:hover,.page-discovery>.discovery-actions button:focus{opacity:1;background-color:#00000008}.page-discovery>.discovery-actions button.toggle-fullscreen{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M -3 8 C -2.734375 8 -2.48046875 8.10546875 -2.29296875 8.29296875 C -2.10546875 8.48046875 -2 8.734375 -2 9 L -2 26.265625 C -2.29296875 26.09765625 -2.63671875 26 -3 26 L -4 26 L -4 10 L -46 10 L -46 44 L -29.999998092651367 44 L -29.999998092651367 45 C -29.999998092651367 45.36328125 -29.902341842651367 45.70703125 -29.734373092651367 46 L -47 46 C -47.265625 46 -47.51953125 45.89453125 -47.70703125 45.70703125 C -47.89453125 45.51953125 -48 45.265625 -48 45 L -48 9 C -48 8.734375 -47.89453125 8.48046875 -47.70703125 8.29296875 C -47.51953125 8.10546875 -47.265625 8 -47 8 Z M -36 13 C -35.640625 12.99609375 -35.3046875 13.18359375 -35.12109375 13.49609375 C -34.94140625 13.80859375 -34.94140625 14.19140625 -35.12109375 14.50390625 C -35.3046875 14.81640625 -35.640625 15.00390625 -36 15 L -39.5859375 15 L -29.292966842651367 25.29296875 C -29.031248092651367 25.54296875 -28.925779342651367 25.91796875 -29.019529342651367 26.265625 C -29.109373092651367 26.6171875 -29.382810592651367 26.890625 -29.734373092651367 26.98046875 C -30.082029342651367 27.07421875 -30.457029342651367 26.96875 -30.707029342651367 26.70703125 L -41 16.4140625 L -41 20 C -40.99609375 20.359375 -41.18359375 20.6953125 -41.49609375 20.87890625 C -41.80859375 21.05859375 -42.19140625 21.05859375 -42.50390625 20.87890625 C -42.81640625 20.6953125 -43.00390625 20.359375 -43 20 L -43 13 Z M -3 28 C -2.44921875 28 -2 28.44921875 -2 29 L -2 45 C -2 45.55078125 -2.44921875 46 -3 46 L -26.999998092651367 46 C -27.550779342651367 46 -27.999998092651367 45.55078125 -27.999998092651367 45 L -27.999998092651367 29 C -27.999998092651367 28.44921875 -27.550779342651367 28 -26.999998092651367 28 Z M -4 30 L -25.999998092651367 30 L -25.999998092651367 44 L -4 44 Z\\" transform=\\"matrix(1 0 0 1 50 0)\\" />%0A</svg>%0A");background-size:25px}.page-discovery>.discovery-actions button.edit-mode{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 128 128\\">%0A <path d=\\"M84.7,39.1l-37.3,64.4c-3.1,5.4-7.4,10-12.6,13.4L24,124l0.8-12.9c0.4-6.2,2.2-12.2,5.3-17.6l37.3-64.4\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M60.4,44.1c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l7-12c0.8-1.4,2.7-1.9,4.1-1.1s1.9,2.7,1.1,4.1l-7,12C62.4,43.5,61.4,44.1,60.4,44.1z\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M77.7,54.1c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l7-12c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1l-7,12C79.7,53.5,78.7,54.1,77.7,54.1z\\" style=\\"fill:%23FFFFFF;\\"></path>%0A <path d=\\"M47.2,94.8c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l25-43.4c0.8-1.4,2.6-1.8,4.1-1.1c5.6,2.7,5.6,2.7,5.6,2.7L49.9,93.4C49.3,94.4,48.2,94.8,47.2,94.8z\\" style=\\"fill:%23FCCA3D;\\"></path>%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M24,127c-0.5,0-1-0.1-1.5-0.4c-1-0.6-1.6-1.6-1.5-2.8l0.8-12.9c0.4-6.6,2.4-13.2,5.7-18.9l30.3-52.4c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1L32.7,95c-2.9,4.9-4.5,10.6-4.9,16.3l-0.4,6.9l5.8-3.8C38,111.3,42,107,44.9,102l30.3-52.4c0.8-1.4,2.7-1.9,4.1-1.1c1.4,0.8,1.9,2.7,1.1,4.1L50,105c-3.3,5.8-8,10.7-13.5,14.4l-10.8,7.1C25.2,126.8,24.6,127,24,127z\\"></path>%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M89,127H49c-1.7,0-3-1.3-3-3s1.3-3,3-3h40c1.7,0,3,1.3,3,3S90.7,127,89,127z\\"></path>%0A <circle fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\".5\\" cx=\\"104\\" cy=\\"124\\" r=\\"3\\"></circle>%0A <path d=\\"M87.7,36.7c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1c0.9-1.6,1.2-3.5,0.7-5.3s-1.6-3.3-3.3-4.2c-1.6-0.9-3.5-1.2-5.3-0.7s-3.3,1.6-4.3,3.3c-0.8,1.4-2.7,1.9-4.1,1.1s-1.9-2.7-1.1-4.1c3.6-6.2,11.6-8.3,17.8-4.8c3,1.7,5.2,4.5,6.1,7.9s0.4,6.9-1.3,9.9C89.7,36.2,88.7,36.7,87.7,36.7z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M87.7,33.7c2.8-4.8,1.1-10.9-3.7-13.7l0,0c-4.8-2.8-10.9-1.1-13.7,3.7l-3.7,6.5l17.3,10L87.7,33.7z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M83.9,43.2c-0.5,0-1-0.1-1.5-0.4l-17.3-10c-0.7-0.4-1.2-1.1-1.4-1.8c-0.2-0.8-0.1-1.6,0.3-2.3l3.7-6.5c3.6-6.2,11.6-8.3,17.8-4.8c3,1.7,5.2,4.5,6.1,7.9s0.4,6.9-1.3,9.9l-3.7,6.5c-0.4,0.7-1.1,1.2-1.8,1.4C84.4,43.2,84.2,43.2,83.9,43.2z M70.7,29.1l12.1,7l2.2-3.9l0,0c0.9-1.6,1.2-3.5,0.7-5.3s-1.6-3.3-3.3-4.2c-3.3-1.9-7.6-0.8-9.6,2.6L70.7,29.1z\\" style=\\"fill:%23FF5576;\\"></path>%0A <path d=\\"M83.9,43.2c-0.5,0-1-0.1-1.5-0.4c-1.4-0.8-1.9-2.7-1.1-4.1l3.7-6.5c1-1.8,1.2-4,0.5-6c-0.6-1.6,0.2-3.3,1.8-3.9c1.6-0.6,3.3,0.2,3.9,1.8c1.4,3.7,1,7.7-0.9,11.1l-3.7,6.5C86,42.7,85,43.2,83.9,43.2z\\" style=\\"fill:%23D32F56;\\"></path>%0A</svg>%0A");background-size:20px}.page-discovery>.discovery-actions button.edit-mode:not(.disabled){opacity:1}.page-discovery>.discovery-actions button.edit-mode.disabled{filter:grayscale()}.page-discovery>.discovery-actions button.share{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M 28.875 11 C 28.371094 11.0625 27.996094 11.492188 28 12 L 28 19.0625 C 16.488281 19.414063 10.28125 25.507813 7.21875 31.5625 C 4.113281 37.699219 4.003906 43.683594 4 43.875 C 4 43.875 4 43.9375 4 43.9375 L 4 44 C 3.984375 44.550781 4.417969 45.015625 4.96875 45.03125 C 5.519531 45.046875 5.984375 44.613281 6 44.0625 C 6 44.0625 6 44 6 44 C 6.007813 43.90625 6.230469 40.878906 9.09375 37.65625 C 11.90625 34.496094 17.394531 31.308594 28 31.09375 L 28 38 C 28 38.382813 28.21875 38.734375 28.566406 38.902344 C 28.914063 39.070313 29.324219 39.023438 29.625 38.78125 L 45.625 25.78125 C 45.863281 25.589844 46 25.304688 46 25 C 46 24.695313 45.863281 24.410156 45.625 24.21875 L 29.625 11.21875 C 29.414063 11.046875 29.144531 10.96875 28.875 11 Z M 30 14.09375 L 43.40625 25 L 30 35.90625 L 30 30 C 30 29.449219 29.550781 29 29 29 C 17.246094 29 10.910156 32.613281 7.59375 36.34375 C 7.46875 36.484375 7.398438 36.609375 7.28125 36.75 C 7.703125 35.375 8.257813 33.90625 9 32.4375 C 11.917969 26.671875 17.488281 21 29 21 C 29.550781 21 30 20.550781 30 20 Z \\" />%0A</svg>%0A");background-size:25px}.discovery[data-dzen] .page-discovery>.discovery-actions{top:20px}.discovery[data-dzen] .page-discovery>.discovery-actions button.toggle-fullscreen{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 50 50\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" fill=\\"%23888\\" d=\\"M -3 8 C -2.734375 8 -2.48046875 8.10546875 -2.29296875 8.29296875 C -2.10546875 8.48046875 -2 8.734375 -2 9 L -2 26.265625 C -2.29296875 26.09765625 -2.63671875 26 -3 26 L -4 26 L -4 10 L -46 10 L -46 44 L -29.999998092651367 44 L -29.999998092651367 45 C -29.999998092651367 45.36328125 -29.902341842651367 45.70703125 -29.734373092651367 46 L -47 46 C -47.265625 46 -47.51953125 45.89453125 -47.70703125 45.70703125 C -47.89453125 45.51953125 -48 45.265625 -48 45 L -48 9 C -48 8.734375 -47.89453125 8.48046875 -47.70703125 8.29296875 C -47.51953125 8.10546875 -47.265625 8 -47 8 Z M -35.98592758178711 27.01408576965332 C -36.34530258178711 27.01799201965332 -36.68124008178711 26.83049201965332 -36.86483383178711 26.51799201965332 C -37.04452133178711 26.20549201965332 -37.04452133178711 25.82267951965332 -36.86483383178711 25.51017951965332 C -36.68124008178711 25.19767951965332 -36.34530258178711 25.01017951965332 -35.98592758178711 25.01408576965332 L -32.39999008178711 25.01408576965332 L -42.692962646484375 14.721118927001953 C -42.954681396484375 14.471118927001953 -43.060150146484375 14.096118927001953 -42.966400146484375 13.748462677001953 C -42.876556396484375 13.396900177001953 -42.603118896484375 13.123462677001953 -42.251556396484375 13.033618927001953 C -41.903900146484375 12.939868927001953 -41.528900146484375 13.045337677001953 -41.278900146484375 13.307056427001953 L -30.98592185974121 23.60002326965332 L -30.98592185974121 20.01408576965332 C -30.98982810974121 19.65471076965332 -30.80232810974121 19.31877326965332 -30.48982810974121 19.13517951965332 C -30.17732810974121 18.95549201965332 -29.79451560974121 18.95549201965332 -29.48201560974121 19.13517951965332 C -29.16951560974121 19.31877326965332 -28.98201560974121 19.65471076965332 -28.98592185974121 20.01408576965332 L -28.98592185974121 27.01408576965332 Z M -3 28 C -2.44921875 28 -2 28.44921875 -2 29 L -2 45 C -2 45.55078125 -2.44921875 46 -3 46 L -26.999998092651367 46 C -27.550779342651367 46 -27.999998092651367 45.55078125 -27.999998092651367 45 L -27.999998092651367 29 C -27.999998092651367 28.44921875 -27.550779342651367 28 -26.999998092651367 28 Z M -4 30 L -25.999998092651367 30 L -25.999998092651367 44 L -4 44 Z\\" transform=\\"matrix(1 0 0 1 50 -7.10543e-15)\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .discovery-editor-tabs{vertical-align:top;display:inline-block;overflow:hidden}.page-discovery>.discovery-editor .data-query-result:before,.page-discovery>.discovery-editor .discovery-editor-tabs:before{text-align:right;box-sizing:border-box;color:#8d8d8dbf;width:40px;padding:3px 4px;font-size:11px}.page-discovery>.discovery-editor .discovery-editor-tab{-webkit-user-select:none;user-select:none;cursor:pointer;background:#c8c8c833;margin:0 1px 1px 0;padding:2px 12px;font-size:12px;display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tab.active{cursor:default;background:#6cbcf126;margin-bottom:0}.page-discovery>.discovery-editor .discovery-editor-tab:not(.active):hover{background:#bbb6}.page-discovery>.discovery-editor .discovery-editor-tab:first-child{border-top-left-radius:4px;border-bottom-left-radius:4px}.page-discovery>.discovery-editor .discovery-editor-tab:last-child{border-top-right-radius:4px;border-bottom-right-radius:4px}.page-discovery>.discovery-editor .editor-toolbar{flex-direction:row;justify-content:flex-end;align-items:baseline;gap:10px;display:flex}.page-discovery>.discovery-editor .editor-toolbar label{white-space:nowrap;margin:0 1ex;padding:4px}.page-discovery>.discovery-editor .editor-toolbar .syntax-hint{color:#8d8d8dbf;flex:1;align-self:start;padding-left:10px;font-size:12px}.page-discovery>.discovery-editor .editor-toolbar .view-checkbox__label{margin-right:0}.page-discovery>.discovery-editor .discovery-editor-error{background:#ffd7d14d;border-bottom:1px solid #f009}.page-discovery>.discovery-editor textarea{box-sizing:border-box;width:100%;min-height:9em;font-family:var(--discovery-monospace-font-family);resize:vertical;border-color:#aaa;border-radius:3px;padding:8px;font-size:12px;line-height:18px;box-shadow:inset 0 1px 1px #8e8e8e33}.page-discovery>.discovery-editor textarea:focus{border-color:#0af;outline:0;box-shadow:0 0 1px 3px #0af3,inset 0 1px 1px #8e8e8e33!important}.page-discovery>.discovery-editor .query-datasets{flex-wrap:wrap;gap:4px;margin-top:-8px;margin-bottom:11px;display:none}.page-discovery>.discovery-editor .query-datasets .dataset{font-family:var(--discovery-monospace-font-family);background-color:#0a66b92e;border:1px solid #2e4155;border-radius:6px;padding:2px 8px 2px 32px;line-height:1.3;display:inline-block;position:relative;box-shadow:1px 1px 1px #0006}.page-discovery>.discovery-editor .query-datasets .dataset:before{content:"";background-color:color-mix(in srgb,#769ec8,var(--discovery-color));opacity:.7;width:32px;height:100%;position:absolute;top:0;left:0;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke-width=\\".1\\" d=\\"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z\\"/>%0A</svg>");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke-width=\\".1\\" d=\\"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z\\"/>%0A</svg>");-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:20px;mask-size:20px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.page-discovery>.discovery-editor .query-datasets .dataset__type{color:#597898;font-size:9px;display:block}.page-discovery>.discovery-editor .query-datasets .dataset__name{color:color-mix(in srgb,#769ec8,var(--discovery-color));font-size:12px;display:block}.page-discovery>.discovery-editor .query-datasets:empty:before{content:"No datasets";color:#888}.page-discovery>.discovery-editor .query-graph{margin:1px calc(-1 * var(--discovery-page-padding-right)) 1px calc(-1 * var(--discovery-page-padding-left));padding:1px var(--discovery-page-padding-right) 12px calc(1px + var(--discovery-page-padding-left));flex-flow:row;gap:30px;display:flex;position:relative;overflow-x:auto}.page-discovery>.discovery-editor .query-graph .query-graph-layer{flex-direction:column;align-items:flex-start;gap:4px;display:flex}.page-discovery>.discovery-editor .query-graph .query-graph-layer>.view-button{font-family:var(--discovery-monospace-font-family);text-align:center;order:1;margin:0 -1px;padding:3px 12px;font-size:10px;line-height:1}.page-discovery>.discovery-editor .query-graph .query-graph-node{--color:#8888;cursor:pointer;margin-top:calc(var(--pad,0) * 22px);align-items:center;gap:3px;display:flex}.page-discovery>.discovery-editor .query-graph .query-graph-node.target{pointer-events:none}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__dot{background-color:var(--color);outline:.75px solid var(--discovery-background-color);outline-offset:-3px;background-clip:content-box;border-radius:50%;width:10px;height:10px;padding:3px;transition:box-shadow .2s ease-in-out,background-color .2s ease-in-out;display:block;position:relative}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label{z-index:-1;--overlap-dot:20px;padding:0 6px;padding-left:calc(-1px + var(--overlap-dot));margin-left:calc(-1 * var(--overlap-dot));outline:.5px solid color-mix(in srgb,var(--color),transparent 35%);text-overflow:ellipsis;white-space:nowrap;min-width:40px;max-width:180px;font-family:var(--discovery-monospace-font-family);color:color-mix(in srgb,var(--discovery-color),var(--color) 30%);background-color:color-mix(in srgb,var(--discovery-background-color),var(--color) 30%);border:1px solid #0000;border-radius:9px;font-size:10px;position:relative;overflow:hidden}.page-discovery>.discovery-editor .query-graph .query-graph-node:is(:hover,.target)>.query-graph-node__label{outline-color:var(--color);outline-width:1px}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label:is(:empty,:not(.has-label)){color:color-mix(in srgb,#888 65%,var(--color))}.page-discovery>.discovery-editor .query-graph .query-graph-node>.query-graph-node__label:empty:before{content:"<empty query>"}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]{--color:var(--lightningcss-light,#b1ac1a)var(--lightningcss-dark,#f6f61cb5)}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing],.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__dot,.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__label{transition-property:background-color,outline-color,border-color,box-shadow,color}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=computing]>.query-graph-node__dot:before{content:"";aspect-ratio:1;border:2px solid var(--color);clip-path:inset(0 0 50% 50%);border-radius:50%;width:12px;margin:-3px 0 0 -3px;animation:.65s linear infinite forwards discovery-graph-computing,.1s linear forwards discovery-graph-computing-appear;display:block;position:absolute}@keyframes discovery-graph-computing{to{rotate:360deg}}@keyframes discovery-graph-computing-appear{0%{opacity:0}99%{opacity:0}to{opacity:1}}@keyframes discovery-graph-await-computing{to{background-color:#0000}}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]{--color:#4da32fcf}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful],.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]>.query-graph-node__dot,.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=successful]>.query-graph-node__label{transition:none}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=failed]{--color:#d84343}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=canceled]>.query-graph-node__dot{--color:#d84343;--color-dash:color-mix(in srgb, var(--discovery-background-color), #888 15%);--dash-start:7px;--dash-end:9px;background-color:color-mix(in srgb,var(--color),#8888);background-image:linear-gradient(to right,transparent var(--dash-start),var(--color-dash) var(--dash-start),var(--color-dash) var(--dash-end),transparent var(--dash-end));outline:none;rotate:45deg}.page-discovery>.discovery-editor .query-graph .query-graph-node.target>.query-graph-node__dot{cursor:default}.page-discovery>.discovery-editor .query-graph .query-graph-node.target:not([data-state=computing])>.query-graph-node__dot{box-shadow:0 0 0 2px var(--color) inset,0 0 0 3px var(--discovery-background-color) inset}.page-discovery>.discovery-editor .query-graph .query-graph-node:not(.target):hover>.query-graph-node__dot{box-shadow:0 0 0 2px color-mix(in srgb,var(--color),var(--discovery-color) 35%) inset,0 0 0 3px var(--discovery-background-color) inset;opacity:1;transition:none}.page-discovery>.discovery-editor .query-graph .query-graph-node[data-state=awaiting]>.query-graph-node__dot{background-color:var(--lightningcss-light,#b1ac1a)var(--lightningcss-dark,#f6f61cb5)}.page-discovery>.discovery-editor .query-graph>svg{z-index:-1;pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.page-discovery>.discovery-editor .query-graph>svg :is(line,path){stroke:var(--lightningcss-light,#bbb)var(--lightningcss-dark,#666)}.page-discovery>.discovery-editor .query-graph>svg :is(line,path).current{stroke-width:1.25px;stroke:var(--lightningcss-light,#666)var(--lightningcss-dark,#bbb)}.query-graph-actions{gap:1px;display:flex}.query-graph-actions .view-button{background-color:#c0c0c02d;background-position:50%;background-repeat:no-repeat;border:none;border-radius:0;width:23.5px;padding:0;margin:0!important}.query-graph-actions .view-button:hover{background-color:#a5a5a54d}.query-graph-actions .view-button.clone{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 13.5 5 C 11.458 5 9.737 5.82 8.629 7.066 C 7.521 8.313 7 9.917 7 11.5 C 7 13.083 7.521 14.687 8.629 15.934 C 9.439 16.845 10.65 17.394 12 17.695 L 12 30.305 C 10.65 30.606 9.439 31.155 8.629 32.066 C 7.521 33.313 7 34.917 7 36.5 C 7 38.083 7.521 39.687 8.629 40.934 C 9.737 42.18 11.458 43 13.5 43 C 17.072 43 20 40.072 20 36.5 C 20 33.596 18.03 31.21 15.387 30.385 C 15.439 30.313 15.421 30.166 15.486 30.098 C 15.806 29.763 16.385 29.433 17.23 29.168 C 18.921 28.637 21.526 28.421 24.229 28.006 C 26.931 27.591 29.792 26.971 32.111 25.252 C 34.185 23.716 35.591 21.178 35.881 17.719 C 38.775 17.064 41 14.583 41 11.5 C 41 7.928 38.072 5 34.5 5 C 32.458 5 30.737 5.82 29.629 7.066 C 28.521 8.313 28 9.917 28 11.5 C 28 13.083 28.521 14.687 29.629 15.934 C 30.397 16.798 31.531 17.329 32.791 17.652 C 32.54 20.191 31.712 21.815 30.326 22.842 C 28.708 24.041 26.319 24.648 23.771 25.039 C 21.224 25.431 18.579 25.601 16.332 26.307 C 15.869 26.452 15.43 26.645 15 26.855 L 15 17.695 C 17.835 16.997 20 14.541 20 11.5 C 20 7.928 17.072 5 13.5 5 Z\\" transform=\\"matrix(0, 1, -1, 0, 48, 0)\\"/>%0A</svg>%0A");background-size:17.5px 17.5px}.query-graph-actions.root .view-button.clone{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <ellipse cx=\\"23.652\\" cy=\\"10.385\\" rx=\\"6.462\\" ry=\\"6.462\\"/>%0A <ellipse cx=\\"23.617\\" cy=\\"37.467\\" rx=\\"6.462\\" ry=\\"6.462\\"/>%0A <rect x=\\"22.18\\" y=\\"16.245\\" width=\\"2.959\\" height=\\"16.643\\"/>%0A</svg>%0A")}.query-graph-actions .view-button.stash{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 13.5 5 C 11.458 5 9.737 5.82 8.629 7.066 C 7.521 8.313 7 9.917 7 11.5 C 7 13.083 7.521 14.687 8.629 15.934 C 9.439 16.845 10.65 17.394 12 17.695 L 12 30.305 C 10.65 30.606 9.439 31.155 8.629 32.066 C 7.521 33.313 7 34.917 7 36.5 C 7 38.083 7.521 39.687 8.629 40.934 C 9.737 42.18 11.458 43 13.5 43 C 17.072 43 20 40.072 20 36.5 C 20 33.596 18.03 31.21 15.387 30.385 C 15.439 30.313 15.421 30.166 15.486 30.098 C 15.806 29.763 16.385 29.433 17.23 29.168 C 18.921 28.637 21.526 28.421 24.229 28.006 C 26.931 27.591 29.792 26.971 32.111 25.252 C 34.185 23.716 35.591 21.178 35.881 17.719 C 38.775 17.064 41 14.583 41 11.5 C 41 7.928 38.072 5 34.5 5 C 32.458 5 30.737 5.82 29.629 7.066 C 28.521 8.313 28 9.917 28 11.5 C 28 13.083 28.521 14.687 29.629 15.934 C 30.397 16.798 31.531 17.329 32.791 17.652 C 32.54 20.191 31.712 21.815 30.326 22.842 C 28.708 24.041 26.319 24.648 23.771 25.039 C 21.224 25.431 18.579 25.601 16.332 26.307 C 15.869 26.452 15.43 26.645 15 26.855 L 15 17.695 C 17.835 16.997 20 14.541 20 11.5 C 20 7.928 17.072 5 13.5 5 Z M 34.5 8 C 36.451 8 38 9.549 38 11.5 C 38 13.42 36.493 14.935 34.586 14.982 C 34.527 14.979 34.467 14.979 34.408 14.982 C 33.182 14.958 32.413 14.551 31.871 13.941 C 31.313 13.313 31 12.417 31 11.5 C 31 10.583 31.313 9.687 31.871 9.059 C 32.43 8.43 33.208 8 34.5 8 Z\\" transform=\\"matrix(0, 1, -1, 0, 48, 0)\\"/>%0A</svg>%0A");background-size:17.5px 17.5px}.query-graph-actions.root .view-button.stash{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 24.5 5 C 22.458 5 20.737 5.82 19.629 7.066 C 18.521 8.313 18 9.917 18 11.5 C 18 13.083 18.521 14.687 19.629 15.934 C 20.439 16.845 21.65 17.394 23 17.695 L 23 30.305 C 21.65 30.606 20.439 31.155 19.629 32.066 C 18.521 33.313 18 34.917 18 36.5 C 18 38.083 18.521 39.687 19.629 40.934 C 20.737 42.18 22.458 43 24.5 43 C 28.072 43 31 40.072 31 36.5 C 31 33.596 28.671 31.193 26.028 30.368 C 26.08 30.296 26 17.695 26 17.695 C 28.835 16.997 31 14.541 31 11.5 C 31 7.928 28.072 5 24.5 5 Z M 24.5 8 C 26.451 8 28 9.549 28 11.5 C 28 13.42 26.493 14.935 24.586 14.982 C 24.527 14.979 24.467 14.979 24.408 14.982 C 23.182 14.958 22.413 14.551 21.871 13.941 C 21.313 13.313 21 12.417 21 11.5 C 21 10.583 21.313 9.687 21.871 9.059 C 22.43 8.43 23.208 8 24.5 8 Z\\" style=\\"transform-origin: 24.5px 24px;\\" transform=\\"matrix(-1, 0, 0, -1, 0, 0)\\"/>%0A</svg>%0A")}.query-graph-actions .view-button.subquery{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 48 48\\" fill=\\"%23888\\">%0A <path d=\\"M 24.5 5 C 22.458 5 20.737 5.82 19.629 7.066 C 18.521 8.313 18 9.917 18 11.5 C 18 13.083 18.521 14.687 19.629 15.934 C 20.439 16.845 21.65 17.394 23 17.695 L 23 30.305 C 21.65 30.606 20.439 31.155 19.629 32.066 C 18.521 33.313 18 34.917 18 36.5 C 18 38.083 18.521 39.687 19.629 40.934 C 20.737 42.18 22.458 43 24.5 43 C 28.072 43 31 40.072 31 36.5 C 31 33.596 28.671 31.193 26.028 30.368 C 26.08 30.296 26 17.695 26 17.695 C 28.835 16.997 31 14.541 31 11.5 C 31 7.928 28.072 5 24.5 5 Z M 24.5 8 C 26.451 8 28 9.549 28 11.5 C 28 13.42 26.493 14.935 24.586 14.982 C 24.527 14.979 24.467 14.979 24.408 14.982 C 23.182 14.958 22.413 14.551 21.871 13.941 C 21.313 13.313 21 12.417 21 11.5 C 21 10.583 21.313 9.687 21.871 9.059 C 22.43 8.43 23.208 8 24.5 8 Z\\" transform=\\"matrix(0, 1, -1, 0, 48.499998, -0.499998)\\"/>%0A</svg>%0A");background-size:18.5px 18.5px}.query-graph-actions .view-button.delete{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\" fill=\\"%23888\\">%0A <path d=\\"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z\\"/>%0A</svg>%0A");background-size:12.5px 12.5px}.discovery-buildin-view-tooltip.hint-tooltip{padding:1px 6px;font-size:12px}.discovery-buildin-view-tooltip.hint-tooltip>.view-markdown{padding:2px 4px}.query-graph-tooltip{margin:4px}.query-graph-tooltip .view-source{background:0 0;margin:-5px -10px}.query-graph-tooltip>.view-badge{vertical-align:top;font-size:12px;margin:0 -5px!important;padding:4px 8px!important}.page-discovery>.discovery-editor .query-path{opacity:.35}.page-discovery>.discovery-editor .query-path .query{font-family:var(--discovery-monospace-font-family);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;background:#eee;border:1px solid #888;border-bottom-width:0;border-radius:4px 4px 0 0;margin-bottom:-4px;padding:2px 8px 6px;font-size:10px;line-height:16px;overflow:hidden}.discovery-root-darkmode .page-discovery>.discovery-editor .query-path .query{background:#333}.page-discovery>.discovery-editor .query-path .query:last-child{padding-bottom:7px}.page-discovery>.discovery-editor .query-path .query:empty:before{content:"<empty query>"}.page-discovery>.discovery-editor .query-path .query:hover{background:#ccc}.discovery-root-darkmode .page-discovery>.discovery-editor .query-path .query:hover{background:#444}.page-discovery>.discovery-editor .query-editor{position:relative}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__input-panel{background-color:var(--discovery-background-color);border-radius:1px 1px 0 0;grid-template-columns:auto 1fr auto;grid-template-areas:"actions input engine""details details details";gap:0 1px;margin:1px 0;padding:0 1px;display:grid}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__input-panel.details-expanded{border-bottom:1px solid var(--editor-border-color,#888);gap:1px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine{color:var(--discovery-color);background-color:#c0c0c02d;grid-area:engine;padding:1px 8px 3px;font-size:12px;text-decoration:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-engine:before{content:"Syntax: ";color:#888}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input{grid-area:input;gap:1px;font-size:12px;display:flex}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-data,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-context{cursor:pointer;background-color:#c0c0c02d;flex:1;padding:1px 8px 3px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-data:hover,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-context:hover{background-color:#a5a5a54d!important}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=data] .query-input-data,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=context] .query-input-context{background-color:#cdcdcd1a;background-clip:padding-box;border-bottom:1px solid #cdcdcd1a;margin-bottom:-1px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable{color:var(--discovery-fmt-variable-color);font-family:var(--discovery-monospace-font-family);padding-right:14px;position:relative}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .num-delim-wrapper .num-delim{padding-left:1.25px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable:before{content:"";aspect-ratio:1;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;height:100%;margin-right:2px;transition:transform .15s ease-in;position:absolute;top:0;right:0;transform:rotate(-90deg)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=data] .query-input-data .query-input-variable:before,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input[data-details=context] .query-input-context .query-input-variable:before{transform:rotate(0)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-variable:after{content:" (" attr(data-name) ") ";color:#888;font-family:var(--discovery-font-family)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details{grid-area:details;max-height:max(30vh,150px);display:none;overflow:auto}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .discovery-view-editor__input-panel.details-expanded .query-input-details{margin-bottom:1px;display:block}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details>.view-struct{margin:0}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel{border-radius:0 0 1px 1px;grid-template-columns:1fr auto;grid-template-areas:"result buttons";gap:1px;margin:1px;display:grid;overflow:hidden}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel.details-expanded{grid-template-areas:"result buttons""details details"}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons{grid-area:buttons;gap:1px;display:flex}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-button{border-radius:0;padding:3px 16px 4px;font-size:12px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox{cursor:pointer;background-color:#c0c0c02d;align-content:center;padding:2px 6px;font-size:12px}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox input{display:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox .view-checkbox__label{content:"";aspect-ratio:1;color:#0000;background-color:var(--lightningcss-light,#c8c8c8)var(--lightningcss-dark,#6b6b6b);width:16px;margin:0;display:block;overflow:hidden;-webkit-mask:none 50%/16px no-repeat;mask:none 50%/16px no-repeat}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox.suggestions .view-checkbox__label{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 4 172 176\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M25.86719,12.84961l-7.64257,7.64257l3.82128,3.7793l7.60059,7.60058l3.77929,3.82129l7.64258,-7.64258l-3.82129,-3.77929l-7.60058,-7.60059zM146.13281,12.84961l-3.77929,3.82128l-11.37989,11.37989l7.60058,7.64258l3.7793,-3.82129l11.37987,-11.37989zM86,21.5c-23.68359,0 -43,19.31641 -43,43c0,14.86524 6.50879,23.43165 11.75781,30.73828c5.29102,7.26465 9.74219,13.4375 9.74219,28.38672v10.75c0,6.97071 4.57715,12.93359 10.83399,15.11719c-0.042,0.33594 -0.08399,0.67188 -0.08399,1.00781c0,5.9209 4.8291,10.75 10.75,10.75c5.9209,0 10.75,-4.8291 10.75,-10.75c0,-0.33594 0,-0.67187 -0.04199,-1.00781c6.25683,-2.22558 10.79199,-8.14648 10.79199,-15.11719v-10.75c0,-14.94922 4.45118,-21.12207 9.74219,-28.38672c5.24902,-7.30664 11.75781,-15.87304 11.75781,-30.73828c0,-23.68359 -19.31641,-43 -43,-43zM86,32.25c17.88868,0 32.25,14.36133 32.25,32.25c0,12.00977 -4.24121,16.88086 -9.74219,24.35547c-4.74511,6.59277 -9.44824,15.87305 -10.75,29.39453h-23.51562c-1.30176,-13.52148 -6.00489,-22.80176 -10.75,-29.39453c-5.50098,-7.4746 -9.74219,-12.3457 -9.74219,-24.35547c0,-17.88867 14.36133,-32.25 32.25,-32.25zM10.75,64.5v10.75h21.5v-10.75zM139.75,64.5v10.75h21.5v-10.75zM33.42578,104.05665l-3.77929,3.82128l-7.60059,7.60059l-3.82128,3.77929l7.64257,7.60058l11.37989,-11.37987l3.82129,-3.7793zM138.57422,104.05665l-7.60058,7.64257l15.15918,15.15918l7.60058,-7.60058l-11.37987,-11.37989zM75.25,129h21.5v5.375c0,3.02344 -2.35156,5.375 -5.375,5.375h-10.75c-3.02344,0 -5.375,-2.35156 -5.375,-5.375z\\" />%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 4 172 176\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M25.86719,12.84961l-7.64257,7.64257l3.82128,3.7793l7.60059,7.60058l3.77929,3.82129l7.64258,-7.64258l-3.82129,-3.77929l-7.60058,-7.60059zM146.13281,12.84961l-3.77929,3.82128l-11.37989,11.37989l7.60058,7.64258l3.7793,-3.82129l11.37987,-11.37989zM86,21.5c-23.68359,0 -43,19.31641 -43,43c0,14.86524 6.50879,23.43165 11.75781,30.73828c5.29102,7.26465 9.74219,13.4375 9.74219,28.38672v10.75c0,6.97071 4.57715,12.93359 10.83399,15.11719c-0.042,0.33594 -0.08399,0.67188 -0.08399,1.00781c0,5.9209 4.8291,10.75 10.75,10.75c5.9209,0 10.75,-4.8291 10.75,-10.75c0,-0.33594 0,-0.67187 -0.04199,-1.00781c6.25683,-2.22558 10.79199,-8.14648 10.79199,-15.11719v-10.75c0,-14.94922 4.45118,-21.12207 9.74219,-28.38672c5.24902,-7.30664 11.75781,-15.87304 11.75781,-30.73828c0,-23.68359 -19.31641,-43 -43,-43zM86,32.25c17.88868,0 32.25,14.36133 32.25,32.25c0,12.00977 -4.24121,16.88086 -9.74219,24.35547c-4.74511,6.59277 -9.44824,15.87305 -10.75,29.39453h-23.51562c-1.30176,-13.52148 -6.00489,-22.80176 -10.75,-29.39453c-5.50098,-7.4746 -9.74219,-12.3457 -9.74219,-24.35547c0,-17.88867 14.36133,-32.25 32.25,-32.25zM10.75,64.5v10.75h21.5v-10.75zM139.75,64.5v10.75h21.5v-10.75zM33.42578,104.05665l-3.77929,3.82128l-7.60059,7.60059l-3.82128,3.77929l7.64257,7.60058l11.37989,-11.37987l3.82129,-3.7793zM138.57422,104.05665l-7.60058,7.64257l15.15918,15.15918l7.60058,-7.60058l-11.37987,-11.37989zM75.25,129h21.5v5.375c0,3.02344 -2.35156,5.375 -5.375,5.375h-10.75c-3.02344,0 -5.375,-2.35156 -5.375,-5.375z\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox.live-update .view-checkbox__label{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-16 0 172 156\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M32.08203,10.75l-21.5,86h29.05859l-17.46875,53.75h23.89355l50.68457,-86h-32.37598l21.5,-53.75zM127.65625,10.75l-20.15625,53.75h12.09375l4.03125,-10.75h21.5l4.03125,10.75h12.09375l-20.15625,-53.75zM40.48047,21.5h29.52051l-21.5,53.75h29.43652l-38.00293,64.5h-2.98145l17.46875,-53.75h-30.06641zM134.375,25.11133l6.71875,17.88867h-13.4375z\\" />%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-16 0 172 156\\">%0A <path fill=\\"%23888\\" stroke=\\"%23888\\" stroke-width=\\"1.5\\" d=\\"M32.08203,10.75l-21.5,86h29.05859l-17.46875,53.75h23.89355l50.68457,-86h-32.37598l21.5,-53.75zM127.65625,10.75l-20.15625,53.75h12.09375l4.03125,-10.75h21.5l4.03125,10.75h12.09375l-20.15625,-53.75zM40.48047,21.5h29.52051l-21.5,53.75h29.43652l-38.00293,64.5h-2.98145l17.46875,-53.75h-30.06641zM134.375,25.11133l6.71875,17.88867h-13.4375z\\" />%0A</svg>%0A")}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox :checked+.view-checkbox__label{background-color:var(--lightningcss-light,#008dffbf)var(--lightningcss-dark,#b8b8b8)}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel>.buttons .view-checkbox:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .data-query-result .query-result-data{cursor:pointer;background-color:#c0c0c02d;flex:1;padding:2px 8px;font-size:12px;display:flex}.page-discovery>.discovery-editor .data-query-result .query-result-data:hover{background-color:#a5a5a54d}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-message{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-prelude{color:#888;padding-right:20px;display:inline-block;position:relative}.page-discovery>.discovery-editor .data-query-result .query-result-data>.query-output-prelude:before{content:"";aspect-ratio:1;background:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\">%0A <path fill=\\"%23888\\" d=\\"M 3.71875 7.78125 L 2.28125 9.21875 L 11.28125 18.21875 L 12 18.90625 L 12.71875 18.21875 L 21.71875 9.21875 L 20.28125 7.78125 L 12 16.0625 Z \\"/>%0A</svg>%0A") 50%/12px no-repeat;height:100%;margin-right:2px;transition:transform .15s ease-in;position:absolute;top:0;right:0;transform:rotate(-90deg)}.page-discovery>.discovery-editor .data-query-result .query-result-data.error{background-color:#ff2d2836}.page-discovery>.discovery-editor .discovery-view-editor__output-panel.details-expanded .data-query-result .query-result-data>.query-output-prelude:before{transform:rotate(0)}.page-discovery>.discovery-editor .data-query-result{grid-area:result;overflow:hidden}.page-discovery>.discovery-editor .data-query-result>*{overflow:hidden}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details{grid-area:details;max-height:max(50vh,200px);overflow:auto}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel:not(.details-expanded) .data-query-result-details{display:none}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details>.view-struct{margin:0}.page-discovery>.discovery-editor .query-editor>.discovery-view-editor .query-input-details>.state-message,.page-discovery>.discovery-editor .query-editor>.discovery-view-editor>.discovery-view-editor__output-panel .data-query-result-details .state-message{color:#888;background-color:#cdcdcd1a;padding:4px 8px;font-size:12px}.page-discovery>.discovery-editor .view-editor-form{margin:12px calc(-1 * var(--discovery-page-padding-right)) 12px calc(-1 * var(--discovery-page-padding-left))}.page-discovery>.discovery-editor .view-editor-form-header{margin-right:var(--discovery-page-padding-right);flex-wrap:wrap-reverse;display:flex}.page-discovery>.discovery-editor .view-editor-form-header-links{text-align:right;flex:1;margin:2px 0 0 10px;font-size:12px}.page-discovery>.discovery-editor .discovery-editor-tabs.view-mode:before{content:"View:";display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tab[data-mode=default]{border-top-left-radius:4px}.page-discovery>.discovery-editor .view-editor-form:not(.hide-editor) .discovery-editor-tab[data-mode=default]{border-bottom-left-radius:0}.page-discovery>.discovery-editor .discovery-editor-tab[data-mode=custom]{cursor:pointer}.page-discovery>.discovery-editor .view-editor-form:not(.hide-editor) .discovery-editor-tab[data-mode=custom]{border-bottom-right-radius:0;padding-bottom:3px}.page-discovery>.discovery-editor .discovery-editor-tabs .discovery-editor-tab:not(.active) .show-view-editor-toggle{pointer-events:none}.page-discovery>.discovery-editor .discovery-editor-tabs .show-view-editor-toggle{vertical-align:middle;cursor:pointer;margin:-3px -9px -7px 1px;display:inline-block}.page-discovery>.discovery-editor .discovery-editor-tabs .show-view-editor-toggle:before{content:"";aspect-ratio:1;background-color:var(--lightningcss-light,#aaa)var(--lightningcss-dark,#aaac);width:20px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8\\"/>%0A</svg>%0A") 50%/12px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8\\"/>%0A</svg>%0A") 50%/12px no-repeat}.page-discovery>.discovery-editor .discovery-editor-tabs .discovery-editor-tab.active:hover .show-view-editor-toggle:before{background-color:#fff;background-color:var(--lightningcss-light,#008dff)var(--lightningcss-dark,#ccc)}.page-discovery>.discovery-editor .view-editor-form.hide-editor .discovery-editor-tabs .show-view-editor-toggle:before{-webkit-mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4\\"/>%0A</svg>%0A");mask-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 16 16\\">%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2z\\"/>%0A <path stroke=\\"%23888\\" stroke-width=\\".5\\" d=\\"M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4\\"/>%0A</svg>%0A")}.page-discovery>.discovery-editor .discovery-editor-tabs.presets{margin-left:3ex}.page-discovery>.discovery-editor .discovery-editor-tabs.presets:before{content:"View presets:"}.page-discovery>.discovery-editor .discovery-editor-tabs.presets .discovery-editor-tab:first-child{border-bottom-left-radius:4px}.page-discovery>.discovery-editor .view-editor-form.hide-editor .view-editor-form-content{display:none}.page-discovery>.discovery-editor .view-editor-form-content{padding:8px var(--discovery-page-padding-right) 8px var(--discovery-page-padding-left);background-color:#6cbcf126;margin-bottom:1px}.page-discovery>.discovery-editor .view-editor-form-content .formatting{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"%23888\\" d=\\"M26.875,21.5c-8.84221,0 -16.125,7.28279 -16.125,16.125v96.75c0,8.84221 7.28279,16.125 16.125,16.125h37.625v-10.75h-37.625c-3.02579,0 -5.375,-2.34921 -5.375,-5.375v-96.75c0,-3.02579 2.34921,-5.375 5.375,-5.375h118.25c3.02579,0 5.375,2.34921 5.375,5.375v26.875h10.75v-26.875c0,-8.84221 -7.28279,-16.125 -16.125,-16.125zM78.35742,43l-24.37646,83.54345l-0.23096,2.45655h10.68701l6.27783,-21.5h15.09619l10.75,-10.75h-22.69678l12.19873,-41.76123l11.73682,40.52246l8.6084,-8.6084l-12.63965,-43.90283zM137.46142,75.29199c-2.61253,0 -5.21878,0.97757 -7.18066,2.93945l-52.04932,52.07031c-3.92375,3.92375 -3.92375,10.43757 0,14.36132l24.35547,24.35547c3.92375,3.92375 10.43757,3.92375 14.36132,0l52.04932,-52.04932c3.94035,-3.91783 3.94035,-10.4645 0,-14.38232l-24.33447,-24.35547c-1.96187,-1.96188 -4.58912,-2.93945 -7.20166,-2.93945zM137.46142,86.25195l23.53662,23.53663l-21.81493,21.79394l-23.51562,-23.51563zM108.06689,115.66748l23.51563,23.51562l-21.81493,21.81493l-23.51563,-23.51562z\\"/>%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:20px;border-color:#1562944d;width:30px;height:30px;font-size:0;position:absolute;left:5px}.page-discovery>.discovery-editor .view-editor-form-content .view-expand{width:100%;margin-top:5px}.page-discovery>.discovery-editor .view-editor-form-content .view-expand .header{background:0 0}.page-discovery>.discovery-editor .view-editor-form-content .view-expand .header:hover{background:#0000000d}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list{color:#aaa;column-count:8;column-width:150px;column-gap:20px;margin-right:-190px;padding:15px 8px;font-size:12px;display:none}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list.visible{display:block}.page-discovery>.discovery-editor .view-editor-form-content .view-editor-view-list .item:not([href]){color:#888}.discovery-view-popup.view-editor-view-list-hint{min-width:640px;min-height:100px;padding:20px}.discovery-view-popup.view-editor-view-list-hint>.discovery-view-usage>.view-header:first-child{background:#b4b4b433;margin:-36px -20px 0;padding:6px 20px;font-size:16px;line-height:24px}.page-discovery{padding-top:20px!important}.discovery:not([data-dzen]) .page-discovery>.discovery-render-content{min-height:calc(100vh - 121px)}.page-discovery>.discovery-editor .discovery-error,.page-discovery>.discovery-render-content>.discovery-error{white-space:pre-wrap;font-size:12px;font-family:var(--discovery-monospace-font-family);background:#e14b4b33 padding-box padding-box;border-left:3px solid #f00c;padding:8px 12px;font-size:11px;display:block;overflow:hidden}.page-discovery>.discovery-editor .discovery-error:before,.page-discovery>.discovery-render-content>.discovery-error:before{margin-bottom:.5em;font-size:16px;display:block}.page-discovery>.discovery-editor .query-error:before{content:"Query error"}.page-discovery>.discovery-render-content>.render-error:before{content:"Render error"}.discovery-view-usage{margin-top:16px}.discovery-view-usage>.view-header:first-child{margin-top:0;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-weight:200}.discovery-view-usage .usage-render{z-index:0;border:2px solid #aaa3;border-radius:3px;margin:15px 0 10px;padding:30px 16px 16px;position:relative}.discovery-view-usage .usage-render[data-render-type=text]>.view-text-render{margin:-16px;padding:16px;overflow-x:auto}.discovery-view-usage .usage-render.demo-fixed{--image-preview-bg-color:#77777720;padding:var(--discovery-page-padding-top) var(--discovery-page-padding-right) var(--discovery-page-padding-bottom) var(--discovery-page-padding-left);background-clip:padding-box;background-image:linear-gradient(45deg,var(--image-preview-bg-color) 25%,transparent 0,transparent 75%,var(--image-preview-bg-color) 75%),linear-gradient(45deg,var(--image-preview-bg-color) 25%,transparent 0,transparent 75%,var(--image-preview-bg-color) 75%);background-position:0 0,10px 10px;background-size:20px 20px;border-top-left-radius:0;margin-top:29px}.discovery-view-usage .usage-render:before{content:"DEMO";background-color:#aaa3;border-bottom-right-radius:4px;padding:2px 24px 3px;font-size:9px;line-height:1;position:absolute;top:0;left:0}.discovery-view-usage .usage-render.demo-fixed:before{border-radius:4px 4px 0 0;padding-left:26px;top:-16px;left:-2px}.discovery-view-usage .usage-section>.view-h2{margin-top:1.2em;margin-bottom:.5em}.discovery-view-usage .usage-section>.view-h2 .view-header__anchor{scroll-margin:.5em}.discovery-view-usage .view-tabs.usage-sources .view-tabs-buttons:before{display:none}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content{border:1px solid #aaa6;border-top:none;border-radius:0 0 3px 3px;padding:2px;overflow:visible}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand{margin-bottom:1px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand>.header{--discovery-view-expand-trigger-size:32px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand .view-struct.struct-expand{padding-left:28px}.discovery-view-usage .view-tabs.usage-sources .view-tabs-content .view-expand .view-struct:not(.struct-expand){border-left:20px solid #cdcdcd1a}.discovery-view-usage .view-tabs.usage-sources .view-source{background:#9b9b9b1a;border-top-left-radius:0;border-top-right-radius:0}.discovery-view-usage .view-tabs.usage-sources .view-source.first-tab{border-top-left-radius:0}.discovery-view-usage .view-tabs.usage-sources .view-source .spotlight{margin:0 -2px;padding:3px 2px 2px}.discovery-root-darkmode .discovery-view-usage .view-tabs.usage-sources .view-source .spotlight{color:#b6aa6a;background:#92926654}.page-views-showcase{box-sizing:border-box;background-color:#fffc;border:1px solid #aaa6;border-radius:3px;flex-direction:row;flex:1;margin:35px 40px 20px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in;display:flex;overflow:hidden;padding:0!important}.discovery-root-darkmode .page-views-showcase{background-color:#242424cc}.page-views-showcase>.sidebar{border-right:1px solid #aaa3;flex-direction:column;width:220px;display:flex}.page-views-showcase>.sidebar>.sidebar-header{align-items:stretch;gap:1px;margin:1px;display:flex}.page-views-showcase>.sidebar>.sidebar-header .index-page-link{color:var(--discovery-color);text-align:center;flex:1;padding:3px 11px;font-size:13px;text-decoration:none;display:block}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:not(.view-selected){cursor:default;background-color:#bd78ff40}.page-views-showcase>.sidebar>.sidebar-header .index-page-link.view-selected:hover{cursor:pointer;background-color:#83838340}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:before{content:"↑ ";font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Tahoma,sans-serif}.page-views-showcase>.sidebar>.sidebar-header .index-page-link:not(.view-selected):before{content:""}.page-views-showcase>.sidebar>.sidebar-header .render-toggle{border-left:1px solid #aaa3;padding-left:8px;font-size:11px}.page-views-showcase>.sidebar>.sidebar-header .render-toggle .view-toggle{border-radius:0;padding-top:5px;padding-bottom:5px;font-size:11px}.page-views-showcase>.sidebar .view-content-filter{flex-direction:column;flex:1;display:flex;overflow:hidden}.page-views-showcase>.sidebar .view-content-filter>.view-input{margin:0}.page-views-showcase>.sidebar .view-content-filter>.view-input input{box-shadow:none;border:1px solid #aaa3;border-left:none;border-right:none;border-radius:0}.page-views-showcase>.sidebar .view-content-filter .view-block{flex:1;padding:1px;overflow:hidden scroll}.page-views-showcase>.sidebar .view-menu-item:not(.disabled){color:var(--discovery-link-color,#09d)}.page-views-showcase>.sidebar .view-menu-item.selected{background-color:#54768b4d}.page-views-showcase>.sidebar .view-menu-item:not(.selected):hover{color:var(--discovery-link-hover-color,#07b)}.page-views-showcase>.content{flex:1;padding:0 24px 20px;overflow:hidden scroll}.page-views-showcase>.content:not(:has(>.discovery-view-usage>.view-h1:first-child,>.view-h1:first-child)){padding-top:20px}.page-views-showcase>.content>.view-h1{margin-top:16px;font-family:Helvetica Neue,Helvetica,Tahoma,Arial,sans-serif;font-weight:200}.page-views-showcase .view-markdown .view-render{gap:2px;margin:8px 0;display:flex}.page-views-showcase .view-markdown .view-render__source:before,.page-views-showcase .view-markdown .view-render__result:before{content:"Discovery.js view";border-bottom:1px solid var(--discovery-background-color);background-color:color-mix(in srgb,currentcolor 15%,var(--discovery-background-color));padding:4px 8px;display:block}.page-views-showcase .view-markdown .view-render__result:before{content:"Render result"}.page-views-showcase .view-markdown .view-render__source{flex-direction:column;width:510px;max-width:49%;display:flex}.page-views-showcase .view-markdown .view-render__source>.view-source{flex:1}.page-views-showcase .view-markdown .view-render__result{flex-direction:column;flex:1;display:flex}.page-views-showcase .view-markdown .view-render__result>pre{flex:1;padding:8px 16px}.discovery-view-inspector-overlay{z-index:2000;background-color:#0000ff1a;position:fixed;inset:0}.discovery-view-inspector-overlay .cancel-hint{content:"Inspection mode is enabled. Press Esc to cancel";z-index:10;background-color:var(--discovery-background-color);opacity:.8;border-radius:25px;padding:2px 10px;font-size:12px;position:absolute;top:4px;left:50%;transform:translate(-50%)}.discovery-view-inspector-overlay .cancel-hint:before{content:"Inspection mode is enabled. Press Esc to cancel"}.discovery-view-inspector-overlay .cancel-hint[data-alt]:before{content:"Inspection mode is enabled. Unhold Alt to cancel"}.discovery-view-inspector-overlay .overlay{box-sizing:border-box;transition:background-color 15ms 25ms;position:absolute}.discovery-view-inspector-overlay .overlay.view-root:not([data-inspectable]){pointer-events:none}.discovery-view-inspector-overlay .overlay:not(.view-root){pointer-events:auto}.discovery-view-inspector-overlay .overlay.hovered{background-color:rgba(0,255,0,var(--discovery-background-alpha));outline-offset:-1px;--discovery-background-alpha:.3;outline:1px dashed #00800066}.discovery-view-inspector-overlay .overlay.view-root.hovered{background-color:rgba(106,0,204,var(--discovery-background-alpha));outline:1px dashed #36006666}.discovery-root-darkmode .discovery-view-inspector-overlay .overlay.hovered{--discovery-background-alpha:.2;outline-color:#80c880a6}.discovery-root-darkmode .discovery-view-inspector-overlay .overlay.view-root.hovered{outline-color:#6f4a98a6}@supports ((-webkit-backdrop-filter:grayscale(1)) or (backdrop-filter:grayscale(1))){.discovery-view-inspector-overlay .overlay.hovered{--discovery-background-alpha:.25;-webkit-backdrop-filter:grayscale();backdrop-filter:grayscale()}}.discovery-inspect-details-popup{pointer-events:none;z-index:2001;background:rgba(255,255,255,var(--discovery-background-alpha));--discovery-background-alpha:.95;--discovery-mate-background:#f0f0f080;--discovery-link-color:#333;--discovery-link-underline-color:#0002;--discovery-view-root-highlight-color:#6a00cc40;border-radius:2px;grid-template:"sidebar toolbar toolbar""sidebar props-config data-context"1fr/0 4fr 6fr;gap:1px;padding:1px;display:grid;max-width:650px!important}.discovery-root-darkmode .discovery-inspect-details-popup{background:rgba(36,36,36,var(--discovery-background-alpha));--discovery-background-alpha:.92;--discovery-mate-background:#34343480;--discovery-link-color:#aaa;--discovery-link-underline-color:#aaa2;--discovery-view-root-highlight-color:#bd78ff40}.discovery-inspect-details-popup.frozen{pointer-events:all;grid-template-rows:auto minmax(20%,1fr);grid-template-columns:minmax(290px,25%) 4fr 6fr;transition:top .125s,left .125s,right .125s,bottom .125s,grid-template-rows .125s,grid-template-columns .125s;max-width:none!important;max-height:none!important;inset:32px 20px 20px!important}.discovery-inspect-details-popup:not(.frozen){padding-bottom:21px}.discovery-inspect-details-popup:not(.frozen):after{content:"Cmd+Click (Mac) or Ctrl+Click (Win) opens the view description in a documentation";text-align:center;white-space:nowrap;border-top:1px solid var(--discovery-background-color);background-color:color-mix(in srgb,var(--discovery-background-color),var(--lightningcss-light,#000)var(--lightningcss-dark,#fff) 10%);color:#888;padding:.4em 1ex;font-size:11px;line-height:1;position:absolute;bottom:0;left:0;right:0}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.discovery-inspect-details-popup{--discovery-background-alpha:.65;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.discovery-root-darkmode .discovery-inspect-details-popup{--discovery-background-alpha:.4}}.discovery-inspect-details-popup .sidebar{overscroll-behavior:contain;background-color:var(--discovery-mate-background);grid-area:sidebar;padding:4px;overflow:auto}.discovery-inspect-details-popup .sidebar .view-tree-leaf-content{white-space:nowrap;padding-right:12px}.discovery-inspect-details-popup .sidebar .view-root{background-color:var(--discovery-view-root-highlight-color);border:1px solid #0000;border-width:1px 8px;margin-bottom:1px;margin-left:-6px;display:inline-block}.discovery-inspect-details-popup .sidebar .selected{background-color:#4ebbff4d;display:inline;box-shadow:0 0 0 3px #4ebbff4d}.discovery-inspect-details-popup .sidebar .skipped{opacity:.65;font-style:italic;text-decoration:line-through}.discovery-inspect-details-popup .sidebar>.view-tree-leaf:only-child{background:0 0;grid-template-columns:6px auto;margin:-4px 0 0 -4px}.discovery-inspect-details-popup .sidebar>.view-tree-leaf:only-child>.view-tree-leaf-toggle{display:none}.discovery-inspect-details-popup .sidebar .view-badge{vertical-align:top;border-radius:0;margin-left:1ex;margin-right:0;font-size:9px}.discovery-inspect-details-popup .sidebar .view-badge+.view-badge{margin-left:1px}.discovery-inspect-details-popup .toolbar{grid-area:toolbar;gap:1px;display:flex}.discovery-inspect-details-popup .stack-view-chain{background-color:var(--discovery-mate-background);flex:1;gap:1px}.discovery-inspect-details-popup .stack-view-chain .view-toggle{border-radius:0;margin:0;padding:5px 8px;line-height:16px}.discovery-inspect-details-popup .stack-view-chain .skipped{opacity:.65;font-style:italic;text-decoration:line-through}.discovery-inspect-details-popup .stack-view-chain .view-root:not(.checked):not(:hover){background-color:var(--discovery-view-root-highlight-color)}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes{vertical-align:middle;text-align:center;text-transform:uppercase;gap:2px;margin:-5px -2px -2px 4px;font-size:7px;line-height:12px;display:inline-flex;position:relative}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes>*{border-radius:8px;width:12px;height:12px;overflow:hidden;box-shadow:1px 1px 1px #0003}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes .data{background:#1f841f80}.discovery-inspect-details-popup .stack-view-chain .data-flow-changes .context{background:#b1366f80;bottom:0}.discovery-inspect-details-popup .toolbar .view-button{box-shadow:none;border-radius:2px 1px 2px 2px;padding:5px 8px 7px;font-size:12px;line-height:12px}.discovery-inspect-details-popup .content{background-color:var(--discovery-mate-background);font-size:12px;line-height:14px;overflow:hidden}.discovery-inspect-details-popup.frozen .content{overflow:auto}.discovery-inspect-details-popup .content .view-struct{background-color:#0000;overflow:visible}.discovery-inspect-details-popup .content .view-source{background-color:#0000;font-size:11px;line-height:15px}.discovery-inspect-details-popup .content.props-config{grid-area:props-config}.discovery-inspect-details-popup .content.data-context{grid-area:data-context}.discovery-inspect-details-popup .content-section:before{content:var(--header);text-transform:uppercase;color:#444;border-bottom:2px solid #ddd;margin-left:7px;padding:8px 10px 2px 1px;font-size:10px;display:inline-block}.discovery-root-darkmode .discovery-inspect-details-popup .content-section:before{color:inherit;text-shadow:1px 1px #00000040;border-bottom:2px solid #666}.discovery-inspect-details-popup .content-section.skip{--header:"Not rendered reason"}.discovery-inspect-details-popup .content-section.skip .view-block{padding:6px 0 8px 6px;font-size:14px}.discovery-inspect-details-popup .content-section.render{--header:"Render function"}.discovery-inspect-details-popup .content-section.props{--header:"Render props"}.discovery-inspect-details-popup .content-section.config{--header:"Config"}.discovery-inspect-details-popup .content-section.props .transition-fn{border-left:1px solid #888;margin:-4px 0 -4px 11px;padding:16px 0 0 4px;position:relative}.discovery-inspect-details-popup .content-section.props .transition-fn .view-source__content{padding-bottom:6px}.discovery-inspect-details-popup .content-section.props .transition-fn:before{content:"";box-sizing:border-box;border:3.5px solid #0000;border-top:none;border-bottom:7px solid #888;width:7px;height:7px;position:absolute;top:-2px;left:-4px}.discovery-inspect-details-popup .content-section.props .transition-fn:after{content:"Normalize (view.options.props)";opacity:.75;background:#8885;padding:0 4px;font-size:10px;position:absolute;top:5px;left:0}.discovery-inspect-details-popup .content-section.config>.view-tree{margin-left:6px}.discovery-inspect-details-popup .content-section.config .view-tree-leaf-content>.view-struct{margin:-4px 0 -4px -4px}.discovery-inspect-details-popup .content-section.data{--header:"Data"}.discovery-inspect-details-popup .content-section.data .data-flow-transitions{flex-direction:column-reverse;display:flex}.discovery-inspect-details-popup .content-section.data .data-flow-transitions>.more-buttons{margin-top:0;margin-bottom:-4px;padding:6px 0 0 8px}.discovery-inspect-details-popup .content-section.data .data-flow-transitions>.more-buttons .more-button{padding-top:2px;padding-bottom:2px}.discovery-inspect-details-popup .content-section.data .root-data{pointer-events:none;margin-bottom:-6px;padding:6px 0 0 8px}.discovery-inspect-details-popup .content-section.data .root-data .view-badge{text-transform:uppercase;padding:2px 8px;font-size:9px}.discovery-inspect-details-popup .content-section.data .data-flow-transition{border-left:1px solid #888;margin:-4px 0 -2px 11px;padding:12px 0 0 4px;position:relative}.discovery-inspect-details-popup .content-section.data .data-flow-transition>.view-name{opacity:.75;background:#8885;padding:0 4px;font-size:10px;position:absolute;top:0;left:0}.discovery-inspect-details-popup .content-section.data .data-flow-transition:before{content:"";box-sizing:border-box;border:3.5px solid #0000;border-top:7px solid #888;border-bottom:none;width:7px;height:7px;position:absolute;bottom:-2px;left:-4px}.discovery-inspect-details-popup .content-section.context{--header:"Context"}:host{transition:opacity .2s}.discovery-root{all:initial;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light only;font-family:var(--discovery-font-family);-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;background-color:var(--discovery-background-color,white);color:var(--discovery-color,black);--discovery-app-icon:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"-6 -4 136 140\\">%0A <rect x=\\"65.6\\" y=\\"24.6\\" transform=\\"matrix(0.9397 -0.342 0.342 0.9397 -9.9426 31.828)\\" fill=\\"%23FFFFFF\\" width=\\"39.3\\" height=\\"39\\"></rect>%0A <rect x=\\"70.6\\" y=\\"52.7\\" transform=\\"matrix(-0.9397 0.342 -0.342 -0.9397 194.7852 81.1204)\\" fill=\\"%23C7D7E2\\" width=\\"39.3\\" height=\\"10\\"></rect>%0A <path fill=\\"%2398BED8\\" d=\\"M111.5,54.6l-1.1,1.1L97.1,19.1l1.5,0.2c8,0.9,14.7,6.2,17.4,13.7l0,0C118.8,40.4,117,48.8,111.5,54.6z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M73.5,72.2c-1.2,0-2.4-0.8-2.8-2L57.3,33.5c-0.3-0.7-0.2-1.6,0.1-2.3c0.3-0.7,0.9-1.3,1.7-1.6l36.9-13.4c1.6-0.6,3.3,0.2,3.8,1.8l13.3,36.6c0.3,0.7,0.2,1.6-0.1,2.3c-0.3,0.7-0.9,1.3-1.7,1.6L74.5,72C74.2,72.1,73.8,72.2,73.5,72.2zM64,34.3l11.3,31l31.3-11.4l-11.3-31L64,34.3z\\"></path>%0A <rect x=\\"35\\" y=\\"46.7\\" transform=\\"matrix(0.9397 -0.342 0.342 0.9397 -16.2011 20.988)\\" fill=\\"%23FFFFFF\\" width=\\"32.8\\" height=\\"19.5\\"></rect>%0A <rect x=\\"37.3\\" y=\\"59.8\\" transform=\\"matrix(-0.9397 0.342 -0.342 -0.9397 125.6763 103.3946)\\" fill=\\"%23C7D7E2\\" width=\\"32.8\\" height=\\"6\\"></rect>%0A <path fill=\\"%23454B54\\" d=\\"M39.4,74.2c-0.4,0-0.9-0.1-1.3-0.3c-0.7-0.3-1.3-0.9-1.6-1.7l-6.7-18.3c-0.3-0.7-0.2-1.6,0.1-2.3c0.3-0.7,0.9-1.3,1.7-1.6l30.8-11.2c0.7-0.3,1.6-0.2,2.3,0.1c0.7,0.3,1.3,0.9,1.6,1.7L73,59c0.6,1.6-0.2,3.3-1.8,3.8L40.4,74C40,74.1,39.7,74.2,39.4,74.2z M36.5,54.7l4.6,12.7l25.2-9.2l-4.6-12.7L36.5,54.7z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M70,118.9c-1.2,0-2.4-0.7-2.8-1.9l-14-37.2l-8.4,3.1l-17.2,34.4c-0.7,1.5-2.5,2.1-4,1.3c-1.5-0.7-2.1-2.5-1.3-4L40,79c0.3-0.7,0.9-1.2,1.7-1.5L54,73.1c1.5-0.6,3.3,0.2,3.8,1.8l15,40c0.6,1.6-0.2,3.3-1.8,3.9C70.7,118.8,70.4,118.9,70,118.9z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M13.6,80.1c-1.2,0-2.4-0.8-2.8-2L6.3,65.9c-0.6-1.6,0.2-3.3,1.8-3.8c1.6-0.6,3.3,0.2,3.8,1.8l4.4,12.2c0.6,1.6-0.2,3.3-1.8,3.8C14.3,80.1,14,80.1,13.6,80.1z\\"></path>%0A <path fill=\\"%23454B54\\" d=\\"M13.2,73.3c-1.2,0-2.4-0.8-2.8-2c-0.6-1.6,0.2-3.3,1.8-3.8L35,59.2c1.6-0.6,3.3,0.2,3.8,1.8c0.6,1.6-0.2,3.3-1.8,3.8l-22.8,8.3C13.9,73.3,13.6,73.3,13.2,73.3z\\"></path>%0A</svg>%0A");--discovery-font-family:Tahoma, Verdana, Arial, sans-serif;--discovery-monospace-font-family:SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;--discovery-monospace-font-size:12px;--discovery-monospace-line-height:1.5;--discovery-ui-font-family:system-ui, Arial, sans-serif;--discovery-background-color:white;--discovery-color:black;--discovery-input-bg-color:white;--discovery-input-color:black;--discovery-button-color:black;--discovery-button-bg-color:white;--discovery-button-border-color:#ccc;--discovery-button-hover-color:black;--discovery-button-hover-bg-color:#f5f5f5;--discovery-button-hover-border-color:#ccc;--discovery-fmt-color:#666;--discovery-fmt-hover-color:#333;--discovery-fmt-flag-color:#ff6e13;--discovery-fmt-variable-color:#047d65;--discovery-fmt-property-color:#bd6476;--discovery-fmt-keyword-color:#9150c5;--discovery-fmt-number-color:#07a;--discovery-fmt-atom-color:#07a;--discovery-fmt-type-color:#a7994b;--discovery-fmt-string-color:#690;--discovery-fmt-string-highlight-color:#23a5191a;--discovery-fmt-comment-color:#75787b;--discovery-fmt-qualifier-color:#dd4a68;--discovery-fmt-entity-color:#9a6e3a;--discovery-fmt-punctuation-color:#999;--discovery-fmt-meta-color:#9150c5;--discovery-fmt-negative-color:#ec2b2b;--discovery-fmt-positive-color:#690;--discovery-page-padding-top:35px;--discovery-page-padding-right:40px;--discovery-page-padding-bottom:30px;--discovery-page-padding-left:40px;font-size:14px;line-height:1.6;transition-property:background-color,color;transition-duration:.25s;transition-timing-function:ease-in;position:relative}.discovery-root-darkmode{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark only;--discovery-background-color:#242424;--discovery-color:#ccc;--discovery-link-color:#1c87d4;--discovery-link-underline-color:#2592e280;--discovery-link-hover-color:#4aa6e8;--discovery-input-bg-color:#343434;--discovery-input-color:#e8e8e8;--discovery-button-color:#ccc;--discovery-button-bg-color:#3a3a3a;--discovery-button-border-color:#ccc;--discovery-button-hover-color:black;--discovery-button-hover-bg-color:#f5f5f5;--discovery-button-hover-border-color:#ccc;--discovery-fmt-color:#999;--discovery-fmt-hover-color:#aaa;--discovery-fmt-flag-color:#ff8030;--discovery-fmt-variable-color:#16a78a;--discovery-fmt-property-color:#d17a8c;--discovery-fmt-keyword-color:#a783c4;--discovery-fmt-number-color:#0f8dc2;--discovery-fmt-atom-color:#0f8dc2;--discovery-fmt-string-color:#7faf20;--discovery-fmt-string-underline-color:#85ab51;--discovery-fmt-string-hover-color:#97cf26;--discovery-fmt-meta-color:#a783c4;--discovery-fmt-negative-color:#eb6969;--discovery-fmt-positive-color:#7faf20}.discovery[data-dzen] .discovery-hidden-in-dzen{display:none}.discovery{height:100%;display:flex;overflow:hidden}.discovery-content{z-index:10;flex-direction:column;flex:1;display:flex;position:relative;overflow:auto}.discovery-content>.page{padding:var(--discovery-page-padding-top) var(--discovery-page-padding-right) var(--discovery-page-padding-bottom) var(--discovery-page-padding-left)}.discovery[data-compact] .page{--discovery-page-padding-top:0;--discovery-page-padding-left:0;--discovery-page-padding-right:0;--discovery-page-padding-bottom:0}.discovery-sidebar{z-index:200;background:#6969691a;border-right:1px solid #5553;width:350px;position:relative;overflow:auto;transform:translateZ(0);box-shadow:2px 0 5px -3px #00000042}.discovery-sidebar:empty{display:none}.discovery-sidebar .view-tabs,.discovery-sidebar .view-tabs-content,.discovery-sidebar .view-content-filter{flex-direction:column;max-height:100%;display:flex}.discovery-sidebar .view-tabs{height:100%}.discovery-sidebar .view-tab.active:before{background-color:#fff;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in}.discovery-root-darkmode .discovery-sidebar .view-tab.active:before{background-color:#363637}.discovery-sidebar .view-content-filter>.view-input{background-color:#fff;border-bottom:1px solid #aaa6;margin-bottom:-1px;transition-property:background-color;transition-duration:.25s;transition-timing-function:ease-in}.discovery-root-darkmode .discovery-sidebar .view-content-filter>.view-input{background-color:#363637}.discovery-sidebar .view-content-filter>.view-input input,.discovery-sidebar .view-content-filter>.view-input input:focus{box-shadow:none;background-color:#0000;border:none;border-radius:0;outline:none}.discovery-sidebar .view-content-filter>.content>.view-list{padding:8px 0 8px 12px}.discovery-sidebar .view-content-filter>.content>.view-tree{padding:4px 0 8px 8px}.discovery-sidebar .view-list-item:first-child .view-toc-section{margin-top:-8px}.discovery-sidebar .view-list-item:last-child .view-toc-section{margin-bottom:-8px}.discovery-sidebar .view-toc-section{margin-left:-12px}.discovery-sidebar .view-text-match{color:#282828d9;background:#ffffff73;border-bottom:2px solid orange;border-radius:3px;padding:0 1px;line-height:1.2;display:inline-block}.discovery-nav{z-index:102;top:0;right:var(--discovery-page-padding-right,40px);-webkit-user-select:none;user-select:none;background-color:#ffffffeb;border-radius:0 0 6px 6px;padding:0 1px 1px;transition:background-color .25s ease-in;position:absolute}.discovery-root-darkmode .discovery-nav{background-color:#242424eb}@supports ((-webkit-backdrop-filter:blur(5px)) or (backdrop-filter:blur(5px))){.discovery-nav{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);background-color:#fffc}.discovery-root-darkmode .discovery-nav{background-color:#242424cc}}.discovery-nav>:first-child{border-bottom-left-radius:5px;transition:border-radius .25s ease-in-out}.discovery-nav>:last-child{border-bottom-right-radius:5px;transition:border-radius .25s ease-in-out}.discovery-nav .view-nav-button.discovery-view-popup-active:not(.discovery-view-has-tooltip){border-radius:0}.discovery-nav .view-nav-button[data-name=burger]{background-image:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 172 172\\">%0A <path fill=\\"%23888\\" d=\\"M21.5,35.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376zM21.5,78.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376zM21.5,121.83333c-2.58456,-0.03655 -4.98858,1.32136 -6.29153,3.55376c-1.30295,2.2324 -1.30295,4.99342 0,7.22582c1.30295,2.2324 3.70697,3.59031 6.29153,3.55376h129c2.58456,0.03655 4.98858,-1.32136 6.29153,-3.55376c1.30295,-2.2324 1.30295,-4.99342 0,-7.22582c-1.30295,-2.2324 -3.70697,-3.59031 -6.29153,-3.55376z\\" />%0A</svg>%0A");background-position:50%;background-repeat:no-repeat;background-size:18px}.discovery-nav .view-nav-button[data-name=inspect]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:16px;margin:0 -8px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 30 30\\">%0A <path fill=\\"currentColor\\" d=\\"M 15 2 C 8.3844239 2 3 7.3844287 3 14 C 3 20.615571 8.3844239 26 15 26 L 25 26 C 26.105 26 27 25.105 27 24 L 27 14 C 27 7.3844287 21.615576 2 15 2 z M 15 4 C 20.534697 4 25 8.465307 25 14 C 25 19.534693 20.534697 24 15 24 C 9.4653034 24 5 19.534693 5 14 C 5 8.465307 9.4653034 4 15 4 z M 15.953125 6.9863281 A 1.0001 1.0001 0 0 0 15.013672 7.8359375 L 13.013672 19.835938 A 1.0001 1.0001 0 1 0 14.986328 20.164062 L 16.986328 8.1640625 A 1.0001 1.0001 0 0 0 15.953125 6.9863281 z M 10.980469 9.9882812 A 1.0001 1.0001 0 0 0 10.167969 10.445312 L 8.1679688 13.445312 A 1.0001 1.0001 0 0 0 8.1679688 14.554688 L 10.167969 17.554688 A 1.0001 1.0001 0 1 0 11.832031 16.445312 L 10.201172 14 L 11.832031 11.554688 A 1.0001 1.0001 0 0 0 10.980469 9.9882812 z M 18.988281 9.9882812 A 1.0001 1.0001 0 0 0 18.167969 11.554688 L 19.798828 14 L 18.167969 16.445312 A 1.0001 1.0001 0 1 0 19.832031 17.554688 L 21.832031 14.554688 A 1.0001 1.0001 0 0 0 21.832031 13.445312 L 19.832031 10.445312 A 1.0001 1.0001 0 0 0 18.988281 9.9882812 z\\"/>%0A</svg>%0A") 50%/16px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 30 30\\">%0A <path fill=\\"currentColor\\" d=\\"M 15 2 C 8.3844239 2 3 7.3844287 3 14 C 3 20.615571 8.3844239 26 15 26 L 25 26 C 26.105 26 27 25.105 27 24 L 27 14 C 27 7.3844287 21.615576 2 15 2 z M 15 4 C 20.534697 4 25 8.465307 25 14 C 25 19.534693 20.534697 24 15 24 C 9.4653034 24 5 19.534693 5 14 C 5 8.465307 9.4653034 4 15 4 z M 15.953125 6.9863281 A 1.0001 1.0001 0 0 0 15.013672 7.8359375 L 13.013672 19.835938 A 1.0001 1.0001 0 1 0 14.986328 20.164062 L 16.986328 8.1640625 A 1.0001 1.0001 0 0 0 15.953125 6.9863281 z M 10.980469 9.9882812 A 1.0001 1.0001 0 0 0 10.167969 10.445312 L 8.1679688 13.445312 A 1.0001 1.0001 0 0 0 8.1679688 14.554688 L 10.167969 17.554688 A 1.0001 1.0001 0 1 0 11.832031 16.445312 L 10.201172 14 L 11.832031 11.554688 A 1.0001 1.0001 0 0 0 10.980469 9.9882812 z M 18.988281 9.9882812 A 1.0001 1.0001 0 0 0 18.167969 11.554688 L 19.798828 14 L 18.167969 16.445312 A 1.0001 1.0001 0 1 0 19.832031 17.554688 L 21.832031 14.554688 A 1.0001 1.0001 0 0 0 21.832031 13.445312 L 19.832031 10.445312 A 1.0001 1.0001 0 0 0 18.988281 9.9882812 z\\"/>%0A</svg>%0A") 50%/16px no-repeat}.discovery-nav .view-nav-button[data-name=inspect][data-suspend-seconds]:before{visibility:hidden}.discovery-nav .view-nav-button[data-name=inspect][data-suspend-seconds]:after{content:attr(data-suspend-seconds);text-align:center;width:24px;margin-left:-11px;display:inline-block;position:absolute}.discovery-nav>.view-nav-button[data-name=upload-from-clipboard]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:15px;margin-left:-3px;margin-right:5px;display:inline-block;-webkit-mask:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAFSMbK4AAAIwaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KK+qO+QAAATBJREFUeAHtl0kSgzAMBJ1U/v/lLEdceFGQZBl1bmDipdWaglL4QQACEIAABCCQlcDD8OBv5blN9vpU3uR20/1DVbuy2tBEZ0pvwEsbf2c+UWW+87iYhgGdis0OtSqrXUGTdTBgtswKz2kbobClUtIbAAAVjzaexPI9oJXaoXDRAqHKsWAz6Q2wzACvel7KmvQGAMDL06jreGSA9zeAKBNogahqeu0rvQEeGVAXU9Sj9Z9Pri9lTHoDAHCiVKpbKzKgBiztYdUMoQXqcmS7Tm9AhAxQ7WmpwekNAIBUmbs9HyEDRu8BphlBC9xNael50hsQIQNMe3xkBAaMCE2M1ym+tKIT+z08ggEHHD4XtTE+qzZWwYAGmN7trXq8d5DfWHoDRoAYhwAEIAABCEDgvgQ+7DUMfq3x1WcAAAAASUVORK5CYII=) 50%/17px no-repeat;mask:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAFSMbK4AAAIwaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj42NDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOkNvbG9yU3BhY2U+MTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KK+qO+QAAATBJREFUeAHtl0kSgzAMBJ1U/v/lLEdceFGQZBl1bmDipdWaglL4QQACEIAABCCQlcDD8OBv5blN9vpU3uR20/1DVbuy2tBEZ0pvwEsbf2c+UWW+87iYhgGdis0OtSqrXUGTdTBgtswKz2kbobClUtIbAAAVjzaexPI9oJXaoXDRAqHKsWAz6Q2wzACvel7KmvQGAMDL06jreGSA9zeAKBNogahqeu0rvQEeGVAXU9Sj9Z9Pri9lTHoDAHCiVKpbKzKgBiztYdUMoQXqcmS7Tm9AhAxQ7WmpwekNAIBUmbs9HyEDRu8BphlBC9xNael50hsQIQNMe3xkBAaMCE2M1ym+tKIT+z08ggEHHD4XtTE+qzZWwYAGmN7trXq8d5DfWHoDRoAYhwAEIAABCEDgvgQ+7DUMfq3x1WcAAAAASUVORK5CYII=) 50%/17px no-repeat}.discovery-nav>.view-nav-button[data-name=upload-from-clipboard]:empty:before{margin-left:-7px;margin-right:-7px}.discovery-nav>.view-nav-button[data-name=github]:before{content:"";vertical-align:text-top;aspect-ratio:1;opacity:.85;background-color:currentColor;height:15px;margin-left:-3px;margin-right:5px;display:inline-block;-webkit-mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 98 96\\">%0A <path d=\\"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z\\"/>%0A</svg>%0A") 50%/15px no-repeat;mask:url("data:image/svg+xml,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 98 96\\">%0A <path d=\\"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z\\"/>%0A</svg>%0A") 50%/15px no-repeat}.discovery-nav>.view-nav-button[data-name=github]:empty:before{margin-left:-7px;margin-right:-7px}.discovery-nav-popup>.toggle-menu-item{padding:4px 4px 4px 12px}.discovery-nav-popup>.toggle-menu-item .view-toggle-group{align-items:center;display:flex}.discovery-nav-popup>.toggle-menu-item .view-toggle-group-before{flex:1}.discovery-nav-popup>.toggle-menu-item .view-toggle{padding-top:2px;padding-bottom:2px;font-size:11px}.discovery-nav-popup .powered-by-discoveryjs{opacity:.75;text-align:right;background-color:#8882;padding:2px 6px 4px;font-size:11px}.discovery>.loading-overlay{z-index:1000;background:var(--discovery-background-color);will-change:opacity,visibility;padding:35px 40px;position:absolute;inset:0}.discovery>.loading-overlay.error{flex-direction:column;gap:16px;display:flex;overflow:auto}.discovery>.loading-overlay>.view-app-header{will-change:opacity;contain:paint;transition:opacity .25s .5s}@starting-style{.discovery>.loading-overlay>.view-app-header{opacity:0}}.discovery>.loading-overlay.error>.view-app-header{transition:none!important}.discovery>.loading-overlay.done>.view-app-header{visibility:hidden}.discovery>.loading-overlay.error>.view-app-header:first-child{margin-top:-10px;margin-bottom:27px}.discovery>.loading-overlay.error>.action-buttons .view-button+.view-button{margin-left:2ex}.discovery>.loading-overlay.error>.error-message,.discovery>.loading-overlay.error>.warning-message{box-sizing:border-box;color:#d85a5a;background:#ff00002e;min-height:6.2em;padding:20px;overflow:auto}.discovery>.loading-overlay.error>.warning-message{color:#856404;background-color:#fff3d1}.discovery-root-darkmode>.loading-overlay.error>.error-message{color:#dc7c7c;background-color:#3f3333}.discovery-root-darkmode>.loading-overlay.error>.warning-message{color:#bdab77;background-color:#3c3627}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) a{color:color-mix(in srgb,currentColor,var(--discovery-color) 35%);-webkit-text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 65%);text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 65%)}.discovery-root-darkmode>.loading-overlay.error>:is(.error-message,.warning-message) a{color:color-mix(in srgb,currentColor,var(--discovery-color) 45%);-webkit-text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 45%);text-decoration-color:color-mix(in srgb,currentColor,var(--discovery-background-color) 45%)}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) a:hover{text-decoration-color:currentColor}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge{margin:-20px 0 15px -20px}.discovery>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge:before{content:"Error" attr(data-stage);color:#992d2d;text-shadow:none;text-transform:uppercase;background-color:#ff9d9d;padding:1ex 20px;font-size:11px;display:inline-block}.discovery-root-darkmode>.loading-overlay.error>:is(.error-message,.warning-message) .error-type-badge:before{color:var(--discovery-color);background-color:#833939}.discovery>.loading-overlay.error>.warning-message .error-type-badge:before{color:inherit;background-color:#f9de91}.discovery-root-darkmode>.loading-overlay.error>.warning-message .error-type-badge:before{background-color:#5d502d}.discovery>.loading-overlay.done{opacity:0;visibility:hidden;pointer-events:none;transition:all .25s}.discovery>.loading-overlay .view-progress{max-width:none}.discovery>.loading-overlay .view-progress .progress{max-width:300px}.discovery-buildin-view-render-error{vertical-align:top;color:#c66;background-image:linear-gradient(#ff19191a 19px,#0000 0);background-clip:padding-box;border:1px solid #d4000066;border-radius:4px;margin:1px;padding:4px;font-size:10px;line-height:1;display:inline-block}.discovery-buildin-view-render-error:before{content:"ERROR";color:#ffffffd9;text-shadow:1px 1px #0003;background:#e2242466;border-radius:3px 0 0 3px;margin:-4px 1ex -4px -4px;padding:4px;display:inline-block}.discovery-buildin-view-render-error[data-type=config]:before{content:"CONFIG ERROR"}.discovery-buildin-view-render-error[data-type=render]:before{content:"RENDER ERROR"}.discovery-buildin-view-render-error.expanded:before{border-bottom-left-radius:0}.discovery-buildin-view-render-error .toggle-config{cursor:pointer;opacity:.65;color:#888;-webkit-user-select:none;user-select:none;margin-left:1ex}.discovery-buildin-view-render-error .toggle-config:hover{opacity:1}.discovery-buildin-view-render-error .view-struct{border-radius:0 0 3px 3px;margin:5px -4px -4px}.discovery-buildin-view-tooltip{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#ffffffbf;border:.5px solid #fff5;border-radius:3px;min-width:120px;padding:5px 10px;font-size:12px}.discovery-root-darkmode .discovery-buildin-view-tooltip{background:#242424cc}`,v6=`di-expand:`,y6=`di-edit:`;function b6(e){return y6+encodeURIComponent(JSON.stringify(e))}function x6(e){if(!e.startsWith(y6))return null;try{return JSON.parse(decodeURIComponent(e.slice(8)))}catch{return null}}function S6(e){return v6+encodeURIComponent(JSON.stringify(e))}function C6(e){if(!e.startsWith(v6))return null;try{return JSON.parse(decodeURIComponent(e.slice(10)))}catch{return null}}var w6=[],T6=new WeakMap,E6=new WeakMap,D6=new WeakMap,O6=new WeakMap,k6={function:`di-type-function`,Map:`di-type-map`,Set:`di-type-set`,Date:`di-type-date`,RegExp:`di-type-date`,URL:`di-type-date`,bigint:`di-type-other`,symbol:`di-type-other`,Error:`di-type-ref`,"getter-error":`di-type-ref`,Promise:`di-type-other`};function A6(e,t){return{text:t??e,className:`di-type-badge ${k6[e]??`di-type-other`}`}}function j6(e){return!!e&&typeof e==`object`&&(`$ref`in e||`$truncated`in e)}function M6(e,t,n,r,i){return e&&typeof e==`object`?(D6.set(e,t),!1):(i[r]=t,!0)}function N6(e,t,n=`i`){if(!e||typeof e!=`object`)return{value:e};if(Array.isArray(e))return F6(e,t,n);let r=e;return r.$truncated===`depth`&&Array.isArray(r.$path)?I6(r):typeof r.$type==`string`?L6(r,r.$type,t):z6(r,t)}function P6(e,t,n){return t.badge?t.value&&typeof t.value==`object`?(T6.set(t.value,t.badge),!1):(n[e]=t.badge,!0):!1}function F6(e,t,n){let r=Array.from({length:e.length}),i={},a={},o=!1,s=!1;return e.forEach((e,c)=>{let l=t&&!j6(e)?[...t,[n,c]]:null,u=N6(e,l);r[c]=u.value,l&&M6(u.value,l,r,c,a)&&(s=!0),P6(c,u,i)&&(o=!0)}),o&&E6.set(r,i),s&&O6.set(r,a),{value:r}}function I6(e){return{value:typeof e.$preview==`string`?e.$preview:`load deeper`,badge:{text:`load deeper`,className:`di-type-badge di-type-lazy`,href:S6([...w6,...e.$path])}}}function L6(e,t,n){switch(t){case`function`:{let t=typeof e.name==`string`&&e.name!==`(anonymous)`?e.name:``;return{value:t?`<function ${t}>`:`<function>`,badge:A6(`function`,`Function`)}}case`Map`:return{value:(e.value===void 0?N6(e.entries??{},null):N6(e.value,n)).value,badge:A6(`Map`,`Map(${e.size??`?`})`)};case`Set`:return{value:N6(e.values??[],n,`s`).value,badge:A6(`Set`,`Set(${e.size??`?`})`)};case`Date`:case`RegExp`:case`URL`:case`bigint`:case`symbol`:return{value:e.value,badge:A6(t,t===`bigint`?`BigInt`:t===`symbol`?`Symbol`:t)};case`Error`:{let t={...e};return delete t.$type,{value:t,badge:A6(`Error`)}}case`getter-error`:return{value:String(e.message??``),badge:A6(`getter-error`,`getter threw`)};default:return{value:`<${t}>`,badge:A6(t,typeof e.length==`number`?`${t}(${e.length})`:t)}}}function R6(e,t,n){return e&&t!==`$truncated`&&!j6(n)?[...e,[`k`,t]]:null}function z6(e,t){let n={},r={},i={},a=!1,o=!1,s,c=t&&!j6(e)?t:null;for(let[t,l]of Object.entries(e)){if(t===`$class`&&typeof l==`string`){s={text:`class ${l}`,className:`di-type-badge di-type-class`};continue}let e=R6(c,t,l),u=N6(l,e);n[t]=u.value,e&&M6(u.value,e,n,t,i)&&(o=!0),P6(t,u,r)&&(a=!0)}return a&&E6.set(n,r),o&&O6.set(n,i),{value:n,badge:s}}function B6(e,t){let n=e;for(let[e,r]of t){if(!n||typeof n!=`object`)return;let t=n;switch(e){case`k`:n=t.$type===`Map`?t.value?.[r]:t[r];break;case`i`:n=Array.isArray(n)?n[r]:void 0;break;case`s`:n=t.$type===`Set`?t.values?.[r]:void 0;break;case`mk`:n=t.entries?.[r]?.key;break;case`mv`:n=t.entries?.[r]?.value}}return n}function V6(e){return e.length?`$${e.map(([e,t])=>{switch(e){case`k`:return/^[a-z_$][\w$]*$/i.test(String(t))?`.${t}`:`["${t}"]`;case`i`:return`[${t}]`;case`s`:return`~set[${t}]`;case`mk`:return`~keys[${t}]`;case`mv`:return`~values[${t}]`;default:return``}}).join(``)}`:`$`}function H6(e,t=[],n=!1){w6=t;try{let r=N6(e,n&&!j6(e)?t:null);return r.badge&&r.value&&typeof r.value==`object`&&T6.set(r.value,r.badge),n&&r.value&&typeof r.value==`object`&&!j6(e)&&D6.set(r.value,t),r.value}finally{w6=[]}}var U6=`
|
|
893
|
+
:host, .discovery-root {
|
|
894
|
+
--discovery-background-color: var(--di-result-bg);
|
|
895
|
+
--discovery-color: var(--di-result-fg);
|
|
896
|
+
--discovery-page-padding-top: 0;
|
|
897
|
+
--discovery-page-padding-right: 0;
|
|
898
|
+
--discovery-page-padding-bottom: 0;
|
|
899
|
+
--discovery-page-padding-left: 0;
|
|
900
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
901
|
+
}
|
|
902
|
+
.view-struct .di-type-badge {
|
|
903
|
+
font-size: 10px;
|
|
904
|
+
line-height: 1.4;
|
|
905
|
+
padding: 0 5px;
|
|
906
|
+
border-radius: 999px !important;
|
|
907
|
+
border: 1px solid transparent;
|
|
908
|
+
background: color-mix(in srgb, var(--di-badge-color, #888) 14%, transparent) !important;
|
|
909
|
+
border-color: color-mix(in srgb, var(--di-badge-color, #888) 32%, transparent) !important;
|
|
910
|
+
color: var(--di-badge-color, #888) !important;
|
|
911
|
+
}
|
|
912
|
+
.di-type-function { --di-badge-color: #8a63d2; }
|
|
913
|
+
.di-type-class { --di-badge-color: #c98a1f; }
|
|
914
|
+
.di-type-map { --di-badge-color: #2f7fd0; }
|
|
915
|
+
.di-type-set { --di-badge-color: #0f9b8e; }
|
|
916
|
+
.di-type-date { --di-badge-color: #3f9c50; }
|
|
917
|
+
.di-type-ref { --di-badge-color: #c25577; }
|
|
918
|
+
.di-type-other { --di-badge-color: #7a8699; }
|
|
919
|
+
.di-type-lazy { --di-badge-color: #8a63d2; cursor: pointer; text-decoration: none; }
|
|
920
|
+
.di-type-lazy::before { content: '▸ '; }
|
|
921
|
+
.di-type-lazy:hover {
|
|
922
|
+
background: color-mix(in srgb, var(--di-badge-color) 26%, transparent) !important;
|
|
923
|
+
}
|
|
924
|
+
.di-type-lazy.di-lazy-loading { cursor: progress; opacity: 0.6; }
|
|
925
|
+
.di-type-lazy.di-lazy-error { --di-badge-color: #c25577; }
|
|
926
|
+
|
|
927
|
+
/* Edit affordance on writable-source nodes: quiet until hovered. */
|
|
928
|
+
.view-struct .di-type-edit {
|
|
929
|
+
--di-badge-color: #5f9e6e;
|
|
930
|
+
cursor: pointer;
|
|
931
|
+
text-decoration: none;
|
|
932
|
+
opacity: 0.3;
|
|
933
|
+
}
|
|
934
|
+
.view-struct .di-type-edit:hover {
|
|
935
|
+
opacity: 1;
|
|
936
|
+
background: color-mix(in srgb, var(--di-badge-color) 26%, transparent) !important;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/* Lazily fetched subtree, spliced in below its truncation marker. */
|
|
940
|
+
.di-lazy-children {
|
|
941
|
+
display: block;
|
|
942
|
+
margin: 2px 0 2px 1ch;
|
|
943
|
+
padding-left: 1ch;
|
|
944
|
+
border-left: 1px dashed color-mix(in srgb, var(--di-result-fg, #888) 25%, transparent);
|
|
945
|
+
}
|
|
946
|
+
.di-lazy-children-error {
|
|
947
|
+
display: block;
|
|
948
|
+
margin: 2px 0 2px 1ch;
|
|
949
|
+
color: #c25577;
|
|
950
|
+
font-size: 11px;
|
|
951
|
+
}
|
|
952
|
+
`;function W6(e){return e.closest(`.value-annotations`)??e.parentElement??e}function G6(e,t){if(e&&typeof e==`object`){if(typeof e.$ref==`string`)return{place:`after`,style:`badge`,text:`#Circular`,className:`di-type-badge di-type-ref`};let t=T6.get(e);return t?{place:`after`,style:`badge`,...t}:void 0}let n=t?.host;if(n&&typeof n==`object`&&t?.key!==void 0){let e=E6.get(n)?.[t.key];if(e)return{place:`after`,style:`badge`,...e}}}function K6(e,t,n={view:`struct`,expanded:2},r={},i,a){let o=fn(null),s=null;function c(e,t){if(!a?.enabled())return;let n;if(e&&typeof e==`object`)n=D6.get(e);else{let e=t?.host;e&&typeof e==`object`&&t?.key!==void 0&&(n=O6.get(e)?.[t.key])}if(n)return{place:`after`,style:`badge`,text:`✎`,className:`di-type-badge di-type-edit`,href:b6(n),tooltip:{content:`text:"Edit this value"`}}}let l={annotations:[G6,c],...n};function u(e,t,n){e.addEventListener(`click`,e=>{let r=e.composedPath().find(e=>e instanceof HTMLElement&&e.matches(`a.di-type-lazy`));if(!r||(e.preventDefault(),e.stopPropagation(),r.classList.contains(`di-lazy-loading`)||r.dataset.diExpanded===`1`))return;let i=C6(r.getAttribute(`href`)??``);i&&(r.classList.add(`di-lazy-loading`),n(i).then(e=>{r.classList.remove(`di-lazy-loading`),r.dataset.diExpanded=`1`,r.classList.add(`di-lazy-done`);let n=document.createElement(`div`);n.className=`di-lazy-children`,W6(r).after(n),t.view.render(n,l,H6(e,i,a?.enabled()??!1))}).catch(e=>{r.classList.remove(`di-lazy-loading`),r.classList.add(`di-lazy-error`);let t=document.createElement(`div`);t.className=`di-lazy-children-error`,t.textContent=e instanceof Error?e.message:String(e),W6(r).after(t)}))})}function d(e,t){e.addEventListener(`click`,e=>{let n=e.composedPath().find(e=>e instanceof HTMLElement&&e.matches(`a.di-type-edit`));if(!n)return;e.preventDefault(),e.stopPropagation();let r=x6(n.getAttribute(`href`)??``);r&&t(r)})}Qi(async()=>{if(!e.value)return;let n=new l6({container:e.value,styles:[_6,U6],colorScheme:t.value,colorSchemePersistent:!1});n.page.define(`default`,l),i&&u(e.value,n,i.onExpand),a&&d(e.value,a.onEdit),(r.onQuerySubquery||r.onQueryAppend)&&(n.action.define(`queryAcceptChanges`,()=>!0),r.onQuerySubquery&&n.action.define(`querySubquery`,e=>r.onQuerySubquery?.(String(e))),r.onQueryAppend&&n.action.define(`queryAppend`,e=>r.onQueryAppend?.(String(e)))),await n.dom.ready,o.value=n,s&&=(await n.setData(s.data,{render:!0}),null)}),na(()=>{o.value=null}),W(t,e=>{o.value?.colorScheme.set(e)});let f;async function p(e){if(f=e,!o.value){s={data:e};return}await o.value.setData(e,{render:!0})}async function m(e){l.expanded=e,o.value&&f!==void 0&&(o.value.page.define(`default`,l),await o.value.setData(f,{render:!0}))}return{setData:p,setExpanded:m}}var q6={class:`flex flex-col h-full min-h-0 bg-base border-l border-base w-100`},J6={class:`flex items-center gap-2 px3 py2 border-b border-base select-none`},Y6=[`title`],X6={class:`flex-1 min-h-0 overflow-auto px3 py2 flex flex-col gap-4 text-sm`},Z6={key:0,class:`px-2.5 py-1.5 font-mono text-11px whitespace-pre-wrap rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},Q6={key:1,class:`flex flex-col gap-2`},$6={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},e8=[`onClick`],t8=[`placeholder`],n8={key:2,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},r8={class:`font-mono`},i8={key:3,class:`text-xs color-faint font-mono select-none`},a8={key:2,class:`flex flex-col gap-2`},o8={class:`flex gap-2`},s8={key:3,class:`flex flex-col gap-2`},c8={class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},l8=[`placeholder`],u8={class:`flex flex-wrap gap-1 p-0.5 bg-secondary rounded-lg self-start`,role:`tablist`},d8=[`onClick`],f8={key:3,class:`flex items-center gap-2 text-xs cursor-pointer select-none`},p8={class:`font-mono`},m8={key:4,class:`text-xs color-faint font-mono select-none`},h8={key:4,class:`flex flex-col gap-2`},g8=G({__name:`EditPanel`,props:{path:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=EN(),a=[`string`,`number`,`boolean`,`null`,`undefined`,`json`],o=Q(()=>B6(i.result.value,n.path)),s=Q(()=>V6(n.path)),c=Q(()=>{let e=o.value;if(Array.isArray(e))return`array`;if(!e||typeof e!=`object`)return null;let t=e;return t.$type===`Map`?`map`:t.$type===`Set`?`set`:typeof t.$type==`string`||typeof t.$ref==`string`||t.$truncated!==void 0?null:`object`}),l=Q(()=>n.path[n.path.length-1]),u=Q(()=>l.value?.[0]===`k`),d=Q(()=>n.path.length>0),f=Q(()=>n.path.length>0),p=V(`string`),m=V(``),h=V(!0);function g(){let e=o.value;if(typeof e==`string`)p.value=`string`,m.value=e;else if(typeof e==`number`)p.value=`number`,m.value=String(e);else if(typeof e==`boolean`)p.value=`boolean`,h.value=e;else if(e===null)p.value=`null`,m.value=``;else if(e&&typeof e==`object`&&typeof e.$type==`string`&&typeof e.value==`string`)p.value=`string`,m.value=e.value;else{p.value=`json`;try{m.value=JSON.stringify(e,null,2)??``}catch{m.value=``}}}W(()=>n.path,g,{immediate:!0});let _=fn(null),v=fn(!1);function y(e,t,n){switch(e){case`string`:return{kind:`json`,value:t};case`number`:{let e=Number(t);if(t.trim()===``||Number.isNaN(e))throw Error(`"${t}" is not a number`);return{kind:`json`,value:e}}case`boolean`:return{kind:`json`,value:n};case`null`:return{kind:`json`,value:null};case`undefined`:return{kind:`undefined`};case`json`:try{return{kind:`json`,value:JSON.parse(t)}}catch(e){throw Error(`invalid JSON: ${e instanceof Error?e.message:String(e)}`)}}}async function b(e,t){v.value=!0,_.value=null;let n=await i.applyEdit(e);if(v.value=!1,!n.ok){_.value=`${n.error.name}: ${n.error.message}`;return}t?.()}function x(){let e;try{e=y(p.value,m.value,h.value)}catch(e){_.value=e instanceof Error?e.message:String(e);return}b({op:`set`,path:n.path,value:e},()=>r(`close`))}let S=V(``);W(l,e=>{S.value=e?.[0]===`k`?String(e[1]):``},{immediate:!0});function C(){S.value&&b({op:`rename`,path:n.path,key:{kind:`json`,value:S.value}},()=>r(`close`))}let w=V(``),T=V(`string`),E=V(``),D=V(!0),O=Q(()=>c.value===`array`?`Index (blank appends)`:c.value===`map`?`Key (JSON or plain string)`:`Key`);function k(){let e=w.value;if(c.value!==`set`){if(c.value===`array`){if(e.trim()===``)return;let t=Number(e);if(!Number.isInteger(t))throw Error(`an array index must be an integer`);return{kind:`json`,value:t}}if(c.value===`map`)try{return{kind:`json`,value:JSON.parse(e)}}catch{return{kind:`json`,value:e}}if(!e)throw Error(`a property key is required`);return{kind:`json`,value:e}}}function A(){let e,t;try{e=k(),t=y(T.value,E.value,D.value)}catch(e){_.value=e instanceof Error?e.message:String(e);return}b({op:`add`,path:n.path,key:e,value:t},()=>{w.value=``,E.value=``})}let j=fn(!1);function M(){if(!j.value){j.value=!0;return}j.value=!1,b({op:`delete`,path:n.path},()=>r(`close`))}return(e,t)=>(q(),J(`div`,q6,[X(`div`,J6,[t[10]||=X(`span`,{class:`i-ph:pencil-simple-duotone color-active`},null,-1),t[11]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide`},` Edit `,-1),X(`code`,{class:`font-mono text-xs color-muted truncate`,title:s.value},je(s.value),9,Y6),t[12]||=X(`div`,{class:`flex-auto`},null,-1),Z(Gv,{class:`text-sm`,icon:`i-ph:x`,label:`Close`,tooltip:`Close the edit panel`,onClick:t[0]||=e=>r(`close`)})]),X(`div`,X6,[_.value?(q(),J(`div`,Z6,je(_.value),1)):Os(``,!0),d.value?(q(),J(`section`,Q6,[t[14]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Set value `,-1),X(`div`,$6,[(q(),J(cs,null,ha(a,e=>X(`button`,{key:e,type:`button`,class:ye([`px-2 py-0.5 rounded-md text-xs cursor-pointer`,p.value===e?`bg-base color-base shadow-sm`:`color-muted hover:color-base`]),onClick:t=>p.value=e},je(e),11,e8)),64))]),p.value===`string`||p.value===`number`?vr((q(),J(`input`,{key:0,"onUpdate:modelValue":t[1]||=e=>m.value=e,placeholder:p.value===`number`?`42`:`text`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`,onKeydown:du(x,[`enter`])},null,40,t8)),[[Jl,m.value]]):p.value===`json`?vr((q(),J(`textarea`,{key:1,"onUpdate:modelValue":t[2]||=e=>m.value=e,rows:`6`,placeholder:`{ }`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full resize-y`},null,512)),[[Jl,m.value]]):p.value===`boolean`?(q(),J(`label`,n8,[vr(X(`input`,{"onUpdate:modelValue":t[3]||=e=>h.value=e,type:`checkbox`},null,512),[[Yl,h.value]]),X(`code`,r8,je(h.value),1)])):(q(),J(`div`,i8,je(p.value),1)),Z(GR,{class:`text-sm self-start`,icon:`i-ph:check`,disabled:v.value,loading:v.value,title:`Apply the new value`,onClick:x},{default:U(()=>[...t[13]||=[X(`span`,null,`Apply`,-1)]]),_:1},8,[`disabled`,`loading`])])):Os(``,!0),u.value?(q(),J(`section`,a8,[t[16]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Rename key `,-1),X(`div`,o8,[vr(X(`input`,{"onUpdate:modelValue":t[4]||=e=>S.value=e,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base flex-1 min-w-0`,onKeydown:du(C,[`enter`])},null,544),[[Jl,S.value]]),Z(GR,{class:`text-sm`,icon:`i-ph:textbox-duotone`,disabled:v.value||!S.value,title:`Rename the key (the renamed key lands last)`,onClick:C},{default:U(()=>[...t[15]||=[X(`span`,null,`Rename`,-1)]]),_:1},8,[`disabled`])])])):Os(``,!0),c.value?(q(),J(`section`,s8,[X(`div`,c8,` Add to `+je(c.value),1),c.value===`set`?Os(``,!0):vr((q(),J(`input`,{key:0,"onUpdate:modelValue":t[5]||=e=>w.value=e,placeholder:O.value,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`},null,8,l8)),[[Jl,w.value]]),X(`div`,u8,[(q(),J(cs,null,ha(a,e=>X(`button`,{key:e,type:`button`,class:ye([`px-2 py-0.5 rounded-md text-xs cursor-pointer`,T.value===e?`bg-base color-base shadow-sm`:`color-muted hover:color-base`]),onClick:t=>T.value=e},je(e),11,d8)),64))]),T.value===`string`||T.value===`number`?vr((q(),J(`input`,{key:1,"onUpdate:modelValue":t[6]||=e=>E.value=e,placeholder:`value`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full`,onKeydown:du(A,[`enter`])},null,544)),[[Jl,E.value]]):T.value===`json`?vr((q(),J(`textarea`,{key:2,"onUpdate:modelValue":t[7]||=e=>E.value=e,rows:`4`,placeholder:`{ }`,class:`font-mono text-xs px-2 py-1.5 rounded-lg border border-base bg-base color-base w-full resize-y`},null,512)),[[Jl,E.value]]):T.value===`boolean`?(q(),J(`label`,f8,[vr(X(`input`,{"onUpdate:modelValue":t[8]||=e=>D.value=e,type:`checkbox`},null,512),[[Yl,D.value]]),X(`code`,p8,je(D.value),1)])):(q(),J(`div`,m8,je(T.value),1)),Z(GR,{class:`text-sm self-start`,icon:`i-ph:plus`,disabled:v.value,title:`Add the entry`,onClick:A},{default:U(()=>[...t[17]||=[X(`span`,null,`Add`,-1)]]),_:1},8,[`disabled`])])):Os(``,!0),f.value?(q(),J(`section`,h8,[t[18]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Danger `,-1),Z(GR,{class:`text-sm self-start`,icon:`i-ph:trash-duotone`,disabled:v.value,title:j.value?`Click again to delete this node`:`Delete this node from its container`,onClick:M,onBlur:t[9]||=e=>j.value=!1},{default:U(()=>[X(`span`,null,je(j.value?`Confirm Delete?`:`Delete Key`),1)]),_:1},8,[`disabled`,`title`])])):Os(``,!0)])]))}}),_8={class:`flex flex-col h-full min-h-0`},v8={class:`flex items-center gap-1`},y8={class:`flex items-center gap-1`},b8={class:`flex items-center gap-1`},x8={class:`flex items-center gap-1`},S8={class:`flex items-center gap-1`},C8={key:1,class:`op-fade select-none`},w8={key:2,class:`flex items-center gap-1.5 color-faint`},T8=[`title`],E8={key:0,class:`mx-3 mt-2 px-3 py-2 font-mono text-xs whitespace-pre-wrap rounded-lg border border-red-600/40 bg-red-500:8 color-red-700 dark:border-red-400/40 dark:color-red-300`},D8={class:`flex-1 min-h-0 flex`},O8={key:1,class:`flex-1 grid place-items-center select-none`},k8=100,A8=G({__name:`ResultViewer`,props:{result:{},hasResult:{type:Boolean},stats:{},statsStale:{type:Boolean},error:{},running:{type:Boolean},lastRunAt:{},canEdit:{type:Boolean},editHint:{},expand:{type:Function}},emits:[`rerun`,`querySubquery`,`queryAppend`],setup(e,{emit:t}){let n=e,r=t,i=fn(null),a=fn(null),o=K6(a,CE,{view:`struct`,expanded:2},{onQuerySubquery:e=>r(`querySubquery`,e),onQueryAppend:e=>r(`queryAppend`,e)},{onExpand:e=>n.expand(e)},{enabled:()=>n.canEdit??!1,onEdit:e=>i.value=e});W(()=>[n.result,n.canEdit],([e])=>{n.hasResult&&o.setData(H6(e,[],n.canEdit??!1))}),W(()=>n.canEdit,e=>{e||(i.value=null)});let s=Q(()=>n.editHint===`readonly-source`?`Read-only source: register it with writable: true to edit values`:n.editHint===`derived-view`?`Editing applies on the root view: clear the query (or run $) to edit`:``),c=fn(!1),l;function u(){try{navigator.clipboard.writeText(JSON.stringify(n.result,null,2)),c.value=!0,clearTimeout(l),l=setTimeout(()=>c.value=!1,1200)}catch{}}return(t,n)=>(q(),J(`div`,_8,[X(`div`,{class:ye([`flex items-center gap-3 px-3 py-1.5 border-b border-base min-h-9 text-xs ws-nowrap color-muted font-mono tabular-nums flex-wrap`,{"op-fade":e.statsStale}])},[e.stats?(q(),J(cs,{key:0},[X(`span`,v8,[n[4]||=X(`span`,{class:`op50`},`jora`,-1),n[5]||=Es(),Z(TB,{ms:e.stats.queryMs,colorize:``},null,8,[`ms`])]),n[14]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,y8,[n[6]||=X(`span`,{class:`op50`},`norm`,-1),n[7]||=Es(),Z(TB,{ms:e.stats.normalize.ms,colorize:``},null,8,[`ms`])]),n[15]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,b8,[n[8]||=X(`span`,{class:`op50`},`rpc`,-1),n[9]||=Es(),Z(TB,{ms:e.stats.rpcMs,colorize:``},null,8,[`ms`])]),n[16]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,x8,[Z(xB,{bytes:e.stats.payloadBytes,colorize:``},null,8,[`bytes`])]),n[17]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,null,[Es(je(e.stats.normalize.nodes)+` `,1),n[10]||=X(`span`,{class:`op50`},`nodes`,-1)]),e.stats.normalize.refs?(q(),J(cs,{key:0},[n[12]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,null,[Es(je(e.stats.normalize.refs)+` `,1),n[11]||=X(`span`,{class:`op50`},`refs`,-1)])],64)):Os(``,!0),e.stats.normalize.truncatedEntries||e.stats.normalize.truncatedDepth?(q(),Y(Ew,{key:1,color:12,text:`truncated`})):Os(``,!0),e.lastRunAt?(q(),J(cs,{key:2},[n[13]||=X(`div`,{class:`h-5 border-r border-base`},null,-1),X(`span`,S8,[Z(CB,{date:e.lastRunAt,live:``},null,8,[`date`])])],64)):Os(``,!0)],64)):(q(),J(`span`,C8,`no query run yet`)),n[19]||=X(`div`,{class:`flex-auto`},null,-1),e.running?(q(),J(`span`,w8,[...n[18]||=[X(`span`,{class:`i-ph:circle-notch animate-spin`},null,-1),Es(` running `,-1)]])):Os(``,!0),e.editHint?(q(),J(`span`,{key:3,class:`flex items-center color-faint`,title:s.value},[X(`span`,{class:ye(e.editHint===`readonly-source`?`i-ph:lock-simple-duotone`:`i-ph:pencil-simple-slash-duotone`)},null,2)],8,T8)):Os(``,!0),e.hasResult?(q(),Y(Gv,{key:4,class:`text-sm`,icon:`i-ph:arrows-out-line-vertical`,label:`Expand all`,tooltip:`Expand all levels`,onClick:n[0]||=e=>H(o).setExpanded(k8)})):Os(``,!0),e.hasResult?(q(),Y(Gv,{key:5,class:`text-sm`,icon:`i-ph:arrows-in-line-vertical`,label:`Collapse all`,tooltip:`Collapse to the top level`,onClick:n[1]||=e=>H(o).setExpanded(1)})):Os(``,!0),e.hasResult?(q(),Y(Gv,{key:6,class:`text-sm`,icon:c.value?`i-ph:check`:`i-ph:copy-duotone`,label:`Copy result as JSON`,tooltip:`Copy the result as JSON`,onClick:u},null,8,[`icon`])):Os(``,!0),Z(Gv,{class:`text-sm`,icon:e.running?`i-ph:arrows-clockwise animate-spin`:`i-ph:arrows-clockwise`,label:`Re-run query`,tooltip:`Re-run against the live object`,disabled:e.running,onClick:n[2]||=e=>r(`rerun`)},null,8,[`icon`,`disabled`])],2),e.error?(q(),J(`div`,E8,je(e.error),1)):Os(``,!0),vr(X(`div`,D8,[X(`div`,{ref_key:`containerEl`,ref:a,class:`di-result-host flex-1 min-w-0 min-h-0 overflow-auto`},null,512),i.value&&e.canEdit?(q(),Y(g8,{key:0,path:i.value,onClose:n[3]||=e=>i.value=null},null,8,[`path`])):Os(``,!0)],512),[[Gc,e.hasResult]]),e.hasResult?Os(``,!0):(q(),J(`div`,O8,[...n[20]||=[X(`div`,{class:`flex flex-col items-center gap-2 color-faint`},[X(`span`,{class:`i-ph:tree-structure-duotone text-3xl`}),X(`span`,{class:`text-sm`},`Results render here, start typing a query`)],-1)]]))]))}}),j8={key:1},M8=G({__name:`ActionToggleGroup`,props:Ia({options:{},multiple:{type:Boolean,default:!1},iconOnly:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=io(e,`modelValue`);return(n,r)=>(q(),Y(H(DR),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.multiple?`multiple`:`single`,class:`p-1 rounded-lg bg-sunken inline-flex gap-1 w-max`},{default:U(()=>[(q(!0),J(cs,null,ha(e.options,t=>(q(),Y(H(kR),{key:t.value,value:t.value,disabled:t.disabled,"aria-label":t.label??t.value,class:ye([`text-sm color-muted outline-none rounded-md flex gap-1.5 transition items-center data-[state=on]:color-base hover:color-base data-[state=on]:bg-raised disabled:op50 focus-visible:ring-2 focus-visible:ring-primary-500/40 data-[state=on]:shadow-sm`,e.iconOnly?`p-1.5`:`px-3 py-1`])},{default:U(()=>[t.icon?(q(),J(`span`,{key:0,class:ye(t.icon),"aria-hidden":`true`},null,2)):Os(``,!0),e.iconOnly?Os(``,!0):(q(),J(`span`,j8,je(t.label??t.value),1))]),_:2},1032,[`value`,`disabled`,`aria-label`,`class`]))),128))]),_:1},8,[`modelValue`,`type`]))}}),N8=[`type`,`placeholder`,`disabled`,`aria-invalid`],P8=G({__name:`FormTextInput`,props:Ia({icon:{},clearable:{type:Boolean},placeholder:{},type:{default:`text`},size:{default:`md`},disabled:{type:Boolean},invalid:{type:Boolean}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=io(e,`modelValue`);return(n,r)=>(q(),J(`label`,{class:ye([`px-2 border rounded bg-raised inline-flex gap-2 transition items-center focus-within:ring-2`,[e.size===`sm`?`h-7 text-sm`:`h-9`,e.invalid?`border-red-500/60 focus-within:ring-red-500/40`:`border-base focus-within:ring-primary-500/40`,{"op50 pointer-events-none":e.disabled}]])},[e.icon?(q(),J(`span`,{key:0,class:ye([e.icon,`op-fade shrink-0`]),"aria-hidden":`true`},null,2)):Os(``,!0),K(n.$slots,`prefix`),vr(X(`input`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,type:e.type,placeholder:e.placeholder,disabled:e.disabled,"aria-invalid":e.invalid||void 0,class:`color-base outline-none bg-transparent flex-1 min-w-0 placeholder:op-mute`},null,8,N8),[[ru,t.value]]),e.clearable&&t.value?(q(),J(`button`,{key:1,type:`button`,class:`op-fade shrink-0 transition hover:op100`,"aria-label":`Clear`,onClick:r[1]||=e=>t.value=``},[...r[2]||=[X(`span`,{class:`i-ph:x`,"aria-hidden":`true`},null,-1)]])):Os(``,!0),K(n.$slots,`suffix`)],2))}});function F8(e){let t=Rs(),n=fn(),r;return Qi(()=>{let e=t?.proxy?.$el,i=e?.getRootNode();if(!(i instanceof ShadowRoot))return;let a=document.createElement(`div`);i.append(a),n.value=a;let o=(e instanceof Element?e:e?.parentElement)?.closest(`.dark, .light`);if(o){let e=()=>{a.className=o.classList.contains(`dark`)?`dark`:`light`};e(),r=new MutationObserver(e),r.observe(o,{attributeFilter:[`class`]})}}),ta(()=>{r?.disconnect(),n.value?.remove(),n.value=void 0}),Q(()=>e?.()??n.value)}var I8={class:`p-4 flex pointer-events-none items-center inset-0 justify-center fixed z-modal-content`},L8={key:0,class:`px-3 py-2 border-b border-base flex shrink-0 gap-2 items-start justify-between`},R8={class:`min-w-0`},z8={class:`p-3 flex-1 overflow-auto`},B8={key:1,class:`px-2 py-2 border-t border-base flex shrink-0 gap-2 justify-end`},V8=G({__name:`OverlayModal`,props:Ia({title:{},description:{},to:{}},{open:{type:Boolean},openModifiers:{}}),emits:[`update:open`],setup(e){let t=e,n=io(e,`open`),r=F8(()=>t.to);return(t,i)=>(q(),Y(H(SI),{open:n.value,"onUpdate:open":i[0]||=e=>n.value=e},{default:U(()=>[t.$slots.trigger?(q(),Y(H(aL),{key:0,"as-child":``},{default:U(()=>[K(t.$slots,`trigger`)]),_:3})):Os(``,!0),Z(H(rL),{to:H(r)},{default:U(()=>[Z(H(tL),{class:`bg-[#ddd]/40 inset-0 fixed z-modal-backdrop backdrop-blur-sm dark:bg-black/40`,"data-af-animate":``}),X(`div`,I8,[Z(H(QI),{class:`outline-none border border-base rounded-lg bg-base flex flex-col max-h-full max-w-lg w-full pointer-events-auto shadow-xl overflow-hidden`,"data-af-modal":``},{default:U(()=>[e.title||e.description||t.$slots.header?(q(),J(`header`,L8,[X(`div`,R8,[e.title?(q(),Y(H(iL),{key:0,class:`color-base font-medium`},{default:U(()=>[Es(je(e.title),1)]),_:1})):Os(``,!0),e.description?(q(),Y(H($I),{key:1,class:`text-sm op-fade`},{default:U(()=>[Es(je(e.description),1)]),_:1})):Os(``,!0),K(t.$slots,`header`)]),Z(H(CI),{class:`btn-icon shrink-0 h-7 w-7`,"aria-label":`Close`},{default:U(()=>[...i[1]||=[X(`span`,{class:`i-ph:x`,"aria-hidden":`true`},null,-1)]]),_:1})])):Os(``,!0),X(`div`,z8,[K(t.$slots,`default`)]),t.$slots.footer?(q(),J(`footer`,B8,[K(t.$slots,`footer`)])):Os(``,!0)]),_:3})])]),_:3},8,[`to`])]),_:3},8,[`open`]))}}),H8={class:`flex flex-col gap-2 min-h-0`},U8={class:`flex items-center gap-2`},W8={key:0,class:`text-xs op-fade font-mono tabular-nums`},G8={key:0,class:`grid grid-cols-[repeat(auto-fit,minmax(15rem,1fr))] gap-1`},K8=[`title`,`onClick`],q8={class:`flex flex-col min-w-0`},J8={class:`text-sm truncate`},Y8={key:0,class:`font-mono text-11px color-faint truncate`},X8=[`title`],Z8={key:1,class:`text-xs color-faint px-1 select-none`},Q8={class:`flex flex-col gap-3`},$8={class:`px-3 py-2 rounded-lg bg-secondary border border-base font-mono text-xs whitespace-pre-wrap break-all max-h-24 overflow-auto`},e5={class:`flex items-center gap-3 flex-wrap text-xs`},t5={class:`flex flex-col gap-1.5`},n5={class:`text-11px color-faint`},r5=G({__name:`SavedQueriesPanel`,props:{saved:{},suggested:{},currentQuery:{},currentFilters:{},readonly:{type:Boolean}},emits:[`load`,`remove`,`save`],setup(e,{emit:t}){let n=e,r=t,i=V(!1),a=V(``),o=V(``),s=V(`project`),c=[{value:`project`,label:`Just me`,icon:`i-ph:user-duotone`},{value:`workspace`,label:`Shared with team`,icon:`i-ph:users-three-duotone`}],l=Q(()=>[{label:`Exclude functions`,on:n.currentFilters.excludeFunctions},{label:`Exclude _ props`,on:n.currentFilters.excludeUnderscoreProps},{label:`Exclude $ props`,on:n.currentFilters.excludeDollarProps}]),u=Q(()=>[...n.suggested.map(e=>({key:`suggested:${e.query}`,recipe:e,icon:`i-ph:lightbulb-duotone`})),...n.saved.map(e=>({key:`${e.scope}:${e.id}`,recipe:e,icon:`i-ph:code-duotone`,saved:e}))]);function d(){a.value=``,o.value=``,i.value=!0}function f(){r(`save`,{title:a.value.trim()||void 0,description:o.value.trim()||void 0,scope:s.value}),i.value=!1}function p(e){let t=[];return e.excludeFunctions&&t.push({label:`no fn`,title:`Excludes functions`}),e.excludeUnderscoreProps&&t.push({label:`no _`,title:`Excludes _-prefixed props`}),e.excludeDollarProps&&t.push({label:`no $`,title:`Excludes $-prefixed props`}),t}return(t,n)=>(q(),J(`div`,H8,[X(`div`,U8,[n[6]||=X(`div`,{class:`font-semibold text-xs op-fade uppercase tracking-wide select-none`},` Saved Queries `,-1),e.saved.length+e.suggested.length?(q(),J(`span`,W8,`(`+je(e.saved.length+e.suggested.length)+`)`,1)):Os(``,!0),n[7]||=X(`div`,{class:`flex-1`},null,-1),e.readonly?Os(``,!0):(q(),Y(GR,{key:1,class:`text-sm`,icon:`i-ph:bookmark-simple-duotone`,onClick:d},{default:U(()=>[...n[5]||=[Es(` Save query `,-1)]]),_:1}))]),u.value.length?(q(),J(`div`,G8,[(q(!0),J(cs,null,ha(u.value,t=>(q(),J(`div`,{key:t.key,class:`group flex items-center gap-2 px1.5 py-1 border border-base rounded hover:bg-active cursor-pointer`,title:t.recipe.description??t.recipe.query,onClick:e=>r(`load`,t.recipe)},[X(`span`,{class:ye([`shrink-0 color-active`,t.icon])},null,2),X(`div`,q8,[X(`span`,J8,je(t.recipe.title??(t.recipe.query||`$ (entire object)`)),1),t.recipe.title||!t.recipe.query?(q(),J(`span`,Y8,je(t.recipe.query||`$`),1)):Os(``,!0)]),n[8]||=X(`div`,{class:`flex-1`},null,-1),(q(!0),J(cs,null,ha(p(t.recipe),e=>(q(),J(`span`,{key:e.label,title:e.title,class:`shrink-0 font-mono text-10px color-muted bg-secondary border border-base rounded px-1.5 py-0.5 leading-none`},je(e.label),9,X8))),128)),t.saved&&!e.readonly?(q(),Y(Gv,{key:0,icon:`i-ph:trash-duotone`,label:`Delete`,tooltip:`Delete`,class:`text-sm op0 group-hover:op100 transition-opacity`,onClick:lu(e=>r(`remove`,t.saved),[`stop`])},null,8,[`onClick`])):Os(``,!0)],8,K8))),128))])):(q(),J(`div`,Z8,` No queries yet. Compose one and hit "Save query". `)),Z(V8,{open:i.value,"onUpdate:open":n[4]||=e=>i.value=e,title:`Save query`,description:`Stores the query text together with the active filter options.`},{footer:U(()=>[Z(GR,{onClick:n[3]||=e=>i.value=!1},{default:U(()=>[...n[11]||=[Es(` Cancel `,-1)]]),_:1}),Z(GR,{variant:`primary`,onClick:f},{default:U(()=>[...n[12]||=[Es(` Save `,-1)]]),_:1})]),default:U(()=>[X(`div`,Q8,[X(`div`,$8,je(e.currentQuery.trim()||`$`),1),X(`div`,e5,[n[9]||=X(`span`,{class:`color-muted`},`Filters:`,-1),(q(!0),J(cs,null,ha(l.value,e=>(q(),J(`span`,{key:e.label,class:ye([`flex items-center gap-1`,e.on?`color-base`:`color-faint`])},[X(`span`,{class:ye(e.on?`i-ph:check-circle-duotone color-active`:`i-ph:circle-duotone`)},null,2),Es(` `+je(e.label),1)],2))),128))]),Z(P8,{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e,placeholder:`Title (optional, becomes the storage id)`},null,8,[`modelValue`]),Z(P8,{modelValue:o.value,"onUpdate:modelValue":n[1]||=e=>o.value=e,placeholder:`Description (optional)`},null,8,[`modelValue`]),X(`div`,t5,[n[10]||=X(`span`,{class:`text-xs color-muted`},`Save location`,-1),Z(M8,{modelValue:s.value,"onUpdate:modelValue":n[2]||=e=>s.value=e,options:c},null,8,[`modelValue`]),X(`span`,n5,je(s.value===`workspace`?`.devframe/, committed and shared with the team`:`node_modules/, this checkout only`),1)])])]),_:1},8,[`open`])]))}});function i5(){let e=V([]);async function t(){e.value=await hT().savedList()}async function n(e){let n=await hT().savedSave(e);return await t(),n}async function r(e){await hT().savedDelete(e.id,e.scope),await t()}return{saved:e,refresh:t,save:n,remove:r}}var a5={class:`h-100dvh flex flex-col bg-base color-base font-sans`},o5={class:`flex-1 min-h-0`},s5={class:`flex flex-col h-full overflow-hidden min-h-0`},c5={class:`flex-1 min-h-0 overflow-y-auto`},l5={class:`min-h-full flex flex-col`};yu(G({__name:`App`,setup(e){let t=wN(),n=i5();br(TN,t),Uh(()=>CE.value),Qi(async()=>{await wT(),pT.connected&&(await Promise.all([t.loadSources(),n.refresh()]),hT().onSourcesChanged(()=>void t.loadSources()),hT().onDataChanged(e=>t.handleDataChanged(e)),vT(`devframes:plugin:data-inspector`,e=>t.focusSource(e)),t.runNow(),t.loadSkeleton())});function r(e){n.save({...e,query:t.query.value,excludeFunctions:t.settings.excludeFunctions||void 0,excludeUnderscoreProps:t.settings.excludeUnderscoreProps||void 0,excludeDollarProps:t.settings.excludeDollarProps||void 0})}return(e,i)=>(q(),J(`div`,a5,[X(`main`,o5,[Z(Vh,{"storage-key":`data-inspector-panes`,class:`h-full`},{default:U(()=>[Z(H(Bh),{size:38,"min-size":`24`,class:`min-w-0`},{default:U(()=>[X(`div`,s5,[Z(EE),Z(UR),X(`div`,c5,[X(`div`,l5,[Z(qz),Z(r5,{saved:H(n).saved.value,suggested:H(t).activeSource.value?.queries??[],"current-query":H(t).query.value,"current-filters":H(t).settings,readonly:H(pT).mode===`static`,class:`px3 py2`,onLoad:i[0]||=e=>H(t).applyRecipe(e),onRemove:i[1]||=e=>H(n).remove(e),onSave:r},null,8,[`saved`,`suggested`,`current-query`,`current-filters`,`readonly`])])])])]),_:1}),Z(H(Bh),{class:`min-w-0`},{default:U(()=>[Z(A8,{result:H(t).result.value,"has-result":H(t).hasResult.value,stats:H(t).stats.value,"stats-stale":H(t).statsStale.value,error:H(t).serverError.value,running:H(t).running.value,"last-run-at":H(t).lastRunAt.value,"can-edit":H(t).canEdit.value,"edit-hint":H(t).editHint.value,expand:H(t).expandNode,onRerun:i[2]||=e=>H(t).runNow(),onQuerySubquery:i[3]||=e=>H(t).applySubquery(e),onQueryAppend:i[4]||=e=>H(t).appendPath(e)},null,8,[`result`,`has-result`,`stats`,`stats-stale`,`error`,`running`,`last-run-at`,`can-edit`,`edit-hint`,`expand`])]),_:1})]),_:1})])]))}})).mount(`#app`),lh();export{Sp as t};
|