@hollware/admin 0.8.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/admin/assets/Alert-CMaqdPPm.js +1 -0
- package/dist/client/admin/assets/Callback-CTeaCQ1c.js +1 -0
- package/dist/client/admin/assets/Checkbox-CX1Z7ANx.js +1 -0
- package/dist/client/admin/assets/Collection-CipG9Wh2.js +1 -0
- package/dist/client/admin/assets/Collections-utASuXRR.js +1 -0
- package/dist/client/admin/assets/DashboardSidebarToggle-DiLFyMk8.js +1 -0
- package/dist/client/admin/assets/Entries-Dkqm8ivX.js +1 -0
- package/dist/client/admin/assets/Entry-ByVv3iGP.js +112 -0
- package/dist/client/admin/assets/FormField-BW-1Q8yL.js +1 -0
- package/dist/client/admin/assets/Home-DgLZiqMI.js +1 -0
- package/dist/client/admin/assets/InputNumber-BDjnMfc0.js +1 -0
- package/dist/client/admin/assets/InputTags-CXM25qrT.js +1 -0
- package/dist/client/admin/assets/NewEntry-B3jhZJwX.js +2 -0
- package/dist/client/admin/assets/Page-DiAoPkZK.js +1 -0
- package/dist/client/admin/assets/People-ChnT7l2-.js +1 -0
- package/dist/client/admin/assets/PopperArrow-BS1pa-ZI.js +1 -0
- package/dist/client/admin/assets/Reviews-GXuRFTtw.js +1 -0
- package/dist/client/admin/assets/RovingFocusItem-BXnbqPHm.js +1 -0
- package/dist/client/admin/assets/Select-C3_gJLfL.js +1 -0
- package/dist/client/admin/assets/Site-CPJ13O0q.js +1 -0
- package/dist/client/admin/assets/Textarea-B6SaL6Nm.js +1 -0
- package/dist/client/admin/assets/Tokens-Du08JWB5.js +1 -0
- package/dist/client/admin/assets/VerdictList-iJ1FBr2W.js +1 -0
- package/dist/client/admin/assets/bulk-report-BT91Ho7U.js +1 -0
- package/dist/client/admin/assets/columns-DwvnEvu1.js +4 -0
- package/dist/client/admin/assets/index-BFUeS7ic.js +28 -0
- package/dist/client/admin/assets/index-CsZc4d_V.css +2 -0
- package/dist/client/admin/assets/session-CzMvpLSp.js +3 -0
- package/dist/client/admin/assets/src-Cvyt4NDD.js +55 -0
- package/dist/client/admin/assets/useComposing-ELkCVDQg.js +1 -0
- package/dist/client/admin/assets/useFilter-CbKhrFc4.js +1 -0
- package/dist/client/admin/assets/useForwardScopeId-C4BUSLTt.js +1 -0
- package/dist/client/admin/assets/useKbd-CEpT28wF.js +1 -0
- package/dist/client/admin/assets/usePortal-C0d2q6c8.js +4 -0
- package/dist/client/admin/assets/utils-C5Ac3kcY.js +1 -0
- package/dist/client/admin/index.html +10 -5
- package/package.json +3 -2
- package/dist/client/admin/assets/Alert-BNqegYGY.js +0 -1
- package/dist/client/admin/assets/Badge-CUm0y7_3.js +0 -1
- package/dist/client/admin/assets/Button-gYrKAAPg.js +0 -1
- package/dist/client/admin/assets/Callback-CYEOMe-_.js +0 -1
- package/dist/client/admin/assets/Collection-BqZqvxD4.js +0 -1
- package/dist/client/admin/assets/Collections-h5teP9gk.js +0 -1
- package/dist/client/admin/assets/Entries-CCDREf-Z.js +0 -1
- package/dist/client/admin/assets/Entry-ToOSZZed.js +0 -112
- package/dist/client/admin/assets/FormField-A-XleJwz.js +0 -1
- package/dist/client/admin/assets/Home-BuQe24Wv.js +0 -1
- package/dist/client/admin/assets/Input-CJ_nv5ol.js +0 -1
- package/dist/client/admin/assets/InputNumber-BRcx3Ozf.js +0 -1
- package/dist/client/admin/assets/InputTags-BVQtV47x.js +0 -1
- package/dist/client/admin/assets/Modal-FM_ms2EK.js +0 -1
- package/dist/client/admin/assets/NewEntry-Cdo-HtVN.js +0 -2
- package/dist/client/admin/assets/People-C4WXD3c3.js +0 -1
- package/dist/client/admin/assets/Reviews-CvdX3MbK.js +0 -1
- package/dist/client/admin/assets/RovingFocusItem-B_oW7xIc.js +0 -1
- package/dist/client/admin/assets/Site-DIJ-5llg.js +0 -1
- package/dist/client/admin/assets/Textarea-DHB-lEZj.js +0 -1
- package/dist/client/admin/assets/Tokens-Cwe2MNqp.js +0 -1
- package/dist/client/admin/assets/VerdictList-Da-qipcx.js +0 -1
- package/dist/client/admin/assets/VisuallyHidden-CUiOLRpP.js +0 -4
- package/dist/client/admin/assets/VisuallyHiddenInput-9CeUtDLZ.js +0 -1
- package/dist/client/admin/assets/entries-CswbEbYi.js +0 -1
- package/dist/client/admin/assets/index-Bw9PriKb.js +0 -28
- package/dist/client/admin/assets/index-DLRJbMgK.css +0 -2
- package/dist/client/admin/assets/session-D_7iusJi.js +0 -3
- package/dist/client/admin/assets/src-CgvxW5Vk.js +0 -55
- package/dist/client/admin/assets/utils-gliHxok-.js +0 -1
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import{C as e,S as t,f as n,h as r,i,n as a,p as o,r as s,v as c,y as l}from"./VisuallyHidden-CUiOLRpP.js";import{Ar as u,D as d,Er as f,F as p,G as m,Gn as h,J as g,K as _,Lt as v,Nt as y,Sn as b,Ut as x,Xn as S,Xt as C,Y as w,Yt as ee,Zt as te,_ as T,_n as ne,d as re,er as ie,f as ae,fn as oe,h as se,it as ce,kr as le,kt as ue,l as de,nt as E,q as D,qn as O,r as fe,rr as k,s as pe,t as me,tr as he,tt as ge,u as _e,yn as ve}from"./session-D_7iusJi.js";import{D as ye,F as be,N as xe,s as Se,t as Ce,v as we}from"./Button-gYrKAAPg.js";import{t as Te}from"./InputTags-BVQtV47x.js";import{n as Ee,t as De}from"./InputNumber-BRcx3Ozf.js";import{t as Oe}from"./Modal-FM_ms2EK.js";import{n as ke,t as Ae}from"./RovingFocusItem-B_oW7xIc.js";import{t as je}from"./FormField-A-XleJwz.js";import{b as Me,n as Ne,t as Pe}from"./index-Bw9PriKb.js";import{t as Fe}from"./Textarea-DHB-lEZj.js";import{t as Ie}from"./Input-CJ_nv5ol.js";import{$ as Le,A as Re,B as ze,C as A,D as Be,E as Ve,F as He,G as j,H as Ue,I as We,J as Ge,L as Ke,M as qe,N as Je,O as Ye,P as Xe,Q as M,R as Ze,S as Qe,T as $e,U as et,V as tt,W as nt,X as N,Y as rt,_ as it,a as at,at as ot,b as st,c as ct,ct as lt,d as ut,dt,et as ft,f as pt,ft as mt,g as ht,h as gt,i as _t,it as P,j as vt,k as yt,l as bt,lt as xt,m as St,n as Ct,nt as wt,o as Tt,ot as Et,p as Dt,pt as Ot,q as kt,r as At,rt as jt,s as Mt,st as Nt,t as Pt,tt as Ft,u as It,ut as Lt,v as Rt,w as zt,x as F,y as Bt,z as Vt}from"./editor-theme-C6fTtbqY.js";import{t as Ht}from"./Badge-CUm0y7_3.js";import{i as Ut,n as Wt,r as Gt,t as Kt}from"./entries-CswbEbYi.js";import{t as qt}from"./site-DXdSwt1M.js";import{t as Jt}from"./VerdictList-Da-qipcx.js";var Yt={meta:``,ctrl:``,alt:``,win:`⊞`,command:`⌘`,shift:`⇧`,control:`⌃`,option:`⌥`,enter:`↵`,delete:`⌦`,backspace:`⌫`,escape:`Esc`,tab:`⇥`,capslock:`⇪`,arrowup:`↑`,arrowright:`→`,arrowdown:`↓`,arrowleft:`←`,pageup:`⇞`,pagedown:`⇟`,home:`↖`,end:`↘`},Xt=we(()=>{let e=m(()=>navigator&&navigator.userAgent&&navigator.userAgent.match(/Macintosh;/)),t=h({meta:` `,alt:` `,ctrl:` `});v(()=>{t.meta=e.value?Yt.command:`Ctrl`,t.ctrl=e.value?Yt.control:`Ctrl`,t.alt=e.value?Yt.option:`Alt`});function n(e){if(e)return[`meta`,`alt`,`ctrl`].includes(e)?t[e]:Yt[e]||e}return{macOS:e,getKbdKey:n}}),Zt=/^[^-]+.*-.*[^-]+$/,Qt=/^[^_]+.*_.*[^_]+$/,$t=[`arrowleft`,`arrowright`,`arrowup`,`arrowdown`,`tab`,`escape`,`enter`,`backspace`];function en(e){return/^[a-z]$/i.test(e)?`Key${e.toUpperCase()}`:/^\d$/.test(e)?`Digit${e}`:/^f\d+$/i.test(e)?e.toUpperCase():{space:`Space`,enter:`Enter`,escape:`Escape`,tab:`Tab`,backspace:`Backspace`,delete:`Delete`,arrowup:`ArrowUp`,arrowdown:`ArrowDown`,arrowleft:`ArrowLeft`,arrowright:`ArrowRight`}[e.toLowerCase()]||e}function tn(e,t={}){let r=t.chainDelay??800,i=O([]),a=()=>{i.value.splice(0,i.value.length)},s=xe(a,r),c,l=()=>{c=void 0,d.stop()},u=()=>{let e=c;if(l(),!e)return;let t=x.value.find(t=>t.key===e.shortcut.key&&!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey);t?.enabled&&t.handler(e.event)},d=be(()=>{u(),a()},r,{immediate:!1}),{macOS:f}=Xt(),p=n(),h=t.layoutIndependent??!1,g=$t.map(e=>en(e)),_=e=>{if(!e.key)return;let t=h||e.altKey,n=t?/^Key[A-Z]$/i.test(e.code):/^[a-z]{1}$/i.test(e.key),r=t?g.includes(e.code):$t.includes(e.key.toLowerCase()),o;if(i.value.push(h?e.code:e.key),i.value.length>=2){o=i.value.slice(-2).join(`-`);for(let t of b.value)if(t.key===o){t.enabled?(l(),e.preventDefault(),t.handler(e)):u(),a();return}}u();for(let t of x.value){if(h){if(e.code!==t.key)continue}else if(t.altKey&&e.altKey){if(e.code!==en(t.key))continue}else if(e.key.toLowerCase()!==t.key)continue;if(e.metaKey===t.metaKey&&e.ctrlKey===t.ctrlKey&&e.altKey===t.altKey&&!((n||r||t.shiftKey||e.shiftKey&&(e.metaKey||e.ctrlKey))&&e.shiftKey!==t.shiftKey)){if(!t.metaKey&&!t.ctrlKey&&!t.altKey&&!t.shiftKey&&S.value.has(t.key)){t.enabled&&e.preventDefault(),c={shortcut:t,event:e},d.start();return}t.enabled&&(e.preventDefault(),t.handler(e)),a();return}}s()},v=m(()=>{let e=p.value?.tagName,t=p.value?.contentEditable;return e===`INPUT`||e===`TEXTAREA`||t===`true`||t===`plaintext-only`?p.value?.name||!0:!1}),y=m(()=>Object.entries(he(e)).map(([e,t])=>{if(!t)return null;let n;e.includes(`-`)&&e!==`-`&&!e.includes(`_`)&&!e.match(Zt)?.length&&console.trace(`[Shortcut] Invalid key: "${e}"`),e.includes(`_`)&&e!==`_`&&!e.match(Qt)?.length&&console.trace(`[Shortcut] Invalid key: "${e}"`);let r=e.includes(`-`)&&e!==`-`&&!e.includes(`_`);if(r)n=h?{key:e.split(`-`).map(e=>en(e)).join(`-`),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1}:{key:e.toLowerCase(),metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1};else{let t=e.toLowerCase().split(`_`).map(e=>e),r=t.filter(e=>![`meta`,`command`,`ctrl`,`shift`,`alt`,`option`].includes(e)).join(`_`);h&&(r=en(r)),n={key:r,metaKey:t.includes(`meta`)||t.includes(`command`),ctrlKey:t.includes(`ctrl`),shiftKey:t.includes(`shift`),altKey:t.includes(`alt`)||t.includes(`option`)}}if(n.chained=r,!f.value&&n.metaKey&&!n.ctrlKey&&(n.metaKey=!1,n.ctrlKey=!0),typeof t==`function`?n.handler=t:typeof t==`object`&&(n={...n,handler:t.handler}),!n.handler)return console.trace(`[Shortcut] Invalid value`),null;let i=!0;return t.usingInput?typeof t.usingInput==`string`&&(i=v.value===t.usingInput):i=!v.value,n.enabled=i,n}).filter(Boolean)),b=m(()=>y.value.filter(e=>e.chained)),x=m(()=>y.value.filter(e=>!e.chained)),S=m(()=>new Set(b.value.map(e=>e.key.split(`-`)[0])));return o(`keydown`,_)}var[nn,rn]=se(`TabsRoot`),an=ce({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{orientation:a,unmountOnHide:o,dir:c}=ie(n),u=Me(c);i();let d=l(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),f=O(),p=S(new Set);return rn({modelValue:d,changeModelValue:e=>{d.value=e},orientation:a,dir:u,unmountOnHide:o,activationMode:n.activationMode,baseId:s(void 0,`reka-tabs`),tabsList:f,contentIds:p,registerContent:e=>{p.value=new Set([...p.value,e])},unregisterContent:e=>{let t=new Set(p.value);t.delete(e),p.value=t}}),(e,t)=>(x(),D(k(ae),{dir:k(u),"data-orientation":k(a),"as-child":e.asChild,as:e.as},{default:b(()=>[C(e.$slots,`default`,{modelValue:k(d)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function on(e,t){return`${e}-trigger-${t}`}function sn(e,t){return`${e}-content-${t}`}var cn=ce({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=i(),r=nn(),o=m(()=>on(r.baseId,t.value)),s=m(()=>sn(r.baseId,t.value)),c=m(()=>t.value===r.modelValue.value),l=O(c.value);return v(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{l.value=!1})}),y(()=>{r.unregisterContent(t.value)}),(e,t)=>(x(),D(k(a),{present:e.forceMount||c.value,"force-mount":``},{default:b(({present:t})=>[E(k(ae),{id:s.value,ref:k(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":c.value?`active`:`inactive`,"data-orientation":k(r).orientation.value,"aria-labelledby":o.value,hidden:!t,tabindex:`0`,style:le({animationDuration:l.value?`0s`:void 0})},{default:b(()=>[!k(r).unmountOnHide.value||t?C(e.$slots,`default`,{key:0}):g(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),ln=ce({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,a=nn();t({updateIndicatorStyle:u}),i();let o=r(),s=O({size:null,thickness:null,position:null}),l=O([]);ne(()=>[a.modelValue.value,a?.dir.value],()=>{u()},{immediate:!0,flush:`post`}),ve(()=>{l.value=Array.from(a.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),c(m(()=>[a.tabsList.value,...l.value]),u);function u(){let e=a.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(a.orientation.value===`horizontal`?s.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:s.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>k(o)&&typeof s.value.size==`number`?(x(),D(k(ae),ue({key:0},n,{style:{"--reka-tabs-indicator-size":`${s.value.size}px`,"--reka-tabs-indicator-thickness":`${s.value.thickness}px`,"--reka-tabs-indicator-position":`${s.value.position}px`}}),{default:b(()=>[C(e.$slots,`default`)]),_:3},16,[`style`])):g(`v-if`,!0)}}),un=ce({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=ie(e),{forwardRef:n,currentElement:r}=i(),a=nn();return a.tabsList=r,(e,r)=>(x(),D(k(ke),{"as-child":``,orientation:k(a).orientation.value,dir:k(a).dir.value,loop:k(t)},{default:b(()=>[E(k(ae),{ref:k(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":k(a).orientation.value},{default:b(()=>[C(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),dn=ce({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(n){let r=n,{forwardRef:a}=i(),o=nn(),s=m(()=>on(o.baseId,r.value)),c=m(()=>o.contentIds.value.has(r.value)?sn(o.baseId,r.value):void 0),l=m(()=>r.value===o.modelValue.value);return(n,r)=>(x(),D(k(Ae),{"as-child":``,focusable:!n.disabled,active:l.value},{default:b(()=>[E(k(ae),{id:s.value,ref:k(a),role:`tab`,type:n.as===`button`?`button`:void 0,as:n.as,"as-child":n.asChild,"aria-selected":l.value?`true`:`false`,"aria-controls":c.value,"data-state":l.value?`active`:`inactive`,disabled:n.disabled,"data-disabled":n.disabled?``:void 0,"data-orientation":k(o).orientation.value,onMousedown:r[0]||=e(e=>{!n.disabled&&e.ctrlKey===!1?k(o).changeModelValue(n.value):e.preventDefault()},[`left`]),onKeydown:r[1]||=t(e=>k(o).changeModelValue(n.value),[`enter`,`space`]),onFocus:r[2]||=()=>{let e=k(o).activationMode!==`manual`;!l.value&&!n.disabled&&e&&k(o).changeModelValue(n.value)}},{default:b(()=>[C(n.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),fn={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},pn={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=oe(),o=re(`tabs`,r),s=d(),c=Se(ye(o,`as`,`unmountOnHide`),i),l=m(()=>_e({extend:fn,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),h=O([]);function _(e,t){h.value[e]=t}return t({triggersRef:h}),(e,t)=>(x(),D(k(an),ue(k(c),{"model-value":k(o).modelValue,"default-value":k(o).defaultValue,orientation:k(o).orientation,"activation-mode":k(o).activationMode,"data-slot":`root`,class:l.value.root({class:[k(o).ui?.root,k(o).class]})}),{default:b(()=>[E(k(un),{"data-slot":`list`,class:f(l.value.list({class:k(o).ui?.list}))},{default:b(()=>[E(k(ln),{"data-slot":`indicator`,class:f(l.value.indicator({class:k(o).ui?.indicator}))},null,8,[`class`]),C(e.$slots,`list-leading`),(x(!0),w(p,null,ee(k(o).items,(t,n)=>(x(),D(k(dn),{key:k(T)(t,k(o).valueKey)??n,ref_for:!0,ref:e=>_(n,e),value:k(T)(t,k(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:f(l.value.trigger({class:[k(o).ui?.trigger,t.ui?.trigger]}))},{default:b(()=>[C(e.$slots,`leading`,{item:t,index:n,ui:l.value},()=>[t.icon?(x(),D(de,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:f(l.value.leadingIcon({class:[k(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(x(),D(pe,ue({key:1,size:t.ui?.leadingAvatarSize||k(o).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:l.value.leadingAvatar({class:[k(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):g(``,!0)]),k(T)(t,k(o).labelKey)||a.default?(x(),w(`span`,{key:0,"data-slot":`label`,class:f(l.value.label({class:[k(o).ui?.label,t.ui?.label]}))},[C(e.$slots,`default`,{item:t,index:n},()=>[ge(u(k(T)(t,k(o).labelKey)),1)])],2)):g(``,!0),C(e.$slots,`trailing`,{item:t,index:n,ui:l.value},()=>[t.badge||t.badge===0?(x(),D(Ht,ue({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||k(o).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:l.value.trailingBadge({class:[k(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):g(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),C(e.$slots,`list-trailing`)]),_:3},8,[`class`]),k(o).content?(x(!0),w(p,{key:0},ee(k(o).items,(t,n)=>(x(),D(k(cn),{key:k(T)(t,k(o).valueKey)??n,value:k(T)(t,k(o).valueKey)??String(n),"data-slot":`content`,class:f(l.value.content({class:[k(o).ui?.content,t.ui?.content,t.class]}))},{default:b(()=>[C(e.$slots,t.slot||`content`,{item:t,index:n,ui:l.value},()=>[ge(u(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):g(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},mn=Symbol.for(`yaml.alias`),hn=Symbol.for(`yaml.document`),gn=Symbol.for(`yaml.map`),_n=Symbol.for(`yaml.pair`),vn=Symbol.for(`yaml.scalar`),yn=Symbol.for(`yaml.seq`),I=Symbol.for(`yaml.node.type`),bn=e=>!!e&&typeof e==`object`&&e[I]===mn,xn=e=>!!e&&typeof e==`object`&&e[I]===hn,Sn=e=>!!e&&typeof e==`object`&&e[I]===gn,L=e=>!!e&&typeof e==`object`&&e[I]===_n,R=e=>!!e&&typeof e==`object`&&e[I]===vn,Cn=e=>!!e&&typeof e==`object`&&e[I]===yn;function z(e){if(e&&typeof e==`object`)switch(e[I]){case gn:case yn:return!0}return!1}function B(e){if(e&&typeof e==`object`)switch(e[I]){case mn:case gn:case vn:case yn:return!0}return!1}var wn=e=>(R(e)||z(e))&&!!e.anchor,Tn=Symbol(`break visit`),En=Symbol(`skip children`),Dn=Symbol(`remove node`);function On(e,t){let n=An(t);xn(e)?kn(null,e.contents,n,Object.freeze([e]))===Dn&&(e.contents=null):kn(null,e,n,Object.freeze([]))}On.BREAK=Tn,On.SKIP=En,On.REMOVE=Dn;function kn(e,t,n,r){let i=jn(e,t,n,r);if(B(i)||L(i))return Mn(e,r,i),kn(e,i,n,r);if(typeof i!=`symbol`){if(z(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=kn(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Tn)return Tn;else i===Dn&&(t.items.splice(e,1),--e)}}else if(L(t)){r=Object.freeze(r.concat(t));let e=kn(`key`,t.key,n,r);if(e===Tn)return Tn;e===Dn&&(t.key=null);let i=kn(`value`,t.value,n,r);if(i===Tn)return Tn;i===Dn&&(t.value=null)}}return i}function An(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function jn(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Sn(t))return n.Map?.(e,t,r);if(Cn(t))return n.Seq?.(e,t,r);if(L(t))return n.Pair?.(e,t,r);if(R(t))return n.Scalar?.(e,t,r);if(bn(t))return n.Alias?.(e,t,r)}function Mn(e,t,n){let r=t[t.length-1];if(z(r))r.items[e]=n;else if(L(r))e===`key`?r.key=n:r.value=n;else if(xn(r))r.contents=n;else{let e=bn(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Nn={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Pn=e=>e.replace(/[!,[\]{}]/g,e=>Nn[e]),Fn=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Pn(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&B(e.contents)){let t={};On(e.contents,(e,n)=>{B(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
2
|
-
`)}};Fn.defaultYaml={explicit:!1,version:`1.2`},Fn.defaultTags={"!!":`tag:yaml.org,2002:`};function In(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Ln(e){let t=new Set;return On(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Rn(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function zn(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Ln(e);let a=Rn(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(R(t.node)||z(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Bn(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Bn(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Bn(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Bn(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Bn(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function V(e,t,n){if(Array.isArray(e))return e.map((e,t)=>V(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!wn(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Vn=class{constructor(e){Object.defineProperty(this,I,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!xn(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=V(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Bn(i,{"":o},``,o):o}},Hn=class extends Vn{constructor(e){super(mn),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],On(e,{Node:(e,t)=>{(bn(t)||wn(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(V(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=Un(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(In(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Un(e,t,n){if(bn(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(z(t)){let r=0;for(let i of t.items){let t=Un(e,i,n);t>r&&(r=t)}return r}if(L(t)){let r=Un(e,t.key,n),i=Un(e,t.value,n);return Math.max(r,i)}return 1}var Wn=e=>!e||typeof e!=`function`&&typeof e!=`object`,H=class extends Vn{constructor(e){super(vn),this.value=e}toJSON(e,t){return t?.keep?this.value:V(this.value,e,t)}toString(){return String(this.value)}};H.BLOCK_FOLDED=`BLOCK_FOLDED`,H.BLOCK_LITERAL=`BLOCK_LITERAL`,H.PLAIN=`PLAIN`,H.QUOTE_DOUBLE=`QUOTE_DOUBLE`,H.QUOTE_SINGLE=`QUOTE_SINGLE`;var Gn=`tag:yaml.org,2002:`;function Kn(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function qn(e,t,n){if(xn(e)&&(e=e.contents),B(e))return e;if(L(e)){let t=n.schema[gn].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new Hn(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Gn+t.slice(2));let l=Kn(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new H(e);return c&&(c.node=t),t}l=e instanceof Map?o[gn]:Symbol.iterator in Object(e)?o[yn]:o[gn]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new H(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Jn(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return qn(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Yn=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Xn=class extends Vn{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>B(t)||L(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Yn(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(z(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Jn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(z(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&R(i)?i.value:i:z(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!L(t))return!1;let n=t.value;return n==null||e&&R(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return z(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(z(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Jn(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Zn=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Qn(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var $n=(e,t,n)=>e.endsWith(`
|
|
3
|
-
`)?Qn(n,t):n.includes(`
|
|
4
|
-
`)?`
|
|
5
|
-
`+Qn(n,t):(e.endsWith(` `)?``:` `)+n,er=`flow`,tr=`block`,nr=`quoted`;function rr(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=ir(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
6
|
-
`)n===`block`&&(h=ir(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
7
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
8
|
-
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function ir(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
9
|
-
`);r=t,i=t+1,a=e[i]}return r}var ar=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),or=e=>/^(%|---|\.\.\.)/m.test(e);function sr(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
10
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function cr(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(or(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
11
|
-
|
|
12
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
13
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:rr(o,a,nr,ar(t,!1))}function lr(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
14
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return cr(e,t);let n=t.indent||(or(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:rr(r,n,er,ar(t,!1))}function ur(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=cr;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?lr:i&&!t?cr:n?lr:cr}return r(e,t)}var dr;try{dr=RegExp(`(^|(?<!
|
|
15
|
-
))
|
|
16
|
-
+(?!
|
|
17
|
-
|$)`,`g`)}catch{dr=/\n+(?!\n|$)/g}function fr({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return ur(n,r);let l=r.indent||(r.forceBlockIndent||or(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===H.BLOCK_FOLDED?!1:t===H.BLOCK_LITERAL||!sr(n,c,l.length);if(!n)return u?`|
|
|
18
|
-
`:`>
|
|
19
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
20
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
21
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
22
|
-
`&&(p=p.slice(0,-1)),p.replace(dr,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
23
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
24
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=ar(r,!0);o!==`folded`&&t!==H.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=rr(`${v}${e}${p}`,l,tr,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function pr(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
25
|
-
`)||u&&/[[\]{},]/.test(a))return ur(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
26
|
-
`)?ur(a,t):fr(e,t,n,r);if(!s&&!u&&i!==H.PLAIN&&a.includes(`
|
|
27
|
-
`))return fr(e,t,n,r);if(or(a)){if(c===``)return t.forceBlockIndent=!0,fr(e,t,n,r);if(s&&c===l)return ur(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return ur(a,t)}return s?d:rr(d,c,er,ar(t,!1))}function mr(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==H.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=H.QUOTE_DOUBLE);let c=e=>{switch(e){case H.BLOCK_FOLDED:case H.BLOCK_LITERAL:return i||a?ur(o.value,t):fr(o,t,n,r);case H.QUOTE_DOUBLE:return cr(o.value,t);case H.QUOTE_SINGLE:return lr(o.value,t);case H.PLAIN:return pr(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function hr(e,t){let n=Object.assign({blockQuote:!0,commentString:Zn,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function gr(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(R(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function _r(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(R(e)||z(e))&&e.anchor;a&&In(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function vr(e,t,n,r){if(L(e))return e.toString(t,n,r);if(bn(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=B(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=gr(t.doc.schema.tags,a);let o=_r(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):R(a)?mr(a,t,n,r):a.toString(t,n,r);return o?R(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function yr({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=B(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(z(e)||!B(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||z(e)||(R(e)?e.type===H.BLOCK_FOLDED||e.type===H.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=vr(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=$n(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=$n(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=$n(g,n.indent,l(f))));let _,v,y;B(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&R(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Cn(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=vr(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
|
28
|
-
`:``,v){let e=l(v);S+=`\n${Qn(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
|
29
|
-
`&&y&&(S=`
|
|
30
|
-
|
|
31
|
-
`):S+=`\n${n.indent}`}else if(!p&&z(t)){let e=x[0],r=x.indexOf(`
|
|
32
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
|
33
|
-
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=$n(g,n.indent,l(y)):h&&i&&i(),g}function br(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var xr=`<<`,Sr={identify:e=>e===xr||typeof e==`symbol`&&e.description===xr,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new H(Symbol(xr)),{addToJSMap:wr}),stringify:()=>xr},Cr=(e,t)=>(Sr.identify(t)||R(t)&&(!t.type||t.type===H.PLAIN)&&Sr.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===Sr.tag&&e.default);function wr(e,t,n){let r=Er(e,n);if(Cn(r))for(let n of r.items)Tr(e,t,n);else if(Array.isArray(r))for(let n of r)Tr(e,t,n);else Tr(e,t,r)}function Tr(e,t,n){let r=Er(e,n);if(!Sn(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function Er(e,t){return e&&bn(t)?t.resolve(e.doc,e):t}function Dr(e,t,{key:n,value:r}){if(B(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Cr(e,n))wr(e,t,r);else{let i=V(n,``,e);if(t instanceof Map)t.set(i,V(r,i,e));else if(t instanceof Set)t.add(i);else{let a=Or(n,i,e),o=V(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function Or(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(B(e)&&n?.doc){let t=hr(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),br(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function kr(e,t,n){return new U(qn(e,void 0,n),qn(t,void 0,n))}var U=class e{constructor(e,t=null){Object.defineProperty(this,I,{value:_n}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return B(n)&&(n=n.clone(t)),B(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return Dr(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?yr(this,e,t,n):JSON.stringify(this)}};function Ar(e,t,n){return(t.inFlow??e.flow?Mr:jr)(e,t,n)}function jr({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(B(i))!d&&i.spaceBefore&&f.push(``),Nr(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(L(i)){let e=B(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),Nr(n,f,e.commentBefore,d))}d=!1;let s=vr(i,u,()=>o=null,()=>d=!0);o&&(s+=$n(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
34
|
-
`}}return e?(p+=`
|
|
35
|
-
`+Qn(l(e),c),s&&s()):d&&o&&o(),p}function Mr({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(B(i))i.spaceBefore&&d.push(``),Nr(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(L(i)){let e=B(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),Nr(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=B(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=vr(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
36
|
-
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=$n(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
37
|
-
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function Nr({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Qn(t(r),e);n.push(i.trimStart())}}function Pr(e,t){let n=R(t)?t.value:t;for(let r of e)if(L(r)&&(r.key===t||r.key===n||R(r.key)&&r.key.value===n))return r}var W=class extends Xn{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(gn,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(kr(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=L(e)?e:!e||typeof e!=`object`||!(`key`in e)?new U(e,e?.value):new U(e.key,e.value);let r=Pr(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);R(r.value)&&Wn(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=Pr(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=Pr(this.items,e)?.value;return(!t&&R(n)?n.value:n)??void 0}has(e){return!!Pr(this.items,e)}set(e,t){this.add(new U(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)Dr(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!L(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Ar(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},Fr={collection:`map`,default:!0,nodeClass:W,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Sn(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>W.from(e,t,n)},Ir=class extends Xn{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(yn,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=Lr(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=Lr(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&R(r)?r.value:r}has(e){let t=Lr(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=Lr(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];R(r)&&Wn(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(V(e,String(r++),t));return n}toString(e,t,n){return e?Ar(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(qn(a,void 0,n))}}return i}};function Lr(e){let t=R(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Rr={collection:`seq`,default:!0,nodeClass:Ir,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Cn(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>Ir.from(e,t,n)},zr={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),mr(e,t,n,r)}},Br={identify:e=>e==null,createNode:()=>new H(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new H(null),stringify:({source:e},t)=>typeof e==`string`&&Br.test.test(e)?e:t.options.nullStr},Vr={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new H(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Vr.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function G({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var Hr={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:G},Ur={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():G(e)}},Wr={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new H(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:G},Gr=e=>typeof e==`bigint`||Number.isInteger(e),Kr=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function qr(e,t,n){let{value:r}=e;return Gr(r)&&r>=0?n+r.toString(t):G(e)}var Jr={identify:e=>Gr(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>Kr(e,2,8,n),stringify:e=>qr(e,8,`0o`)},Yr={identify:Gr,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Kr(e,0,10,n),stringify:G},Xr={identify:e=>Gr(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Kr(e,2,16,n),stringify:e=>qr(e,16,`0x`)},Zr=[Fr,Rr,zr,Br,Vr,Jr,Yr,Xr,Hr,Ur,Wr];function Qr(e){return typeof e==`bigint`||Number.isInteger(e)}var $r=({value:e})=>JSON.stringify(e),ei=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:$r},{identify:e=>e==null,createNode:()=>new H(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:$r},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:$r},{identify:Qr,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Qr(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:$r}],ti=[Fr,Rr].concat(ei,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),ni={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=H.BLOCK_LITERAL,t!==H.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===H.BLOCK_LITERAL?`
|
|
38
|
-
`:` `)}return mr({comment:e,type:t,value:s},r,i,a)}};function ri(e,t){if(Cn(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!L(r)){if(Sn(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new U(new H(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=L(r)?r:new U(r)}}else t(`Expected a sequence for this tag`);return e}function ii(e,t,n){let{replacer:r}=n,i=new Ir(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(kr(o,s,n))}return i}var ai={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:ri,createNode:ii},oi=class e extends Ir{constructor(){super(),this.add=W.prototype.add.bind(this),this.delete=W.prototype.delete.bind(this),this.get=W.prototype.get.bind(this),this.has=W.prototype.has.bind(this),this.set=W.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(L(e)?(r=V(e.key,``,t),i=V(e.value,r,t)):r=V(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=ii(e,t,n),i=new this;return i.items=r.items,i}};oi.tag=`tag:yaml.org,2002:omap`;var si={collection:`seq`,identify:e=>e instanceof Map,nodeClass:oi,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=ri(e,t),r=[];for(let{key:e}of n.items)R(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new oi,n)},createNode:(e,t,n)=>oi.from(e,t,n)};function ci({value:e,source:t},n){return t&&(e?li:ui).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var li={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new H(!0),stringify:ci},ui={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new H(!1),stringify:ci},di={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:G},fi={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():G(e)}},pi={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new H(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:G},mi=e=>typeof e==`bigint`||Number.isInteger(e);function hi(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function gi(e,t,n){let{value:r}=e;if(mi(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return G(e)}var _i={identify:mi,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>hi(e,2,2,n),stringify:e=>gi(e,2,`0b`)},vi={identify:mi,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>hi(e,1,8,n),stringify:e=>gi(e,8,`0`)},yi={identify:mi,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>hi(e,0,10,n),stringify:G},bi={identify:mi,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>hi(e,2,16,n),stringify:e=>gi(e,16,`0x`)},xi=class e extends W{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=L(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new U(e.key,null):new U(e,null),Pr(this.items,t.key)||this.items.push(t)}get(e,t){let n=Pr(this.items,e);return!t&&L(n)?R(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=Pr(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new U(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(kr(e,null,n));return i}};xi.tag=`tag:yaml.org,2002:set`;var Si={collection:`map`,identify:e=>e instanceof Set,nodeClass:xi,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>xi.from(e,t,n),resolve(e,t){if(Sn(e)){if(e.hasAllNullValues(!0))return Object.assign(new xi,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function Ci(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function wi(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return G(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var Ti={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Ci(e,n),stringify:wi},Ei={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Ci(e,!1),stringify:wi},Di={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(Di.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=Ci(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},Oi=[Fr,Rr,zr,Br,li,ui,_i,vi,yi,bi,di,fi,pi,ni,Sr,si,ai,Si,Ti,Ei,Di],ki=new Map([[`core`,Zr],[`failsafe`,[Fr,Rr,zr]],[`json`,ti],[`yaml11`,Oi],[`yaml-1.1`,Oi]]),Ai={binary:ni,bool:Vr,float:Wr,floatExp:Ur,floatNaN:Hr,floatTime:Ei,int:Yr,intHex:Xr,intOct:Jr,intTime:Ti,map:Fr,merge:Sr,null:Br,omap:si,pairs:ai,seq:Rr,set:Si,timestamp:Di},ji={"tag:yaml.org,2002:binary":ni,"tag:yaml.org,2002:merge":Sr,"tag:yaml.org,2002:omap":si,"tag:yaml.org,2002:pairs":ai,"tag:yaml.org,2002:set":Si,"tag:yaml.org,2002:timestamp":Di};function Mi(e,t,n){let r=ki.get(t);if(r&&!e)return n&&!r.includes(Sr)?r.concat(Sr):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(ki.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Sr)),i.reduce((e,t)=>{let n=typeof t==`string`?Ai[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(Ai).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var Ni=(e,t)=>e.key<t.key?-1:+(e.key>t.key),Pi=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?Mi(e,`compat`):e?Mi(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?ji:{},this.tags=Mi(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,gn,{value:Fr}),Object.defineProperty(this,vn,{value:zr}),Object.defineProperty(this,yn,{value:Rr}),this.sortMapEntries=typeof a==`function`?a:a===!0?Ni:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function Fi(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=hr(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(Qn(t,``))}let o=!1,s=null;if(e.contents){if(B(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(Qn(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=vr(e.contents,i,()=>s=null,t);s&&(c+=$n(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(vr(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
|
|
39
|
-
`)?(n.push(`...`),n.push(Qn(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(Qn(a(t),``)))}return n.join(`
|
|
40
|
-
`)+`
|
|
41
|
-
`}var Ii=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,I,{value:hn});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Fn({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[I]:{value:hn}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=B(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Li(this.contents)&&this.contents.add(e)}addIn(e,t){Li(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=Ln(this);e.anchor=!t||n.has(t)?Rn(t||`a`,n):t}return new Hn(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=zn(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=qn(e,l,p);return o&&z(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new U(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Li(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Yn(e)?this.contents!=null&&(this.contents=null,!0):Li(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return z(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Yn(e)?!t&&R(this.contents)?this.contents.value:this.contents:z(this.contents)?this.contents.getIn(e,t):void 0}has(e){return z(this.contents)?this.contents.has(e):!1}hasIn(e){return Yn(e)?this.contents!==void 0:z(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Jn(this.schema,[e],t):Li(this.contents)&&this.contents.set(e,t)}setIn(e,t){Yn(e)?this.contents=t:this.contents==null?this.contents=Jn(this.schema,Array.from(e),t):Li(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new Fn({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new Fn({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new Pi(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=V(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?Bn(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return Fi(this,e)}};function Li(e){if(z(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Ri=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},zi=class extends Ri{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Bi=class extends Ri{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Vi=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
42
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function Hi(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function Ui(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
43
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(Ui(t.key)||Ui(t.value))return!0}return!1;default:return!0}}function Wi(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Ui(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Gi(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||R(e)&&R(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Ki=`All mapping items must start at the same column`;function qi({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??W)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=Hi(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,Ki)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
|
44
|
-
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Ui(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,Ki);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Wi(r.indent,u,i),n.atKey=!1,Gi(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Hi(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&Wi(r.indent,f,i),s=c.range[2];let l=new U(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
|
45
|
-
`+_.comment:g.comment=_.comment);let e=new U(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Ji({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??Ir)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=Hi(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Wi(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Yi(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var Xi=`Block collections are not allowed within flow collections`,Zi=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Qi({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?W:Ir))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=Hi(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
|
46
|
-
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&Ui(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];L(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
47
|
-
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],Zi(m)&&i(r.range,`BLOCK_IN_FLOW`,Xi)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);Zi(f)&&i(g.range,`BLOCK_IN_FLOW`,Xi),n.atKey=!1;let _=Hi(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?Zi(m)&&i(v.range,`BLOCK_IN_FLOW`,Xi):_.comment&&(g.comment?g.comment+=`
|
|
48
|
-
`+_.comment:g.comment=_.comment);let y=new U(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Gi(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new W(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=Yi(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
49
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function $i(e,t,n,r,i,a){let o=n.type===`block-map`?qi(e,t,n,r,a):n.type===`block-seq`?Ji(e,t,n,r,a):Qi(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function ea(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===W.tagName&&s===`map`||o===Ir.tagName&&s===`seq`)return $i(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),$i(e,t,n,i,o)}let l=$i(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=B(u)?u:new H(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function ta(e,t,n){let r=t.offset,i=na(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?H.BLOCK_FOLDED:H.BLOCK_LITERAL,o=t.source?ra(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
50
|
-
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
51
|
-
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===H.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
52
|
-
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
53
|
-
`:!p&&f===`
|
|
54
|
-
`&&(f=`
|
|
55
|
-
|
|
56
|
-
`),d+=f+t.slice(c)+r,f=`
|
|
57
|
-
`,p=!0):r===``?f===`
|
|
58
|
-
`?d+=`
|
|
59
|
-
`:f=`
|
|
60
|
-
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
61
|
-
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
62
|
-
`&&(d+=`
|
|
63
|
-
`);break;default:d+=`
|
|
64
|
-
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function na({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function ra(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function ia(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=H.PLAIN,c=aa(a,l);break;case`single-quoted-scalar`:s=H.QUOTE_SINGLE,c=oa(a,l);break;case`double-quoted-scalar`:s=H.QUOTE_DOUBLE,c=ca(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=Yi(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function aa(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),sa(e)}function oa(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),sa(e.slice(1,-1)).replace(/''/g,`'`)}function sa(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
|
65
|
-
`?a+=o:o=`
|
|
66
|
-
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function ca(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
|
67
|
-
`){if(i===`
|
|
68
|
-
`){let{fold:t,offset:i}=la(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=ua[i];if(a)n+=a;else if(i===`
|
|
69
|
-
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
70
|
-
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=da(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
71
|
-
`&&(a!==`\r`||e[r+2]!==`
|
|
72
|
-
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function la(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
73
|
-
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
|
74
|
-
`);)r===`
|
|
75
|
-
`&&(n+=`
|
|
76
|
-
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var ua={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
77
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function da(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function fa(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?ta(e,t,r):ia(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[vn]:c?pa(e.schema,i,c,n,r):t.type===`scalar`?ma(e,i,t,r):e.schema[vn];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=R(a)?a:new H(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new H(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function pa(e,t,n,r,i){if(n===`!`)return e[vn];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[vn])}function ma({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[vn];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[vn];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function ha(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var ga={composeNode:_a,composeEmptyNode:va};function _a(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=ya(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=fa(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=ea(ga,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=va(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!R(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function va(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=fa(e,{type:`scalar`,offset:ha(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function ya({options:e},{offset:t,source:n,end:r},i){let a=new Hn(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=Yi(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function ba(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Ii(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Hi(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?_a(c,i,l,o):va(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Yi(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function xa(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function Sa(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
|
78
|
-
|
|
79
|
-
`:`
|
|
80
|
-
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var Ca=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=xa(e);r?this.warnings.push(new Bi(i,t,n)):this.errors.push(new zi(i,t,n))},this.directives=new Fn({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Sa(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(z(i)&&!i.flow&&i.items.length>0){let e=i.items[0];L(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Sa(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=xa(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=ba(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new zi(xa(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new zi(xa(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Yi(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new zi(xa(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new Ii(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},wa=Symbol(`break visit`),Ta=Symbol(`skip children`),Ea=Symbol(`remove item`);function Da(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),Oa(Object.freeze([]),e,t)}Da.BREAK=wa,Da.SKIP=Ta,Da.REMOVE=Ea,Da.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},Da.parentCollection=(e,t)=>{let n=Da.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function Oa(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=Oa(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===wa)return wa;else r===Ea&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function ka(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
81
|
-
`:case`\r
|
|
82
|
-
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function K(e){switch(e){case void 0:case` `:case`
|
|
83
|
-
`:case`\r`:case` `:return!0;default:return!1}}var Aa=new Set(`0123456789ABCDEFabcdef`),ja=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),Ma=new Set(`,[]{}`),Na=new Set(` ,[]{}
|
|
84
|
-
\r `),Pa=e=>!e||Na.has(e),Fa=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
85
|
-
`||t===`\r`&&this.buffer[e+1]===`
|
|
86
|
-
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
87
|
-
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
88
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&K(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
89
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&K(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!K(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&K(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(Pa),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&K(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(Pa),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||K(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
90
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
91
|
-
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>K(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
92
|
-
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
93
|
-
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
94
|
-
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
95
|
-
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
96
|
-
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(K(r)||e&&Ma.has(r))break;t=n}else if(K(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
97
|
-
`?(n+=1,r=`
|
|
98
|
-
`,i=this.buffer[n+1]):t=n),i===`#`||e&&Ma.has(i))break;if(r===`
|
|
99
|
-
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&Ma.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(Pa),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(K(n)||t&&Ma.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!K(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(ja.has(t))t=this.buffer[++e];else if(t===`%`&&Aa.has(this.buffer[e+1])&&Aa.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
100
|
-
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
101
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Ia=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function La(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Ra(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function za(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function Ba(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function Va(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function Ha(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Ua(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!La(t.start,`explicit-key-ind`)&&!La(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,za(t.value)?t.value.end?Ha(t.value.end,t.sep):t.value.end=t.sep:Ha(t.start,t.sep),delete t.sep)}var Wa=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new Fa,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=ka(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&Ua(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Ra(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:Ra(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=Va(Ba(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
102
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
103
|
-
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Ha(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(La(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=Va(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(La(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(za(t.key)&&!La(t.sep,`newline`)){let e=Va(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):La(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!La(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Ha(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||La(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=Va(Ba(t));Ua(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
104
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
105
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=Va(Ba(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=Va(Ba(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Ga(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Ia||null,prettyErrors:t}}function Ka(e,t={}){let{lineCounter:n,prettyErrors:r}=Ga(t),i=new Wa(n?.addNewLine),a=new Ca(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new zi(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Vi(e,n)),o.warnings.forEach(Vi(e,n))),o}function qa(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return xn(e)&&!r?e.toString(n):new Ii(e,r,n).toString(n)}function Ja(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ya=120;function Xa(e){let t=Ja(e.properties)?e.properties:{},n=new Set(Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]);return Object.entries(t).flatMap(([e,t])=>{if(!Ja(t))return[];let r=typeof t.maxLength==`number`?t.maxLength:null,i={key:e,required:n.has(e),options:[],maxLength:r,description:typeof t.description==`string`?t.description:null};if(Array.isArray(t.enum))return[{...i,kind:`choice`,options:t.enum.map(String)}];switch(t.type){case`string`:return t.format===`date`?[{...i,kind:`date`}]:[{...i,kind:r!==null&&r>Ya?`long`:`text`}];case`number`:case`integer`:return[{...i,kind:`number`}];case`boolean`:return[{...i,kind:`switch`}];case`array`:return(Ja(t.items)?t.items:{}).type===`string`?[{...i,kind:`list`}]:[];default:return[]}})}var Za=/^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/;function Qa(e){let t=Za.exec(e);if(t===null)return null;let n=Ka(t[1]??``);if(n.errors.length>0)return null;let r=n.toJS();return Ja(r)?{...r}:{}}function $a(e,t){let n=qa(t,{lineWidth:0}).trimEnd(),r=Za.exec(e);return r===null?`---\n${n}\n---\n\n${e}`:`---\n${n}\n---${r[2]??`
|
|
106
|
-
`}${e.slice(r[0].length)}`}var eo={key:0,class:`text-sm text-muted`},to={key:1,class:`text-sm text-muted`},no=ce({__name:`FrontmatterForm`,props:{modelValue:{},schema:{}},emits:[`update:modelValue`],setup(t,{emit:n}){let r=t,i=n,a=m(()=>Xa(r.schema)),o=m(()=>Qa(r.modelValue));function s(e,t){o.value!==null&&i(`update:modelValue`,$a(r.modelValue,{...o.value,[e]:t}))}function c(e){let t=o.value?.[e.key];return t==null?``:String(t)}function l(e){let t=o.value?.[e.key];return Array.isArray(t)?t.map(String):[]}function u(e){let t=o.value?.[e.key];return typeof t==`number`?t:void 0}return(t,n)=>{let r=Fe,i=Ie,d=Pe,f=Te,m=De,h=Ee,g=je;return o.value===null?(x(),w(`p`,eo,[...n[1]||=[ge(` The frontmatter does not read as YAML between two `,-1),_(`code`,null,`---`,-1),ge(` lines. Fix it in the Markdown, and its fields come back here. `,-1)]])):a.value.length===0?(x(),w(`p`,to,` The collection describes no field this form can show. Edit the frontmatter in the Markdown. `)):(x(),w(`form`,{key:2,class:`space-y-4`,onSubmit:n[0]||=e(()=>{},[`prevent`])},[(x(!0),w(p,null,ee(a.value,e=>(x(),D(g,{key:e.key,label:e.key,required:e.required,help:e.description??void 0,hint:e.maxLength!==null&&(e.kind===`text`||e.kind===`long`)?`${c(e).length} / ${e.maxLength}`:void 0},{default:b(()=>[e.kind===`long`?(x(),D(r,{key:0,"model-value":c(e),rows:3,autoresize:``,class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`date`?(x(),D(i,{key:1,type:`date`,"model-value":c(e),class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`choice`?(x(),D(d,{key:2,"model-value":c(e),items:e.options,class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`items`,`onUpdate:modelValue`])):e.kind===`list`?(x(),D(f,{key:3,"model-value":l(e),class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`number`?(x(),D(m,{key:4,"model-value":u(e),class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`switch`?(x(),D(h,{key:5,"model-value":o.value[e.key]===!0,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`])):(x(),D(i,{key:6,"model-value":c(e),class:`w-full`,"onUpdate:modelValue":t=>s(e.key,t)},null,8,[`model-value`,`onUpdate:modelValue`]))]),_:2},1032,[`label`,`required`,`help`,`hint`]))),128))],32))}}}),ro=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},io=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(yo).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new jt,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=Ao(s);if(i)o.add(n,n,F.widget({widget:new Co(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,F.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,ao(f))}};function ao(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new ro(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new ro(r.from,n,r.diagnostic)}}),r}function oo(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(yo).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(lo))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function so(e,t){return e.field(q,!1)?t:t.concat(P.appendConfig.of(Vo))}function co(e,t){return{effects:so(e,[lo.of(t)])}}var lo=P.define(),uo=P.define(),fo=P.define(),q=ot.define({create(){return new io(F.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=ao(n,e.selected.diagnostic,i)||ao(n,null,i)}!n.size&&i&&t.state.facet(yo).autoPanel&&(i=null),e=new io(n,i,r)}for(let n of t.effects)if(n.is(lo)){let r=t.state.facet(yo).autoPanel?n.value.length?To.open:null:e.panel;e=io.init(n.value,r,t.state)}else n.is(uo)?e=new io(e.diagnostics,n.value?To.open:null,e.selected):n.is(fo)&&(e=new io(e.diagnostics,e.panel,n.value));return e},provide:e=>[et.from(e,e=>e.panel),A.decorations.from(e,e=>e.diagnostics)]}),po=F.mark({class:`cm-lintRange cm-lintRange-active`});function mo(e,t,n){let{diagnostics:r}=e.state.field(q),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(yo).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:ho(e,i)}}}:null}function ho(e,t){return j(`ul`,{class:`cm-tooltip-lint`},t.map(t=>So(e,t,!1)))}var go=e=>{let t=e.state.field(q,!1);(!t||!t.panel)&&e.dispatch({effects:so(e.state,[uo.of(!0)])});let n=qe(e,To.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},_o=e=>{let t=e.state.field(q,!1);return!t||!t.panel?!1:(e.dispatch({effects:uo.of(!1)}),!0)},vo=[{key:`Mod-Shift-m`,run:go,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(q,!1);if(!t)return!1;let n=e.state.selection.main,r=ao(t.diagnostics,null,n.to+1);return!r&&(r=ao(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),Be(e,r.from,1,{tooltip:Bo,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],yo=ft.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...Lt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:bo,tooltipFilter:bo,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function bo(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function xo(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function So(e,t,n){let r=n?xo(t.actions):[];return j(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},j(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=ao(e.state.field(q).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),j(`u`,s.slice(c,c+1)),s.slice(c+1)],u=n.markClass?` `+n.markClass:``;return j(`button`,{type:`button`,class:`cm-diagnosticAction`+u,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&j(`div`,{class:`cm-diagnosticSource`},t.source))}var Co=class extends Ve{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return j(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},wo=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=So(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},To=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)_o(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=xo(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=ao(this.view.state.field(q).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=j(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=j(`div`,{class:`cm-panel-lint`},this.list,j(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>_o(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(q).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(q),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new wo(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new wo(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=ao(this.view.state.field(q).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:fo.of(t)})}static open(t){return new e(t)}};function Eo(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Do(e){return Eo(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var Oo=A.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:Do(`#f11`)},".cm-lintRange-warning":{backgroundImage:Do(`orange`)},".cm-lintRange-info":{backgroundImage:Do(`#999`)},".cm-lintRange-hint":{backgroundImage:Do(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function ko(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function Ao(e){let t=`hint`,n=1;for(let r of e){let e=ko(r.severity);e>n&&(n=e,t=r.severity)}return t}var jo=class extends zt{constructor(e){super(),this.diagnostics=e,this.severity=Ao(e)}toDOM(e){let t=document.createElement(`div`);t.className=`cm-lint-marker cm-lint-marker-`+this.severity;let n=this.diagnostics,r=e.state.facet(Ho).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>No(e,t,n)),t}};function Mo(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientX<i.right+10&&r.clientY>i.top-10&&r.clientY<i.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains(`cm-tooltip-lint`))return;window.removeEventListener(`mousemove`,n),e.state.field(Ro)&&e.dispatch({effects:Lo.of(null)})}};window.addEventListener(`mousemove`,n)}function No(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:Lo.of({pos:r.from,above:!1,clip:!1,create(){return{dom:ho(e,n),getCoords:()=>t.getBoundingClientRect()}}})}),t.onmouseout=t.onmousemove=null,Mo(e,t)}let{hoverTime:i}=e.state.facet(Ho),a=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(a),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(a),a=setTimeout(r,i)}}function Po(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new jo(n[e]).range(+e));return wt.of(r,!0)}var Fo=Je({class:`cm-gutter-lint`,markers:e=>e.state.field(Io),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(Io).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new jo(r):null}}),Io=ot.define({create(){return wt.empty},update(e,t){e=e.map(t.changes);let n=t.state.facet(Ho).markerFilter;for(let r of t.effects)if(r.is(lo)){let i=r.value;n&&(i=n(i||[],t.state)),e=Po(t.state.doc,i.slice(0))}return e}}),Lo=P.define(),Ro=ot.define({create(){return null},update(e,t){return e&&t.docChanged&&(e=oo(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(Lo)?t.value:e,e)},provide:e=>nt.from(e)}),zo=A.baseTheme({".cm-gutter-lint":{width:`1.4em`,"& .cm-gutterElement":{padding:`.2em`}},".cm-lint-marker":{width:`1em`,height:`1em`},".cm-lint-marker-info":{content:Eo(`<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`)},".cm-lint-marker-warning":{content:Eo(`<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`)},".cm-lint-marker-error":{content:Eo(`<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>`)}}),Bo=Ke(mo,{hideOn:oo}),Vo=[q,A.decorations.compute([q],e=>{let{selected:t,panel:n}=e.field(q);return!t||!n||t.from==t.to?F.none:F.set([po.range(t.from,t.to)])}),Bo,Oo],Ho=ft.define({combine(e){return Lt(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function Uo(e={}){return[Ho.of(e),Io,Fo,zo,Ro]}var Wo=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Yo(e.state,n.from);return r.line?Ko(e):r.block?Jo(e):!1};function Go(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var Ko=Go(es,0),qo=Go($o,0),Jo=Go((e,t)=>$o(e,t,Qo(t)),0);function Yo(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var Xo=50;function Zo(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-Xo,r),o=e.sliceDoc(i,i+Xo),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+Xo),d=e.sliceDoc(i-Xo,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function Qo(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function $o(e,t,n=t.selection.ranges){let r=n.map(e=>Yo(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>Zo(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function es(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=Yo(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var ts=kt.define(),ns=kt.define(),rs=ft.define(),is=ft.define({combine(e){return Lt(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),as=ot.define({create(){return Cs.empty},update(e,t){let n=t.state.facet(is),r=t.annotation(ts);if(r){let i=fs.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?ps(o,o.length,n.minDepth,i):vs(o,t.startState.selection),new Cs(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ns);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Nt.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=fs.fromTransaction(t),o=t.annotation(Nt.time),s=t.annotation(Nt.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new Cs(e.done.map(fs.fromJSON),e.undone.map(fs.fromJSON))}});function os(e={}){return[as,is.of(e),A.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?cs:e.inputType==`historyRedo`?ls:null;return n?(e.preventDefault(),n(t)):!1}})]}function ss(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(as,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var cs=ss(0,!1),ls=ss(1,!1),us=ss(0,!0),ds=ss(1,!0),fs=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&rt.fromJSON(t.changes),[],t.mapped&&Ge.fromJSON(t.mapped),t.startSelection&&M.fromJSON(t.startSelection),t.selectionsAfter.map(M.fromJSON))}static fromTransaction(t,n){let r=J;for(let e of t.startState.facet(rs)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,J)}static selection(t){return new e(void 0,J,void 0,void 0,t)}};function ps(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function ms(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function hs(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function gs(e,t){return e.length?t.length?e.concat(t):e:t}var J=[],_s=200;function vs(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-_s));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),ps(e,e.length-1,1e9,n.setSelAfter(r)))}return[fs.selection([t])]}function ys(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function bs(e,t){if(!e.length)return e;let n=e.length,r=J;for(;n;){let i=xs(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[fs.selection(r)]:J}function xs(e,t,n){let r=gs(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):J,n);if(!e.changes)return fs.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new fs(i,P.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var Ss=/^(input\.type|delete)($|\.)/,Cs=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||Ss.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,ms(s.changes,t.changes))||r==`input.type.compose`)?ps(o,o.length-1,i.minDepth,new fs(t.changes.compose(s.changes),gs(P.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,J)):ps(o,o.length,i.minDepth,t),new e(o,J,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:J;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&hs(a[a.length-1],t)?this:new e(vs(this.done,t),this.undone,n,r)}addMapping(t){return new e(bs(this.done,t),bs(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:ts.of({side:e,rest:ys(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?J:r.slice(0,r.length-1);return i.mapped&&(n=bs(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:ts.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};Cs.empty=new Cs(J,J);var ws=[{key:`Mod-z`,run:cs,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:ls,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:ls,preventDefault:!0},{key:`Mod-u`,run:us,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:ds,preventDefault:!0}];function Ts(e,t){return M.create(e.ranges.map(t),e.mainIndex)}function Y(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function X({state:e,dispatch:t},n){let r=Ts(e.selection,n);return!r.eq(e.selection,!0)&&(t(Y(e,r)),!0)}function Es(e,t){return M.cursor(t?e.to:e.from)}function Ds(e,t){return X(e,n=>n.empty?e.moveByChar(n,t):Es(n,t))}function Z(e){return e.textDirectionAt(e.state.selection.main.head)==Qe.LTR}var Os=e=>Ds(e,!Z(e)),ks=e=>Ds(e,Z(e));function As(e,t){return X(e,n=>n.empty?e.moveByGroup(n,t):Es(n,t))}var js=e=>As(e,!Z(e)),Ms=e=>As(e,Z(e));typeof Intl<`u`&&Intl.Segmenter;function Ns(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Ps(e,t,n){let r=Bt(e).resolveInner(t.head),i=n?st.closedBy:st.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;Ns(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?it(e,r.from,1):it(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,M.cursor(s,n?-1:1)}var Fs=e=>X(e,t=>Ps(e.state,t,!Z(e))),Is=e=>X(e,t=>Ps(e.state,t,Z(e)));function Ls(e,t){return X(e,n=>{if(!n.empty)return Es(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var Rs=e=>Ls(e,!1),zs=e=>Ls(e,!0);function Bs(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(A.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function Vs(e,t){let n=Bs(e),{state:r}=e,i=Ts(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):Es(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=A.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(Y(r,i),{effects:a}),!0}var Hs=e=>Vs(e,!1),Us=e=>Vs(e,!0);function Ws(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=M.cursor(r.from+n))}return i}var Gs=e=>X(e,t=>Ws(e,t,!0)),Ks=e=>X(e,t=>Ws(e,t,!1)),qs=e=>X(e,t=>Ws(e,t,!Z(e))),Js=e=>X(e,t=>Ws(e,t,Z(e))),Ys=e=>X(e,t=>e.moveToLineBoundary(t,!1,!1)),Xs=e=>X(e,t=>e.moveToLineBoundary(t,!0,!1));function Zs(e,t,n){let r=!1,i=Ts(e.selection,t=>{let i=it(e,t.head,-1)||it(e,t.head,1)||t.head>0&&it(e,t.head-1,1)||t.head<e.doc.length&&it(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?M.range(t.anchor,a):M.cursor(a)});return r?(t(Y(e,i)),!0):!1}var Qs=({state:e,dispatch:t})=>Zs(e,t,!1);function Q(e,t,n){let r=Ts(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=M.range(e.head,e.anchor));let r=n(e);return M.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(Y(e.state,r)),!0)}function $s(e,t){return Q(e,t,n=>e.moveByChar(n,t))}var ec=e=>$s(e,!Z(e)),tc=e=>$s(e,Z(e));function nc(e,t){return Q(e,t,n=>e.moveByGroup(n,t))}var rc=e=>nc(e,!Z(e)),ic=e=>nc(e,Z(e)),ac=e=>{let t=!Z(e);return Q(e,t,n=>Ps(e.state,n,t))},oc=e=>{let t=Z(e);return Q(e,t,n=>Ps(e.state,n,t))};function sc(e,t){return Q(e,t,n=>e.moveVertically(n,t))}var cc=e=>sc(e,!1),lc=e=>sc(e,!0);function uc(e,t){return Q(e,t,n=>e.moveVertically(n,t,Bs(e).height))}var dc=e=>uc(e,!1),fc=e=>uc(e,!0),pc=e=>Q(e,!0,t=>Ws(e,t,!0)),mc=e=>Q(e,!1,t=>Ws(e,t,!1)),hc=e=>{let t=!Z(e);return Q(e,t,n=>Ws(e,n,t))},gc=e=>{let t=Z(e);return Q(e,t,n=>Ws(e,n,t))},_c=e=>Q(e,!1,t=>M.cursor(e.lineBlockAt(t.head).from)),vc=e=>Q(e,!0,t=>M.cursor(e.lineBlockAt(t.head).to)),yc=({state:e,dispatch:t})=>(t(Y(e,{anchor:0})),!0),bc=({state:e,dispatch:t})=>(t(Y(e,{anchor:e.doc.length})),!0),xc=({state:e,dispatch:t})=>(t(Y(e,{anchor:e.selection.main.anchor,head:0})),!0),Sc=({state:e,dispatch:t})=>(t(Y(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Cc=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),wc=({state:e,dispatch:t})=>{let n=Uc(e).map(({from:t,to:n})=>M.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:M.create(n),userEvent:`select`})),!0},Tc=({state:e,dispatch:t})=>{let n=Ts(e.selection,t=>{let n=Bt(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return M.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(Y(e,n)),!0)};function Ec(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(Y(n,M.create(i,i.length-1))),!0)}var Dc=e=>Ec(e,!1),Oc=e=>Ec(e,!0),kc=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=M.create([n.main]):n.main.empty||(r=M.create([M.cursor(n.main.head)])),r?(t(Y(e,r)),!0):!1};function Ac(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=jc(e,o,!1)):o>i&&(n=`delete.forward`,o=jc(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=jc(e,i,!1),a=jc(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:M.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?A.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function jc(e,t,n){if(e instanceof A)for(let r of e.state.facet(A.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var Mc=(e,t,n)=>Ac(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=dt(s,a.tabSize)%pt(a)||pt(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=mt(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=mt(o.text,c-o.from,!1,!1)+o.from);return c}),Nc=e=>Mc(e,!1,!0),Pc=e=>Mc(e,!0,!1),Fc=(e,t)=>Ac(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=mt(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Ic=e=>Fc(e,!1),Lc=e=>Fc(e,!0),Rc=e=>Ac(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),zc=e=>Ac(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Bc=e=>Ac(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Vc=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Et.of([``,``])},range:M.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Hc=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:mt(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:mt(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:M.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function Uc(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Wc(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Uc(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(M.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(M.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:M.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Gc=({state:e,dispatch:t})=>Wc(e,t,!1),Kc=({state:e,dispatch:t})=>Wc(e,t,!0);function qc(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Uc(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Jc=({state:e,dispatch:t})=>qc(e,t,!1),Yc=({state:e,dispatch:t})=>qc(e,t,!0),Xc=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Uc(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=Ts(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Zc(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Bt(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(st.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Qc=el(!1),$c=el(!0);function el(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Zc(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Mt(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=Dt(s,r);for(c??=dt(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,gt(t,c)];return o&&l.push(gt(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:Et.of(l)},range:M.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function tl(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:M.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var nl=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Mt(e,{overrideIndentation:e=>n[e]??-1}),i=tl(e,(t,i,a)=>{let o=Dt(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=gt(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},rl=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(tl(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ht)})}),{userEvent:`input.indent`})),!0),il=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(tl(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=dt(r,e.tabSize),a=0,o=gt(e,Math.max(0,i-pt(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),al=e=>(e.setTabFocusMode(),!0),ol=[{key:`Ctrl-b`,run:Os,shift:ec,preventDefault:!0},{key:`Ctrl-f`,run:ks,shift:tc},{key:`Ctrl-p`,run:Rs,shift:cc},{key:`Ctrl-n`,run:zs,shift:lc},{key:`Ctrl-a`,run:Ys,shift:_c},{key:`Ctrl-e`,run:Xs,shift:vc},{key:`Ctrl-d`,run:Pc},{key:`Ctrl-h`,run:Nc},{key:`Ctrl-k`,run:Rc},{key:`Ctrl-Alt-h`,run:Ic},{key:`Ctrl-o`,run:Vc},{key:`Ctrl-t`,run:Hc},{key:`Ctrl-v`,run:Us}],sl=[{key:`ArrowLeft`,run:Os,shift:ec,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:js,shift:rc,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:qs,shift:hc,preventDefault:!0},{key:`ArrowRight`,run:ks,shift:tc,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:Ms,shift:ic,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:Js,shift:gc,preventDefault:!0},{key:`ArrowUp`,run:Rs,shift:cc,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:yc,shift:xc},{mac:`Ctrl-ArrowUp`,run:Hs,shift:dc},{key:`ArrowDown`,run:zs,shift:lc,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:bc,shift:Sc},{mac:`Ctrl-ArrowDown`,run:Us,shift:fc},{key:`PageUp`,run:Hs,shift:dc},{key:`PageDown`,run:Us,shift:fc},{key:`Home`,run:Ks,shift:mc,preventDefault:!0},{key:`Mod-Home`,run:yc,shift:xc},{key:`End`,run:Gs,shift:pc,preventDefault:!0},{key:`Mod-End`,run:bc,shift:Sc},{key:`Enter`,run:Qc,shift:Qc},{key:`Mod-a`,run:Cc},{key:`Backspace`,run:Nc,shift:Nc,preventDefault:!0},{key:`Delete`,run:Pc,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Ic,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:Lc,preventDefault:!0},{mac:`Mod-Backspace`,run:zc,preventDefault:!0},{mac:`Mod-Delete`,run:Bc,preventDefault:!0}].concat(ol.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),cl=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:Fs,shift:ac},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:Is,shift:oc},{key:`Alt-ArrowUp`,run:Gc},{key:`Shift-Alt-ArrowUp`,run:Jc},{key:`Alt-ArrowDown`,run:Kc},{key:`Shift-Alt-ArrowDown`,run:Yc},{key:`Mod-Alt-ArrowUp`,run:Dc},{key:`Mod-Alt-ArrowDown`,run:Oc},{key:`Escape`,run:kc},{key:`Mod-Enter`,run:$c},{key:`Alt-l`,mac:`Ctrl-l`,run:wc},{key:`Mod-i`,run:Tc,preventDefault:!0},{key:`Mod-[`,run:il},{key:`Mod-]`,run:rl},{key:`Mod-Alt-\\`,run:nl},{key:`Shift-Mod-k`,run:Xc},{key:`Shift-Mod-\\`,run:Qs},{key:`Mod-/`,run:Wo},{key:`Alt-A`,mac:`Ctrl-A`,run:qo},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:al}].concat(sl),ll=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,ul=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ll(e)):ll,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return lt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ot(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=xt(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(ul.prototype[Symbol.iterator]=function(){return this});var dl={from:-1,to:-1,match:/.*/.exec(``),precise:!0},fl=`gm`+(/x/.unicode==null?``:`u`),pl=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=dl,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new gl(e,t,n,r,i);this.re=new RegExp(t,fl+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=vl(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=vl(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},ml=new WeakMap,hl=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=ml.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return ml.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),ml.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},gl=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=dl,this.matchPos=vl(e,r),this.re=new RegExp(t,fl+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=hl.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=vl(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(pl.prototype[Symbol.iterator]=gl.prototype[Symbol.iterator]=function(){return this});function _l(e){try{return new RegExp(e,fl),!0}catch{return!1}}function vl(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var yl=e=>{let t=vt(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=Ue(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=M.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,A.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},bl={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xl=ft.define({combine(e){return Lt(e,bl,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Sl(e){let t=[Ol,Dl];return e&&t.push(xl.of(e)),t}var Cl=F.mark({class:`cm-selectionMatch`}),wl=F.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Tl(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=N.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=N.Word)}function El(e,t,n,r){return e(t.sliceDoc(n,n+1))==N.Word&&e(t.sliceDoc(r-1,r))==N.Word}var Dl=$e.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(xl),{state:n}=e,r=n.selection;if(r.ranges.length>1)return F.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return F.none;let e=n.wordAt(i.head);if(!e)return F.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return F.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Tl(o,n,i.from,i.to)&&El(o,n,i.from,i.to)))return F.none}else if(a=n.sliceDoc(i.from,i.to),!a)return F.none}let s=[];for(let r of e.visibleRanges){let e=new ul(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Tl(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(wl.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Cl.range(r,a)),s.length>t.maxMatches))return F.none}}return F.set(s)}},{decorations:e=>e.decorations}),Ol=A.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),kl=({state:e,dispatch:t})=>{let{selection:n}=e,r=M.create(n.ranges.map(t=>e.wordAt(t.head)||M.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function Al(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new ul(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new ul(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var jl=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return kl({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Al(e,r);return i?(t(e.update({selection:e.selection.addRange(M.range(i.from,i.to),!1),effects:A.scrollIntoView(i.to)})),!0):!1},Ml=ft.define({combine(e){return Lt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new fu(e),scrollToMatch:e=>A.scrollIntoView(e)})}}),Nl=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||_l(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
107
|
-
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Wl(this):new Rl(this)}getCursor(e,t=0,n){let r=e.doc?e:Le.create({doc:e});return n??=r.doc.length,this.regexp?Bl(this,r,t,n):Il(this,r,t,n)}},Pl=class{constructor(e){this.spec=e}};function Fl(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function Il(e,t,n,r){let i;return e.wholeWord&&(i=Ll(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Fl(e.test,t,i)),new ul(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ll(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(Vl(i,n-a))!=N.Word||t(Hl(i,n-a))!=N.Word)&&(t(Hl(i,r-a))!=N.Word||t(Vl(i,r-a))!=N.Word))}var Rl=class extends Pl{constructor(e){super(e)}nextMatch(e,t,n){let r=Il(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Il(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=Il(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Il(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Il(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function zl(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function Bl(e,t,n,r){let i;return e.wholeWord&&(i=Ul(t.charCategorizer(t.selection.main.head))),e.test&&(i=zl(e.test,t,i)),new pl(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function Vl(e,t){return e.slice(mt(e,t,!1),t)}function Hl(e,t){return e.slice(t,mt(e,t))}function Ul(e){return(t,n,r)=>!r[0].length||(e(Vl(r.input,r.index))!=N.Word||e(Hl(r.input,r.index))!=N.Word)&&(e(Hl(r.input,r.index+r[0].length))!=N.Word||e(Vl(r.input,r.index+r[0].length))!=N.Word)}var Wl=class extends Pl{nextMatch(e,t,n){let r=Bl(this.spec,e,n,e.doc.length).next();return r.done&&(r=Bl(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=Bl(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=Bl(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=Bl(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},Gl=P.define(),Kl=P.define(),ql=ot.define({create(e){return new Jl(ou(e).create(),null)},update(e,t){for(let n of t.effects)n.is(Gl)?e=new Jl(n.value.create(),e.panel):n.is(Kl)&&(e=new Jl(e.query,n.value?au:null));return e},provide:e=>et.from(e,e=>e.panel)}),Jl=class{constructor(e,t){this.query=e,this.panel=t}},Yl=F.mark({class:`cm-searchMatch`}),Xl=F.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Zl=$e.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(ql))}update(e){let t=e.state.field(ql);(t!=e.startState.field(ql)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return F.none;let{view:n}=this,r=new jt;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?Xl:Yl)})}return r.finish()}},{decorations:e=>e.decorations});function Ql(e){return t=>{let n=t.state.field(ql,!1);return n&&n.query.spec.valid?e(t,n):lu(t)}}var $l=Ql((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=M.single(r.from,r.to),a=e.state.facet(Ml);return e.dispatch({selection:i,effects:[hu(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),cu(e),!0}),eu=Ql((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=M.single(i.from,i.to),o=e.state.facet(Ml);return e.dispatch({selection:a,effects:[hu(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),cu(e),!0}),tu=Ql((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:M.create(n.map(e=>M.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),nu=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new ul(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(M.range(t.value.from,t.value.to))}return t(e.update({selection:M.create(a,o),userEvent:`select.search.matches`})),!0},ru=Ql((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(A.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=M.single(o.from,o.to).map(d),u.push(hu(e,o)),u.push(n.facet(Ml).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),iu=Ql((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:A.announce.of(r),userEvent:`input.replace.all`}),!0});function au(e){return e.state.facet(Ml).createPanel(e)}function ou(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(Ml);return new Nl({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function su(e){let t=qe(e,au);return t&&t.dom.querySelector(`[main-field]`)}function cu(e){let t=su(e);t&&t==e.root.activeElement&&t.select()}var lu=e=>{let t=e.state.field(ql,!1);if(t&&t.panel){let n=su(e);if(n&&n!=e.root.activeElement){let r=ou(e.state,t.query.spec);r.valid&&e.dispatch({effects:Gl.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Kl.of(!0),t?Gl.of(ou(e.state,t.query.spec)):P.appendConfig.of(_u)]});return!0},uu=e=>{let t=e.state.field(ql,!1);if(!t||!t.panel)return!1;let n=qe(e,au);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Kl.of(!1)}),!0},du=[{key:`Mod-f`,run:lu,scope:`editor search-panel`},{key:`F3`,run:$l,shift:eu,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:$l,shift:eu,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:uu,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:nu},{key:`Mod-Alt-g`,run:yl},{key:`Mod-d`,run:jl,preventDefault:!0}],fu=class{constructor(e){this.view=e;let t=this.query=e.state.field(ql).query.spec;this.commit=this.commit.bind(this),this.searchField=j(`input`,{value:t.search,placeholder:$(e,`Find`),"aria-label":$(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=j(`input`,{value:t.replace,placeholder:$(e,`Replace`),"aria-label":$(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=j(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=j(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=j(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return j(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=j(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>$l(e),[$(e,`next`)]),n(`prev`,()=>eu(e),[$(e,`previous`)]),n(`select`,()=>tu(e),[$(e,`all`)]),j(`label`,null,[this.caseField,$(e,`match case`)]),j(`label`,null,[this.reField,$(e,`regexp`)]),j(`label`,null,[this.wordField,$(e,`by word`)]),...e.state.readOnly?[]:[j(`br`),this.replaceField,n(`replace`,()=>ru(e),[$(e,`replace`)]),n(`replaceAll`,()=>iu(e),[$(e,`replace all`)])],j(`button`,{name:`close`,onclick:()=>uu(e),"aria-label":$(e,`close`),type:`button`},[`×`])])}commit(){let e=new Nl({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Gl.of(e)}))}keydown(e){tt(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?eu:$l)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ru(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Gl)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ml).top}};function $(e,t){return e.state.phrase(t)}var pu=30,mu=/[\s\.,:;?!]/;function hu(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-pu),o=Math.min(i,n+pu),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<pu;e++)if(!mu.test(s[e+1])&&mu.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-pu;e--)if(!mu.test(s[e-1])&&mu.test(s[e])){s=s.slice(0,e);break}}return A.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var gu=A.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),_u=[ql,Ft.low(Zl),gu],vu=[Vt(),He(),We(),os(),It(),yt(),Re(),Le.allowMultipleSelections.of(!0),St(),Rt(bt,{fallback:!0}),ct(),_t(),At(),ze(),Ye(),Xe(),Sl(),Ze.of([...at,...cl,...du,...ws,...ut,...Tt,...vo])],yu=ce({__name:`MarkdownEditor`,props:{modelValue:{},diagnostics:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=O(null),a=null;function o(e){return Le.create({doc:e,extensions:[vu,Ct(),Uo(),Le.lineSeparator.of(e.includes(`\r
|
|
108
|
-
`)?`\r
|
|
109
|
-
`:`
|
|
110
|
-
`),A.lineWrapping,Pt,A.contentAttributes.of({"aria-label":`Markdown of the entry`}),A.updateListener.of(e=>{e.docChanged&&r(`update:modelValue`,e.state.doc.toString())})]})}return v(()=>{i.value!==null&&(a=new A({parent:i.value,state:o(n.modelValue)}))}),y(()=>{a?.destroy()}),ne(()=>n.modelValue,e=>{a!==null&&a.state.doc.toString()!==e&&a.setState(o(e))}),ne(()=>n.diagnostics,e=>{if(a===null)return;let t=a.state.doc.length;a.dispatch(co(a.state,e.map(e=>({...e,from:Math.min(e.from,t),to:Math.min(e.to,t)}))))}),(e,t)=>(x(),w(`div`,{ref_key:`host`,ref:i,class:`overflow-hidden rounded border border-default text-sm`},null,512))}});function bu(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
111
|
-
`&&t.push(n+1);return t}function xu(e,t){let n=/^\/frontmatter\/([^/]+)/.exec(t);if(n===null)return null;let r=n[1]?.replace(/~1/g,`/`).replace(/~0/g,`~`),i=e.split(`
|
|
112
|
-
`);if(i[0]?.trimEnd()!==`---`)return null;for(let e=1;e<i.length;e++){let t=i[e]??``;if(t.trimEnd()===`---`)return null;if(t.startsWith(`${r}:`))return e+1}return null}function Su(e,t,n){let r=Math.min(Math.max(n,1),t.length)-1,i=t[r]??0,a=t[r+1];return{from:i,to:a===void 0?e.length:Math.max(i,a-1)}}function Cu(e,t){let n=bu(e),r=t=>{let r=t.line??xu(e,t.path)??1;return{...Su(e,n,r),severity:t.severity,message:`${t.message} ${t.fix}`,source:t.contract}};return[...t.errors.map(r),...t.warnings.map(r)]}var wu={key:0,class:`text-muted`},Tu={key:1,class:`space-y-5`},Eu={class:`space-y-3`},Du={class:`flex flex-wrap items-start gap-3`},Ou={class:`min-w-0 flex-1 space-y-1`},ku={class:`text-xl font-semibold text-balance`},Au={class:`flex flex-wrap items-center gap-2 text-sm text-muted`},ju={key:1},Mu={class:`font-mono`},Nu={key:2,class:`text-warning`},Pu={class:`flex flex-wrap gap-2`},Fu={key:0,"aria-label":`Translations`,class:`flex flex-wrap items-center gap-2 text-sm`},Iu={key:0,"aria-current":`page`,class:`rounded-md bg-elevated px-2 py-0.5 font-mono text-highlighted`},Lu={class:`grid gap-4 lg:grid-cols-[minmax(0,3fr)_minmax(0,2fr)]`},Ru={class:`pt-3`},zu={class:`pt-3`},Bu={"aria-label":`Preview of the saved revision`,class:`prose mt-3 max-w-none rounded border border-default p-4`},Vu=[`innerHTML`],Hu={class:`space-y-2 pt-3 text-sm`},Uu={key:0,class:`text-muted`},Wu={class:`font-medium`},Gu={class:`block font-mono text-xs text-muted`},Ku={class:`space-y-2 text-sm`},qu={class:`font-mono text-xs text-muted`},Ju={class:`text-muted`},Yu={key:0},Xu={key:1},Zu={key:2,class:`text-muted`},Qu=ce({__name:`Entry`,props:{collection:{},locale:{},slug:{}},setup(e){let t=e,n=Ne(),r=O(null),i=O(null),a=O([]),o=O([]),s=O(!1),c=O(``),l=O(``),d=O(null),f=O(!1),h=O(!1),v=O([]),y=O(!1),S=O(!1),C=O(!1),T=O(``),re,ie=m(()=>({collection:t.collection,locale:t.locale,slug:t.slug})),ae=m(()=>r.value?.collections.find(e=>e.name===t.collection)),oe=m(()=>c.value!==l.value),se=m(()=>d.value===null?[]:Cu(c.value,d.value)),ce=m(()=>i.value?.status===`published`&&ae.value!==void 0?qt(r.value?.url??null,ae.value.routes,t.locale,t.slug):null),le=m(()=>i.value?.translationGroup===null||i.value===null?[]:(r.value?.locales??[]).filter(e=>!o.value.some(t=>t.locale===e))),ue=m(()=>i.value!==null&&!oe.value&&(i.value.status!==`published`||i.value.hasUnpublishedChanges));async function de(){let[e,n]=await Promise.all([r.value===null?me.call(`describe_site`,{}):null,me.call(`get_entry`,{...ie.value,formats:[`markdown`,`html`],related:!0})]);if(e!==null&&(r.value=e.site),n.outcome===`not_found`||n.entry===void 0){s.value=!0;return}s.value=!1,i.value=n.entry,a.value=n.related??[],c.value=n.entry.markdown??``,l.value=c.value,d.value=n.entry.verdict,o.value=n.entry.translationGroup===null?[]:(await me.call(`get_translations`,{collection:t.collection,translationGroup:n.entry.translationGroup})).entries??[]}ne(ie,de,{immediate:!0});let pe;ne(c,e=>{clearTimeout(pe),e!==l.value&&(pe=setTimeout(async()=>{d.value=(await me.call(`validate`,{...ie.value,markdown:e})).verdict},600))});function he(e,t){let r=e instanceof fe?`${e.message} ${e.fix}`:String(e);n.add({title:t,description:r,color:`error`})}async function _e(){f.value=!0;try{d.value=(await me.call(`validate`,{...ie.value,markdown:c.value})).verdict;let{errors:e,warnings:t}=d.value;n.add({title:e.length===0&&t.length===0?`Every contract passes`:`${e.length} errors, ${t.length} warnings`,color:e.length>0?`error`:t.length>0?`warning`:`success`})}catch(e){he(e,`Not checked`)}finally{f.value=!1}}async function ve(){if(i.value!==null&&oe.value){f.value=!0;try{let e=await me.call(`update_draft`,{id:i.value.id,version:i.value.version,markdown:c.value});switch(e.outcome){case`saved`:case`unchanged`:await de(),n.add({title:e.outcome===`saved`?`Saved`:`Nothing changed`,color:`success`});break;case`conflict`:h.value=!0;break;case`refused`:d.value=e.verdict??d.value,n.add({title:`Not saved`,description:`See what the contracts say.`,color:`error`});break;case`not_found`:s.value=!0}}catch(e){he(e,`Not saved`)}finally{f.value=!1}}}tn({meta_s:()=>void ve()});async function ye(e=[],t){if(i.value!==null){f.value=!0,y.value=!1,C.value=!1;try{let r=await me.call(`publish`,{id:i.value.id,version:i.value.version,acknowledgeWarnings:e.map(({contract:e,path:t})=>({contract:e,path:t})),...t===void 0?{}:{publishAt:t}});switch(r.outcome){case`published`:await de(),n.add({title:`Published`,color:`success`});break;case`scheduled`:await de(),n.add({title:`Scheduled`,description:`It is published at ${Ut(r.entry?.scheduledAt??t??``)}.`,color:`info`});break;case`pending_review`:n.add({title:`Sent for review`,description:`A person who may publish will approve it, or ask for changes.`,color:`info`});break;case`needs_acknowledgement`:v.value=r.verdict?.warnings??[],re=t,y.value=!0;break;case`blocked`:d.value=r.verdict??d.value,n.add({title:`Blocked`,description:`Fix the errors first.`,color:`error`});break;case`conflict`:h.value=!0;break;case`not_found`:await de()}}catch(e){he(e,t===void 0?`Not published`:`Not scheduled`)}finally{f.value=!1}}}function be(){let e=new Date(Date.now()+36e5);e.setSeconds(0,0),T.value=new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16),C.value=!0}let xe=m(()=>{let e=Date.parse(T.value);return Number.isNaN(e)?`Pick a date and a time.`:e<=Date.now()?`Pick a time in the future.`:null});async function Se(){if(i.value===null)return;let e=i.value.status===`scheduled`;f.value=!0,S.value=!1;try{await me.call(`unpublish`,{id:i.value.id}),await de(),n.add({title:e?`Schedule cancelled`:`Unpublished`,description:`The entry is a draft again, with all its revisions.`,color:`success`})}catch(t){he(t,e?`Not cancelled`:`Not unpublished`)}finally{f.value=!1}}async function we(){h.value=!1,await de()}let Te=[{label:`Fields`,slot:`fields`,value:`fields`},{label:`Checks`,slot:`checks`,value:`checks`},{label:`Preview`,slot:`preview`,value:`preview`},{label:`Related`,slot:`related`,value:`related`}];return(e,t)=>{let n=Ht,r=Ce,l=te(`RouterLink`),m=pn,ne=Oe,ie=Ie,de=je;return s.value?(x(),w(`p`,wu,`There is no such entry.`)):i.value===null?(x(),w(`p`,Zu,`Loading…`)):(x(),w(`div`,Tu,[_(`div`,Eu,[_(`div`,Du,[_(`div`,Ou,[_(`h1`,ku,u(k(Gt)(i.value)),1),_(`p`,Au,[E(n,{label:i.value.status,color:k(Kt)[i.value.status],variant:`subtle`},null,8,[`label`,`color`]),i.value.status===`published`&&i.value.hasUnpublishedChanges?(x(),D(n,{key:0,label:`unpublished changes`,color:`warning`,variant:`outline`})):g(``,!0),i.value.scheduledAt===null?g(``,!0):(x(),w(`span`,ju,`publishes `+u(k(Ut)(i.value.scheduledAt)),1)),_(`span`,Mu,u(i.value.collection)+`/`+u(i.value.slug)+` · v`+u(i.value.version),1),oe.value?(x(),w(`span`,Nu,`unsaved`)):g(``,!0)])]),_(`div`,Pu,[ce.value===null?g(``,!0):(x(),D(r,{key:0,to:ce.value,target:`_blank`,label:`View on site`,icon:`i-lucide-external-link`,variant:`ghost`},null,8,[`to`])),E(r,{label:`Validate`,variant:`outline`,loading:f.value,onClick:_e},null,8,[`loading`]),E(r,{label:`Save`,loading:f.value,disabled:!oe.value,onClick:ve},null,8,[`loading`,`disabled`]),E(r,{label:`Publish`,color:`secondary`,loading:f.value,disabled:!ue.value,onClick:t[0]||=e=>ye()},null,8,[`loading`,`disabled`]),i.value.status===`draft`?(x(),D(r,{key:1,label:`Schedule`,icon:`i-lucide-calendar-clock`,variant:`outline`,disabled:oe.value,onClick:be},null,8,[`disabled`])):g(``,!0),i.value.status===`draft`?g(``,!0):(x(),D(r,{key:2,label:i.value.status===`scheduled`?`Cancel schedule`:`Unpublish`,color:`error`,variant:`outline`,loading:f.value,onClick:t[1]||=e=>S.value=!0},null,8,[`label`,`loading`]))])]),i.value.translationGroup===null?g(``,!0):(x(),w(`nav`,Fu,[t[15]||=_(`span`,{class:`text-muted`},`Translations`,-1),(x(!0),w(p,null,ee(o.value,e=>(x(),w(p,{key:e.id},[e.id===i.value.id?(x(),w(`span`,Iu,u(e.locale),1)):(x(),D(l,{key:1,to:k(Wt)(e),"aria-label":`${k(Gt)(e)} (${e.locale})`,class:`rounded-md border border-default px-2 py-0.5 font-mono hover:bg-elevated`},{default:b(()=>[ge(u(e.locale),1)]),_:2},1032,[`to`,`aria-label`]))],64))),128)),(x(!0),w(p,null,ee(le.value,e=>(x(),D(r,{key:e,to:{path:`/entries/new`,query:{collection:i.value.collection,locale:e,group:i.value.translationGroup}},label:`Translate to ${e}`,icon:`i-lucide-plus`,size:`xs`,variant:`ghost`},null,8,[`to`,`label`]))),128))]))]),_(`div`,Lu,[E(yu,{modelValue:c.value,"onUpdate:modelValue":t[2]||=e=>c.value=e,diagnostics:se.value},null,8,[`modelValue`,`diagnostics`]),E(m,{items:Te,"default-value":`fields`,class:`min-w-0`,variant:`link`},{fields:b(()=>[_(`div`,Ru,[E(no,{modelValue:c.value,"onUpdate:modelValue":t[3]||=e=>c.value=e,schema:ae.value?.schema??{}},null,8,[`modelValue`,`schema`])])]),checks:b(()=>[_(`div`,zu,[E(Jt,{verdict:d.value},null,8,[`verdict`])])]),preview:b(()=>[_(`section`,Bu,[_(`div`,{innerHTML:i.value.html??``},null,8,Vu)])]),related:b(()=>[_(`div`,Hu,[a.value.length===0?(x(),w(`p`,Uu,` Nothing related yet. Related entries come from the semantic search of the deployment, for published entries. `)):g(``,!0),(x(!0),w(p,null,ee(a.value,e=>(x(),D(l,{key:e.id,to:k(Wt)(e),class:`block rounded border border-default px-3 py-2 hover:bg-elevated`},{default:b(()=>[_(`span`,Wu,u(k(Gt)(e)),1),_(`span`,Gu,u(e.slug),1)]),_:2},1032,[`to`]))),128))])]),_:1})]),E(ne,{open:h.value,"onUpdate:open":t[5]||=e=>h.value=e,title:`Someone changed this entry`},{body:b(()=>[...t[16]||=[_(`p`,null,` The entry is at a newer version than the one you edited. Copy what you wrote if you need it, then load the newer version. `,-1)]]),footer:b(()=>[E(r,{label:`Keep editing`,variant:`ghost`,onClick:t[4]||=e=>h.value=!1}),E(r,{label:`Load the newer version`,color:`warning`,onClick:we})]),_:1},8,[`open`]),E(ne,{open:y.value,"onUpdate:open":t[8]||=e=>y.value=e,title:`Publish with these warnings?`},{body:b(()=>[_(`ul`,Ku,[(x(!0),w(p,null,ee(v.value,(e,t)=>(x(),w(`li`,{key:t},[_(`span`,qu,u(e.contract),1),_(`p`,null,u(e.message),1),_(`p`,Ju,u(e.fix),1)]))),128))])]),footer:b(()=>[E(r,{label:`Cancel`,variant:`ghost`,onClick:t[6]||=e=>y.value=!1}),E(r,{label:k(re)===void 0?`Publish anyway`:`Schedule anyway`,color:`warning`,onClick:t[7]||=e=>ye(v.value,k(re))},null,8,[`label`])]),_:1},8,[`open`]),E(ne,{open:S.value,"onUpdate:open":t[10]||=e=>S.value=e,title:i.value.status===`scheduled`?`Cancel the schedule?`:`Unpublish this entry?`},{body:b(()=>[i.value.status===`scheduled`?(x(),w(`p`,Yu,` The entry stays a draft and is not published at `+u(k(Ut)(i.value.scheduledAt??``))+`. `,1)):(x(),w(`p`,Xu,` The entry leaves the public site: its page answers 404 and it drops out of listings and search. It stays here as a draft, with all its revisions, and can be published again. `))]),footer:b(()=>[E(r,{label:`Keep it`,variant:`ghost`,onClick:t[9]||=e=>S.value=!1}),E(r,{label:i.value.status===`scheduled`?`Cancel the schedule`:`Unpublish`,color:`error`,onClick:Se},null,8,[`label`])]),_:1},8,[`open`,`title`]),E(ne,{open:C.value,"onUpdate:open":t[14]||=e=>C.value=e,title:`Schedule the publication`},{body:b(()=>[E(de,{label:`Publish at`,help:`In your time zone. It is published within a minute of the time, unless it changes first.`,error:xe.value??void 0},{default:b(()=>[E(ie,{modelValue:T.value,"onUpdate:modelValue":t[11]||=e=>T.value=e,type:`datetime-local`,class:`w-full`},null,8,[`modelValue`])]),_:1},8,[`error`])]),footer:b(()=>[E(r,{label:`Cancel`,variant:`ghost`,onClick:t[12]||=e=>C.value=!1}),E(r,{label:`Schedule`,disabled:xe.value!==null,onClick:t[13]||=e=>ye([],new Date(T.value).toISOString())},null,8,[`disabled`])]),_:1},8,[`open`])]))}}});export{Qu as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./VisuallyHidden-CUiOLRpP.js";import{Ar as t,Ct as n,D as r,Er as i,G as a,Gt as o,J as s,K as c,Sn as l,Ut as u,Xt as d,Y as f,_n as p,d as m,f as h,fn as g,it as _,kt as v,ln as y,nt as b,q as x,qn as S,rr as C,tt as w,u as T}from"./session-D_7iusJi.js";import{a as E,i as D,n as O,r as k}from"./Button-gYrKAAPg.js";var A=_({__name:`Label`,props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`label`}},setup(t){let n=t;return e(),(e,t)=>(u(),x(C(h),v(n,{onMousedown:t[0]||=e=>{!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}),{default:l(()=>[d(e.$slots,`default`)]),_:3},16))}}),j={slots:{root:``,wrapper:``,labelWrapper:`flex content-center items-center justify-between gap-1`,label:`block font-medium text-default`,container:`relative`,description:`text-muted`,error:`mt-2 text-error`,hint:`text-muted`,help:`mt-2 text-muted`},variants:{size:{xs:{root:`text-xs`},sm:{root:`text-xs`},md:{root:`text-sm`},lg:{root:`text-sm`},xl:{root:`text-base`}},required:{true:{label:`after:content-['*'] after:ms-0.5 after:text-error`}},orientation:{vertical:{container:`mt-1`},horizontal:{root:`flex justify-between place-items-baseline gap-2`}}},defaultVariants:{size:`md`}},M=[`id`],N=[`id`],P=[`id`],F=[`id`],I={__name:`FormField`,props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:`vertical`},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){let _=e,v=g(),I=m(`formField`,_),L=r(),R=a(()=>T({extend:j,...L.ui?.formField||{}})({size:I.size,required:I.required,orientation:I.orientation})),z=n(O,null),B=a(()=>I.error||z?.value?.find(e=>e.name===I.name||I.errorPattern&&e.name?.match(I.errorPattern))?.message),V=S(y()),H=V.value,U=n(D,void 0);return p(V,()=>{U&&I.name&&(U.value[I.name]={id:V.value,pattern:I.errorPattern})},{immediate:!0}),o(E,V),o(k,a(()=>({error:B.value,name:I.name,size:I.size,eagerValidation:I.eagerValidation,validateOnInputDelay:I.validateOnInputDelay,errorPattern:I.errorPattern,hint:I.hint,description:I.description,help:I.help,ariaId:H}))),(e,n)=>(u(),x(C(h),{as:C(I).as,"data-orientation":C(I).orientation,"data-slot":`root`,class:i(R.value.root({class:[C(I).ui?.root,C(I).class]}))},{default:l(()=>[c(`div`,{"data-slot":`wrapper`,class:i(R.value.wrapper({class:C(I).ui?.wrapper}))},[C(I).label||v.label?(u(),f(`div`,{key:0,"data-slot":`labelWrapper`,class:i(R.value.labelWrapper({class:C(I).ui?.labelWrapper}))},[b(C(A),{for:V.value,"data-slot":`label`,class:i(R.value.label({class:C(I).ui?.label}))},{default:l(()=>[d(e.$slots,`label`,{label:C(I).label},()=>[w(t(C(I).label),1)])]),_:3},8,[`for`,`class`]),C(I).hint||v.hint?(u(),f(`span`,{key:0,id:`${C(H)}-hint`,"data-slot":`hint`,class:i(R.value.hint({class:C(I).ui?.hint}))},[d(e.$slots,`hint`,{hint:C(I).hint},()=>[w(t(C(I).hint),1)])],10,M)):s(``,!0)],2)):s(``,!0),C(I).description||v.description?(u(),f(`p`,{key:1,id:`${C(H)}-description`,"data-slot":`description`,class:i(R.value.description({class:C(I).ui?.description}))},[d(e.$slots,`description`,{description:C(I).description},()=>[w(t(C(I).description),1)])],10,N)):s(``,!0)],2),c(`div`,{class:i([(C(I).label||!!v.label||C(I).description||!!v.description)&&R.value.container({class:C(I).ui?.container})])},[d(e.$slots,`default`,{error:B.value}),C(I).error!==!1&&(typeof B.value==`string`&&B.value||v.error)?(u(),f(`div`,{key:0,id:`${C(H)}-error`,"data-slot":`error`,class:i(R.value.error({class:C(I).ui?.error}))},[d(e.$slots,`error`,{error:B.value},()=>[w(t(B.value),1)])],10,P)):C(I).help||v.help?(u(),f(`div`,{key:1,id:`${C(H)}-help`,"data-slot":`help`,class:i(R.value.help({class:C(I).ui?.help}))},[d(e.$slots,`help`,{help:C(I).help},()=>[w(t(C(I).help),1)])],10,F)):s(``,!0)],2)]),_:3},8,[`as`,`data-orientation`,`class`]))}};export{A as n,I as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ar as e,F as t,G as n,J as r,K as i,Lt as a,Sn as o,Ut as s,Y as c,Yt as l,Zt as u,it as d,kr as f,nt as p,q as m,qn as h,rr as g,t as _,tt as v}from"./session-D_7iusJi.js";import{t as ee}from"./Badge-CUm0y7_3.js";import{i as y,n as b,r as x,t as te}from"./entries-CswbEbYi.js";var ne={class:`space-y-8`},re={class:`grid gap-6 lg:grid-cols-[3fr_2fr]`},S={"aria-labelledby":`read`,class:`space-y-3 rounded-lg border border-default p-5`},C={class:`flex items-baseline justify-between gap-3`},w={key:0,class:`font-mono text-sm text-muted tabular-nums`},T={key:0,class:`text-sm text-muted`},E={key:1,class:`text-sm text-muted`},D={key:2,class:`text-sm text-muted`},O={key:3,class:`space-y-2`},k={class:`flex items-baseline justify-between gap-3`},A={key:1,class:`min-w-0 truncate font-mono text-muted`},j={class:`font-mono text-muted tabular-nums`},M={class:`h-1 rounded-full bg-elevated`,"aria-hidden":`true`},N={"aria-labelledby":`waiting`,class:`space-y-3 rounded-lg border border-default p-5`},P={class:`flex items-baseline justify-between gap-3`},F={key:0,class:`text-sm text-muted`},I={key:1,class:`text-sm text-muted`},L={key:2,class:`divide-y divide-default text-sm`},ie={class:`text-muted`},R={class:`grid gap-6 lg:grid-cols-[3fr_2fr]`},z={"aria-labelledby":`drafts`,class:`space-y-3`},B={class:`flex items-baseline justify-between gap-3`},V={key:0,class:`text-sm text-muted`},H={key:1,class:`text-sm text-muted`},U={key:2,class:`divide-y divide-default rounded-lg border border-default text-sm`},W={class:`font-mono text-xs text-muted`},G={"aria-labelledby":`audit`,class:`space-y-3`},K={key:0,class:`text-sm text-muted`},q={class:`font-medium`},J={class:`text-muted`},Y=d({__name:`Home`,setup(d){let Y=h(null),X=h(null),Z=h(null),Q=h(null);a(async()=>{let{site:e}=await _.call(`describe_site`,{}),t=e.collections.map(e=>e.name),[n,r,...i]=await Promise.all([_.call(`content_stats`,{days:30,limit:8}),_.call(`list_reviews`,{status:`pending`,limit:5}),...t.map(e=>_.call(`list_entries`,{collection:e,limit:50}))]);Y.value=n,X.value=r.reviews;let a=i.flatMap(e=>e.entries),o=(e,t)=>t.updatedAt.localeCompare(e.updatedAt);Z.value=a.filter(e=>e.status!==`published`||e.hasUnpublishedChanges).filter(e=>!e.slug.startsWith(`audit-`)).sort(o).slice(0,6),Q.value=a.filter(e=>e.slug.startsWith(`audit-`)).sort(o)[0]??null});let ae=n(()=>Math.max(1,...(Y.value?.pages??[]).map(e=>e.views))),oe=n(()=>(Y.value?.pages??[]).reduce((e,t)=>e+t.views,0)),$=new Intl.NumberFormat;return(n,a)=>{let d=u(`RouterLink`),h=ee;return s(),c(`div`,ne,[a[6]||=i(`h1`,{class:`text-xl font-semibold`},`Home`,-1),i(`div`,re,[i(`section`,S,[i(`div`,C,[a[0]||=i(`h2`,{id:`read`,class:`font-semibold`},`Most read, last 30 days`,-1),Y.value?.outcome===`ok`?(s(),c(`span`,w,e(g($).format(oe.value))+` views`,1)):r(``,!0)]),Y.value===null?(s(),c(`p`,T,`Loading…`)):Y.value.outcome===`unavailable`?(s(),c(`p`,E,` This deployment has no analytics. Bind Analytics Engine and add the beacon to the site to see what readers read. `)):(Y.value.pages??[]).length===0?(s(),c(`p`,D,` No page views yet. `)):(s(),c(`ol`,O,[(s(!0),c(t,null,l(Y.value.pages,t=>(s(),c(`li`,{key:t.path,class:`space-y-1 text-sm`},[i(`div`,k,[t.entry===null?(s(),c(`span`,A,e(t.path),1)):(s(),m(d,{key:0,to:g(b)(t.entry),class:`min-w-0 truncate font-medium hover:underline`},{default:o(()=>[v(e(g(x)(t.entry)),1)]),_:2},1032,[`to`])),i(`span`,j,e(g($).format(t.views)),1)]),i(`div`,M,[i(`div`,{class:`h-1 rounded-full bg-secondary`,style:f({width:`${t.views/ae.value*100}%`})},null,4)])]))),128))]))]),i(`section`,N,[i(`div`,P,[a[2]||=i(`h2`,{id:`waiting`,class:`font-semibold`},`Waiting for review`,-1),p(d,{to:`/reviews`,class:`text-sm text-muted hover:text-highlighted`},{default:o(()=>[...a[1]||=[v(`All reviews`,-1)]]),_:1})]),X.value===null?(s(),c(`p`,F,`Loading…`)):X.value.length===0?(s(),c(`p`,I,`Nothing waits for review.`)):(s(),c(`ul`,L,[(s(!0),c(t,null,l(X.value,t=>(s(),c(`li`,{key:t.id,class:`py-2`},[p(d,{to:`/reviews`,class:`font-medium hover:underline`},{default:o(()=>[v(e(g(x)(t.entry)),1)]),_:2},1024),i(`p`,ie,` asked by `+e(t.requestedByName??t.requestedBy)+` · `+e(g(y)(t.requestedAt)),1)]))),128))]))])]),i(`div`,R,[i(`section`,z,[i(`div`,B,[a[4]||=i(`h2`,{id:`drafts`,class:`font-semibold`},`Unpublished work`,-1),p(d,{to:`/entries`,class:`text-sm text-muted hover:text-highlighted`},{default:o(()=>[...a[3]||=[v(`All entries`,-1)]]),_:1})]),Z.value===null?(s(),c(`p`,V,`Loading…`)):Z.value.length===0?(s(),c(`p`,H,` Everything written is published. `)):(s(),c(`ul`,U,[(s(!0),c(t,null,l(Z.value,t=>(s(),c(`li`,{key:t.id,class:`flex items-center gap-3 px-4 py-2.5`},[p(d,{to:g(b)(t),class:`min-w-0 flex-1 truncate font-medium hover:underline`},{default:o(()=>[v(e(g(x)(t)),1)]),_:2},1032,[`to`]),i(`span`,W,e(t.locale),1),p(h,{label:t.status===`published`?`changes`:t.status,color:t.status===`published`?`warning`:g(te)[t.status],variant:`subtle`},null,8,[`label`,`color`])]))),128))]))]),i(`section`,G,[a[5]||=i(`h2`,{id:`audit`,class:`font-semibold`},`Last audit`,-1),Q.value===null?(s(),c(`p`,K,` No audit report yet. The auditor of @hollware/agents writes one a week. `)):(s(),m(d,{key:1,to:g(b)(Q.value),class:`block rounded-lg border border-default p-4 text-sm hover:bg-elevated`},{default:o(()=>[i(`p`,q,e(g(x)(Q.value)),1),i(`p`,J,`Written `+e(g(y)(Q.value.updatedAt)),1)]),_:1},8,[`to`]))])])])}}});export{Y as default};
|