Current section
Files
Jump to
Current section
Files
priv/dist/kindly.js
import e from"node:path";import{pathToFileURL as t}from"node:url";var n=class{withFields(e){let t=Object.keys(this).map(t=>t in e?e[t]:this[t]);return new this.constructor(...t)}},r=class{static fromArray(e,t){let n=t||new s;for(let t=e.length-1;t>=0;--t)n=new l(e[t],n);return n}[Symbol.iterator](){return new o(this)}toArray(){return[...this]}atLeastLength(e){let t=this;for(;e-- >0&&t;)t=t.tail;return t!==void 0}hasLength(e){let t=this;for(;e-- >0&&t;)t=t.tail;return e===-1&&t instanceof s}countLength(){let e=this,t=0;for(;e;)e=e.tail,t++;return t-1}};function i(e,t){return new l(e,t)}function a(e,t){return r.fromArray(e,t)}var o=class{#e;constructor(e){this.#e=e}next(){if(this.#e instanceof s)return{done:!0};{let{head:e,tail:t}=this.#e;return this.#e=t,{value:e,done:!1}}}},s=class extends r{};const c=()=>new s;var l=class extends r{constructor(e,t){super(),this.head=e,this.tail=t}};const u=(e,t)=>new l(e,t);var d=class{bitSize;byteSize;bitOffset;rawBuffer;constructor(e,t,n){if(!(e instanceof Uint8Array))throw globalThis.Error(`BitArray can only be constructed from a Uint8Array`);if(this.bitSize=t??e.length*8,this.byteSize=Math.trunc((this.bitSize+7)/8),this.bitOffset=n??0,this.bitSize<0)throw globalThis.Error(`BitArray bit size is invalid: ${this.bitSize}`);if(this.bitOffset<0||this.bitOffset>7)throw globalThis.Error(`BitArray bit offset is invalid: ${this.bitOffset}`);if(e.length!==Math.trunc((this.bitOffset+this.bitSize+7)/8))throw globalThis.Error(`BitArray buffer length is invalid`);this.rawBuffer=e}byteAt(e){if(!(e<0||e>=this.byteSize))return f(this.rawBuffer,this.bitOffset,e)}equals(e){if(this.bitSize!==e.bitSize)return!1;let t=Math.trunc(this.bitSize/8);if(this.bitOffset===0&&e.bitOffset===0){for(let n=0;n<t;n++)if(this.rawBuffer[n]!==e.rawBuffer[n])return!1;let n=this.bitSize%8;if(n){let r=8-n;if(this.rawBuffer[t]>>r!==e.rawBuffer[t]>>r)return!1}}else{for(let n=0;n<t;n++)if(f(this.rawBuffer,this.bitOffset,n)!==f(e.rawBuffer,e.bitOffset,n))return!1;let n=this.bitSize%8;if(n){let r=f(this.rawBuffer,this.bitOffset,t),i=f(e.rawBuffer,e.bitOffset,t),a=8-n;if(r>>a!==i>>a)return!1}}return!0}get buffer(){if(this.bitOffset!==0||this.bitSize%8!=0)throw new globalThis.Error(`BitArray.buffer does not support unaligned bit arrays`);return this.rawBuffer}get length(){if(this.bitOffset!==0||this.bitSize%8!=0)throw new globalThis.Error(`BitArray.length does not support unaligned bit arrays`);return this.rawBuffer.length}};function f(e,t,n){return t===0?e[n]??0:e[n]<<t&255|e[n+1]>>8-t}function p(e){if(e.length===0)return new d(new Uint8Array);if(e.length===1){let t=e[0];return t instanceof d?t:t instanceof Uint8Array?new d(t):new d(new Uint8Array(e))}let t=0,n=!0;for(let r of e)r instanceof d?(t+=r.bitSize,n=!1):r instanceof Uint8Array?(t+=r.byteLength*8,n=!1):t+=8;if(n)return new d(new Uint8Array(e));let r=new Uint8Array(Math.trunc((t+7)/8)),i=0;for(let t of e){let e=i%8==0;if(t instanceof d)if(e&&t.bitOffset===0){r.set(t.rawBuffer,i/8),i+=t.bitSize;let e=t.bitSize%8;if(e!==0){let t=Math.trunc(i/8);r[t]>>=8-e,r[t]<<=8-e}}else a(t.rawBuffer,t.bitSize,t.bitOffset);else t instanceof Uint8Array?e?(r.set(t,i/8),i+=t.byteLength*8):a(t,t.byteLength*8,0):e?(r[i/8]=t,i+=8):a(new Uint8Array([t]),8,0)}function a(e,t,n){if(t===0)return;let a=Math.trunc(t+7/8),o=i%8,s=8-o,c=Math.trunc(i/8);for(let l=0;l<a;l++){let a=f(e,n,l);t<8&&(a>>=8-t,a<<=8-t),r[c]|=a>>o;let u=t-Math.max(0,t-s);if(t-=u,i+=u,t===0)break;r[++c]=a<<s,u=t-Math.max(0,t-o),t-=u,i+=u}}return new d(r,t)}var m=class e extends n{static isResult(t){return t instanceof e}},h=class extends m{constructor(e){super(),this[0]=e}isOk(){return!0}};const g=e=>new h(e);var _=class extends m{constructor(e){super(),this[0]=e}isOk(){return!1}};const v=e=>new _(e),y=e=>e instanceof _,b=e=>e[0];function x(e,t){let n=[e,t];for(;n.length;){let e=n.pop(),t=n.pop();if(e===t)continue;if(!oe(e)||!oe(t)||!se(e,t)||S(e,t)||te(e,t)||ne(e,t)||re(e,t)||ie(e,t)||ae(e,t))return!1;let r=Object.getPrototypeOf(e);if(r!==null&&typeof r.equals==`function`)try{if(e.equals(t))continue;return!1}catch{}let[i,a]=ee(e),o=i(e),s=i(t);if(o.length!==s.length)return!1;for(let r of o)n.push(a(e,r),a(t,r))}return!0}function ee(e){if(e instanceof Map)return[e=>e.keys(),(e,t)=>e.get(t)];{let t=e instanceof globalThis.Error?[`message`]:[];return[e=>[...t,...Object.keys(e)],(e,t)=>e[t]]}}function S(e,t){return e instanceof Date&&(e>t||e<t)}function te(e,t){return!(e instanceof d)&&e.buffer instanceof ArrayBuffer&&e.BYTES_PER_ELEMENT&&!(e.byteLength===t.byteLength&&e.every((e,n)=>e===t[n]))}function ne(e,t){return Array.isArray(e)&&e.length!==t.length}function re(e,t){return e instanceof Map&&e.size!==t.size}function ie(e,t){return e instanceof Set&&(e.size!=t.size||[...e].some(e=>!t.has(e)))}function ae(e,t){return e instanceof RegExp&&(e.source!==t.source||e.flags!==t.flags)}function oe(e){return typeof e==`object`&&!!e}function se(e,t){return typeof e!=`object`&&typeof t!=`object`&&(!e||!t)||[Promise,WeakSet,WeakMap,Function].some(t=>e instanceof t)?!1:e.constructor===t.constructor}function ce(e,t){return t===0?0:e%t}function le(e,t){return Math.trunc(ue(e,t))}function ue(e,t){return t===0?0:e/t}function de(e,t,n,r,i,a,o){let s=new globalThis.Error(a);s.gleam_error=e,s.file=t,s.module=n,s.line=r,s.function=i,s.fn=i;for(let e in o)s[e]=o[e];return s}const fe=new WeakMap,pe=new DataView(new ArrayBuffer(8));let me=0;function he(e){let t=fe.get(e);if(t!==void 0)return t;let n=me++;return me===2147483647&&(me=0),fe.set(e,n),n}function ge(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function _e(e){let t=0,n=e.length;for(let r=0;r<n;r++)t=Math.imul(31,t)+e.charCodeAt(r)|0;return t}function ve(e){pe.setFloat64(0,e);let t=pe.getInt32(0),n=pe.getInt32(4);return Math.imul(73244475,t>>16^t)^n}function ye(e){return _e(e.toString())}function be(e){let t=Object.getPrototypeOf(e);if(t!==null&&typeof t.hashCode==`function`)try{let t=e.hashCode(e);if(typeof t==`number`)return t}catch{}if(e instanceof Promise||e instanceof WeakSet||e instanceof WeakMap)return he(e);if(e instanceof Date)return ve(e.getTime());let n=0;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||e instanceof Uint8Array)for(let t=0;t<e.length;t++)n=Math.imul(31,n)+C(e[t])|0;else if(e instanceof Set)e.forEach(e=>{n=n+C(e)|0});else if(e instanceof Map)e.forEach((e,t)=>{n=n+ge(C(e),C(t))|0});else{let t=Object.keys(e);for(let r=0;r<t.length;r++){let i=t[r],a=e[i];n=n+ge(C(a),_e(i))|0}}return n}function C(e){if(e===null)return 1108378658;if(e===void 0)return 1108378659;if(e===!0)return 1108378657;if(e===!1)return 1108378656;switch(typeof e){case`number`:return ve(e);case`string`:return _e(e);case`bigint`:return ye(e);case`object`:return be(e);case`symbol`:return he(e);case`function`:return he(e);default:return 0}}var xe=class{constructor(e,t){this.size=e,this.root=t}};const Se=Symbol(),Ce=Symbol(),we=Oe(0),Te=new xe(0,we),Ee=v(void 0);function De(e,t,n,r){return{datamap:t,nodemap:n,data:r,[Ce]:e}}function Oe(e){return De(e,0,0,[])}function ke(e,t){if(e[Ce]===t)return e;let n=e.data.slice(0);return De(t,e.datamap,e.nodemap,n)}function Ae(e,t,n,r){return e.data[n]===r?e:(e=ke(e,t),e.data[n]=r,e)}function je(e,t,n,r,i,a){let o=e.data,s=o.length,c=Array(s+2),l=0,u=0;for(;l<r;)c[u++]=o[l++];for(c[u++]=i,c[u++]=a;l<s;)c[u++]=o[l++];return De(t,e.datamap|n,e.nodemap,c)}function Me(){return Te}function Ne(e,t){let n=Fe(e.root,t,C(t));return n===Se?Ee:g(n)}function Pe(e,t){return Fe(e.root,t,C(t))!==Se}function Fe(e,t,n){for(let r=0;r<32;r+=5){let i=e.data,a=Ke(n,r);if(e.nodemap&a)e=i[i.length-1-Ge(e.nodemap,a)];else if(e.datamap&a){let n=Math.imul(Ge(e.datamap,a),2);return x(t,i[n])?i[n+1]:Se}else return Se}let r=e.data;for(let e=0;e<r.length;e+=2)if(x(t,r[e]))return r[e+1];return Se}function Ie(e){return{generation:Re(e),root:e.root,size:e.size,dict:e}}function Le(e){return e.root===e.dict.root?e.dict:new xe(e.size,e.root)}function Re(e){let t=e.root;if(t[Ce]<2**53-1)return t[Ce]+1;let n=[t];for(;n.length;){let e=n.pop();e[Ce]=0;let t=data.length-We(e.nodemap);for(let r=t;r<e.data.length;++r)n.push(e.data[r])}return 1}const ze=Ie(Te);function Be(e,t,n){ze.generation=Re(e),ze.size=e.size;let r=C(t),i=He(ze,e.root,t,n,r,0);return i===e.root?e:new xe(ze.size,i)}function Ve(e,t,n){let r=C(e);return n.root=He(n,n.root,e,t,r,0),n}function He(e,t,n,r,i,a){let o=t.data,s=e.generation;if(a>32){for(let e=0;e<o.length;e+=2)if(x(n,o[e]))return Ae(t,s,e+1,r);return e.size+=1,je(t,s,0,o.length,n,r)}let c=Ke(i,a);if(t.nodemap&c){let l=o.length-1-Ge(t.nodemap,c),u=o[l];return u=He(e,u,n,r,i,a+5),Ae(t,s,l,u)}let l=Math.imul(Ge(t.datamap,c),2);if((t.datamap&c)===0)return e.size+=1,je(t,s,c,l,n,r);if(x(n,o[l]))return Ae(t,s,l+1,r);let u=a+5,d=we;d=He(e,d,n,r,i,u);let f=o[l],p=o[l+1],m=C(f);d=He(e,d,f,p,m,u),--e.size;let h=o.length,g=h-1-Ge(t.nodemap,c),_=Array(h-1),v=0,y=0;for(;v<l;)_[y++]=o[v++];for(v+=2;v<=g;)_[y++]=o[v++];for(_[y++]=d;v<h;)_[y++]=o[v++];return De(s,t.datamap^c,t.nodemap|c,_)}function Ue(e,t,n){let r=[e.root];for(;r.length;){let e=r.pop(),i=e.data,a=i.length-We(e.nodemap);for(let e=0;e<a;e+=2)t=n(t,i[e],i[e+1]);for(let e=a;e<i.length;++e)r.push(i[e])}return t}function We(e){return e-=e>>>1&1431655765,e=(e&858993459)+(e>>>2&858993459),Math.imul(e+(e>>>4)&252645135,16843009)>>>24}function Ge(e,t){return We(e&t-1)}function Ke(e,t){return 1<<(e>>>t&31)}var w=class extends n{constructor(e){super(),this[0]=e}},T=class extends n{};function qe(e,t){return e instanceof w?e[0]:t}function Je(e,t){if(e instanceof w){let n=e[0];return new w(t(n))}else return e}function Ye(e){return Ue(e,a([]),(e,t,n)=>i([t,n],e))}function Xe(e,t){return Le(Ue(t,Ie(Me()),(t,n,r)=>e(n,r)?Ve(n,r,t):t))}function Ze(e,t){return Xe(t,e)}function Qe(e,t,n){let r=Ne(e,t);if(r instanceof h){let i=r[0];return Be(e,t,n(new w(i)))}else return Be(e,t,n(new T))}var E=class extends n{},D=class extends n{},$e=class extends n{};function et(e,t){return e>t?e:t}function tt(e,t){return e<t?e:t}var O=class extends n{},nt=class extends n{};function rt(e,t){for(;;){let n=e,r=t;if(n instanceof s)return r;e=n.tail,t=r+1}}function it(e){return rt(e,0)}function at(e,t){for(;;){let n=e,r=t;if(n instanceof s)return r;{let a=n.head;e=n.tail,t=i(a,r)}}}function k(e){return at(e,a([]))}function ot(e,t,n){for(;;){let r=e,a=t,o=n;if(r instanceof s)return k(o);{let s=r.head,c=r.tail,l;l=a(s)?i(s,o):o;let u=l;e=c,t=a,n=u}}}function st(e,t){return ot(e,t,a([]))}function ct(e,t,n){for(;;){let r=e,a=t,o=n;if(r instanceof s)return k(o);{let s=r.head;e=r.tail,t=a,n=i(a(s),o)}}}function A(e,t){return ct(e,t,a([]))}function lt(e,t,n,r){for(;;){let a=e,o=t,c=n,l=r;if(a instanceof s)return k(l);{let s=a.head,u=a.tail,d=i(o(s,c),l);e=u,t=o,n=c+1,r=d}}}function ut(e,t){return lt(e,t,0,a([]))}function dt(e,t){for(;;){let n=e,r=t;if(n instanceof s)return r;{let a=n.head;e=n.tail,t=i(a,r)}}}function ft(e,t){return dt(k(e),t)}function pt(e,t){for(;;){let n=e,r=t;if(n instanceof s)return k(r);{let i=n.head;e=n.tail,t=at(i,r)}}}function j(e){return pt(e,a([]))}function mt(e,t){return j(A(e,t))}function M(e,t,n){for(;;){let r=e,i=t,a=n;if(r instanceof s)return i;{let o=r.head;e=r.tail,t=a(i,o),n=a}}}function ht(e,t){for(;;){let n=e,r=t;if(n instanceof s)return!0;{let i=n.head,a=n.tail,o=r(i);if(o)e=a,t=r;else return o}}}function gt(e,t,n){for(;;){let r=e,a=t,o=n;if(r instanceof s)return k(o);{let s=r.head;e=r.tail,t=a,n=i(s,i(a,o))}}}function _t(e,t){if(e instanceof s)return e;{let n=e.tail;if(n instanceof s)return e;{let r=e.head;return gt(n,t,a([r]))}}}function vt(e,t,n,r){for(;;){let a=e,o=t,c=n,l=r;if(a instanceof s)return at(o,l);if(o instanceof s)return at(a,l);{let s=a.head,u=a.tail,d=o.head,f=o.tail,p=c(s,d);p instanceof E?(e=a,t=f,n=c,r=i(d,l)):(p instanceof D,e=u,t=o,n=c,r=i(s,l))}}}function yt(e,t,n){for(;;){let r=e,o=t,c=n;if(r instanceof s)return k(c);{let l=r.tail;if(l instanceof s){let e=r.head;return k(i(k(e),c))}else{let s=r.head,u=l.head,d=l.tail,f=vt(s,u,o,a([]));e=d,t=o,n=i(f,c)}}}}function bt(e,t,n,r){for(;;){let a=e,o=t,c=n,l=r;if(a instanceof s)return at(o,l);if(o instanceof s)return at(a,l);{let s=a.head,u=a.tail,d=o.head,f=o.tail,p=c(s,d);p instanceof E?(e=u,t=o,n=c,r=i(s,l)):(p instanceof D,e=a,t=f,n=c,r=i(d,l))}}}function xt(e,t,n){for(;;){let r=e,o=t,c=n;if(r instanceof s)return k(c);{let l=r.tail;if(l instanceof s){let e=r.head;return k(i(k(e),c))}else{let s=r.head,u=l.head,d=l.tail,f=bt(s,u,o,a([]));e=d,t=o,n=i(f,c)}}}}function St(e,t,n){for(;;){let r=e,i=t,o=n;if(r instanceof s)return r;if(i instanceof O){if(r.tail instanceof s)return r.head;e=xt(r,o,a([])),t=new nt,n=o}else if(r.tail instanceof s){let e=r.head;return k(e)}else e=yt(r,o,a([])),t=new O,n=o}}function Ct(e,t,n,r,o,c){for(;;){let l=e,u=t,d=n,f=r,p=o,m=c,h=i(p,d);if(l instanceof s)return f instanceof O?i(k(h),m):i(h,m);{let d=l.head,g=l.tail,_=u(p,d);if(f instanceof O)if(_ instanceof E)e=g,t=u,n=h,r=f,o=d,c=m;else if(_ instanceof D)e=g,t=u,n=h,r=f,o=d,c=m;else{let l;l=f instanceof O?i(k(h),m):i(h,m);let p=l;if(g instanceof s)return i(a([d]),p);{let i=g.head,s=g.tail,l,f=u(d,i);l=f instanceof E||f instanceof D?new O:new nt;let m=l;e=s,t=u,n=a([d]),r=m,o=i,c=p}}else if(_ instanceof E){let l;l=f instanceof O?i(k(h),m):i(h,m);let p=l;if(g instanceof s)return i(a([d]),p);{let i=g.head,s=g.tail,l,f=u(d,i);l=f instanceof E||f instanceof D?new O:new nt;let m=l;e=s,t=u,n=a([d]),r=m,o=i,c=p}}else if(_ instanceof D){let l;l=f instanceof O?i(k(h),m):i(h,m);let p=l;if(g instanceof s)return i(a([d]),p);{let i=g.head,s=g.tail,l,f=u(d,i);l=f instanceof E||f instanceof D?new O:new nt;let m=l;e=s,t=u,n=a([d]),r=m,o=i,c=p}}else e=g,t=u,n=h,r=f,o=d,c=m}}}function wt(e,t){if(e instanceof s)return e;{let n=e.tail;if(n instanceof s)return e;{let r=e.head,i=n.head,o=n.tail,s,c=t(r,i);s=c instanceof E||c instanceof D?new O:new nt;let l=s;return St(Ct(o,t,a([r]),l,i,a([])),new O,t)}}}function Tt(e,t,n){for(;;){let r=e,o=t,c=n;if(o<=0)return[k(c),r];if(r instanceof s)return[k(c),a([])];{let a=r.head;e=r.tail,t=o-1,n=i(a,c)}}}function Et(e,t){return Tt(e,t,a([]))}function Dt(e,t){for(;;){let n=e,r=t;if(n instanceof s)return;{let i=n.head,a=n.tail;r(i),e=a,t=r}}}function Ot(e,t,n,r,o){for(;;){let c=e,l=t,u=n,d=r,f=o;if(c instanceof s)return d instanceof s?k(f):k(i(k(d),f));{let s=c.head,p=c.tail,m=i(s,d);u>1?(e=p,t=l,n=u-1,r=m,o=f):(e=p,t=l,n=l,r=a([]),o=i(k(m),f))}}}function kt(e,t){return Ot(e,t,t,a([]),a([]))}function At(e,t){if(e instanceof s)return new _(void 0);{let n=e.head,r=e.tail;return new h(M(r,n,t))}}function jt(e,t,n){return Gt(qt(Gt(e),t,n))}function Mt(e,t){return e===t?new D:tn(e,t)?new E:new $e}function Nt(e,t,n){if(n<=0)return``;if(t<0){let r=Jt(e)+t;return r<0?``:rn(e,r,n)}else return rn(e,t,n)}function Pt(e,t){return t===``?Yt(e):A(nn(Gt(e),t),Gt)}function Ft(e,t){return e+t}function It(e,t){for(;;){let n=e,r=t;if(n instanceof s)return r;{let i=n.head;e=n.tail,t=r+i}}}function Lt(e){return It(e,``)}function Rt(e,t,n){for(;;){let r=e,i=t,a=n,o;o=r%2==0?a:a+i;let s=o,c=globalThis.Math.trunc(r/2);if(c<=0)return s;e=c,t=i+i,n=s}}function zt(e,t){return t<=0?``:Rt(t,e,``)}function Bt(e,t,n){for(;;){let r=e,i=t,a=n;if(r instanceof s)return a;{let o=r.head;e=r.tail,t=i,n=a+i+o}}}function N(e,t){if(e instanceof s)return``;{let n=e.head,r=e.tail;return Bt(r,t,n)}}function Vt(e,t){let n=Jt(t),r=le(e,n),i=ce(e,n);return zt(t,r)+Nt(t,0,i)}function Ht(e,t,n){let r=t-Jt(e);return r<=0?e:Vt(r,n)+e}function Ut(e){return fn(dn(e))}function Wt(e){let t=Qt(e);if(t instanceof h){let e=t[0][0],n=t[0][1];return Ft(en(e),$t(n))}else return``}function Gt(e){return e}function Kt(e){return/^[-+]?(\d+)$/.test(e)?g(parseInt(e)):v(void 0)}function P(e){return e.toString()}function qt(e,t,n){return e.replaceAll(t,n)}function Jt(e){if(e===``)return 0;let t=Zt(e);if(t){let e=0;for(let n of t)e++;return e}else return e.match(/./gsu).length}function Yt(e){let t=Zt(e);return mn(t?Array.from(t).map(e=>e.segment):e.match(/./gsu))}let Xt;function Zt(e){if(globalThis.Intl&&Intl.Segmenter)return Xt||=new Intl.Segmenter,Xt.segment(e)[Symbol.iterator]()}function Qt(e){let t,n=Zt(e);return t=n?n.next().value?.segment:e.match(/./su)?.[0],t?g([t,e.slice(t.length)]):v(void 0)}function $t(e){return e.toLowerCase()}function en(e){return e.toUpperCase()}function tn(e,t){return e<t}function nn(e,t){return mn(e.split(t))}function rn(e,t,n){if(n<=0||t>=e.length)return``;let r=Zt(e);if(r){for(;t-- >0;)r.next();let e=``;for(;n-- >0;){let t=r.next().value;if(t===void 0)break;e+=t.segment}return e}else return e.match(/./gsu).slice(t,t+n).join(``)}function an(e,t){return e.indexOf(t)>=0}function on(e,t){return e.startsWith(t)}function sn(e,t){let n=e.indexOf(t);return n>=0?g([e.slice(0,n),e.slice(n+t.length)]):v(void 0)}const cn=[` `,` `,`
`,`\v`,`\f`,`\r`,`
`,`\u2028`,`\u2029`].join(``),ln=RegExp(`^[${cn}]*`),un=RegExp(`[${cn}]*$`);function dn(e){return e.replace(ln,``)}function fn(e){return e.replace(un,``)}function F(e){console.log(e)}function pn(e){console.error(e)}function mn(e){let t=c(),n=e.length;for(;n--;)t=u(e[n],t);return t}var hn=class e{constructor(e){this.promise=e}static wrap(t){return t instanceof Promise?new e(t):t}static unwrap(t){return t instanceof e?t.promise:t}};function I(e){return Promise.resolve(hn.wrap(e))}function L(e,t){return e.then(e=>t(hn.unwrap(e)))}function gn(e,t){return e.then(e=>hn.wrap(t(hn.unwrap(e))))}function _n(e,t){return gn(e,e=>{if(e instanceof h){let n=e[0];return t(n)}else return e})}function vn(e,t){return L(e,e=>{if(e instanceof h){let n=e[0];return t(n)}else{let t=e[0];return I(new _(t))}})}function yn(e,t,n){return e?t:n()}function R(e,t,n){return e?t():n()}function bn(e,t){if(e instanceof h){let n=e[0];return new h(t(n))}else return e}function xn(e,t){if(e instanceof h){let n=e[0];return t(n)}else return e}function Sn(e,t){return e instanceof h?e[0]:t}function Cn(e,t){return e instanceof h?e:new _(t)}const wn=/\x1b(?:[\x30-\x4f\x51-\x57\x59-\x5a\x60-\x7e]|(?:\[[\x20-\x3f]*?[\x40-\x7e])|(?:[\x50\x58\x5d\x5e\x5f].*?(?:\x07|\x1b\\)))/gm,Tn=/[\x20-\x7e]+(?=[\x20-\x7e]|$)/g,En=new Intl.Segmenter;function Dn(e){return e.reduceRight((e,t)=>u(t,e),c())}function On(e,t){e.count_ansi_codes||(t=t.replaceAll(wn,``));let n=Pn(Tn,t);return[t,n,1]}function kn(e,t){let n=t>>8,r=(t&255)>>3,i=t&7;return(e.byteAt(e.byteAt(n)*32+r)>>i&1)>0}function An(e,t){return[e.slice(0,t),e.slice(t)]}function jn(e,t,n){for(let r of e)t=n(t,r.codePointAt(0));return t}function Mn(e,t,n){for(let{segment:r}of En.segment(e))t=n(t,r);return t}function Nn(e){return String.fromCodePoint(e)}function Pn(e,t){let n,r=[];for(e.lastIndex=0;(n=e.exec(t))!==null;)r.push([n.index,e.lastIndex-n.index]);return Dn(r)}const Fn=p([16,17,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,17,33,17,17,17,34,35,36,37,38,39,40,17,17,41,17,17,17,17,17,17,17,17,17,17,17,42,43,17,17,44,45,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,46,17,47,48,49,50,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,51,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,52,17,17,53,54,17,55,56,57,17,17,17,17,17,17,58,17,17,59,60,61,62,63,64,65,66,67,68,69,70,71,72,17,73,74,75,76,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,77,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,78,17,17,17,17,17,17,17,17,79,80,17,17,17,81,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,82,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,83,17,84,85,17,17,17,17,17,17,17,86,17,17,17,17,17,87,80,88,17,89,90,17,17,91,92,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,128,255,255,255,255,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,191,182,0,0,0,0,0,0,0,63,0,255,23,0,0,0,0,0,248,255,255,0,0,1,0,0,0,0,0,0,0,0,0,0,0,192,191,159,61,0,0,0,128,2,0,0,0,255,255,255,7,0,0,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,0,248,15,32,0,0,192,251,239,62,0,0,0,0,0,14,0,0,0,0,0,0,131,255,0,0,0,0,0,252,255,255,255,255,255,255,7,0,0,0,0,0,0,20,254,33,254,0,12,0,0,0,2,0,0,0,0,0,0,16,30,32,0,0,12,0,0,64,6,0,0,0,0,0,0,16,134,57,2,0,0,0,35,0,6,0,0,0,0,0,0,16,190,33,0,0,12,0,0,252,2,0,0,0,0,0,0,144,30,32,96,0,12,0,0,0,4,0,0,0,0,0,0,0,1,32,0,0,0,0,0,0,17,0,0,0,0,0,0,208,193,61,96,0,12,0,0,0,2,0,0,0,0,0,0,144,64,48,0,0,12,0,0,0,3,0,0,0,0,0,0,24,30,32,0,0,12,0,0,0,2,0,0,0,0,0,0,0,0,4,92,0,0,0,0,0,0,0,0,0,0,0,242,7,128,127,0,0,0,0,0,0,0,0,0,0,0,0,242,31,0,127,0,0,0,0,0,0,0,0,0,3,0,0,160,2,0,0,0,0,0,0,254,127,223,224,255,254,255,255,255,31,64,0,0,0,0,0,0,0,0,0,0,0,0,224,253,102,0,0,0,195,1,0,30,0,100,32,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,0,0,0,0,176,63,64,254,15,32,0,0,0,0,0,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,1,4,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,9,0,0,0,0,0,0,64,127,229,31,248,159,0,0,0,0,0,0,255,255,255,127,0,0,0,0,0,0,15,0,0,0,0,0,208,23,4,0,0,0,0,248,15,0,3,0,0,0,60,59,0,0,0,0,0,0,64,163,3,0,0,0,0,0,0,240,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,255,253,33,16,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,248,0,0,0,127,0,0,0,0,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,247,63,0,0,0,192,0,0,0,0,0,0,0,0,0,0,3,0,68,8,0,0,96,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,255,255,3,128,0,0,0,0,192,63,0,0,128,255,3,0,0,0,0,0,7,0,0,0,0,0,200,51,0,0,0,0,32,0,0,0,0,0,0,0,0,126,102,0,8,16,0,0,0,0,0,16,0,0,0,0,0,0,157,193,2,0,0,0,0,48,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,127,248,255,255,255,255,255,15,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,0,0,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,240,0,0,0,0,0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,62,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,192,255,1,0,0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,255,127,0,0,0,0,0,25,128,3,0,0,0,0,0,120,38,4,32,0,0,0,0,0,0,7,0,0,0,128,239,31,0,0,0,0,0,0,0,8,0,3,0,0,0,0,0,192,127,0,158,0,0,0,0,0,0,0,0,0,0,0,128,211,64,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,248,7,0,0,3,0,0,0,0,0,0,24,1,0,0,0,192,31,31,0,0,0,0,0,0,0,0,248,1,64,5,0,6,0,0,0,0,0,0,0,0,0,0,255,92,0,0,64,0,0,0,0,0,0,0,0,0,0,248,133,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,176,1,0,0,48,0,0,0,0,0,0,0,0,0,0,248,167,1,0,0,0,0,0,0,0,0,0,0,0,0,40,191,0,0,0,0,0,0,0,0,0,0,0,0,160,188,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,255,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,12,1,0,0,0,254,7,0,0,0,0,248,121,128,0,126,14,0,0,0,0,0,252,127,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,191,0,0,0,0,0,0,0,0,0,0,252,255,255,252,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,126,180,191,0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,3,0,0,0,0,0,192,7,5,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,129,255,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,128,7,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,15,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,63,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,248,255,231,15,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,127,248,255,255,255,255,255,31,32,0,16,0,0,248,254,255,0,0,0,0,0,0,0,0,0,0,127,255,255,249,219,7,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,240,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),In=p([8,9,10,11,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,15,16,17,18,19,20,21,13,13,13,22,13,13,13,13,13,13,23,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,13,13,13,13,13,25,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,101,223,247,64,0,129,193,67,55,141,87,2,0,10,8,192,8,14,129,23,47,12,0,192,8,0,0,0,0,0,0,0,0,0,0,0,64,85,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,144,46,1,175,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,254,255,251,3,254,255,251,3,0,0,0,0,0,0,2,0,255,255,255,255,255,255,255,255,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,121,51,247,0,45,72,0,0,0,0,0,0,16,128,30,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,40,2,72,0,70,8,0,0,0,0,24,120,255,15,255,3,0,2,255,3,0,0,0,3,0,0,20,0,128,0,0,0,141,137,34,228,169,95,240,48,0,17,4,0,243,204,0,0,204,0,32,2,32,0,0,128,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,251,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,15,0,255,255,60,0,251,3,204,48,195,201,3,0,60,128,0,0,96,194,0,80,0,0,0,0,5,0,0,0,187,183,0,0,0,0,0,192,0,0,0,128,192,191,239,255,11,251,211,219,0,0,0,0,0,0,0,32,0,0,0,0,0,0,192,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32]),Ln=p([16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,18,16,19,20,21,16,16,16,22,16,16,23,24,25,26,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,16,16,16,16,30,16,16,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,31,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,28,28,16,16,16,32,33,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,34,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,35,28,28,28,28,36,37,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,38,28,39,40,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,41,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,42,43,44,45,46,47,48,49,16,50,51,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,0,48,0,0,0,255,0,0,255,15,0,0,0,0,128,0,252,8,0,2,12,0,96,48,64,16,0,0,4,44,36,32,12,0,0,0,1,0,0,0,80,184,0,0,0,0,0,0,0,224,0,0,0,1,128,0,0,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,251,255,255,255,255,255,255,255,255,255,255,15,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,255,255,255,255,255,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,127,254,255,255,255,255,255,255,255,255,255,255,255,255,224,255,255,255,255,255,254,255,255,255,255,255,255,255,255,255,255,127,255,255,255,255,255,255,255,255,255,255,63,128,255,255,255,255,255,127,255,255,255,255,255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,31,255,255,255,255,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,255,3,0,0,255,255,255,255,247,255,127,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,255,255,255,255,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,3,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,63,0,0,0,0,128,255,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,239,111,255,255,255,255,7,0,4,0,0,0,39,0,240,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15,255,255,255,255,255,255,255,255,255,255,127,0,255,255,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,254,7,0,0,0,0,0,0,0,0,0,0,0,0,7,0,255,255,255,255,255,15,255,1,3,0,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,1,224,191,255,255,255,255,255,255,255,255,223,255,255,15,0,255,255,255,255,255,135,15,0,255,255,17,255,255,255,255,255,255,255,255,127,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,159,255,255,255,255,255,255,255,63,0,120,255,255,255,0,0,4,0,0,96,0,16,0,0,0,0,0,0,0,0,0,0,248,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,63,16,231,240,0,24,240,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,15,1,0,0,240,255,255,255,255,255,247,191,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,31,255,131,255,255,255,255,255,255,127,192,255,159,255,3,255,1]),Rn=p([16,16,16,16,16,16,16,16,16,17,18,19,20,21,16,22,23,16,16,16,16,16,16,24,16,25,26,27,28,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,29,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,30,31,32,33,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,34,35,36,37,38,39,40,41,42,43,44,16,45,46,47,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,49,16,16,16,16,16,16,16,16,16,16,16,16,16,50,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,51,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,200,1,222,0,0,0,0,0,0,12,0,0,0,0,0,0,192,129,25,128,0,0,0,0,0,8,0,0,0,0,0,0,192,1,0,0,0,0,0,0,0,8,0,0,0,0,0,0,192,1,26,0,0,0,0,0,0,12,0,0,0,0,0,0,64,129,25,128,0,0,0,0,0,0,0,0,0,0,0,0,192,198,29,128,0,0,0,0,0,14,0,0,0,0,0,0,0,30,0,0,0,0,0,0,0,12,0,0,0,0,0,0,64,159,13,96,0,0,0,8,0,12,0,0,0,0,0,0,192,193,29,128,0,0,0,0,0,12,0,0,0,0,0,0,0,0,128,3,255,0,0,12,0,0,0,0,0,0,0,0,192,0,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,2,25,0,0,192,0,156,63,0,0,152,159,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,192,191,1,0,0,0,0,0,0,0,0,0,0,120,14,251,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,160,0,26,224,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,32,232,27,0,0,0,0,0,0,0,4,0,0,0,194,4,0,0,0,0,0,0,128,92,12,0,0,0,0,0,240,15,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,128,0,0,0,0,0,0,192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,240,255,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,8,0,0,0,0,0,48,204,1,0,0,0,0,0,0,0,0,0,0,0,0,128,25,0,0,32,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,200,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,216,22,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,135,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,96,0,0,0,0,0,0,0,4,0,0,0,0,0,56,128,1,64,0,0,0,0,0,0,0,0,0,0,0,112,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,12,0,0,0,0,0,0,192,158,57,128,0,12,0,0,0,0,0,0,0,0,0,0,7,164,183,0,0,0,0,0,0,0,0,0,0,0,0,224,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,7,122,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,3,79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,88,0,0,0,0,0,0,0,0,0,0,0,0,0,208,64,0,0,0,0,0,0,0,0,0,0,0,0,64,67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,33,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,240,16,0,0,0,0,0,0,0,0,0,0,2,0,0,128,1,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,2,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,8,0,0,0,0,0,48,192,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,254,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,96,224,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);var zn=class extends n{constructor(e,t,n,r,i){super(),this.count_ansi_codes=e,this.ambiguous_as_wide=t,this.mode=n,this.tab_width=r,this.tab_offset=i}},Bn=class extends n{},Vn=class extends n{},Hn=class extends n{constructor(e,t){super(),this.rows=e,this.columns=t}};const Un=new zn(!1,!1,new Bn,8,0);function Wn(){return Un}function Gn(e){return new zn(e.count_ansi_codes,!0,e.mode,e.tab_width,e.tab_offset)}function Kn(e,t,n,r,i,a){for(;;){let o=e,c=t,l=n,u=r,d=i,f=a;if(l instanceof s)return o===``?u:d(u,o);{let s=l.head[0];if(s===c){let c=l.tail,p=l.head[1],m=An(o,p),h=m[0],g=m[1],_=f(u,h,p),v=s+p;e=g,t=v,n=c,r=_,i=d,a=f}else{let s=l.tail,p=l.head[0],m=l.head[1],h=An(o,p-c),g=h[0],_=h[1],v=An(_,m),y=v[0],b=v[1],x;x=f(d(u,g),y,m);let ee=x,S=p+m;e=b,t=S,n=s,r=ee,i=d,a=f}}}}function qn(e){return e<=131071&&kn(Rn,e)}function Jn(e){return e<=65535?kn(In,e):e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e>=127375&&e<=127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Yn(e){return e<=131071?kn(Ln,e):e>=131072&&e<=262144}function Xn(e){return e<=131071?kn(Fn,e):e>=917504&&e<=921599}function Zn(e,t){return t<=31?0:t<=126?1:Xn(t)?0:Yn(t)||e.ambiguous_as_wide&&Jn(t)?2:1}function Qn(e,t){return jn(t,0,(t,n)=>{if(t===0)return Zn(e,n);if(n===65039)return 2;{let r=Zn(e,n);if(r===0)return t;{let e=r;return qn(n)?et(t,e):2}}})}function $n(e,t,n,r){return Mn(t,n,(t,n)=>r(t,n,Qn(e,n)))}function er(e,t){return jn(t,0,(t,n)=>n===65039&&t>0?2:et(t,Zn(e,n)))}function tr(e,t,n,r){return Mn(t,n,(t,n)=>r(t,n,er(e,n)))}function nr(e,t,n,r){return jn(t,n,(t,n)=>r(t,Nn(n),Zn(e,n)))}function rr(e,t){return(le(t,e.tab_width)+1)*e.tab_width-t}function ir(e,t){let n=On(t,e),r=n[0],i=n[1],a=n[2],o=(e,n,r)=>{let i=e[0],a=e[1],o=e[2];return n===`
`?[i+1,et(a,o),t.tab_offset]:n===` `?[i,a,o+rr(t,o)]:[i,a,o+r]},s=(e,t,n)=>o(e,t,a*n),c,l=t.mode;c=l instanceof Bn?(e,n)=>nr(t,n,e,o):l instanceof Vn?(e,n)=>tr(t,n,e,o):(e,n)=>$n(t,n,e,o);let u=c,d=Kn(r,0,i,[0,0,t.tab_offset],u,s),f=d[0],p=d[1],m=d[2],h=et(p,m)-t.tab_offset,g;return g=m>t.tab_offset?f+1:f,new Hn(g,h)}function ar(e){return ir(e,Un).columns}function or(e,t){return ir(e,t).columns}function sr(e,t){return e.has(t)}function cr(e,t){return e.difference(t)}function lr(e,t){return new Set(e).add(t)}function ur(e,t){return e.intersection(t)}function dr(e,t){return e.isDisjointFrom(t)}function fr(e,t){return e.isSubsetOf(t)}function z(e){return new Set(e)}function B(e){return a([...e])}function pr(e,t){return e.union(t)}function mr(e){return x(e,z())}var hr={version:new Uint8Array([48,46,50,46,49]),description:new Uint8Array([65,32,110,105,99,101,32,108,105,116,116,108,101,32,116,97,115,107,32,114,117,110,110,101,114]),min_gleam_version:new Uint8Array([49,46,49,52,46,48]),completion:{bash:new Uint8Array([99,111,109,112,108,101,116,101,32,45,111,32,100,101,102,97,117,108,116,32,45,70,32,95,107,105,110,100,108,121,32,107,105,110,100,108,121,10,10,95,107,105,110,100,108,121,40,41,32,123,10,32,32,108,111,99,97,108,32,99,117,114,10,32,32,108,111,99,97,108,32,45,105,32,99,119,111,114,100,10,32,32,108,111,99,97,108,32,45,97,32,119,111,114,100,115,10,10,32,32,67,79,77,80,82,69,80,76,89,61,40,41,10,32,32,105,102,32,100,101,99,108,97,114,101,32,45,70,32,95,105,110,105,116,95,99,111,109,112,108,101,116,105,111,110,32,62,47,100,101,118,47,110,117,108,108,32,50,62,38,49,59,32,116,104,101,110,10,32,32,32,32,95,105,110,105,116,95,99,111,109,112,108,101,116,105,111,110,32,45,110,32,61,58,32,124,124,32,114,101,116,117,114,110,10,32,32,101,108,115,101,10,32,32,32,32,95,103,101,116,95,99,111,109,112,95,119,111,114,100,115,95,98,121,95,114,101,102,32,45,110,32,61,58,32,99,117,114,32,112,114,101,118,32,119,111,114,100,115,32,99,119,111,114,100,32,124,124,32,114,101,116,117,114,110,10,32,32,102,105,10,10,32,32,108,111,99,97,108,32,120,10,32,32,119,104,105,108,101,32,73,70,83,61,34,34,32,114,101,97,100,32,45,114,32,120,59,32,100,111,10,32,32,32,32,67,79,77,80,82,69,80,76,89,43,61,40,34,36,123,120,125,34,41,10,32,32,100,111,110,101,32,60,32,60,40,10,32,32,32,32,101,120,112,111,114,116,32,67,79,76,85,77,78,83,10,10,32,32,32,32,108,111,99,97,108,32,97,114,103,115,61,40,34,36,123,119,111,114,100,115,91,64,93,58,49,58,36,123,99,119,111,114,100,125,45,49,125,34,41,10,10,32,32,32,32,107,105,110,100,108,121,32,45,45,99,117,101,32,98,97,115,104,32,45,45,32,34,36,123,97,114,103,115,91,64,93,125,34,32,34,36,123,99,117,114,125,34,32,50,62,47,100,101,118,47,110,117,108,108,10,10,32,32,32,32,112,114,105,110,116,102,32,37,115,32,34,36,123,63,125,34,10,32,32,41,10,10,32,32,99,97,115,101,32,34,36,123,120,125,44,36,40,116,121,112,101,32,45,116,32,99,111,109,112,111,112,116,41,34,32,105,110,10,32,32,32,32,48,44,98,117,105,108,116,105,110,41,32,99,111,109,112,111,112,116,32,45,111,32,110,111,115,111,114,116,32,59,59,10,32,32,32,32,42,44,98,117,105,108,116,105,110,41,32,99,111,109,112,111,112,116,32,43,111,32,100,101,102,97,117,108,116,32,59,59,10,32,32,101,115,97,99,32,62,47,100,101,118,47,110,117,108,108,32,50,62,38,49,10,125,10]),fish:new Uint8Array([99,111,109,112,108,101,116,101,32,45,101,99,32,107,105,110,100,108,121,10,10,99,111,109,112,108,101,116,101,32,45,99,32,107,105,110,100,108,121,32,45,107,120,97,32,34,40,95,95,107,105,110,100,108,121,95,99,111,109,112,108,101,116,105,111,110,115,41,34,10,10,99,111,109,112,108,101,116,101,32,45,99,32,107,105,110,100,108,121,32,45,70,110,32,39,10,32,32,32,32,115,101,116,32,120,115,32,40,95,95,107,105,110,100,108,121,95,99,111,109,112,108,101,116,105,111,110,115,41,10,32,32,32,32,97,110,100,32,110,111,116,32,99,111,117,110,116,32,36,120,115,39,10,10,102,117,110,99,116,105,111,110,32,95,95,107,105,110,100,108,121,95,99,111,109,112,108,101,116,105,111,110,115,10,32,32,32,32,115,101,116,32,45,108,120,32,67,79,76,85,77,78,83,32,36,67,79,76,85,77,78,83,10,10,32,32,32,32,115,101,116,32,45,108,32,97,114,103,115,32,40,99,111,109,109,97,110,100,108,105,110,101,32,45,99,111,112,41,91,50,46,46,93,10,32,32,32,32,115,101,116,32,45,108,32,99,117,114,114,101,110,116,32,40,99,111,109,109,97,110,100,108,105,110,101,32,45,99,116,41,10,10,32,32,32,32,107,105,110,100,108,121,32,45,45,99,117,101,32,102,105,115,104,32,45,45,32,36,97,114,103,115,32,36,99,117,114,114,101,110,116,32,50,62,47,100,101,118,47,110,117,108,108,10,101,110,100,10]),pwsh:new Uint8Array([117,115,105,110,103,32,110,97,109,101,115,112,97,99,101,32,83,121,115,116,101,109,46,77,97,110,97,103,101,109,101,110,116,46,65,117,116,111,109,97,116,105,111,110,10,117,115,105,110,103,32,110,97,109,101,115,112,97,99,101,32,83,121,115,116,101,109,46,77,97,110,97,103,101,109,101,110,116,46,65,117,116,111,109,97,116,105,111,110,46,76,97,110,103,117,97,103,101,10,117,115,105,110,103,32,110,97,109,101,115,112,97,99,101,32,83,121,115,116,101,109,46,84,101,120,116,10,10,82,101,103,105,115,116,101,114,45,65,114,103,117,109,101,110,116,67,111,109,112,108,101,116,101,114,32,45,78,97,116,105,118,101,32,45,67,111,109,109,97,110,100,78,97,109,101,32,107,105,110,100,108,121,32,45,83,99,114,105,112,116,66,108,111,99,107,32,123,10,32,32,32,32,112,97,114,97,109,40,10,32,32,32,32,32,32,32,32,91,115,116,114,105,110,103,93,32,36,87,111,114,100,84,111,67,111,109,112,108,101,116,101,44,10,32,32,32,32,32,32,32,32,91,67,111,109,109,97,110,100,65,115,116,93,32,36,67,111,109,109,97,110,100,65,115,116,44,10,32,32,32,32,32,32,32,32,91,105,110,116,93,32,36,67,117,114,115,111,114,80,111,115,105,116,105,111,110,10,32,32,32,32,41,10,10,32,32,32,32,91,67,111,110,115,111,108,101,93,58,58,73,110,112,117,116,69,110,99,111,100,105,110,103,32,61,32,91,69,110,99,111,100,105,110,103,93,58,58,85,84,70,56,10,32,32,32,32,91,67,111,110,115,111,108,101,93,58,58,79,117,116,112,117,116,69,110,99,111,100,105,110,103,32,61,32,91,69,110,99,111,100,105,110,103,93,58,58,85,84,70,56,10,32,32,32,32,36,79,117,116,112,117,116,69,110,99,111,100,105,110,103,32,61,32,91,69,110,99,111,100,105,110,103,93,58,58,85,84,70,56,10,10,32,32,32,32,36,101,110,118,58,67,79,76,85,77,78,83,32,61,32,40,71,101,116,45,72,111,115,116,41,46,85,73,46,82,97,119,85,73,46,87,105,110,100,111,119,83,105,122,101,46,87,105,100,116,104,10,10,32,32,32,32,36,97,114,103,115,32,61,32,64,40,41,10,10,32,32,32,32,36,95,44,32,36,120,115,32,61,32,36,67,111,109,109,97,110,100,65,115,116,46,67,111,109,109,97,110,100,69,108,101,109,101,110,116,115,10,10,32,32,32,32,102,111,114,101,97,99,104,32,40,36,120,32,105,110,32,36,120,115,41,32,123,10,32,32,32,32,32,32,32,32,105,102,32,40,36,120,46,69,120,116,101,110,116,46,83,116,97,114,116,79,102,102,115,101,116,32,45,103,116,32,36,67,117,114,115,111,114,80,111,115,105,116,105,111,110,41,32,123,10,32,32,32,32,32,32,32,32,32,32,32,32,98,114,101,97,107,10,32,32,32,32,32,32,32,32,125,10,10,32,32,32,32,32,32,32,32,36,97,114,103,115,32,43,61,32,36,120,46,69,120,116,101,110,116,10,32,32,32,32,125,10,10,32,32,32,32,105,102,32,40,45,110,111,116,32,36,87,111,114,100,84,111,67,111,109,112,108,101,116,101,41,32,123,10,32,32,32,32,32,32,32,32,36,97,114,103,115,32,43,61,32,34,34,10,32,32,32,32,125,10,10,32,32,32,32,38,32,107,105,110,100,108,121,32,45,45,99,117,101,32,112,119,115,104,32,45,45,32,64,97,114,103,115,32,50,62,36,110,117,108,108,32,124,32,37,32,123,10,32,32,32,32,32,32,32,32,36,120,115,32,61,32,36,95,32,45,115,112,108,105,116,32,34,96,116,34,10,10,32,32,32,32,32,32,32,32,36,99,111,109,112,108,101,116,105,111,110,32,61,32,64,40,36,120,115,91,48,93,41,32,42,32,51,10,10,32,32,32,32,32,32,32,32,102,111,114,101,97,99,104,32,40,36,105,32,105,110,32,49,46,46,50,41,32,123,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32,40,36,120,115,91,36,105,93,41,32,123,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,36,99,111,109,112,108,101,116,105,111,110,91,36,105,93,32,61,32,36,120,115,91,36,105,93,10,32,32,32,32,32,32,32,32,32,32,32,32,125,10,32,32,32,32,32,32,32,32,125,10,10,32,32,32,32,32,32,32,32,91,67,111,109,112,108,101,116,105,111,110,82,101,115,117,108,116,93,58,58,110,101,119,40,10,32,32,32,32,32,32,32,32,32,32,32,32,36,99,111,109,112,108,101,116,105,111,110,91,48,93,44,10,32,32,32,32,32,32,32,32,32,32,32,32,36,99,111,109,112,108,101,116,105,111,110,91,49,93,44,10,32,32,32,32,32,32,32,32,32,32,32,32,91,67,111,109,112,108,101,116,105,111,110,82,101,115,117,108,116,84,121,112,101,93,58,58,80,97,114,97,109,101,116,101,114,86,97,108,117,101,44,10,32,32,32,32,32,32,32,32,32,32,32,32,36,99,111,109,112,108,101,116,105,111,110,91,50,93,10,32,32,32,32,32,32,32,32,41,10,32,32,32,32,125,10,125,10]),zsh:new Uint8Array([35,99,111,109,112,100,101,102,32,107,105,110,100,108,121,10,99,111,109,112,100,101,102,32,95,107,105,110,100,108,121,32,107,105,110,100,108,121,10,10,122,115,116,121,108,101,32,34,58,99,111,109,112,108,101,116,105,111,110,58,42,58,42,58,107,105,110,100,108,121,58,42,34,32,108,105,115,116,45,103,114,111,117,112,101,100,32,102,97,108,115,101,10,10,95,107,105,110,100,108,121,40,41,32,123,10,32,32,108,111,99,97,108,32,99,111,109,112,108,101,116,105,111,110,115,61,40,41,10,32,32,108,111,99,97,108,32,120,10,32,32,119,104,105,108,101,32,73,70,83,61,34,34,32,114,101,97,100,32,45,114,32,120,59,32,100,111,10,32,32,32,32,99,111,109,112,108,101,116,105,111,110,115,43,61,34,36,123,120,125,34,10,32,32,100,111,110,101,32,60,32,60,40,10,32,32,32,32,101,120,112,111,114,116,32,67,79,76,85,77,78,83,10,10,32,32,32,32,108,111,99,97,108,32,97,114,103,115,61,40,34,36,123,61,119,111,114,100,115,91,50,44,67,85,82,82,69,78,84,93,125,34,41,10,10,32,32,32,32,107,105,110,100,108,121,32,45,45,99,117,101,32,122,115,104,32,45,45,32,34,36,123,97,114,103,115,91,64,93,125,34,32,50,62,47,100,101,118,47,110,117,108,108,10,10,32,32,32,32,112,114,105,110,116,102,32,37,115,32,34,36,123,63,125,34,10,32,32,41,10,10,32,32,99,97,115,101,32,34,36,123,120,125,44,36,123,35,99,111,109,112,108,101,116,105,111,110,115,125,34,32,105,110,10,32,32,32,32,48,44,48,41,32,95,97,114,103,117,109,101,110,116,115,32,34,42,58,102,105,108,101,110,97,109,101,58,95,102,105,108,101,115,34,32,59,59,10,32,32,32,32,42,44,42,41,32,95,100,101,115,99,114,105,98,101,32,45,86,120,32,34,99,111,109,112,108,101,116,105,111,110,115,34,32,99,111,109,112,108,101,116,105,111,110,115,32,59,59,10,32,32,101,115,97,99,10,125,10,10,99,97,115,101,32,34,36,123,102,117,110,99,115,116,97,99,107,91,49,93,125,34,32,105,110,10,32,32,95,107,105,110,100,108,121,41,32,95,107,105,110,100,108,121,32,59,59,10,101,115,97,99,10])}};function gr(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function _r(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
`))}return i}var V=class extends Error{line;column;codeblock;constructor(e,t){let[n,r]=gr(t.toml,t.ptr),i=_r(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}};function vr(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}function yr(e,t=0,n=e.length){let r=e.indexOf(`
`,t);return e[r-1]===`\r`&&r--,r<=n?r:-1}function br(e,t){for(let n=t;n<e.length;n++){let r=e[n];if(r===`
`)return n;if(r===`\r`&&e[n+1]===`
`)return n+1;if(r<` `&&r!==` `||r===``)throw new V(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}function H(e,t,n,r){let i;for(;;){for(;(i=e[t])===` `||i===` `||!n&&(i===`
`||i===`\r`&&e[t+1]===`
`);)t++;if(r||i!==`#`)break;t=br(e,t)}return t}function xr(e,t,n,r,i=!1){if(!r)return t=yr(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let t=e[a];if(t===`#`)a=yr(e,a);else if(t===n)return a+1;else if(t===r||i&&(t===`
`||t===`\r`&&e[a+1]===`
`))return a}throw new V(`cannot find end of structure`,{toml:e,ptr:t})}function Sr(e,t){let n=e[t],r=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=r.length-1;do t=e.indexOf(r,++t);while(t>-1&&n!==`'`&&vr(e,t));return t>-1&&(t+=r.length,r.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}let Cr=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;var wr=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(Cr);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};let Tr=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Er=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Dr=/^[+-]?0[0-9_]/,Or=/^[0-9a-f]{2,8}$/i,kr={b:`\b`,t:` `,n:`
`,f:`\f`,r:`\r`,e:`\x1B`,'"':`"`,"\\":`\\`};function Ar(e,t=0,n=e.length){let r=e[t]===`'`,i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]===`\r`&&t++,e[t]===`
`&&t++);let a=0,o,s=``,c=t;for(;t<n-1;){let n=e[t++];if(n===`
`||n===`\r`&&e[t]===`
`){if(!i)throw new V(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(n<` `&&n!==` `||n===``)throw new V(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(o){if(o=!1,n===`x`||n===`u`||n===`U`){let r=e.slice(t,t+=n===`x`?2:n===`u`?4:8);if(!Or.test(r))throw new V(`invalid unicode escape`,{toml:e,ptr:a});try{s+=String.fromCodePoint(parseInt(r,16))}catch{throw new V(`invalid unicode escape`,{toml:e,ptr:a})}}else if(i&&(n===`
`||n===` `||n===` `||n===`\r`)){if(t=H(e,t-1,!0),e[t]!==`
`&&e[t]!==`\r`)throw new V(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:a});t=H(e,t)}else if(n in kr)s+=kr[n];else throw new V(`unrecognized escape sequence`,{toml:e,ptr:a});c=t}else !r&&n===`\\`&&(a=t-1,o=!0,s+=e.slice(c,a))}return s+e.slice(c,n-1)}function jr(e,t,n,r){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return r?0n:0;let i=Tr.test(e);if(i||Er.test(e)){if(Dr.test(e))throw new V(`leading zeroes are not allowed`,{toml:t,ptr:n});e=e.replace(/_/g,``);let a=+e;if(isNaN(a))throw new V(`invalid number`,{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!r)throw new V(`integer value cannot be represented losslessly`,{toml:t,ptr:n});(i||r===!0)&&(a=BigInt(e))}return a}let a=new wr(e);if(!a.isValid())throw new V(`invalid value`,{toml:t,ptr:n});return a}function Mr(e,t,n){let r=e.slice(t,n),i=r.indexOf(`#`);return i>-1&&(br(e,i),r=r.slice(0,i)),[r.trimEnd(),i]}function Nr(e,t,n,r,i){if(r===0)throw new V(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let a=e[t];if(a===`[`||a===`{`){let[o,s]=a===`[`?Lr(e,t,r,i):Ir(e,t,r,i);if(n){if(s=H(e,s),e[s]===`,`)s++;else if(e[s]!==n)throw new V(`expected comma or end of structure`,{toml:e,ptr:s})}return[o,s]}let o;if(a===`"`||a===`'`){o=Sr(e,t);let r=Ar(e,t,o);if(n){if(o=H(e,o),e[o]&&e[o]!==`,`&&e[o]!==n&&e[o]!==`
`&&e[o]!==`\r`)throw new V(`unexpected character encountered`,{toml:e,ptr:o});o+=+(e[o]===`,`)}return[r,o]}o=xr(e,t,`,`,n);let s=Mr(e,t,o-+(e[o-1]===`,`));if(!s[0])throw new V(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return n&&s[1]>-1&&(o=H(e,t+s[1]),o+=+(e[o]===`,`)),[jr(s[0],e,t,i),o]}let Pr=/^[a-zA-Z0-9-_]+[ \t]*$/;function Fr(e,t,n=`=`){let r=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new V(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++r];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new V(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let s=Sr(e,t);if(s<0)throw new V(`unfinished string encountered`,{toml:e,ptr:t});r=e.indexOf(`.`,s);let c=e.slice(s,r<0||r>a?a:r),l=yr(c);if(l>-1)throw new V(`newlines are not allowed in keys`,{toml:e,ptr:t+r+l});if(c.trimStart())throw new V(`found extra tokens after the string part`,{toml:e,ptr:s});if(a<s&&(a=e.indexOf(n,s),a<0))throw new V(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});i.push(Ar(e,t,s))}else{r=e.indexOf(`.`,t);let n=e.slice(t,r<0||r>a?a:r);if(!Pr.test(n))throw new V(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});i.push(n.trimEnd())}}while(r+1&&r<a);return[i,H(e,a+1,!0,!0)]}function Ir(e,t,n,r){let i={},a=new Set,o;for(t++;(o=e[t++])!==`}`&&o;)if(o===`,`)throw new V(`expected value, found comma`,{toml:e,ptr:t-1});else if(o===`#`)t=br(e,t);else if(o!==` `&&o!==` `&&o!==`
`&&o!==`\r`){let o,s=i,c=!1,[l,u]=Fr(e,t-1);for(let n=0;n<l.length;n++){if(n&&(s=c?s[o]:s[o]={}),o=l[n],(c=Object.hasOwn(s,o))&&(typeof s[o]!=`object`||a.has(s[o])))throw new V(`trying to redefine an already defined value`,{toml:e,ptr:t});!c&&o===`__proto__`&&Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new V(`trying to redefine an already defined value`,{toml:e,ptr:t});let[d,f]=Nr(e,u,`}`,n-1,r);a.add(d),s[o]=d,t=f}if(!o)throw new V(`unfinished table encountered`,{toml:e,ptr:t});return[i,t]}function Lr(e,t,n,r){let i=[],a;for(t++;(a=e[t++])!==`]`&&a;)if(a===`,`)throw new V(`expected value, found comma`,{toml:e,ptr:t-1});else if(a===`#`)t=br(e,t);else if(a!==` `&&a!==` `&&a!==`
`&&a!==`\r`){let a=Nr(e,t-1,`]`,n-1,r);i.push(a[0]),t=a[1]}if(!a)throw new V(`unfinished array encountered`,{toml:e,ptr:t});return[i,t]}function Rr(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}function zr(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let r={},i={},a=r,o=i;for(let s=H(e,0);s<e.length;){if(e[s]===`[`){let t=e[++s]===`[`,n=Fr(e,s+=+t,`]`);if(t){if(e[n[1]-1]!==`]`)throw new V(`expected end of table declaration`,{toml:e,ptr:n[1]-1});n[1]++}let c=Rr(n[0],r,i,t?2:1);if(!c)throw new V(`trying to redefine an already defined table or value`,{toml:e,ptr:s});o=c[2],a=c[1],s=n[1]}else{let r=Fr(e,s),i=Rr(r[0],a,o,0);if(!i)throw new V(`trying to redefine an already defined table or value`,{toml:e,ptr:s});let c=Nr(e,r[1],void 0,t,n);i[1][i[0]]=c[0],s=c[1]}if(s=H(e,s,!0),e[s]&&e[s]!==`
`&&e[s]!==`\r`)throw new V(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:s});s=H(e,s)}return r}let Br=/^[a-z0-9-_]+$/i;function Vr(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(e instanceof Date)return`date`}return t}function Hr(e){for(let t=0;t<e.length;t++)if(Vr(e[t])!==`object`)return!1;return e.length!=0}function Ur(e){return JSON.stringify(e).replace(/\x7f/g,`\\u007f`)}function Wr(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);if(t===`number`)return isNaN(e)?`nan`:e===1/0?`inf`:e===-1/0?`-inf`:r&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t===`bigint`||t===`boolean`)return e.toString();if(t===`string`)return Ur(e);if(t===`date`){if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString()}if(t===`object`)return Gr(e,n,r);if(t===`array`)return Kr(e,n,r)}function Gr(e,t,n){let r=Object.keys(e);if(r.length===0)return`{}`;let i=`{ `;for(let a=0;a<r.length;a++){let o=r[a];a&&(i+=`, `),i+=Br.test(o)?o:Ur(o),i+=` = `,i+=Wr(e[o],Vr(e[o]),t-1,n)}return i+` }`}function Kr(e,t,n){if(e.length===0)return`[]`;let r=`[ `;for(let i=0;i<e.length;i++){if(i&&(r+=`, `),e[i]===null||e[i]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);r+=Wr(e[i],Vr(e[i]),t-1,n)}return r+` ]`}function qr(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let i=``;for(let a=0;a<e.length;a++)i+=`${i&&`
`}[[${t}]]\n`,i+=Jr(0,e[a],t,n,r);return i}function Jr(e,t,n,r,i){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``,o=``,s=Object.keys(t);for(let e=0;e<s.length;e++){let c=s[e];if(t[c]!==null&&t[c]!==void 0){let e=Vr(t[c]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let s=Br.test(c)?c:Ur(c);if(e===`array`&&Hr(t[c]))o+=(o&&`
`)+qr(t[c],n?`${n}.${s}`:s,r-1,i);else if(e===`object`){let e=n?`${n}.${s}`:s;o+=(o&&`
`)+Jr(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=Wr(t[c],e,r,i),a+=`
`}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function Yr(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(Vr(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=Jr(0,e,``,t,n);return r[r.length-1]===`
`?r:r+`
`}const Xr={parse:zr,stringify:Yr,TomlDate:wr,TomlError:V},{events:Zr,fs:U,process:W,spawn:Qr}=await(async()=>globalThis.Deno?{}:{events:await import(`node:events`),fs:await import(`node:fs/promises`),process:(await import(`node:process`)).default,spawn:(await import(`node:child_process`)).spawn})(),$r=e.join(`build`,`kindly`,`handbook_runner`),ei=`kindly_handbook_runner`,ti=[e.join(`dev`,`handbook.gleam`),e.join($r,`build`,`dev`,`javascript`,ei,`handbook.mjs`)],ni=[ti,[`handbook.ts`,void 0],[`handbook.mjs`,void 0],[`handbook.js`,void 0]],ri=[`.git`,`.jj`,`biome.json`,`biome.jsonc`,`bunfig.toml`,`deno.json`,`deno.jsonc`,`erlang.mk`,`gleam.toml`,`jsconfig.json`,`jsr.json`,`jsr.jsonc`,`mix.exs`,`package.json`,`rebar.config`,`tsconfig.json`],ii=globalThis;let G=ii.Kindly;if(!G){let t=new TextDecoder(`utf-8`);if(ii.Kindly=G={should_style:ai(`NO_COLOR`)||ai(`NO_COLOUR`)?`never`:ai(`COLOR`)??ai(`COLOUR`)??`auto`,is_terminal:{stdin:(()=>{try{return W?W.stdin.isTTY:Deno.stdin.isTerminal()}catch{return!1}})(),stdout:W?W.stdout.isTTY:Deno.stdout.isTerminal(),stderr:W?W.stderr.isTTY:Deno.stderr.isTerminal()},stdin:``,version:t.decode(hr.version),description:t.decode(hr.description),min_gleam_version:t.decode(hr.min_gleam_version),project_root:Ii(),gleam_project:``,handbook_module:``},!G.is_terminal.stdin)try{for await(let e of W?W.stdin:Deno.stdin.readable)G.stdin+=t.decode(e)}catch{}let n=G.project_root,r=``;search:for(;n!==r;){for(let[t,r]of ni){if(await zi(e.join(n,t))){await oi(n),G.project_root=n,G.handbook_module=e.join(n,r??t);break search}if(G.project_root!==Ii()&&n!==qi(G.project_root)&&n!==qi(qi(G.project_root)))break search;if((await Promise.all(ri.map(t=>zi(e.join(n,t))))).some(Boolean)){let{project_root:e}=G;if(G.project_root=n,e!==Ii())break search}}r=n,n=e.dirname(n)}}function ai(e){return W?W.env[e]:Deno.env.get(e)}async function oi(t){let n=await Bi(e.join(t,`gleam.toml`),`utf-8`)??``,r=new RegExp([`(?:^|
)`,`name`,`=`,`["'](.*?)["']`,`(?:
|$)`].join(`(?: | )*`));G.gleam_project=r.exec(n)?.[1]??``}function si(e){return qe(e,void 0)}function ci(e){return G.is_terminal[e]}function li(){return G.description}function ui(){return G.version}function di(){return G.gleam_project}function fi(){return G.project_root}async function pi(){let e=await mi();if(y(e))return v(b(e)??"can’t build `handbook.gleam`");if(!G.handbook_module)return v(`no handbook to run`);try{let e=await import(t(G.handbook_module).href);if(typeof e!=`object`||!e)throw Error(`can’t run handbook`);let n;if(`main`in e&&e.main instanceof Function?n=e.main():`default`in e&&(n=e.default),!(n instanceof Object))throw Error(`can’t run handbook`);let r=`handbook`in n?n.handbook:n;if(!(r instanceof Object))throw Error(`can’t run handbook`);return`run`in r&&r.run instanceof Function?g(r.run):v(`can’t run handbook`)}catch(e){return v(e instanceof Error?e.message:`can’t run handbook`)}}async function mi(){if(!G.handbook_module.endsWith(ti[1]))return g(void 0);let t=await hi();if(y(t))return t;if(!Wi()&&!await ji(`gleam`,[`build`,`--no-print-progress`],{cwd:G.project_root}))return v("can’t build `handbook.gleam`");let n=await gi();try{let t=new TextDecoder(`utf-8`).decode(n.find(([e])=>e===`gleam.toml`)?.[1]??new Uint8Array);await Hi(e.join($r,`gleam.toml`),_i(t),420,!0),await Hi(e.join($r,`src`,`kindly_handbook_runner.gleam`),`pub fn main() { Nil }
`,420,!0),await xi(n)}catch(e){return v(e instanceof Error?e.message:"can’t build `handbook.gleam`")}let r=await Vi(e.join($r,`manifest.toml`));return y(r)?v("can’t build `handbook.gleam`\n"+b(r)):await ji(`gleam`,[`build`,`--target=javascript`,`--no-print-progress`],{cwd:$r})?g(void 0):v("can’t build `handbook.gleam`")}async function hi(){let e=G.min_gleam_version.split(`.`).map(Number);if(e.length!==3)return v(`Kindly has an unsupported Gleam version requirement`);let t=await ji(`gleam`,[`--version`],{stdout:`piped`});if(!t?.success)return v("can’t find `gleam` on `PATH`");let n=t.stdout.match(/\bgleam +v?(\d+)[.](\d+)[.](\d+)\b/);if(!n)return v("can’t determine `gleam` version");let r=[Number(n[1]),Number(n[2]),Number(n[3])];for(let t of[0,1,2]){if(r[t]>e[t])return g(void 0);if(r[t]<e[t])return v(`Kindly requires Gleam >= ${G.min_gleam_version}, but \`gleam --version\` is ${r.join(`.`)}.`)}return g(void 0)}async function gi(){let t=[`gleam.toml`,`manifest.toml`];for await(let n of Ri(e.dirname(ti[0])))t.push(n);return t.sort(),(await Promise.allSettled(t.map(async e=>[e,await Bi(e)]))).reduce((e,t)=>(`value`in t&&t.value[1]&&e.push(t.value),e),[])}function _i(e){let t=Xr.parse(e),n=vi(bi(t,`dependencies`)??{}),r=vi(bi(t,`dev_dependencies`)??bi(t,`dev-dependencies`)??{});return n[G.gleam_project]={path:`../../..`},Xr.stringify({name:ei,version:`0.0.0`,target:`javascript`,dependencies:n,dev_dependencies:r})}function vi(t){let n=structuredClone(t);for(let[t,r]of Object.entries(n)){let i=!yi(r)||typeof r.version==`string`||typeof r.git==`string`&&typeof r.ref==`string`?{path:e.join(`build`,`packages`,t)}:r;if(typeof i.path==`string`){let r=e.resolve(G.project_root,i.path),a=e.join(G.project_root,$r);i.path=Xi(e.relative(a,r)),n[t]=i}}return n}function yi(e){return typeof e==`object`&&!Array.isArray(e)&&!(e instanceof Date)}function bi(e,t){let n=e[t];return n&&yi(n)?n:void 0}async function xi(t){let n=e.join(`..`,`..`,`..`,`dev`),r=e.join($r,`dev`);try{if(await(U?U.readlink:Deno.readLink)(r)===n)return}catch{}try{U?await U.symlink(n,r,`dir`):await Deno.symlink(n,r,{type:`dir`});return}catch{}let i=e.dirname(ti[0]),a=i+e.sep;await Promise.all(t.map(([t,n])=>t===i||t.startsWith(a)?Hi(e.join($r,t),n,420,!0):Promise.resolve(g(!1))))}function Si(e){let t=new TextDecoder(`utf-8`).decode(hr.completion[e]);return t?g(t):v(void 0)}function Ci(e){return!e.startsWith(`-`)&&/^\S+$/.test(e)}function wi(){let e=0;try{e=(W?W.stdout:Deno.consoleSize()).columns??0}catch{}return e||=parseInt(ai(`COLUMNS`)??`80`),e>0?e:80}function Ti(e){let t=ai(e);return t===void 0?v(t):g(t)}function Ei(e,t){W?W.env[e]=t:Deno.env.set(e,t)}function Di(e){W?delete W.env[e]:Deno.env.delete(e)}function Oi(){return Math.floor(globalThis.performance.now())}function ki(){let e=W?W.argv.slice(2):Deno.args;if(G.stdin&&!e.includes(`--`)){let t=RegExp([`"((?:\\\\"|[^"])*?)"`,`'((?:\\\\'|[^'])*?)'`,`(\\S+)`].join(`|`),`g`);e=e.concat(e.length?`--`:[],G.stdin.match(t)??[])}return a(e)}function K(e,t,...n){if(G.should_style===`never`||G.should_style!==`always`&&!ci(`stdout`)||(t=typeof t==`number`?[t]:t,n=[...t,...n],!n.length))return e;let r=n.length?`\x1B[`+n.join(`;`)+`m`:``,i=`\x1B[m\x1B[K`;return r+e+(e.endsWith(i)?``:i)}async function Ai(e,t,...n){return t=typeof t==`string`?[t]:t,n=[...t,...n],(await ji(e,n))?.success?g(void 0):v(void 0)}async function ji(e,t,n={}){n.cwd??=`.`,n.stdin??=`inherit`,n.stdout??=`inherit`,n.stderr??=`inherit`;let{cwd:r,stdin:i,stdout:a,stderr:o}=n,s={code:1,stderr:``,stdout:``,success:!1},c=new TextDecoder(`utf-8`),l=()=>void 0;Zr&&W?W.on(`SIGINT`,l):Deno.addSignalListener(`SIGINT`,l);try{if(Qr)return await new Promise(n=>{let l=Qr(e,t,{cwd:r,env:W.env,stdio:[i===`null`?`ignore`:i,a===`piped`?`pipe`:a,o===`piped`?`pipe`:o],windowsHide:!0});l.stderr?.on(`data`,e=>{s.stderr+=c.decode(e)}),l.stdout?.on(`data`,e=>{s.stdout+=c.decode(e)}),l.on(`close`,e=>{s.code=e??1,s.success=!s.code,n(e===null?void 0:s)})});let n=await new Deno.Command(e,{args:t,cwd:r,env:Deno.env.toObject(),stdin:i,stdout:a,stderr:o}).output();return s.code=n.code,o===`piped`&&(s.stderr=c.decode(n.stderr)),a===`piped`&&(s.stdout=c.decode(n.stdout)),s.success=n.success,s}catch{return}finally{Zr&&W?W.off(`SIGINT`,l):Deno.removeSignalListener(`SIGINT`,l)}}function q(e){throw W?W.exit(e):Deno.exit(e),Error(`unreachable`)}async function Mi(e){try{return Ni(await e())}catch(e){return console.error(K(`error`,1,31)+K(`: `+String(e instanceof Error?e.message:e),1)),v(void 0)}}function Ni(e){if(!Pi(e))throw Error(`Expected return type to be Result<Nil, Nil>`);return e.isOk()?g(void 0):v(void 0)}function Pi(e){if(typeof e!=`object`||!e||!(`isOk`in e)||typeof e.isOk!=`function`)return!1;try{let t=e.isOk();return t===!0||t===!1}catch{return!1}}async function Fi(e,t){console.log(e);let{createInterface:n}=await import(`node:readline`),{default:{stdin:r,stderr:i}}=await import(`node:process`);try{e=`> `;let a=n({input:r,output:i,prompt:e});return await new Promise(n=>{let r=()=>{console.error(),n(v(void 0))};a.once(`close`,r),a.once(`SIGINT`,()=>a.close()),a.once(`line`,o=>{o||(o=t,i.write(`\x1B[1A`+e+o+`
`)),a.off(`close`,r),a.close(),n(g(o))}),a.prompt()})}catch{return v(void 0)}}function Ii(){return(W||Deno).cwd()}function Li(e){try{return g((W||Deno).chdir(e))}catch(e){return v(String(e instanceof Error?e.message:e))}}async function*Ri(t){let n=await(U?U.readdir(t,{withFileTypes:!0}):Deno.readDir(t));for await(let r of n){let n=e.join(t,r.name);(typeof r.isDirectory==`boolean`?r.isDirectory:r.isDirectory())?yield*Ri(n):yield n}}async function zi(e){try{return(await(U?U.open(e,`r`):Deno.open(e,{read:!0}))).close(),!0}catch{return!1}}async function Bi(e,t){try{let n=await(U?U.readFile(e):Deno.readFile(e)),r=new Uint8Array(n);return t===void 0?r:new TextDecoder(t).decode(r)}catch{return}}async function Vi(e){try{await(U?U.rm(e):Deno.remove(e))}catch(e){if(!(U?e instanceof Error&&`code`in e&&e.code===`ENOENT`:e instanceof Deno.errors.NotFound))return v(String(e))}return g(void 0)}function Hi(t,n,r,i){return Ui(async()=>{await(U||Deno).mkdir(e.dirname(t),{recursive:!0,mode:493}),await(U?U.writeFile(t,n,{flag:i?`w`:`wx`}):Deno.writeTextFile(t,typeof n==`string`?n:new TextDecoder(`utf-8`).decode(n),{create:!0,createNew:!i})),await(U||Deno).chmod(t,r)})}async function Ui(e){try{return await e(),g(!0)}catch(e){return(U?e.code===`EEXIST`:e instanceof Deno.errors.AlreadyExists)?g(!1):v(void 0)}}function Wi(){return Gi().endsWith(`/gleam.main.mjs`)}function Gi(){return W?W.argv[1]??``:Deno.mainModule}function Ki(){return`Deno`in globalThis}function qi(t){return e.dirname(t)}function Ji(t){return e.isAbsolute(t)}function Yi(t){return e.join(...t)}function Xi(t){return e.normalize(t)}const Zi=`src/kindly.gleam`;var J=class extends n{constructor(e,t,n,r,i,a,o,s,c,l,u){super(),this.cue=e,this.help=t,this.new=n,this.time=r,this.all_tags=i,this.any_tags=a,this.action_args=o,this.has_tags=s,this.has_any=c,this.has_end=l,this.errors=u}},Qi=class extends n{constructor(e,t,n){super(),this.doc=e,this.tag=t,this.tasks=n}},$i=class extends n{constructor(e){super(),this[0]=e}},ea=class extends n{constructor(e){super(),this[0]=e}},ta=class extends n{constructor(e,t,n,r){super(),this.name=e,this.tasks=t,this.theme=n,this.run=r}},na=class extends n{constructor(e,t,n,r,i,a,o,s,c){super(),this.highlight=e,this.heading=t,this.tag=n,this.first_tag=r,this.given_tag=i,this.flag=a,this.parameter=o,this.time=s,this.tab=c}};const ra=(e,t,n,r,i,a,o,s,c)=>new na(e,t,n,r,i,a,o,s,c),ia=e=>e instanceof na,aa=e=>e.highlight,oa=e=>e.highlight,sa=e=>e.heading,ca=e=>e.heading,la=e=>e.tag,ua=e=>e.tag,da=e=>e.first_tag,fa=e=>e.first_tag,pa=e=>e.given_tag,ma=e=>e.given_tag,ha=e=>e.flag,ga=e=>e.flag,_a=e=>e.parameter,va=e=>e.parameter,ya=e=>e.time,ba=e=>e.time,xa=e=>e.tab,Sa=e=>e.tab;var Ca=class extends n{constructor(e,t,n,r){super(),this.doc=e,this.tags=t,this.action=n,this.group_doc=r}};const wa=(e,t,n,r)=>new Ca(e,t,n,r),Ta=e=>e instanceof Ca,Ea=e=>e.doc,Da=e=>e.doc,Oa=e=>e.tags,ka=e=>e.tags,Aa=e=>e.action,ja=e=>e.action,Ma=e=>e.group_doc,Na=e=>e.group_doc;var Pa=class extends n{};const Fa=()=>new Pa,Ia=e=>e instanceof Pa;var La=class extends n{};const Ra=()=>new La,za=e=>e instanceof La;var Ba=class extends n{};const Va=()=>new Ba,Ha=e=>e instanceof Ba,Ua=`Print shell completions`,Wa=`Make a new handbook`,Ga=`Print help information`,Ka=a([[`--help`,Ga],[`--new `,Wa],[`--cue `,Ua]]),qa=`Pass further arguments to all selected tasks`,Ja=a([[`-- `,qa],[`--any `,`Filter tasks for any of the following tags`],[`--help`,Ga],[`--time`,`Print time elapsed`],[`--new `,Wa],[`--cue `,Ua]]),Ya=a([[`-- `,`Print completions for further arguments`],[`--help`,`Print help information for completions`]]),Xa=a([[`bash`,`Print a bash completion script`],[`fish`,`Print a fish completion script`],[`pwsh`,`Print a pwsh completion script`],[`zsh `,`Print a zsh completion script`]]);function Za(e){return ar(e)}function Y(e){let t;return t=Gn(Wn()),or(e,t)}function Qa(e,t,n,r){for(;;){let a=e,o=t,c=n,l=r,u=a[0],d=a[1];if(o instanceof s)return N(k(u),`
`);{let a=o.head,f=o.tail,p;p=Y(a);let m=p,h=d+m+1,g;if(u instanceof s)g=[i(c+a,u),Za(c)+m];else if(h<=l){let e=u.head,t=u.tail;g=[i(e+` `+a,t),h]}else g=[i(c+a,u),Za(c)+m];e=g,t=f,n=c,r=l}}}function $a(){return et(Sn(xn(Ti(`KINDLY_MAX_WIDTH`),Kt),64),16)}function X(e,t){let n;n=tt($a(),wi());let r=n,i=e=>jt(e,`\xA0`,` `);return yn(Y(e)<=r,i(e),()=>{let n=Pt(e,` `);if(n instanceof s)return``;{let e=n.head,o=n.tail;return i(Qa([a([e]),Y(e)],o,t,r))}})}function Z(e){let t;t=K(`error`,a([1,31]));let n=t,r;return r=K(`: `+e,a([1])),pn(X(n+r,``))}function eo(e){return"`"+K(e,a([1,34]))+"`"}function Q(e){return!e}function to(e,t){return Fi(`
`+X(e,``),t)}function no(e,t){return _n(t?to(e+`\xA0(Y/n)`,`y`):to(e+`\xA0(y/N)`,`n`),e=>{let n=$t(Ut(e)),r;return r=t?e=>Q(on(e,`n`)):e=>on(e,`y`),new h(r(n))})}function ro(){return`
`+K(`Overwrite?`,a([1,31]))}function io(){return K(`TypeScript`,a([1,34]))}function ao(){return K(`Gleam`,i(1,a([38,5,219])))}function oo(){let e=fi(),t=e=>(pn(``),Z(e));return vn(no(`It looks like `+eo(e)+` is your project’s root directory. Is\xA0that\xA0OK?`,!0),n=>vn(n?I(new h(e)):to(`What is your project’s root directory?`,``),e=>R(e===``,()=>I(new _(t(`can’t proceed without a project root directory`))),()=>{let n;n=Ji(e)?e:Yi(a([Ii(),e]));let r=n;return L(zi(r),e=>R(Q(e),()=>I(new _(t(`project root directory is unreadable`))),()=>L(oi(r),e=>vn((()=>{let e=di();return e===``?to(`What is your project’s name?`,`new project`):I(new h(e))})(),e=>vn(di()===``?I(new h(!1)):no(`It looks like you can write your handbook in `+ao()+`. Is\xA0that\xA0OK?`,!0),n=>vn(n?I(new h(!1)):no(`It looks like you can write your handbook in `+io()+`. Is\xA0that\xA0OK?`,!0),i=>L(zi(Yi(a([r,`handbook.js`]))),o=>{let s,c;c=a(n?[r,`dev`,`handbook.gleam`]:i?[r,`handbook.ts`]:o?[r,`handbook.js`]:[r,`handbook.mjs`]),s=Yi(c);let l=s;return L(zi(l),r=>vn(r?no(`The file `+eo(l)+` already exists.`+ro(),!1):I(new h(!0)),r=>R(Q(r),()=>I(new _(t(`can’t proceed without overwriting existing file`))),()=>{let r=Ki();return L((()=>{let t;return t=n?`import kindly.{type Handbook, task}
pub fn main() -> Handbook {
kindly.handbook(for: "{{project}}")
|> task(
doc: "Print a greeting",
tags: ["hi"],
action: kindly.just(run: "echo", with: ["Welcome to your new handbook!"]),
)
}
`:r?jt(`import kindly from "{{module}}";
export default kindly.handbook({ for: "{{project}}" })
.task({
doc: "Print a greeting",
tags: ["hi"],
action: kindly.just("echo", "Welcome to your new handbook!"),
});
`,`{{module}}`,`jsr:@tynanbe/kindly@1`):jt(`import kindly from "{{module}}";
export default kindly.handbook({ for: "{{project}}" })
.task({
doc: "Print a greeting",
tags: ["hi"],
action: kindly.just("echo", "Welcome to your new handbook!"),
});
`,`{{module}}`,`@tynanbe/kindly`),Hi(l,jt(t,`{{project}}`,e),420,!0)})(),e=>R(!x(e,new h(!0)),()=>I(new _(t(`failed writing handbook`))),()=>I(new h(F(N(a([``,K(`Success!`,a([1,32])),``,`Your new handbook module is `+eo(l)]),`
`))))))})))})))))))})))}function so(e,t){return L(e,e=>{if(e instanceof h){let n=e[0];return t(n)}else return q(1)})}function co(e){let t;return t=tt($a(),wi()),t-Y(e)<16}function lo(e,t){return i(t.heading(`Flags`),A(e,e=>{let n=e[0],r=e[1],i=zt(` `,Y(n)),a=t.tab+i+t.tab;return Q(co(a))?X(t.tab+t.flag(n)+t.tab+r,a):`
`+t.flag(n)+`
`+X(` `+r,` `)}))}function uo(e,t){let n;n=t.highlight(`kindly`);let r=n,i;i=t.flag(`...flags?`);let o=i,s;s=t.parameter(`...arguments?`);let c=s,l;l=e===``?e:` `+e;let u=l;return a([t.heading(`Usage`),Q(co(t.tab))?X(t.tab+r+u+` `+o+` `+c,t.tab+t.tab):`
`+X(r+u+` `+o+` `+c,` `)])}function fo(e){let t;t=K(e.highlight(`kindly`),a([3]));let n=t,r;r=K(`v`+ui(),a([3]));let i=r,o,s=li();o=K(e.flag(s),a([3]));let c=o;return a([X(n+` `+i,``),Q(co(e.tab))?X(e.tab+c,e.tab):`
`+X(` `+c,` `)])}function $(e){return t=>K(t,e)}function po(){return new na($(a([1,36])),$(a([1,95])),$(a([33])),$(a([1])),$(a([3])),$(a([32])),$(a([34])),$(a([1,3,90])),` `)}function mo(e,t){let n;n=Et(k(Yt(P(Oi()-e))),3);let r=n,i=r[0],o=r[1],s;s=Ht(Lt(k(j(_t(kt(o,3),a([`,`]))))),1,`0`);let c=s,l;l=Ht(Lt(k(i)),3,`0`);let u=l,d,f=`All done in `+c+`.`+u+` seconds`;return d=X(t.time(f),``),F(`
`+d)}function ho(){return I(new _(void 0))}function go(e,t,n,r){if(t instanceof s)return I(e);{let i=t.tail,o=t.head.doc,c=t.head.tags,l=t.head.action,u=r.theme,d=e[0],f=e[1],p=d+1,m,g;g=i instanceof s&&p===1?``:` `+P(p);let _=(e=>`Task`+e+`:`)(g);m=K(u.heading(_),a([3]));let v=m,y,b;if(o===``){let e=B(c);if(e instanceof s)b=` Unknown`;else{let t=e.head;b=` `+Wt(t)}}else b=` `+o;y=K(b,a([3]));let x=y,ee;return ee=X(v+x,``),F(`
`+ee),L(Li(fi())instanceof h?Mi(()=>l(n,r.tasks)):ho(),e=>{let t;return e instanceof h?t=[p,f]:(Z(`task failed`),t=[p,f+1]),go(t,i,n,r)})}}function _o(e,t,n){let r=n.theme,i;i=K(r.highlight(`Kindly`),a([3]));let o=i,s,c,l=P(it(e));c=l===`1`?`a task`:l+` tasks`;let u=(e=>` running `+e+` for `)(c);s=K(r.heading(u),a([3]));let d=s,f,p=n.name;f=K(r.highlight(p),a([3]));let m=f;return F(X(o+d+m,``)),gn(go([0,0],e,t.action_args,n),e=>{let t=e[0],n=e[1];return n===0?new h(void 0):t>1?new _((()=>{pn(``);let e,r=P(t),i=P(n);if(r===`2`&&i===`2`)e=`both tasks failed`;else{let t=r;if(t===i)e=`all `+t+` tasks failed`;else{let t=r;e=i+` of `+t+` tasks failed`}}return Z(e)})()):new _(void 0)})}function vo(e,t){let n=t-Za(e);return n>0?zt(` `,n)+e:e}function yo(e,t,n,r){return yn(x(e,a([])),a([a([r.tab+`None. The plan is empty!`])]),()=>{let i=e=>n===1?`· `:P(e)+`: `,o;o=Y(i(n));let c=o,l=r.tab+zt(` `,c),u,d=t.all_tags;u=pr(d,t.any_tags);let f=u,p=e=>{if(sr(f,e)){let t=e;return r.given_tag(t)}else return K(e,a([2]))};return ut(e,(e,t)=>{let n=e.doc,o=e.tags,u,d=(e=>Q(co(l))?vo(e,c):e)(i(t+1));u=K(r.heading(d),a([3]));let f=u,m,h=B(o);if(h instanceof s)m=``;else{let e=h.head,t=h.tail,n=p(e),i=r.first_tag(n);m=M(t,r.tag(i),(e,t)=>{let n=p(t);return(t=>e+`, `+t)(r.tag(n))})}let g=m;return Q(co(l))?a([X(r.tab+f+n,l),X(l+r.tab+g,l+r.tab)]):a([`
`+X(f+n,``),X(` `+g,` `)])})})}function bo(e,t){let n=t.theme,r=M(t.tasks,z(),(e,t)=>{let n=t.tags,r=B(n);if(r instanceof s)return e;{let t=r.head;return lr(e,t)}}),a=e=>A(B(e),e=>{let t;if(sr(r,e)){let r=e;t=n.first_tag(r)}else t=e;let i=t;return n.tag(i)}),o=e.all_tags;return N(ft(a(o),(()=>{let t=(()=>{let t=e.any_tags;return a(t)})();if(t instanceof s)return t;{let e=t;return i(n.flag(`--any`),e)}})()),` `)}function xo(e,t,n){let r=n.theme,i;i=it(e);let o=i,s,c=P(o);s=c===`1`?`a task`:c+` tasks`;let l=s,u,d=n.name;u=r.highlight(d);let f=u;return a([fo(r),a([``]),uo(bo(t,n),r),a([``]),lo(Ja,r),a([``]),a([(()=>{let e=`Planning `+l+` for `+f;return X(r.heading(e),``)})()]),j(yo(e,t,o,r))])}function So(e){let t,n=At(e,ur);t=n instanceof h?n[0]:z();let r=t,o=M(k(e),a([]),(e,t)=>{let n=B(cr(t,r));return n instanceof s?e:i(new ea(n),e)}),c=B(r);return c instanceof s?o:x(o,a([]))?a([new ea(c)]):i(new $i(c),o)}function Co(e,t){let n=t-Za(e);return n>0?e+zt(` `,n):e}function wo(e,t){for(;;){let n=e,r=t;if(r instanceof s)return A(k(n),e=>new Qi(e.doc,e.tag,(()=>{let t=e.tasks;return k(t)})()));{let o=r.tail,c=r.head.doc,l=r.head.tags,u=r.head.group_doc,d,f=B(l);if(f instanceof s)d=n;else{let e=f.head,t=f.tail,r;r=z(t);let o=r,l;l=u instanceof w?u[0]:c;let p=l;if(n instanceof s)d=i(new Qi(p,e,a([o])),n);else{let t=n.head;if(p===t.doc&&e===t.tag){let e=n.tail;d=i(new Qi(t.doc,t.tag,i(o,t.tasks)),e)}else d=i(new Qi(p,e,a([o])),n)}}e=d,t=o}}}function To(e){let t=e.theme,n;n=wo(a([]),e.tasks);let r=n;return yn(x(r,a([])),a([t.tab+`None. The handbook is empty!`]),()=>{let e=M(r,0,(e,t)=>{let n=t.tag;return et(Y(n),e)}),n=t.tab+zt(` `,e)+t.tab;return mt(r,r=>{let a=r.doc,o=r.tag,s=r.tasks,c,l=P(it(s));if(l===`1`)c=``;else{let e=` (`+l+`)`;c=t.heading(e)}let u=c,d,f=Co(o,e),p=t.first_tag(f);d=(e=>Q(co(n))?X(t.tab+e+t.tab+a+u,n):`
`+e+`
`+X(` `+a+u,` `))(t.tag(p));let m=d,h=n+t.tab,g;g=Q(co(h))?h:``;let _=g;return i(m,A(So(s),e=>{let n;n=e instanceof $i?[`∩ `,e[0]]:[`· `,e[0]];let r=n,i=r[0],a=r[1];return(e=>X(_+t.heading(i)+e,_+` `))(N(A(a,t.tag),`, `))}))})})}function Eo(e){let t=e.theme,n,r=e.name;n=t.highlight(r);let i=n;return a([fo(t),a([``]),uo(t.tag(`...tags?`),t),a([``]),lo(Ja,t),a([``]),a([(()=>{let e=`Task menu for `+i;return X(t.heading(e),``)})()]),To(e)])}function Do(e,t,n){let r;r=e instanceof s?[Eo(n),Q(t.has_tags)]:[xo(e,t,n),!0];let i=r,a=i[0],o=i[1],c;c=N(j(a),`
`);let l=c,u;return o?u=new h(F(l)):(Z(`no tasks to run
`),u=new _(pn(l))),I(u)}function Oo(e,t,n,r){for(;;){let i=e,a=t,o=n,c=r;if(a instanceof s)return i;{let s=a.head;if(s===`\x1B`){let c=a.tail;e=i+s,t=c,n=o,r=!0}else if(c){let s=a.head,c=a.tail,l,u=Mt(s,`@`),d=Mt(s,`~`);l=u instanceof E?!0:d instanceof $e;let f=l;e=i+s,t=c,n=o,r=f}else{let s=a.head,c=a.tail,l=i+s;if(Y(l)<=o)e=l,t=c,n=o,r=!1;else return i}}}}function ko(e,t){return(e=>Oo(``,e,t,!1))(Yt(e))+`\x1B[m\x1B[K`}function Ao(e,t){let n,r=t.all_tags;n=pr(r,t.any_tags);let i=n,o=Q((()=>{let e=t.all_tags;return mr(e)})()),c=st(e,e=>{let n=e.tags;return(()=>{let e=t.all_tags;return fr(e,n)})()&&(()=>{let e=t.any_tags;return dr(e,n)})()}),l;l=c instanceof s?o?c:e:c;let u=M(l,[Me(),Me()],(e,t)=>{let n=e[0],r=e[1],a=t.doc,o=t.tags,c=t.group_doc,l=B(o);if(l instanceof s)return[n,r];{let e=l.head,t=l.tail,o;return o=sr(i,e)?n:Qe(n,e,e=>e instanceof w?[e[0][0],e[0][1]+1]:[qe(c,a),1]),[o,M(t,r,(e,t)=>sr(i,t)?e:Qe(e,t,e=>e instanceof w?[``,e[0][1]+1]:[a,1]))]}}),d=u[0],f=u[1],p;p=Ze(f,(e,t)=>Q(Pe(d,e)));let m=p;return j(A(a([A(Ye(d),e=>{let t,n,r;t=e[0],n=e[1][0],r=e[1][1];let i;return i=r===1?``:`: `+P(r)+` tasks`,[t,n+i]}),A(Ye(m),e=>{let t,n,r;t=e[0],n=e[1][0],r=e[1][1];let i;return i=r===1?n:P(r)+` tasks`,[t,i]})]),e=>wt(e,(e,t)=>Mt(e[0],t[0]))))}function jo(e){let t=e.cue,n=e.help,r=e.new,i=e.time,o=e.action_args,c=e.has_tags,l=e.has_any,u=e.has_end,d=e.errors,f;f=B(d);let p=f,m;m=j(a([t instanceof w?c||l||r||i?a(["can’t run `--cue` with other flags or tags"]):t[0]instanceof T&&!n&&!u?a(["can’t run `--cue` without any arguments"]):a([]):a([]),(()=>{if(t instanceof w){let e=t[0];if(e instanceof w){let t=e[0];return a(t!==`bash`&&t!==`fish`&&t!==`pwsh`&&t!==`zsh`?["can’t run `--cue` for `"+t+"`, try `bash`, `fish`, `pwsh`, or `zsh`"]:[])}else return a([])}else return a([])})(),r&&(c||l||!(t instanceof T)||i||!x(o,a([])))?a(["can’t run `--new` with other arguments"]):a([]),p]));let g=m;return g instanceof s?new h(e):new _(Dt(g,Z))}function Mo(e,t,n){for(;;){let r=e,i=t,o=n,c=r.all_tags,l=r.any_tags,u=r.has_any,d=r.has_end;if(i instanceof s)return jo(r);if(d)e=new J(r.cue,r.help,r.new,r.time,r.all_tags,r.any_tags,i,r.has_tags,r.has_any,r.has_end,r.errors),t=a([]),n=o;else{let a=i.head;if(a===`--cue`){let a=i.tail;if(a instanceof s)e=new J(new w(new T),r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors),t=a,n=o;else{let i=a.head;if(i.charCodeAt(0)===45)e=new J(new w(new T),r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors),t=a,n=o;else{let s=i,c=a.tail;e=new J(new w(new w(s)),r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors),t=c,n=o}}}else{let s=a,d=i.tail,f;if(s===`--`)f=new J(r.cue,r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,!0,r.errors);else if(s===`--any`)f=new J(r.cue,r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,!0,r.has_end,r.errors);else if(s.startsWith(`--cue=`))f=new J(new w(new w(s.slice(6))),r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors);else if(s===`--help`)f=new J(r.cue,!0,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors);else if(s===`--new`)f=new J(r.cue,r.help,!0,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors);else if(s===`--time`)f=new J(r.cue,r.help,r.new,!0,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,r.errors);else{let e=s,t=t=>{let n="tag `"+e+"` "+t;return new J(r.cue,r.help,r.new,r.time,r.all_tags,r.any_tags,r.action_args,r.has_tags,r.has_any,r.has_end,(()=>{let e=r.errors;return lr(e,n)})())},n=Q(Ci(e)),i;if(o instanceof w){let t=o[0];i=Q(sr(t,e))}else i=!1;let a=i,d;d=n?t("can’t start with `-`, contain blank space, or be empty"):a?t(`isn’t in your handbook`):r;let p=d;if(u){let t=e;f=new J(p.cue,p.help,p.new,p.time,p.all_tags,lr(l,t),p.action_args,!0,p.has_any,p.has_end,p.errors)}else{let t=e;f=new J(p.cue,p.help,p.new,p.time,lr(c,t),p.any_tags,p.action_args,!0,p.has_any,p.has_end,p.errors)}}e=f,t=d,n=o}}}}function No(e,t){let n;if(t instanceof w){let e=t[0].tasks;n=M(e,[new w(z()),z(),0],(e,t)=>{let n=e[0],r=e[1],i=e[2],a;a=Je(n,e=>pr(e,t.tags));let o=a,s=M((()=>{let e=t.tags;return B(e)})(),r,(e,t)=>Q(Ci(t))?lr(e,t):e),c;return c=(()=>{let e=t.doc;return an(e,`
`)})()||(()=>{let e=t.doc;return an(e,`\r`)})()?i+1:i,[o,s,c]})}else n=[new T,z(),0];let r=n,i=r[0],o=r[1],c=r[2],l;l=A(j(a([(()=>{let e=B(o);return e instanceof s?e:a([a(["handbook tags can’t start with `-`, contain blank space, or be empty",`choose different tags for: `+N(A(e,e=>"`"+e+"`"),`, `)])])})(),a(c===0?[]:[a(["handbook docs can’t contain `\\n` or `\\r`",`revise docs for `+P(c)+` of your tasks`])])])),e=>N(e,`
`));let u=l;return u instanceof s?Mo(new J(new T,!1,!1,!1,z(),z(),a([]),!1,!1,!1,z()),e,i):new _(Dt(u,Z))}function Po(e,t,n){return xn((()=>{let e=(()=>{let e=t.action_args;return k(e)})();if(e instanceof s)return new _(Z(N(a(["can’t run `--cue --` without any further arguments",`hint: an empty string '' should represent a blank, incomplete word`]),`
`)));{let t=e.tail;if(t instanceof s){let t=e.head;return new h([a([]),t,new T])}else{let n=e.head,r=t.head,a=t.tail;return new h([k(i(r,a)),n,new w(r)])}}})(),t=>{let r=t[0],o=t[1],c=t[2],l,u=sn(o,`=`);if(u instanceof h){let e=u[0][0];if(e.startsWith(`--`)){let t=e,n=u[0][1];l=[ft(r,a([t])),n,new w(t),!0]}else l=[r,o,c,!1]}else l=[r,o,c,!1];let d=l,f=d[0],p=d[1],m=d[2],g=d[3],v;v=m instanceof w&&m[0]===`--cue`?[ft(f,a([`bash`])),!0]:[f,!1];let y=v,b=y[0],ee=y[1];return xn(No(b,new w(n)),t=>{let r=t,o=t.cue,c=t.help,l=t.new,u=t.time,d=r.has_tags,f=r.has_any,v=r.has_end;return R(c&&(!(o instanceof T)||l),()=>new _(Z(`can’t accept any further arguments`)),()=>R(v,()=>new h(void 0),()=>{let t=wi(),v;v=n.tasks instanceof s?Ka:Ja;let y=v,b=M((()=>{if(!(o instanceof T))return j(a([Xa,Ya]));if(p.charCodeAt(0)===45)return y;{let e=(()=>{let e=n.tasks;return Ao(e,r)})();return e instanceof s?y:ft(e,a([[`--`,qa]]))}})(),[a([]),0,0],(n,r)=>{let a=n,s=n[0],h=n[1],_=n[2],v=r[0],y=r[1],b;b=Ut(v);let S=b;return yn((S===`--help`?g?!0:c:S===`--`?l?!0:g:S===`--any`?l?!0:f:S===`--cue`?l?!0:d||f||u:S===`--new`?l?!0:d||f||!(o instanceof T)||u:S===`--time`?l?!0:u:l?!0:!(o instanceof T)&&!ee)||Q(on(S,p)),a,()=>{let n;n=m instanceof w&&g&&!x(e,new w(`bash`))?m[0]+`=`+S:S;let r=n,a;a=et(Y(r),h);let o=a,c;c=tt(et(Za(r+` (`+y+`)`),_),t);let l=c;return[i([r,y],s),o,l]})}),S=b[0],te=b[1],ne=b[2],re;re=S instanceof s||S.tail instanceof s?!1:ne-te>19;let ie=re,ae=A(k(S),t=>{let n=t[0],r=t[1],i;if(e instanceof w){let t=e[0];if(t===`bash`&&ie){let e;e=Za(n);let t=ne-e,a=` (`+r+`)`;i=Y(a)>t?n+ko(a,t-2)+`…)`:n+vo(a,t)}else if(t===`pwsh`&&ie){let e;e=Za(n);let t=ne-e,a=` (`+r+`)`;i=Y(a)>t?n+ko(a,t-2)+`…)`:n+vo(a,t)}else if(t===`zsh`&&ie){let e=e=>jt(e,`:`,`\\:`);i=e(n)+`:`+e(r)}else i=ie?n+` `+r:n}else i=ie?n+` `+r:n;let a=i;return e instanceof w&&e[0]===`pwsh`?n+` `+a+` `+r:a});return ae instanceof s?new _(Z(`no more completions`)):new h(F(N(ae,`
`)))}))})})}function Fo(e,t){return i(t.heading(`Description`),Q(co(t.tab))?A(_t(e,``),e=>X(t.tab+e,t.tab)):A(e,e=>`
`+X(e,``)))}function Io(e,t){let n;n=e instanceof w?e[0]:`shell?`;let r=n;return F(N(j(a([fo(t),a([``]),uo(t.flag(`--cue`)+` `+t.parameter(r),t),a([``]),Fo(a([`Print tab completions for the given shell.`,"When no end flag (`--`) is given, a script is printed for the given shell to obtain completions from `kindly`.","With an end flag, any further arguments are seen as what would be given to `kindly`, and used to generate completions for the given shell.",`If the end flag is given without a shell, default output is printed with an argument and description per line, separated by a tab.`]),t),a([``]),lo(Ya,t),a([``]),a([t.heading(`Shells`)]),A(Xa,e=>{let n=e[0],r=e[1],i=zt(` `,Y(n)),a=t.tab+i+t.tab;return Q(co(a))?X(t.tab+t.parameter(n)+t.tab+r,a):`
`+t.parameter(n)+`
`+X(` `+r,` `)})])),`
`))}function Lo(e,t){let n=e.cue,r=e.help,i=e.has_end;if(r)return new h(Io(qe(n,new T),t.theme));if(n instanceof w)if(i){let r=n[0];return Po(r,e,t)}else{let e=n[0];if(e instanceof w){let t=e[0];return bn(Si(t),F)}else return new h(void 0)}else return new h(void 0)}function Ro(e){return so(I(No(ki(),new w(e))),t=>{let n=t,r=t.time,i=t.has_tags,o=n.help||Q(i),s=new ta(e.name,A(e.tasks,e=>new Ca((()=>{let t=e.doc;return Ut(t)})(),e.tags,e.action,(()=>{let t=e.group_doc;return Je(t,Ut)})())),e.theme,e.run);return R(!(n.cue instanceof T),()=>q(Lo(n,s)instanceof h?0:1),()=>{let e=st(s.tasks,e=>{let t=e.tags;return(()=>{let e=n.all_tags;return fr(e,t)})()&&(i&&(()=>{let e=n.any_tags;return mr(e)})()||Q((()=>{let e=n.any_tags;return dr(e,t)})()))});return R(x(e,a([]))&&Q(o),()=>(Z(`no tasks to run`),q(1)),()=>{let t=Oi();return L(o?Do(e,n,s):_o(e,n,s),e=>(r&&mo(t,s.theme),q(e instanceof h?0:1)))})})})}function zo(e){return new ta(e.name,e.tasks,e.theme,()=>Ro(e))}function Bo(e){let t;return t=e instanceof Pa?`stdin`:e instanceof La?`stdout`:`stderr`,ci(t)}function Vo(e){return zo(new ta(e,a([]),po(),Ho))}function Ho(){return so(I(No(ki(),new T)),e=>{let t=e,n=e.cue,r=e.help,i=e.new,o;o=ht(a([new Pa,new La,new Ba]),Bo);let s=o,c=()=>F(N(fo(po()),`
`));return R(i,()=>s?(c(),L(oo(),e=>q(e instanceof h?0:1))):(Z("`--new` needs a terminal for `stdin`, `stdout`, and `stderr`"),q(1)),()=>L(pi(),e=>{if(e instanceof h){let t=e[0];return t()}else{let i=e[0];if(i!==`no handbook to run`)return Z(i),q(1);if(!(n instanceof T))return q(Lo(t,Vo(`blank`))instanceof h?0:1);if(r){let e=po();return F(N(j(a([fo(e),a([``]),uo(``,e),a([``]),lo(Ka,e)])),`
`)),q(0)}else if(s)return c(),so(no(`It looks like you’ll need to make a new handbook. Is\xA0that\xA0OK?`,!0),e=>R(Q(e),()=>(F(`
`+X(`No worries. Farewell~`,``)),q(0)),()=>L(oo(),e=>q(e instanceof h?0:1))));else return Z(`no handbook to run`),q(1)}}))})}function Uo(){throw de(`panic`,Zi,`kindly`,234,`panic_from_erlang_main`,"Kindly’s CLI runs with JavaScript.\n\nUse the `kindly` command from npm or jsr instead of `gleam run -t erlang -m kindly`.",{})}function Wo(e,t){return zo(new ta(e.name,e.tasks,t,e.run))}function Go(){let e=e=>a([38,5,e]),t=e(123),n=e(158),r=e(219),o=e(183),s=e(223),c=po();return new na($(i(1,t)),$(i(1,r)),$(s),c.first_tag,c.given_tag,$(o),$(n),c.time,c.tab)}function Ko(){let e=po();return new na($(a([])),$(a([])),$(a([])),$(a([])),$(a([4])),$(a([])),$(a([])),$(a([])),e.tab)}function qo(e,t,n,r){let i=new Ca(t,z(n),r,new T);return zo(new ta(e.name,(()=>{let t=e.tasks;return ft(t,a([i]))})(),e.theme,e.run))}function Jo(e,t,n,r){return zo(qo(e,t,n,(e,t)=>r(e)))}function Yo(e,t,n,r){let i=e.tasks,o=r(new ta(e.name,a([]),e.theme,e.run)),s;s=z(n);let c=s,l=A(o.tasks,e=>new Ca(e.doc,pr(c,e.tags),e.action,new w(t)));return zo(new ta(o.name,ft(i,l),o.theme,o.run))}function Xo(e,t){return zo(t(e))}function Zo(e,t){return L(e(),e=>{if(e instanceof h){let n=e[0];return gn(t(n),e=>Cn(e,void 0))}else return I(new _(void 0))})}function Qo(e,t,n){return Zo(()=>Ai(e,t),e=>n())}function $o(){return I(new h(void 0))}function es(e,t){return n=>Ai(e,t)}function ts(){throw de(`panic`,Zi,`kindly`,2335,`panic_from_erlang_api`,`Kindly’s API cannot be run with Erlang!`,{})}function ns(e){return ts()}function rs(e,t){return ts()}function is(e,t,n){return ts()}function as(e,t,n,r){return ts()}export{Va as IoStream$Stderr,Fa as IoStream$Stdin,Ra as IoStream$Stdout,Ha as IoStream$isStderr,Ia as IoStream$isStdin,za as IoStream$isStdout,Ba as Stderr,Pa as Stdin,La as Stdout,Ca as Task,wa as Task$Task,Da as Task$Task$0,ka as Task$Task$1,ja as Task$Task$2,Na as Task$Task$3,Aa as Task$Task$action,Ea as Task$Task$doc,Ma as Task$Task$group_doc,Oa as Task$Task$tags,Ta as Task$isTask,na as Theme,ra as Theme$Theme,oa as Theme$Theme$0,ca as Theme$Theme$1,ua as Theme$Theme$2,fa as Theme$Theme$3,ma as Theme$Theme$4,ga as Theme$Theme$5,va as Theme$Theme$6,ba as Theme$Theme$7,Sa as Theme$Theme$8,da as Theme$Theme$first_tag,ha as Theme$Theme$flag,pa as Theme$Theme$given_tag,sa as Theme$Theme$heading,aa as Theme$Theme$highlight,_a as Theme$Theme$parameter,xa as Theme$Theme$tab,la as Theme$Theme$tag,ya as Theme$Theme$time,ia as Theme$isTheme,K as ansi,Ai as command,Qo as command_step,po as default_theme,Ti as get_env,Go as gleam_theme,Yo as group,Vo as handbook,Bo as is_terminal,es as just,Ho as main,Xo as map,Oi as now,si as option_to_optional,ts as panic_from_erlang_api,ns as panic_from_erlang_api1,rs as panic_from_erlang_api2,is as panic_from_erlang_api3,as as panic_from_erlang_api4,Uo as panic_from_erlang_main,Ko as plain_theme,ho as reject,$o as resolve,Ei as set_env,Zo as step,$ as styler,Jo as task,qo as task_with_tasks,Wo as theme,Di as unset_env};